Repository navigation
test(attestation): write-v2 receiver controls end to end (aegis-2idcev) - #823
Conversation
6b30452 to
ec8dca1
Compare
The DREAM adapter reaches quipu as an sd subprocess over HTTP, so the canonical receiving service is the signed-write middleware, not an in-process dispatch. The only v2 test stopped at the pre-check and settled directly. These drive the full stack (pre-check, real graph_create under the writer lock, durable finalization): - a settled write replays nowhere: same store is replay; another store that trusts the session refuses on audience and is not mutated; a signature for another route is badsig; - sixteen concurrent copies create exactly one; - a handler failing inside the lock still spends its nonce, and each of the two durability layers is controlled on its own (lock-time spend with no finalization; finalization with no lock taken); - a binding revoked while queued is a 401 with nothing created or spent. Sabotage, each red: lock-time consume skipped; finalization skipped on non-2xx; audience taken from the envelope; revocation not re-checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BzgSY2LpdGhBhb7D1nHbiF
ec8dca1 to
7cb6c37
Compare
|
SOURCE APPROVE at 7cb6c37. Original full two-path source audit at ec8dca1 and shared middleware/fixture call-chain read retained. The six new controls exercise replay/audience/path, concurrency, failed-handler and finalization durability, and queued revocation. The direct-handler case deliberately isolates the shared lock-settlement layer; wire cases go through v2 middleware. Exact-head hosted controls are green; no local Cargo/runtime reproduction is claimed by this reviewer. SAME qualification: both proposal blobs/modes are unchanged, and replaying the original whole binary patch reconstructs the entire refreshed tree. Automatic refresh reuse combined with diff-bound was refused; that refusal is retained. Fresh ordinary SAME review bound content943c accepted. Normal diff-bound preflight/execute merged d6c403c, predicted and actual integration tree1584 match; the whole inverse restores07f. Exact-main watch remains pending; no runtime acceptance. The repository auto-deleted the source ref despite no delete flag. It was restored to the exact reviewed7cb head to preserve the stacked proposal. #824 remains open and was automatically retargeted to main; it still needs its own current CI and review. |
Stacked on #820 (base
malcolm/2idcev-verified-write). It changes tests only; no product code changes.Why
An external signed-write client (an
sdsubprocess over HTTP) reaches quipu through the signed-write middleware. So the receiving service that must re-verify is that middleware, and an in-process dispatch would have no caller.The existing write-v2 unit test stops at the pre-check and settles directly. The integration tests cover v2 audience refusal, but only before any settlement. Replay, concurrency and nonce durability are covered on v1 only.
What
New
src/server/write_attest_v2_tests.rs, a child of the existing test module. Each test drives the full stack: pre-check, the realgraph_createunder the writer lock, then durable finalization.a_settled_v2_write_replays_nowhere_and_binds_its_pathreplayat this store. A second store that trusts the same session refuses them asinvalid(audience) and is not mutated. A signature for/knotsent to/graph/createisbadsig.concurrent_copies_of_one_v2_write_admit_exactly_onereplay.a_v2_write_that_fails_inside_the_lock_still_spends_its_noncereplay.the_lock_time_spend_alone_survives_a_failed_handlera_v2_write_refused_before_the_lock_is_finalized_by_the_middlewarea_v2_write_revoked_while_queued_is_refused_end_to_endrevoked, nothing created, nothing spent.Sabotage
Each sabotaged file was restored from a saved copy, and its sha256 was checked after the run.
settle_on)handle)check_signed_request)The fails-inside-the-lock test stays green when either durability layer is removed alone. That is by design, since there are two independent layers, and the two single-layer tests cover each one.
Not sabotaged: the path-binding arm. A verifier that ignores the path also breaks the positive case, so no sabotage isolates that arm. Path binding stays covered by the canonical-message construction.
Gates
cargo clippy --all-targets -D warnings -A missing-docsrc 0 forfullandshacl,owl;🤖 Generated with Claude Code
https://claude.ai/code/session_01BzgSY2LpdGhBhb7D1nHbiF