Repository navigation
test(session): cover file and MongoDB driver contracts - #494
Conversation
Extend the session store conformance suite to cover the file and MongoDB storage drivers alongside the existing memory and SQLite backends. The MongoDB test is ignored by default and requires a local replica set via TSD_MONGO_URL, with a helper that validates the target is loopback and generates a unique database name per run. Auto-committed-on: dragonfly
Adds a shared conformance check that runs the run ledger contract against a scoped backend and verifies that a separate scope cannot list another scope's runs. The check runs against file storage by default and against MongoDB behind an ignored test that requires a local replica set. Auto-committed-on: dragonfly
Reordered the driver imports so the core crate precedes the file crate, and reformatted the MongoDB-backed conformance test's store construction to fit within the line width. No behaviour changed. Auto-committed-on: dragonfly
Auto-committed-on: dragonfly
The file storage driver no longer needs its own conformance test since the shared helper already covers ledger conformance and scope isolation for all backends. Auto-committed-on: dragonfly
… isolation Auto-committed-on: dragonfly
Tiny Sweeper reviewTiny Sweeper reviewed this change across 5 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below. State: Incomplete Review snapshot
Completeness: Incomplete FeaturesNone identified with supported citations. TestsNo supported feature-to-test mapping was produced. Test execution is not inferred.
FindingsNo active actionable findings. Could not review: .github/workflows/session-mongodb.yml, Cargo.toml, crates/tinyagents-session/Cargo.toml, crates/tinyagents-session/src/port/drivers/mod_tests.rs, crates/tinyagents-session/src/run_ledger/drivers/mod_tests.rs, crates/tinyagents-session/src/testkit/conformance.rs, integration-proofs/run-ledger-mongodb/tests/session_driver_conformance.rs, tinysweeper/description, tinysweeper/tests Before merge
How this fits togetherflowchart LR
n0["sqlite_backed_stores_keep_agents_apart<br/>changed"]:::changed
n1["unwrap"]:::impacted
n2["ledgers"]:::impacted
n3["upsert_workflow_run"]:::impacted
n4["workflow"]:::impacted
n5["...ence_stale_owners_and_lifecycle_revisions"]:::impacted
n6["...low_concurrent_native_claim_has_one_owner"]:::impacted
n0 -->|calls| n1
n0 -->|tests| n1
n2 -->|calls| n1
n5 -->|calls| n1
n5 -->|tests| n1
n5 -->|calls| n2
n5 -->|tests| n2
n5 -->|calls| n3
n5 -->|tests| n3
n5 -->|calls| n4
n5 -->|tests| n4
n6 -->|calls| n1
n6 -->|tests| n1
n6 -->|calls| n2
n6 -->|tests| n2
n6 -->|calls| n3
n6 -->|tests| n3
n6 -->|calls| n4
n6 -->|tests| n4
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: .github/scripts/start-session-mongo-replset.sh, .github/workflows/session-mongodb.yml, Cargo.toml, crates/tinyagents-session/Cargo.toml, crates/tinyagents-session/src/port/drivers/mod_tests.rs, crates/tinyagents-session/src/run_ledger/drivers/mod_tests.rs, crates/tinyagents-session/src/testkit/mod.rs, tinysweeper/description and 1 more.
$0.0001 · 0 in / 0 out · 628 embedded · ladder/vectors-oai3
…c ops Adds tests exercising the FileStorage workflow lease path, including concurrent claimers, renewal by a non-owner, and revision-fenced compare-and-swap. Also verifies that unsupported validated-batch agent operations fail without leaving partial writes in agent or event rows. Auto-committed-on: dragonfly
Extend the file ledger test to verify that a claim on an agent team task fails with an unsupported validated batch error when the driver cannot perform atomic writes. The task is asserted to remain in the todo state and unclaimed after the failed operation. Auto-committed-on: dragonfly
Explain that FileStorage is tested against the operations its capability set supports, namely workflow CRUD and leases, and that atomic agent, event, and task operations are verified to return Unsupported(ValidatedBatch) without partial writes because its document driver lacks the required multi-document transaction boundary. Auto-committed-on: dragonfly
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15d047d755
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The driver tests now compare full collection snapshots before and after failed atomic operations instead of checking only the public list views, so partial writes to any record are caught. The lease race test also synchronises claimants on a barrier and asserts that losing live claimants report Busy with the winning owner. Auto-committed-on: dragonfly
The file ledger test now snapshots the tasks and members collections after the seed upserts instead of before them, so the comparison reflects only the partial-write behaviour under test. The unused request imports were dropped. Auto-committed-on: dragonfly
Auto-committed-on: dragonfly
The MongoDB driver conformance tests were removed from the tinyagents-session crate and relocated to the integration-proofs workspace, so the crate no longer depends on tinystoragedrivers-mongodb. The CI workflow now runs the conformance suite from its new location and watches the integration-proofs path for changes. Auto-committed-on: dragonfly
…/conformance.rs,integration-pro Auto-committed-on: dragonfly
Adjust line wrapping and assertion formatting in the MongoDB session driver conformance test to satisfy rustfmt. No behaviour changes. Auto-committed-on: dragonfly
Drops the unused conformance and scope isolation helper along with its now-unneeded RunLedgerStore import from the driver tests. The helper was no longer referenced, so removing it keeps the test module free of dead code. Auto-committed-on: dragonfly
Updates the Cargo.lock for the MongoDB run-ledger integration proof to pick up tinyagents 2.2.0 and the tinystoragedrivers v1.0.0 tag, along with the cap-std and rustix dependencies those crates now require. Auto-committed-on: dragonfly
…names The test now builds database names from a shorter prefix and a compact UUID representation, keeping identifiers within MongoDB's length limit while still guaranteeing uniqueness per run. Auto-committed-on: dragonfly
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: .github/workflows/session-mongodb.yml, Cargo.toml, crates/tinyagents-session/Cargo.toml, crates/tinyagents-session/src/port/drivers/mod_tests.rs, crates/tinyagents-session/src/run_ledger/drivers/mod_tests.rs, crates/tinyagents-session/src/testkit/conformance.rs, integration-proofs/run-ledger-mongodb/tests/session_driver_conformance.rs, tinysweeper/description and 1 more.
$0.0001 · 0 in / 0 out · 746 embedded · ladder/vectors-oai3
Adds conformance coverage for the file and MongoDB storage drivers used by
tinyagents-session.TSD_MONGO_URL, reject non-loopback hosts, and use unique databases. Keeping MongoDB/BSON outside the normal workspace prevents itsserde_json/preserve_orderfeature from changing the workspace dependency graph. A dedicated workflow starts a TSD-style local replica set and runs both tests for PRs and nightly.Validation:
cargo fmt --all -- --check; Mongo proof manifest formatting andactionlintpassed.cargo check -p tinyagents-session --all-features;cargo test -p tinyagents-session --all-features(597 passed; 2 doctests passed).tinyagents-session(--all-targets --all-features) and the full workspace (--workspace --all-targets). The exact same commands passed on isolated base43861dbf2f89c72f493a57eb7dce474369267800. The initial Clippy failure was dependency feature unification from the MongoDB dev-dependency; MongoDB now lives in its excluded proof manifest, and the normal feature graph no longer enables BSON'sserde_json/preserve_order.TSD_MONGO_URL=mongodb://localhost:27317/tsd_test?directConnection=true, both passed against a local replica set. Forcing--ignoredwithout the URL fails loudly as intended.Refs senamakel#71
Part of tinyhumansai/openhuman#8089
Summary by CodeRabbit