Repository navigation
feat: database user provider, persisted sync failures, Gemini/Bedrock, and a docs sync - #7
Open
gitfromwildan wants to merge 14 commits into
Open
gitfromwildan wants to merge 14 commits into
gitfromwildan wants to merge 14 commits into
Conversation
clippy 1.94 rejects `!r.domain.is_some()` (nonminimal_bool) under -D warnings.
SQLite gives a column declared `UUID` NUMERIC affinity, so the driver reports neither UUID nor BLOB and the row decoder returned null for the id. The scaffold migrations declare ids this way, so a row read through fetch_json lost its id on the default SQLite connection. Try a UUID decode as the last fallback.
A failed inline (sync) dispatch was only tracked in a process-local list, so it vanished on exit and never showed in queue:failed. When a database connection is registered the failure is now written to its failed_jobs table as a full job envelope, so queue:retry can re-enqueue it; without one, or if the insert fails, it still falls back to the in-memory sink. The job body is captured before the run: executing a job consumes it, so every sync dead letter previously stored a null payload.
The store-backed UserProvider for registration, login, password reset, email verification, and profile/timezone updates, against the scaffold users table. Soft-deleted users do not resolve, a malformed id is treated as an unknown user, and any database failure surfaces as AuthError::StoreUnavailable.
Adds the mail-smtp and mail-templates features forwarding to the mail crate's smtp and templates features.
…dpoints provider_from_env rejected both names. Gemini now resolves to the Gemini API's OpenAI-compatible base URL with GEMINI_API_KEY; Bedrock resolves to the regional bedrock-runtime /openai/v1 endpoint with a Bedrock API key (AWS_BEARER_TOKEN_BEDROCK) and AWS_REGION, so no SigV4 signing is needed.
…equests OpenAiProvider::embeddings posted the provider's default chat model, which an embeddings endpoint rejects, so provider-backed Str::to_embeddings could not work with the default configuration. The config now carries an embedding model: <PROVIDER>_EMBEDDING_MODEL, else the provider's known embedding model (openai, gemini, mistral), else the default model as before.
After boot the app replaces the fail-closed user provider with DatabaseUserProvider when the default guard's provider is ORM-backed (eloquent) and the users table is reachable, so registration and login persist. A dev seed user still wins, and with no database or no users table auth stays fail-closed.
Records the database user provider, persisted sync failed jobs, the Gemini and Bedrock providers, the embedding model fix, and the mail re-export, and corrects claims that had gone stale: boot already mounts the config loader, the app's AppServiceProvider is not a no-op, a database session store exists, and provider-backed embeddings were already implemented. M4 moves to Done.
…host-key check The russh bump changed Handler::check_server_key to take a PublicKeyOrCertificate, so rustasea-storage no longer compiled with the sftp feature. The pin now compares the fingerprint of the presented key, or of the key a host certificate certifies.
Returns M4 to Partial: the scheduler cannot dispatch a due command, schedule pause state is per-process, and after-response events are never flushed. The previous docs commit marked M4 Done on the strength of the failed-job sink alone; that was wrong. Records, with path:line evidence, facts found while checking the planning documents: the AI agent runtime echoes the prompt instead of calling a provider, domain routes ignore the request Host, JwtGuard::logout is a no-op, and a bare-word in: rule list rejects every value. Updates the parity rows for events, batches, unique jobs, sessions, the user provider, mail, notifications, the gate, the password-reset store, the scheduler, and the AI SDK, and adds a resolution note to the gap audit.
The roadmap, sprint index, and sprint headers carry the as-built milestone status with a pointer to docs/milestones.md. The 110 implementation-task rows under application/modules were all still Todo; each was checked against the source tree (55 done, 53 partial, 2 not started) and every open row lists what is missing. Plan text is unchanged.
…heck CI runs the latest stable (rustc 1.100.0), where clippy rejects the if-return-false / return-true pair under -D warnings and fails the lint job. Behaviour is unchanged.
The generated-code tests (generated_module_compiles_in_workspace and generated_app_compiles_for_every_variant) compile a generated project offline, so they can only use the crates cargo fetch downloaded for the lockfile. With the yanked 5.4.1 pinned, both fail in CI to resolve rustyline's clipboard-win requirement. 5.4.3 replaces it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes several items that
docs/milestones.mdlisted as missing for M3, M4, and M6, fixes four defects found on the way, and brings the status documents in line with the code.Fourteen commits, one per scope. Each commit message carries the detail; this description only adds what the commits cannot say on their own.
Changes
feat(auth): add DatabaseUserProvider over the users tableUserProviderfor registration, login, password reset, verification, and profile updates.feat(app): read users from the database when the users table existseloquentand theuserstable is reachable. Otherwise auth stays fail-closed.feat(queue): persist failed sync jobs through the database connectionfailed_jobsas a retryable envelope when adatabaseconnection is registered. Also fixes sync dead letters storing anullpayload.feat(ai): serve gemini and bedrock through their OpenAI-compatible endpointsprovider_from_envno longer rejects the two names.fix(ai): send an embedding model, not the chat model, on embeddings requestsfeat(rustasea): re-export rustasea-mail as rustasea::mailmail-smtpandmail-templatesfeatures.fix(orm): decode a UUID stored in a column declared UUID on SQLitefetch_jsonreturnednullfor such an id. The scaffold migrations declare ids this way.fix(storage): accept russh 0.65's PublicKeyOrCertificate in the SFTP host-key checkrustasea-storage --features sftphas not compiled since the russh dependency bump, socargo xtask cifails onmaster.style(router): use is_none() in the domain route sort key-D warningsonmaster.style(validation): address clippy 1.100 needless_bool in the unique checkmastertoo.chore(deps): replace the yanked clipboard-win 5.4.1 in the lockfilemaster; #8 carries the identical change.docs:commitsBehaviour changes
sqlite://database.sqlite?mode=rwcthis creates an emptydatabase.sqliteif none exists.HttpProviderConfiggains a public field,embedding_model. Code that builds the struct with a literal needs the new field. The embedding model resolves from<PROVIDER>_EMBEDDING_MODEL, then a built-in default foropenai,gemini, andmistral, then the chat model as before.failed_jobsonce adatabaseconnection is registered. Without one, nothing changes.Testing
cargo xtask cipasses on rustc 1.100.0, the CI toolchain: fmt, clippy-D warnings(workspace andrustasea-storage --features aws,sftp),deps:check,lines:check,check-cycles.cargo test --workspace --no-fail-fast: 1958 passed, 1 failed. That run predates the storage fix and the last two docs commits;rustasea-storage --features aws,sftpwas run on its own afterwards and passes.generated_app_compiles_for_every_variantinrustasea-scaffold. In CI onmaster,Test (workspace)fails on that suite and ongenerated_module_compiles_in_workspaceinrustasea-cli: both compile a generated project offline, so they can only use the cratescargo fetchdownloaded for the lockfile, and the lockfile pinnedclipboard-win5.4.1, which is yanked. The last commit replaces it with 5.4.3.cargo-auditandcargo-denyfail on this PR because of RustSec advisories published against dependencies already onmaster(for exampleRUSTSEC-2026-0436incalamine 0.36.1andRUSTSEC-2026-0387incrypto-bigint). They are addressed in chore(deps): clear the RustSec advisories failing cargo-audit and cargo-deny #8, not here.userstable it logs that the provider stays fail-closed, with one it logs that users resolve from the database. Both serveGET /with 200.crates/rustasea-auth/tests/database_user_provider.rs,crates/rustasea-queue/tests/sync_failed_sink.rs, a UUID round trip incrates/rustasea-orm/tests/raw_execution.rs, provider resolution cases incrates/rustasea-ai/tests/http_providers.rs, and two incrates/rustasea-app/src/bootstrap/auth.rs.Not verified
DatabaseUserProvideron Postgres or MySQL. It runs on SQLite only. It writesNULLas a literal rather than a bound value because the ORM bindsValue::Nullas an integer, which Postgres rejects for a timestamp column.Documentation
docs/milestones.md. M4 stays Partial. The first docs commit marks it Done and the second reverts that: the scheduler cannot dispatch a due command (dispatch_commandalways returns an error), pause state is per-process, and after-response events are never flushed. Stale claims are also corrected, such as the app'sAppServiceProviderbeing a no-op.docs/laravel-parity.md. Rows that had fallen behind, including three marked Planned or thin that already exist (ShouldBeUnique, the abilityGate, the batch repository)..agents/documents. As-built status on the roadmap and sprint documents. The 110 implementation-task rows underapplication/moduleswere allTodo; they are now 55 done, 53 partial, 2 not started, with what is missing listed for each open row. Plan text is unchanged.The task-row statuses come from reading the code, not from running tests. I re-checked the surprising ones and every
path:lineI cite myself; the rest relies on a search pass.Found, not fixed
Recorded in
docs/milestones.mdwith evidence, and left for separate changes:crates/rustasea-ai/src/agent.rs:247).Host, so a domain route answers for every host (crates/rustasea-router/src/dispatch.rs:57).in:admin,editorrejects every value (crates/rustasea-validation/src/rules/support.rs:134).JwtGuard::logoutis a no-op (crates/rustasea-auth/src/jwt.rs:270).Still open from the milestone list: database, cache, and queue bindings in the container at boot (M0), live column introspection for
show:model(M1), route registration from the generators (M5), and the database user provider in the scaffold templates (M3).@vheins, could you review this?