Repository navigation
E21-33: the token exchange waits for its request's roles (DEC-2350 S6) - #2313
Merged
Merged
Conversation
…n the deploy-manager's pods Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…aunch the exchange with its vault flags Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…v0.74, DEC-2335) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…ed when its connection closes (E21-33 K2a, DEC-2336) The tests half of DEC-77's pair. Phase::Succeeded joins the orchestrator port and the fake can succeed an instance; the manager's fold and decision have no stub form, so the tests that need a success read are pending as behaviour-only rows until K2a's implementation lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…en its connection closes (E21-33 K2a, DEC-2336) The implementation half of DEC-77's pair: the manager reads the request's account, journals the executor's exchanged start while the request is open and the account's executor never ran, wants it until a refusal or revocation, and names each executor stop by the last reason taken away. The pending tests' ignore lines and behaviour-only rows go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…'s account in DEC-2336's risks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…K2b, DEC-2336 items 6 to 10) The tests half of DEC-77's pair. The orchestrator port's start takes a Launch of the exchange's lifetime and the executor's connection, and its stop the connection; the driver passes none yet and the adapter ignores it, so the tests that need it are pending as behaviour-only rows. DEC-2336 gains K2b's items and the coordinator's F2 wording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…d pin it at admission (E21-33 K2b, DEC-2336 items 6 to 10) The implementation half of DEC-77's pair. The manager names an executor's connection on its start and stop and asks once per account per pass; the adapter makes and deletes the executor's hex account, names it and the namespace in its environment, and reads a succeeded pod as Succeeded. The chart pins a manager-started executor to an even-length hex account its environment names, admits that account with the executor's label, and mounts the vault token only on pods the manager starts. The pending tests' ignore lines and behaviour-only rows go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…deployment's or the connect's (E21-33 K2b, review F1) Four pending tests: a revoked connection the deployment does not name is never chosen; a restart after the connect ended names the deployment's connection, across the manager's restart; a stop names its generation's connection once nothing else does; and no executor takes another account's connection. DEC-2336 item 6 says which connection a start names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…from its deployment or its connect (E21-33 K2b, review F1) An executor's start names the connection a running agent's deployment of its account names, else its open connect's; the manager records it per generation as it folds the start, so the stop names the same account and a restarted manager names the same one. A revoked connection no deployment names is no longer chosen. The pending tests' ignore lines and rows go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…switch (DEC-2344 items 1 and 3) Pending E21-33. A covering kill switch gives an account's executor that every agent's retirement left down exactly one start, cause kill_switch, journaled first and caused by the switch; each later covering switch one more; a generation that ends on its own is never restarted; nothing else starts it; and a switch the executor has not answered keeps the account's last retirement from stopping it. A property over random deploys, retirements, kill switches of every scope, ends, clock steps and manager restarts checks both against an oracle computed from the operations alone. Each pending test has its behaviour-only row: the manager answers, no stub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…l_switch_unapplied (DEC-2344 item 1) Pending E21-33. A crash of the start is restarted, so one crash loses no switch; at the crash-loop bound the manager journals ProcessCrashLooped and raises the opaque operator alert kill_switch_unapplied, once, in place of crash_loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…lert (DEC-2344 item 1) The executor no agent wants may now crash before it ends. The oracle allows a crash's restart only before its loop and with no switch pending, requires the switch's one start when one is, never lets the manager stop a generation a switch keeps, admits a crash loop only after a kill switch's crashing start, and requires each such loop to raise kill_switch_unapplied once and every other alert never. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
… its start (DEC-2344, journal v0.76 §9.21) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…nge only once its roles exist (journal v0.77, DEC-2350) Journal spec §9.33 adds ConnectionRolesMade, ConnectionRolesRefused and ConnectionRolesRemoved on the control stream at schema version 1, with rule 261 (a system actor and a cause) and stream rules 262 and 263 (each record tied to its OAuth request; a removal after the roles were made, each role once, on its occasion, and the executor's role on a revocation only once no generation of its executor is left running). §9.21 starts a token exchange only once its request's ConnectionRolesMade is read. Connections spec §5.2 step 4 orders the roles first. The reference module connection_roles builds the vectors: 36 invalid and 4 valid drafts, 19 rule-262 and rule-263 streams, 4 validator, 8 stream and 7 vector mutants caught. Reserves and fills DEC-2350; adds the provisioner's backlog row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…role paths is DEC-2630 item 7's Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…xchange's alone (DEC-2350 item 3) Rule 263 narrows to one removal per made roles, of the token exchange's role, on a closed request or a revocation. A kill switch's start after a revocation can always log in; the cost, one executor role per closed or revoked connection granting a read of its own destroyed token, is recorded in DEC-2350 with the sweep left in the backlog. The executor's role is an invalid draft; its stream cases and the process fold go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…, and grant delete on the exchange's mount alone (DEC-2350, review) Rule 263 now holds a removal's causation_id to a closer of its connection journaled after the latest ConnectionRolesMade, so it never cites an earlier request's refusal under a new request of the same id (DEC-699). The fold and the oracle each read it their own way; four new streams and a vector mutant pin it. DEC-2350 item 5 adds delete on the token exchange's mount's block only, so the policy itself keeps the executor's role. fixtures/refcases/journal.json is regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…old it until its switches are answered (DEC-2344 items 1 and 3) The manager starts such an executor, cause kill_switch, journaled first, once for the covering switches it has not answered, as the account of the connection its last generation ran as. It never stops a generation a switch started or one a switch read while it ran is waiting on; a success ends it, a crash restarts with back-off, and a crash loop raises kill_switch_unapplied in place of crash_loop, again once from a restarted manager. The six pending retired.rs tests run, their behaviour-only rows go, and new tests cover a revoked connection, the restarted alert, a wanted executor's successful exit, and the oracle's seeded bugs. Two older tests follow DEC-2344's change. The alert has its RB-14 section and its infrastructure design §8.2 row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…ameters as strings (DEC-2350 item 5, V2's live check) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…tion's start, the restarted alert, the oracle's seeded bugs (DEC-2344 item 1, review) The four tests the implementation PR wrote fail on today's manager and are pending E21-33 with behaviour-only rows: the N3 revoked-connection start, the restarted manager's one re-raise, the seeded-bug harness, and manager.rs's stopped-agent test with DEC-2344's extra start. The property expects the re-raise, and properties.rs exempts an executor's unwanted start, which retired.rs's property checks more strictly. A wanted executor's restart after a success already passes, so it is a plain test. Record::CrashLooped carries the alert it raises, crash_loop for every loop today, so the harness can seed a loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…equire a finished instance to stay listed (DEC-2344, review) The merge takes #2257's pending tests and deletes their ten ignore lines and rows, so this PR's test diff is only those. RB-14 says the owner's kill_switch_unapplied alert lands with E8's notification row, before staging. The orchestrator port requires a Succeeded instance to stay listed until the manager reads it, and the Kubernetes adapter's doc says why its bare pods do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…at a held crash waits its back-off, and that a redeploy ends a kill-switch run (DEC-2344 item 1, review) Three more tests, pending E21-33 with behaviour-only rows, each failing on today's manager: a covering switch after an unapplied crash loop starts a new run that is restarted and can loop and alert again; a crashed kill-switch generation waits backoff(0) before exactly one restart; and a deployment during a kill-switch run makes its later loop an ordinary crash_loop, after a manager restart too. The property's oracle lets such a start begin a new run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
… merge #2257's new tests (DEC-2344 item 1, review) A kill_switch start of an executor no agent wants clears the last run's restarts, crash loop and alert, so a later covering switch after an unapplied loop is restarted after a crash, loops again, and is reported again: a second ProcessCrashLooped and a second kill_switch_unapplied. The merge takes #2257's three new tests and deletes their ignore lines and rows; a held crash's back-off and a redeploy's ordinary loop already held and are now pinned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…not stop it (DEC-2344 item 3, review) Pending E21-33 with its behaviour-only row: the generation a covering switch started stays running through an agent's deployment and retirement on the account, and its own end is not restarted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…yment (DEC-2344 item 3, review) A deployment on the account no longer ends a held run in the oracle's view: only its own successful end does, so a crash of it is still restarted after the agent retires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…d classify its loop at the loop (DEC-2344 item 3, review) resume no longer clears held, and a kill_switch start made while the executor is wanted no longer clears it either, so an agent deployed and retired while a switch's generation runs never gets that generation stopped before it ends itself (rule 13). A stop the manager journals is only ever of a generation it does not hold, so folding it clears held, and a replay agrees. A crash loop leaves a switch unapplied only when no agent wants the executor at the loop. #2257's new test runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…tests pending (DEC-2350) S3 of DEC-2350: journal spec v0.77 §9.33's ConnectionRolesMade, ConnectionRolesRefused and ConnectionRolesRemoved on the control stream, against the vectors' connection_roles section. Pending: the catalogue entry, each base and valid draft parsing, every invalid draft refused at its path, append judging rule 261 alone, and the verifier's fold verify_connection_roles answering every stream case of rules 262 and 263. The fold is stubbed; the parse tests fail on the unknown event type, with behaviour-only rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
…DEC-2350) S3's implementation: the journal registers ConnectionRolesMade, ConnectionRolesRefused and ConnectionRolesRemoved on the control stream at schema version 1, catalogued with no configuration, and append checks rule 261 on each (a system actor, then a cause). The verifier's fold verify_connection_roles judges rules 262 and 263 as the reference does: an answer names its own version-2 OAuth request, once; a removal follows its connection's latest roles made, once, and names a closer of those roles of its own occasion, a connect refusal or a revocation journaled after them. Deletes the pending markers and the four behaviour-only rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
… held run, a connect's ordinary loop, and a stop a restart must not undo (DEC-2351 item 2, review) Three pending E21-33 with rows, each failing on today's manager, and one plain test that passes today: an executor only a connect wants loops as crash_loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…s alert, and merge #2257's tests (DEC-2351 item 2, review) A kill_switch start of an executor holds its run when no agent of its account is deployed and not stopped, whatever connect request wants it, and the crash loop's alert says kill_switch_unapplied when the run is held and no agent wants the executor at the loop, as journal spec rule 264 reads it; a runtime's start never holds. A deployment on a connection revoked since counts until its AgentStopped, as the rule reads it. The merge takes #2257's four new tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmJtE8JXVQjyqTteJ5b9Cm
…ending (DEC-2350) Mutants found two readings of rule 263 the vectors leave open: a ConnectionRefused of another occasion taken for a request's close, and a removal whose occasion does not name its closer's kind. A pending test edits the removed_on_close case into each and expects rule 263 at the removal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
The fold compares a removal's named occasion against its closer's kind in one step, an occasion that names neither standing for no closer, and deletes the pending marker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
…aits # Conflicts: # docs/project/06-backlog-v1.md # docs/specs/journal.md
…ng (DEC-2350 S6) A connect's token exchange starts only once its request's ConnectionRolesMade is read (journal spec §9.21, §9.33). The new roles suite and the exchange property's oracle say so; the existing connect tests gain the Made row their scenarios now need. The pending tests fail on the manager's behaviour, which has no stub to stop at, and are named in xtask/behaviour-only until the implementation lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
…C-2350 S6) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
The manager reads the role provisioner's ConnectionRolesMade and keeps each request's event id; a connect's token exchange is wanted only once the Made that answers its own request is read, so a refusal, a record for another request, or none starts nothing, and the connect ends by its deadline (journal spec §9.21). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
9 of 10 tasks
D1's K2b chart, test and reference changes keep this branch's side, a superset of main's squashed J2 and R1; the journal spec's status and history add main's v0.72. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
The journal spec's status takes main's v0.80 with this branch's v0.77 clause in its place, and its history keeps both entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
…2334, DEC-2338) #2289 added `api-release` to `cargo xtask ci full` (DEC-2338 item 5) after #2195 had split `full`'s parts into `full-checks` and `full-checks-2` (DEC-2334). No CI job ran `api-release`, and `the_full_jobs_run_exactly_the_full_group` failed on main. Its release build of `mandate-api-server` takes about five minutes on its own. Neither existing job has room for that under ten minutes (DEC-464): `full-checks-2`'s `reference` alone is about 4.5 minutes, before its two release builds. So it runs in `full-checks-3`, on the same selection, and `full` needs all three. The verdict table now shows a failed, cancelled or skipped `full-checks-3` failing `full`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UoxcMViCbnGUTPSaduuGYU
`cargo deny --locked check` fails on main. In ctutils 0.4.2, the constant-time `Choice` mask lacked an optimization barrier (RUSTSEC-2026-0385, RustCrypto/utils#1569); 0.4.4 and later fix it. ctutils is a transitive RustCrypto crate, reached through aes-gcm, crypto-bigint, digest, sec1 and universal-hash (webpush, p256, sqlx-postgres). `cargo update -p ctutils` makes a patch-level bump. Nothing else in Cargo.lock moves, and no manifest or dependency row changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UoxcMViCbnGUTPSaduuGYU
Main runs no job for its api-release part, so the full-job split test fails there; this ports #2322's fix, which no-ops once it lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
The journal spec's status and history keep main's v0.75 and this branch's v0.77 in numeric order, generate.py builds both new sections, the catalogue holds both records' types, and the vectors and fixture are regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
The backlog keeps this branch's K2b rows beside the role provisioner's row main now holds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
Main now holds the K2a, K2b and kill-switch manager work this stack carried. Each file keeps main's text, with this pair's wait for the request's roles added: the manager from main with the S6 change applied, and the tests with their ConnectionRolesMade rows. The infrastructure design gains main's retirement_held row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5V2t72QcDywyLPViJtmFF
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.
Story
E21-33, DEC-2350 S6: the implementation half of the DEC-77 pair whose tests are the base PR (
claude/v2-exchange-waits,b7eb73da). Journal spec §9.21 (v0.77): a connect's token exchange starts only once its request'sConnectionRolesMadeis read.control.rs:Fact::Requestedgains the request'sevent_id.Fact::RolesMade { connection, request }is read fromConnectionRolesMade: itsconnection_id, and itscausation_id, which rule 262 makes the request it answers.manager.rs:Requestgainsidandroles_made.RolesMadesetsroles_madeonly when it answers the connection's request by that request's own id.desired(TokenExchange)is!closed && roles_made. A refusal, a Made for another request, or no record leaves the exchange unwanted, so nothing starts and the connect ends by its deadline as before. A close read before the start leaves it unwanted.Test diff: against the base, the tests change only by deleting the five
#[ignore = "pending E21-33"]lines and the fivextask/behaviour-only/rows.helduntouched:held_stepandwantedare byte-identical to #2290's (e53cbbd5), and no hunk namesheld,wantedorunapplied.Spec clause → test
The same as the base PR. Every test there now runs.
Dependencies
The base PR.
Journal events added
None.
Not done
None.
Decisions needed
None.
Safety checklist (safety-critical changes)
unwrap,expect, or panics on trading pathsx-plannedor(planned: ...)marker added to a value the code already serves, or a reviewer signed it off (DEC-683)Checks
cargo nextest run -p mandate-deploy-manager: 130 passed.cargo xtask ci lintagainst the base: green.cargo xtask ci mutantsagainst the base: 10 tested, 8 caught, 2 unviable, 0 missed.Generated by Claude Code