Implement durable managed recovery transitions and quarantine #48

Open
svc-svd-writer wants to merge 19 commits from feat/svd-dev-attention-mind-mcp-33-dd-469-6-child-5-7-durable-d2b4c2a7 into main
Collaborator

Summary

Managed recovery transition
├── Store, custody and transition engine — durable INITIALIZE, COMMAND and settlement
├── Archive transaction entry — managed snapshot reservation and identity check
└── Service and MCP adapter — single-use release permits and handoff

The engine persists exact provider admissions and bounded recovery progress. It applies an authenticated candidate or cancellation marker once, preserves the original deadlines and charges, and retires required material before lifting quarantine. Fresh custody observations gate new managed commands independently of disclosure readiness.

Evidence

  • Before. The revision-12 dispatches ended at the 2,700 s watchdog (e83a3e6a), the 5,400 s watchdog (5afe3362), and an incomplete declaration (38768ce3). The attempted resume of e83a3e6a was stopped. The operator ruled “Stop; fresh run” at 19:16, “double the stage budget” by 20:58:31, and “Add mcp_adapter.py (Recommended)” at 21:26:52–21:27:54 AEDT on 2026-11-21. Mind-spec records 9ccb4143, a03709b5, 141b1a84 and 01ff94ec cover those stops and the approved revision.
  • After. Revision-13 verify run 20261121T103517Z-cad8f175 was CLEAN on spec SHA-256 10b8a09364771bb01ceb0730f08a710998fc92b962c4f32ffd3b3a029c399cf5. Fresh dispatch 20261121T104247Z-d2b4c2a7 completed with a 10,800 s stage limit and default rework caps. Its evidence reports 1,317 unit, 66 transport, 416 transition, and 180 archive and staging tests passing, plus a 35-case final focused rerun, Ruff, strict mypy, and the native build.
  • Adapter gate follow-up on b5cb5e2. The transport exception handlers match base byte for byte. The adapter diff stays within the approved release ranges. The original integrate passed 1,317 unit and 66 transport tests, then stopped on Test Strategy naming and grouping and the runner's relative-path collection check. Mind-spec 8aa224d8 approved mapping the tests to the v13 names and rerunning with the absolute project interpreter and separate collection and run evidence.
  • Copy-release STOP on b5cb5e2. test_exact_retirement_charges[copy] found that both obsolete copy charges survived into unrelated admission retirement. Mind-spec classified this as implementation conformance in answer feb7dfad to ask 37661f35. In recovery_transition.py:633–646 and 2335–2381, reopen reestablishes conservative reservations before synchronization, and each obsolete encrypted and decoded copy releases its charge at verified retirement. The winner stays charged. Interrupted sync or unlink and unproved worker ownership retain charges.
  • Follow-up verification passed 456 transition cases, 1,357 full unit tests and 66 transport tests. Separate collection matched all 94 named functions and all 72 spec filters, including the required parameter IDs. Ruff format and lint, strict mypy, and the offline lock check passed. Fourteen isolated rule removals made 18 targeted cases fail.
  • Exact-head integrate on b1943a5 returned readyForMerge=true with zero blockers, zero rework and separate locked-interpreter collection and run evidence. Pipeline 73 passed on the same head. The lens initially recorded CI as pending and its lensReadyForMerge remains false. The final CI poll recorded green. The raw integrate log has zero command-start or collection-error signature hits. Receipt SHA-256 496c3e17114b2c97dfdafc2894b68e5232745f7cafa78ce69f10cb10feb8ea7f.

Test Strategy ID mapping

Each row accounts for IDs absent under the spec spelling at the previous head.

Test IDs Change
test_side_file_is_reserved_and_synced_before_use retirement_sync Added an injected directory-sync failure.
test_settled_row_reopens_at_saturation item_count-after_local_commit, item_count-pointer_replaced, item_bytes_submit-after_local_commit, item_bytes_replace-after_local_commit, lifetime-after_local_commit, lifetime-pointer_replaced, commands-after_local_commit, commands-marker_pointer_replaced Renamed and preserved the saturation schedules.
test_forged_settled_stage_refused derived_stage Renamed the existing remote-committed stage case.
test_key_unavailable_is_transient memory_error, os_error, missing_file Renamed the existing resolver exception cases.
test_wrong_key_or_corrupt_readback_is_durable_quarantine corrupt_read Lowercase pytest ID for the spec table’s Fault.CORRUPT_READ scenario.
test_admission_namespace_binding inventory_namespace, inventory_exact_request Added durable inventory-admission mismatch cases.
test_new_work_requires_bound_fresh_observations unavailable, other_namespace, other_generation, other_frontier, disabled Added the five independent new-work hold cases.
test_managed_prepare_requires_own_slot local_legacy Moved and renamed the existing local-mode control.
test_new_work_refresh_once first_transaction_open, second_reentry Mapped the retained successful refresh and single re-entry checks.
test_new_work_refresh_once release_rechecks, release_rechecks-list, release_rechecks-replay, release_rechecks-admit Injected an engine-not-READY barrier before releasing fresh submit, list, replay, and admit results. Replay and admit exercise the service check independently of the frozen query recheck.
test_exact_retirement_charges copy, unused_position, settled_get Added exact retirement checks at the copy, unused position and settled GET boundaries.
test_worker_keeps_workspace_charge stock_command_exit Mapped the existing stock command worker exit.
test_managed_expiry_prune_preserves_charges expired_key_still_ineligible Mapped and strengthened the expired-key case after reopen.

L817 also has a distinct post-send stock observation worker exit checked across reopen, an extra stock observation return case and a separate test transport with absent ownership proof.

Round-one rule-removal checks

Each row was checked independently against this revision in a disposable source copy. With the rule removed, the named case failed. With the rule in place, the case exercises the original managed path.

Rule removed Test that fails
Withhold the original ASGI start and body until managed release is decided test_protected_served_result_requires_release_metadata[obligation_before_start]
Reject an obligation stripped after buffering and before service recheck by checking slot.obligation is None and initial_metadata[1] is not slot.obligation test_protected_served_result_requires_release_metadata[obligation_after_buffer]
Match the buffered obligation to the exact obligation captured at response start test_protected_served_result_requires_release_metadata[obligation_restored]
Match the buffered permit to the exact permit captured at response start test_protected_served_result_requires_release_metadata[permit_restored]
Classify protected get and submit documents when both queue.service._capture and mcp_adapter.obligation registrations are skipped test_protected_served_result_requires_release_metadata[producer_skips_registration,producer_skips_registration_submit]
Require the first GET to prove F before entering the M send path test_recover_does_not_attempt_marker_without_get_and_premise[uncertain_get]
Recheck that the first GET succeeded with F's digest and ETag at durable M handoff test_marker_handoff_requires_exact_first_get[uncertain,wrong_digest,wrong_etag]
Require a qualified premise before attempting an unadmitted M test_recover_does_not_attempt_marker_without_get_and_premise[stale_premise]
Require exactly one hard link on an owned custody file test_custody_rejects_owned_file_with_external_hard_link
Require mode 0700 on a custody family directory test_custody_family_requires_private_directory[0755,0777,0750]

Round-one fault checks also cover EMFILE, EIO and missing keys through the production resolver; SIGKILL before either staged write is durable at 0 and 64 bytes; and file and parent-directory sync failures on both C and M. The checks prove the request remains unspent before PREPARED and retries when authority is proved. The finite-headroom control retains capacity_exceeded.

Round-two verification

Round two checks capacity before the P01 hold under the same transaction and keeps a refused command unprepared, unspent, and unsent. Unsafe or unavailable custody stays fenced as derived quarantine. The four binding errors persist quarantine only after proof of the exact current or prepared authority. Reopen preserves staged files and their charge through failed inspection, unlink, or directory sync. Tests cover revoked custody during both PREPARED and MARKER_PREPARED.

Rule removed or changed independently Cases that failed
Give the P01 hold precedence over an actual finite capacity refusal 8, covering four commands with an untrusted clock or mismatched premise
Classify a protected response by registration alone, skip the barrier-only service recheck, or ignore open prepare intent 5 over three mutations
Persist a post-send key I/O fault or a missing key, persist unsafe key descriptors, or persist a wrong-size key 8 over four mutations
Persist an unsafe family directory, treat an exact recorded binding as unproved, or treat an orphan binding as proved 15 over three mutations
Ignore a staged inspection error, release charge before verified retirement, or persist a store transaction failure 7 over three mutations
Preserve the caught exception as context on invalid prepared-state refusal 2

All 15 targeted mutations produced the expected failures in 45 test invocations. Fault injection used mode, descriptor, and I/O probes that also apply when tests run as root.

Exact-head integrate on 0aad72b returned readyForMerge=true with zero blockers and zero rework. Separate collection and execution used the absolute project interpreter. The raw log records 1,430 unit tests with exit code 0, while the receipt parser marks that background command opaque. All 66 transport tests passed. Hosted CI passed on the same head with 1,420 unit tests, 10 skips, and 66 transport tests. The raw integrate and CI logs had zero command-start or collection errors. Receipt SHA-256 b5478ed74f442b7aac51ec1b9c8b817a13d9425abb68aee71e5b0a5795162ef9. Woodpecker pipeline 76

Accepted round-two residuals

  • An activation parent-directory fsync EIO can leave only custody.lock. A retry refuses initialization_unproven with derived quarantine and a durable flag of zero. READY requires operator-assisted recovery. Automatic adoption is outside #33.
  • The key-file link-count check in recovery_crypto._check_custody is outside this write set and carries to #47.
  • The security review accepted the defence-in-depth or non-load-bearing survivors M7, M8, M10, M14–M16, and M18–M20. The spec review identified seven equivalent or unreachable survivors.

Round-three verification

  • R3-1 and R3-2. Unsafe file metadata and short reads fence readiness without setting the durable flag. The sweep retains custody charges before inspecting or syncing owned files. Reopen preserves staged C/M copies with external hard links until the links are removed and retirement is verified. Unknown fault codes also give derived quarantine. Bounded content, name, size and digest contradictions still persist quarantine. The tests inject file metadata through stat and fstat, and exercise real external hard links on staged copies.
  • R3-3. Command preparation applies the actual occurrence, live and command delta to the ledger checked during reconciliation. It rechecks the exact frontier reference, authenticated header binding and local counters on each attempt, including refresh re-entry. Finite refusal precedes reservation and the P01 hold. Fresh, unavailable, missing and untrusted observations all leave provider calls, the prepared row and spend unchanged at the lifetime ceiling. A changed replacement still proceeds at the lifetime ceiling when its own budget permits it.
  • R3-4. Only a frame validator or authenticated plaintext decoder can establish a structural violation of digest-bound authority. The key resolver has a separate error vocabulary. Current and prepared tests seal real overlength plaintext, a long record line, an oversized spent record and certificate, an out-of-range counter, and an invalid lifetime value. The oversized plaintext is rejected before decryption. A valid maximum counter blocks only a proposed increment.
  • R3-5 to R3-8. The readback envelope_unauthenticated ID now injects InvalidTag after digest and key commitment checks. Wrong returned key ID and wrong key material have the separate key_mismatch-id and key_mismatch-commitment IDs. full_length_unauthenticated_m flips the tag byte of a full-length staged M and verifies retirement with durable zero. Stock and synthetic ownership failures keep durable zero before and after reopen. Pass exhaustion, an invalid marker certificate, lifetime regression, an invalid prepared admission, and a proved unsafe-document conflict each persist durable one across reopen. An S3 subclass returning UNSENT is settled as ambiguous and retains its charge.
  • Standards and release check. The adapter type-only import is in the import section. Status and refresh catch the expected FoundationError and OSError types. The barrier-only service test drives derived readiness with durable zero in the same epoch.

Local verification passed 1,487 unit and 66 transport tests. The first transport run hit a read timeout in the existing [none-list] release-fence case. The isolated retry and the full transport rerun passed.

The 17 targeted rule removals produced 34 expected failing test invocations. The removals covered file safety and charge retention, unknown faults, early budget and header checks, exact digest binding before framing checks, decoder and resolver provenance, authentication and ownership, terminal conflicts, and the S3 UNSENT proof. Ruff, strict mypy and the offline lock check passed.

Exact-head integration on 502620ad65c5771bbfe406b8a79ad59556336e1e in run 20261121T104247Z-d2b4c2a7 returned readyForMerge=true with zero blockers and zero runner rework. Separate collection and run evidence used the absolute project interpreter. Verification accounting passed. The raw log integrate.r5.jsonl records 1,487 unit and 66 transport tests passing. Woodpecker 77 passed on the same head (1,477 unit tests passed, 10 skipped, and 66 transport tests passed). Receipt SHA-256 5d3c6cedb9200f1e22412823012565d9aa9c5afdcc717bc3db22a7da631f343c. Woodpecker 77 · SVD closeout

Accepted round-three residuals

  • Round-two residuals above carry forward. A planted unknown name such as admissions/stray.record remains a durable conflict.
  • Envelope opening independently checks the digest. The earlier digest check binds authority before any framing rejection. The frontier decoder's whole-plaintext size check shares the envelope plaintext cap. The envelope cap fires first on the recorded path, so the real oversized fixture exercises that earlier validator.
  • The row cap precedes staging. The observation refresh path refuses an unrefreshable hold. The prior torn-envelope survivor is covered by independent durable readback and rowless staged M cases.

Round-four gate rework

The guide ruled all five §19 findings in scope. Mind-spec answer ed6241ec resolved the two key-evidence questions within the approved revision-13 spec and seven-file write set. Round-four dispositions

Disposition Result
R4-1 / SEC-r4-4 Plain resolver-raised key mismatch, key-purpose mismatch and contradictory-custody codes give a derived fence. The opener's returned-key and commitment checks and the original KeyRing and KeyCustody comparisons still prove conflicts on a recorded digest. Tests cover plain forwarded codes, failed method lookup, a patched custody instance, the opener, KeyRing and different secure KeyCustody copies.
R4-2 / SEC-r4-5 An unbound staged frontier with a non-torn inspection failure stays on disk with the full prepared charge. Faulted and healthy reopens cover wrong material, purpose, unavailable keys and a forwarded torn-envelope code. The independently recorded activation digest still supports durable quarantine.
R4-3 / SEC-r4-1 After READY, drift either local counter or the current frontier size. Every case fences before reservation and provider dispatch, with no prepared row or command spend.
R4-4 / SEC-r4-2 Inject UID, type and size faults at stat and fstat, and short reads through the opened stream. All four owned file targets retain their evidence and applicable charges under a derived fence and recover once the fault clears.
R4-5 / SEC-r4-3 Seven cases pin the document class limit, stored invalidation filename digest and encoding round trip, unexpected root name, root and family partials missing an original, and unsupported partial with an original. Quarantine persists across reopen. The invalidation round trip uses encoder fault injection because the decoder already requires canonical framing.
R4-6 Translate recorded conflicts outside the handlers. All four boundaries assert both exception context and cause are empty.

The S3 test now covers instance overrides of both executor methods as well as a subclass. Authority classification uses one error-code helper and documents typed conflict precedence. The recorded-open split documents how it distinguishes framing from authenticated record limits. Document decode preserves record_byte_limit, and comments identify the activation returned by the sweep and the ledger check before reservation.

The pre-staging CAPACITY path now restores the prior in-memory charge. A test injects the refusal after reservation, checks for no side effects and successfully retries the same command.

Exact-head SVD integration on 8162065c7175e4a8d56ea0ab76a30b56ff5e2577 returned readyForMerge=true with zero blockers and zero runner rework. Raw log integrate.r9.jsonl records 98 round-four cases and the frozen wire reader passing, with accounted foreground verification and separate collection using absolute project Python paths. The full local suites independently passed 1,543 unit tests and 66 transport tests on the same commit. The initial local wheel test hit a sandbox cache permission error. The isolated and full reruns passed with a writable uv cache. Twenty-five isolated rule changes produced 31 expected test failures. Ruff, formatting, strict mypy and the offline lockfile check passed. Woodpecker 78 passed all four jobs with 1,533 unit tests passing, ten skipped, and 66 transport tests passing. Earlier SVD attempts hit accounting blockers from a relative supplemental collection command and explicit background execution. A subsequent full foreground run hit a pre-existing transport fixture race when reading the barrier file. The affected test passed in isolation and the fixture file stayed outside the round-four patch. The approved spec and frozen protocol hashes match. Receipt SHA-256 3a9f87c20be59391d81eb7920f82e9a9a24bbdde28be5a1db065db3e8e3ea264. Woodpecker 78 · SVD closeout

The round-two and round-three residuals still apply. Equivalent mutation survivors are integer_out_of_range, already classified as a contradiction, frontier_byte_limit, covered by the earlier envelope cap, and counter_overflow, an operation error outside decode. Seal-side plaintext_too_large follows an earlier check with the same cap.

Round-five gate rework

The round-five gate found the round-four key-provenance boundary sound for plain forwarded codes but open in three ways. Mind-spec answer 61eea58d ruled both questions as clashes within the approved revision-13 spec and seven-file write set. The operator ruled all three items in scope and the F4 case a residual. OpenAI's content filter stopped the attention seat three times on this round's material, so under the operator's ruling the guide wrote and pushed commit 55db5f8. Round-five dispositions

Disposition Result
R5-1 / SEC-r5-1 _code reads error.args once. _OpeningKeys.resolve raises a fresh error carrying the checked code after the try and never re-raises the resolver's object. Tests cover an error whose args change after one read and after three reads, on the recorded current frontier (derived, then READY) and on an unbound staged frontier (file and full prepared charge kept, then retired).
R5-2 / SEC-r5-3 F5 A forwarded key_custody_contradictory counted as proof only when the configured KeyCustody directories were exact concrete Path objects. The check ran after the call, so a path that restored exact directories before it raised still passed (SP-r6-3). A Path subclass that raises during path conversion gives a derived fence, then READY. Different secure copies still persist quarantine. Round six replaces this check.
R5-3 / SP-r5-1, SEC-r5-2, ST-r5-1 New cases pin the function, receiver and exact-type checks: a class-level resolve patch and an instance-bound replacement (original function), the genuine resolve bound to another custody (receiver), and a KeyRing subclass (exact type). The bound-method type check stayed unpinned (SP-r6-4). Round six removes these checks.
Nits 4 to 6 _code moved next to _fail; _KEY_VALIDATORS annotated; comment on the resolve = None default.

Guide verification on 55db5f8 before push: ruff, formatting and strict mypy passed; tests/test_recovery_transition.py passed 657 cases. Seven isolated rule removals were checked against the key-resolution selection. Six fail the expected cases: reverting the fresh error on the forwarded-fault branch, a multi-read _code, and dropping the path, function, receiver or exact-type check.

Accepted round-five residuals (the round-two, round-three and round-four residuals still apply):

  • F4: a KeyRing whose frozen private mapping is replaced through object.__setattr__ after construction can report key_purpose_mismatch without a comparison. The configured-resolver boundary covers supported configuration and callbacks and assumes a trusted validator's private state stays intact (mind-spec 61eea58d, operator ruling). If replaced inner state becomes supported, the source-proof rule applies.
  • Unverified equivalent survivor: dropping code == validator[1] appears equivalent, not proved for every input. Restoring the re-raise only in the validator-proof branch needs replaced validator state (the F4 case) to be observable. Round six removes both checks.
  • Integrate history on 8162065: r6 held on a relative interpreter path, r7 on background test runs without exit status, and r8 on a transport fixture timing race under load (test_writer_kill_and_retry[before_response-dispose], outside the write set; the uncontended rerun passed 66). r9 returned readyForMerge=true.

Round-six gate rework

All three round-six reviews failed 55db5f8 on the key-provenance boundary in _OpeningKeys.resolve. A configured resolver could still forge a conflict code that kept durable quarantine after a reopen with the good key. Six paths reached it:

  • a str-subclass path segment (SEC-r6-1);
  • an exception raised while the error was classified (SEC-r6-2, ST-r6-1); on an unbound staged frontier it also removed the file and released its charge;
  • a spoofed bound method (SEC-r6-3);
  • a metaclass alias of the validator type (SP-r6-1);
  • a class swap during the call (SP-r6-2);
  • a Path subclass that restored exact paths before it raised (SP-r6-3).

Mind-spec answer ad41dd8d accommodated the corroboration design and the residual wording within the approved revision-13 spec and seven-file write set. The operator ruled all six in scope and F4 a residual. Under the operator's ruling the guide wrote and pushed commit ad18dd6. Round-six dispositions

The boundary no longer infers provenance from the resolver's type, bound method or paths:

  • Before the call, it captures the resolver's exact type. For an exact KeyCustody it also captures the configured directories as plain strings, but only from an exact tuple of exact concrete Path objects that format to an exact str.
  • A transient code passes through as a derived fault. Any other code only prompts corroboration. The genuine validator, captured at import, runs the comparison for the same purpose and key ID: KeyRing.resolve on a resolver that was an exact KeyRing before and after the call, or KeyCustody.resolve on a fresh custody rebuilt from the captured strings. The proof code is whatever that comparison raises as a plain FoundationError, key_purpose_mismatch or key_custody_contradictory; the claimed code is never compared with it or forwarded. Otherwise the result is key_unavailable. (Reworded in round seven; round six said the validator must reproduce "the same code".)
  • Any exception while capturing state or classifying the error gives key_unavailable. The boundary always raises a fresh error after the handler.
  • An unbound staged frontier keeps its file and full prepared charge even when the lookup corroborates a conflict.
Finding Tests
SEC-r6-1 test_forged_validator_code_is_not_proof[text_subclass_segment]
SEC-r6-2 / ST-r6-1 test_resolver_classification_fault_is_derived[args:*] ×3; test_unbound_staged_key_fault_retains_file_and_charge[raising_args:envelope_*] ×2. Regression guards that do not fire at head: [type_hash:*] and [method_class]. [raising_args:key_custody_contradictory] reads its args fault but stays green without the guard, because a contradiction on an unbound orphan is not torn (corrected in rounds seven and eight)
SEC-r6-3 [spoofed_method_type], [method_lookalike]
SP-r6-1 [keyring_alias]; KeyCustody side [custody_alias] and [foreign_decoy] (round seven)
SP-r6-2 [class_swap_to_keyring], [keyring_swap_after_call]
SP-r6-3 [paths_restored_during_call], [directories_swapped_during_call], [fspath_redirect], [directories_redirect]
Corroboration [keyring_without_key]; test_unbound_staged_key_fault_retains_file_and_charge[corroborated_contradiction]

The foreign_custody case now records the genuine comparison instead of marking itself called. Comments in src/ state invariants only.

Guide verification on ad18dd6 before push: ruff, formatting and strict mypy passed; tests/test_recovery_transition.py passed 679 cases. Fourteen of the 22 new cases fail at 55db5f8 and eight pass there (corrected in round seven; the round-six disposition said two). Fourteen isolated rule changes were checked against the key-resolution selection, and twelve fail the expected case. They cover the capture timing, both type checks, the captured functions, the rebuilt custody, the path, tuple and guard checks, proof matching, and the forwarded code.

Accepted round-six residuals (the round-two to round-five residuals still apply):

  • F4: the boundary assumes that the trusted validator code and module globals, and the private normalized mapping of a KeyRing built through its constructor, stay intact. F4 replaces that mapping after construction and falls inside this assumption. A configured resolver callback, its exception accessors and caller-supplied path behavior stay inside the supported boundary, including during classification and path capture. None can stand in for the comparison (mind-spec ad41dd8d, operator ruling).
  • Equivalent survivors: the exact-str check, because an exact path always formats to an exact str on Python 3.14.5 (kept for other pathlib versions); and the exact error type in corroboration, because only _fail raises inside the boundary, so it is reachable only through the F4 case.

Round-seven gate rework

The round-seven reviews of ad18dd6 found all six round-six items fixed in code and no earlier item regressed. Standards and Security passed; Spec failed on one test gap. Mind-spec answer bf3ee04d accommodated all three fit questions. The operator ruled SEC-r7-1 fixed in this child, the F4 residual extended, and every Spec and Standards item fixed this round. Under the operator's ruling the guide wrote and pushed commit cec9e25. Round-seven dispositions

  • SEC-r7-1: the rebuilt custody resolved relative directory names against the working directory at corroboration time. A resolver callback that changed directory could point it at genuinely differing copies (durable 1). The boundary now captures the working directory with the names before the call and joins each name to it with no lexical normalization, so OS path semantics stay as they are.
  • SP-r7-1: the KeyCustody identity checks were unpinned, because [custody_alias] was refused by the tuple check first. [custody_alias] and the new [foreign_decoy] give an aliased and a plain foreign resolver an exact tuple of exact paths to a real contradiction.
  • ST-r7-2: the captured KeyRing validator was unpinned. [keyring_class_patch] patches the class KeyRing.resolve.
  • SP-r7-3: test_resolver_error_is_checked_once now runs the first read over every transient code, not only key_unavailable.
  • ST-r7-1, SP-r7-4: the classification test asserts which accessors it read. The args fault must be read; the type-hash and bound-method faults are regression guards and must stay unread.
  • SP-r7-2: the round-six wording above is corrected.
  • Nits: the redirect cases record their real reads; [corroborated_contradiction] asserts durable 0, the full charge and the staged file without reassigning its parameter; cast is gone and names is renamed directories.
Finding Tests
SEC-r7-1 test_forged_validator_code_is_not_proof[relative_names_chdir]
SP-r7-1 [custody_alias], [foreign_decoy]
ST-r7-2 test_resolver_overrides_cannot_prove_recorded_key_conflict[keyring_class_patch]
SP-r7-3 test_resolver_error_is_checked_once ×24 (first read over key_unavailable, key_custody_io, key_custody_insecure, key_custody_corrupt)
ST-r7-1 / SP-r7-4 test_resolver_classification_fault_is_derived ×6

Guide verification on cec9e25 before push: ruff, formatting and strict mypy passed; tests/test_recovery_transition.py passed 700 cases. Against the ad18dd6 code the key-resolution selection fails only [relative_names_chdir]; the other new cases pin checks that ad18dd6 already had. Nineteen isolated rule changes were run against the key-resolution selection, and seventeen fail the expected case. They include the class KeyRing.resolve, both KeyCustody identity checks, a re-raise of a held non-key_unavailable transient error, and no working-directory capture. The two survivors are the equivalent ones recorded in round six.

Accepted round-seven residuals (the round-two to round-six residuals still apply):

  • F4, extended (mind-spec bf3ee04d Q2 and Q3, operator ruling): the boundary assumes that the trusted validator code and module globals, and the private normalized mapping of a KeyRing built through its constructor with the frozen KeyEntry values in it, stay intact. It also assumes that its own frames and the objects it captured are not rewritten through interpreter introspection (frame locals, gc, ctypes). F4, the KeyEntry purpose flip (SP-r7-5) and the frame-locals rewrite (SEC-r7-2) fall inside these assumptions. Configured resolver callbacks, their exception accessors and caller-supplied path behavior remain in scope for every other behavior, including during classification and path capture. None can stand in for the comparison.
  • Ruled durable cases: a callback that plants a real contradictory copy reaches durable 1 through a genuine comparison, and a resolver that returns an entry with the wrong purpose reaches durable 1 (mind-spec ed6241ec). Corroboration closes forged proof by a raised code. It does not stop a hostile resolver from forcing durable quarantine through a real disagreement.
  • Equivalent survivors: the exact-str check and the exact error type in corroboration, as in round six.

Round-eight gate rework

The round-eight reviews of cec9e25 found all round-seven items fixed in code, each pinned by its named test, and no earlier item regressed. Standards and Security passed; Spec failed on one test gap. Mind-spec answered the round-eight fit ask (fd282c1a) with three accommodations. The operator ruled all three security items fixed in this child. Under the operator's ruling the guide wrote and pushed commit 9d3f8a2. Round-eight dispositions

  • SEC-r8-1: cec9e25 captured the working directory as a path string. A callback that renamed that directory away and planted differing copies at its old path redirected the rebuilt custody (durable 1). The boundary now records the identity of the working directory with its path before the call. When the path no longer names that directory at corroboration, the result is key_unavailable.
  • SEC-r8-2 / SP-r8-2: cec9e25 read the working directory even when every name was absolute, so a deleted working directory turned a genuine absolute-path contradiction into a derived fault. The working directory is now read only when a name is relative.
  • SEC-r8-3 / SP-r8-1 / ST-r8-2: corroboration reads exactly the configured paths, as the OS reads them: absolute names as given and relative names joined to the captured working directory, with no normalization and no symlink resolution. Tests now pin this.
  • SP-r8-3: a genuine contradiction under relative names stays durable.
  • Nits: the corroborate-side type check is removed, because sources exist only for an exact KeyCustody; the corroborated orphan case asserts the genuine comparison's code. ST-r8-1 is declined: strict mypy narrows only on type(resolver), so reusing the stored type needs cast.
Finding Tests
SEC-r8-1 test_forged_validator_code_is_not_proof[relative_names_renamed]
SEC-r8-2 / SP-r8-2 test_bound_key_validator_conflict_survives_reopen[key_custody_deleted_cwd]
SEC-r8-3 / SP-r8-1 [symlink_dotdot_names], [symlink_dotdot_absolute], [symlinked_directory], [symlinked_directory_relative]
SP-r8-3 test_bound_key_validator_conflict_survives_reopen[key_custody_relative]
ST-r8-4 test_unbound_staged_key_fault_retains_file_and_charge[corroborated_contradiction]

Guide verification on 9d3f8a2 before push: ruff, formatting and strict mypy passed; tests/test_recovery_transition.py passed 707 cases. Against the cec9e25 code the key-resolution selection fails only [relative_names_renamed] and [key_custody_deleted_cwd]. Ten isolated rule changes were run against the key-resolution selection, and eight fail the expected case: no rename check, normalization of relative or absolute names, realpath of relative or absolute names, always reading the working directory, refusing relative names, and never corroborating.

Accepted round-eight residuals (the round-two to round-seven residuals still apply):

  • Equivalent survivors: taking the directory identity from the captured path instead of ., because both name the same directory at capture; and treating a failed stat as unchanged, because paths that are gone make the genuine lookup fail anyway. The exact-str check and the exact error type in corroboration stay equivalent, as in round six.

Round-nine gate rework

The round-nine reviews of 9d3f8a2 found all round-eight items fixed in code, each pinned by its named test, and no earlier item regressed. Standards passed with four nits. Spec and Security each failed on one test gap, and Security raised one should-fix. Mind-spec answered the round-nine fit ask (e83aaeef) with two accommodations (b2f06ecd). The operator ruled both security items fixed in this child. Under the operator's ruling the guide wrote and pushed commit 4982f3f. Round-nine dispositions

  • SEC-r9-1 / SP-r9-1: the round-eight nit removed the corroborate-side type check, so the capture-side exact-type check is the only KeyCustody provenance check. An isinstance mutant passed every case; under it a KeyCustody subclass that configures a real contradiction it never reads, then forges the code, reached durable 1. A new test pins exactness.
  • SEC-r9-2: 9d3f8a2 joined relative names to a captured os.getcwd() path. A deleted working directory with one relative name among disagreeing absolute directories, or a working directory whose path cannot be stat'ed, turned a genuine contradiction into a derived fault. The boundary no longer calls os.getcwd() and no longer joins names. Relative names stay exactly as configured. When any name is relative, the boundary records the identity of . before the call, and corroboration reads the relative names only while . is still that directory; otherwise the result is key_unavailable. Absolute-only custody records nothing.
  • Behavior change from 9d3f8a2 (b2f06ecd Q1): a working directory renamed during the call is read as the same directory, by identity, not refused. A chdir during the call is still refused. [relative_names_renamed] stays derived 0, then READY, because corroboration reads the agreeing copies that the process reads.
  • Nits: the capture comment names the working-directory failure; _CustodySources keeps one optional identity field; two tests no longer build a throwaway absolute KeyCustody; a redundant proofs and is dropped.
  • Correction: the round-eight records said [custody_alias] pins the remaining type check and that no KeyCustody identity check survives alone. [custody_alias] kills only the == form; [custody_subclass] now pins exactness.
Finding Tests
SEC-r9-1 / SP-r9-1 test_forged_validator_code_is_not_proof[custody_subclass]
SEC-r9-2 test_bound_key_validator_conflict_survives_reopen[key_custody_mixed_deleted_cwd], [key_custody_callback_chdir]

Guide verification on 4982f3f before push: ruff, formatting and strict mypy passed; tests/test_recovery_transition.py passed 710 cases. Against the 9d3f8a2 code the new and changed cases fail only [key_custody_mixed_deleted_cwd]. With isinstance in the capture-side type check, [custody_subclass] fails.

Accepted round-nine residuals (the round-two to round-eight residuals still apply):

  • The unsearchable-parent route is fixed by construction, because the identity check stats . and makes no path lookup. It has no CI test, because CI runs as root and a chmod cannot make a parent unsearchable for root.
  • Comparing st_ino only is an untestable survivor. It matters only when another filesystem is mounted at the same place with the same inode number, which needs mount privilege.
  • Treating a failed stat of . as unchanged is an equivalent survivor: the rebuilt lookup of a relative name then fails too and never gives the proof code. The round-eight survivor "identity from the captured path instead of ." no longer exists, because no path is captured.
  • Unverified races, a callback thread that moves the directory between the identity check and the reads, or inode reuse, reach only the ruled P3 outcome, because the callback must write to custody.

Round-ten gate rework (spec-v14)

The round-ten reviews of 4982f3f passed Spec and Standards. Security failed on one test gap and raised three should-fix items. They showed that reading relative key names through the process working directory could not be made sound within the seven-file write set (mind-spec 2576f406). The operator ruled a spec amendment in this child. Spec-v14 adds recovery_crypto.py as the eighth primary file. Its scope is KeyCustody, KeyRing construction, the private directory helpers that KeyCustody calls, and the private record registry with its reader. Mind-spec accommodated the final text, and the operator approved spec-v14 at sha256 ed311972b1265b9d51bed76bd26a863146a8ce4fbd644bd05a26a54a0e20fdef. Under the operator's ruling the guide wrote and pushed commit 49f6f21. Round-ten dispositions

  • KeyCustody and KeyRing get private constructor records keyed by instance identity. Each record holds the kind and the exact type at construction.
  • KeyCustody reads relative names through a directory anchor opened at construction, one component at a time without following links. It never reads through the process working directory. The public KeyCustody.resolve reads the same way. KeyCustody.close() releases the anchor.
  • ManagedConfig records its key custody. Its wrapped initializer refuses reentry before any field write. A config built without its constructor has no record.
  • QueueTransition binds an engine-owned key reader once, at construction, from a snapshot of the config's instance dictionary with exact str keys. No later change to the config or the custody object reaches it. _OpeningKeys and _CustodySources are removed.
Finding Tests
SEC-r10-1, SEC-r10-2, SEC-r10-3 / SP-r10-1 custody matrix in test_forged_validator_code_is_not_proof and test_bound_key_validator_conflict_survives_reopen (absolute, relative and mixed; chdir_before, chdir_during, renamed_anchor, deleted_cwd, callback_thread, close_during, copy_removed_during; disagreeing and agreeing copies)
Spec-v14 anchor test_key_custody_anchor (11 cases)
Spec-v14 reader and records test_key_reader (15 cases, one per v14 arm)

SEC-r10-4 (st_ino), SP-r10-2 and ST-r10-1 are moot, because the working-directory identity check is removed. ST-r10-2 is declined as optional.

Guide verification on 49f6f21 before push: ruff, formatting and strict mypy passed; the full suite passed 1791 cases. With the 4982f3f source and the new test file, 108 of the key-resolution and key-reader cases fail and 34 pass. The passing cases guard behaviour that the base already had. Each named case has a one-line mutant that kills it, with two gaps. Eleven mutants also kill other named cases, because those cases share read paths. The four absolute close_during cases have no killing one-line mutant, because absolute custody holds no descriptor.

Withdrawn residuals: the round-nine residuals on the unsearchable parent, st_ino, the failed stat of . and callback races no longer apply, because no working-directory check remains.

Accepted round-ten residuals: the spec-v14 trust boundary is a closed Not-defended list. Every action not on it is Defended. The list:

  • changes to the trusted validation dependencies;
  • rewriting the boundary's own frames or captured state;
  • direct writes of protected state, for the state written only;
  • a hook's call to engine._quarantine(), for the durable mark only (the staged file and its full charge stay);
  • audit, trace or profile hooks;
  • writes to process memory or to engine-built objects;
  • closing or replacing a descriptor that the acting code did not open;
  • root-directory or mount-namespace changes;
  • in-thread asynchronous code (signal handlers, gc callbacks, finalizers, async exceptions);
  • resource exhaustion.

Round-eleven gate rework (spec-v15)

The round-eleven reviews of 49f6f21 failed all three lenses. Every round-ten item was fixed or moot, and no earlier item regressed. The failures had two causes. Four spec-v14 rules had no test that a one-line mutant turned red. A fault hook's thread could also set the engine's in-memory readiness, which spec-v14 did not list as protected state (SEC-r11-1, also present at 4982f3f). The operator ruled to name every in-memory field of that kind. Mind-spec found the enumerated list fits as a closed set (cfe007fb) and accommodated the final text (f5fc1de1). The operator approved spec-v15 at sha256 ca43e1e047ef1baf232ff08a4608e4e5d1e909e74c41ebbc0d5958ce19bc0853. It differs from spec-v14 in the protected-state item only. Commit ef49467 changes tests only. Round-eleven dispositions

Finding Test
A closed record never equals another reader (SP-r11-1, ST-r11-3, SEC-r11-2) test_key_reader[activate_compares_reader]
Anchor compared by device and inode (ST-r11-2, SEC-r11-2) test_key_reader[activate_compares_reader]
Intermediate descriptors close (SP-r11-2, ST-r11-1, SEC-r11-3) test_key_custody_anchor[no_leaked_descriptor]
Binding requires the exact ManagedConfig type (SP-r11-3) test_key_reader[config_dict_exact_keys]
An unrecorded instance never reads a relative name through the working directory (SP-r11-4) test_key_custody_anchor[public_resolve_anchored]

Each one-line mutant that undoes one of these rules turns exactly its case red. The direct-quarantine case now asserts only the staged file and its full charge, and seven test comments no longer describe the removed corroboration.

Guide verification on ef49467 before push: ruff, formatting and strict mypy passed; tests/test_recovery_transition.py and tests/test_recovery_crypto.py passed 859 cases.

Changed round-ten residual: "direct writes of protected state" now covers the spec-v15 closed set: the database rows, the bound reader and the records named before, plus the instance fields that spec-v15 names for QueueTransition, Store, Service and _ReleaseGate. Only the named fields are protected state. engine.config stays Defended.

Round-twelve gate rework (spec-v16)

The round-twelve reviews of ef49467 gave Spec FAIL, Standards PASS and §19 Security FAIL. Every round-eleven item was fixed or moot, and no earlier item regressed. Configured code reached a result through code rebinding, a file write in the queue's custody directory, and an assignment of engine.config (SEC-r12-1 to SEC-r12-3). The operator ruled code changes and writes in the custody directory Not defended, and later the bound config's authority fields written around their freeze. Mind-spec accommodated the clauses (8056d808, 3d20b3b2) and the final text (7de7866c). The operator approved spec-v16 at sha256 5cf79bb485f411a0cb371a3b61179e2e6a999e5534e6629a48cf007f0d0871a8. Round-twelve dispositions

Finding Change
The engine read engine.config live, including the archive namespace (SEC-r12-2) The engine reads its configuration only from _config, bound at construction; test_key_reader[config_assignment_has_no_effect]
An engine reader bound from a closed record (SP-r12-1) test_key_reader[activate_compares_reader]
The direct-quarantine hook was not shown to run (ST-r12-1) test_key_reader[direct_quarantine_keeps_unbound_charge] asserts the hook fired
The private-access hook rebound _authority_premise (SP-r12-2, SEC-r12-N1) The hook no longer calls _activation

A one-line mutant was run for each of the first three rows, and each turns its case red. For the first row, those mutants put the invalidation read and the archive namespace read back on engine.config; round thirteen pins the other reads. The private-access arm asserts only that the result equals the run without the hook, so it does not detect a hook that writes protected state.

Guide verification on 11fe9d2 before push: ruff, formatting and strict mypy passed; tests/test_recovery_transition.py and tests/test_recovery_crypto.py passed 860 cases.

New residuals (spec-v16 Not-defended list):

  • changes to attention_mind_mcp code: a module global, a class attribute or a function's code rebound, an object's __class__ assigned, or an instance attribute that hides a method or property;
  • creating, changing or deleting a file or directory in the queue's own custody directory;
  • writing around the freeze of the bound config's premise, invalidations or frontier_key_id, or of a field of the premise, namespace, principal or invalidation values they hold.

The protected list adds _config and the three fields that asyncio.Lock assigns on _ReleaseGate.

Round-thirteen gate rework (spec-v17)

The round-thirteen reviews of 11fe9d2 gave Spec FAIL, Standards PASS and §19 Security FAIL. Every round-twelve item was fixed or moot, and no earlier item regressed. A fault hook could empty a list or change a tuple subclass that the config held as invalidations, so a revoked premise dispatched (SEC-r13-1). No test pinned the _config read in _same_config (SP-r13-1). The operator ruled that ManagedConfig refuses a mutable container. Mind-spec accommodated the text (e3a6b5cd). The operator approved spec-v17 at sha256 048cc1ee8777624bb2992ac625aa514d8d580f19c55d3174431d1bb4a3584162. Round-thirteen dispositions

Finding Change
A config accepted a list or a tuple subclass for invalidations (SEC-r13-1) ManagedConfig refuses with unsupported_type unless invalidations is an exact tuple of exact PremiseInvalidation values; test_key_reader[config_invalidations_exact]
The _same_config read had no test (SP-r13-1) test_key_reader[config_assignment_has_no_effect] assigns the requested config before activate on an engine not yet activated
Most _config reads had no test (SP-r13-2, ST-r13-1) The same arm checks that no src module loads a config attribute
The arm changed the premise and the invalidations together (SP-r13-3) Part 1 drops the invalidations alone; a second reopen changes the artifact bucket

A one-line mutant was run for each row, and each turns exactly its case red: the exact check removed; the _same_config read, also with the static check off; the seal key ID and the invalidation read; and the premise and invalidation reads together, with the static check off.

Guide verification on e99c6fb before push: ruff, formatting and strict mypy passed; tests/test_recovery_transition.py and tests/test_recovery_crypto.py passed 861 cases.

Round-fourteen gate rework (spec-v18)

The round-fourteen reviews of e99c6fb gave Spec FAIL, Standards FAIL and §19 Security FAIL. Every round-thirteen item was fixed or partly fixed, and no earlier item regressed. No test pinned that a refused invalidations value stores no record (ST-r14-1, SP-r14-1). A reentrant ManagedConfig.__init__ call, and the generated initializer read from the wrapper's closure, could write a list into a recorded config, so a revoked premise dispatched (SEC-r14-1). The operator ruled that the engine binds the validated invalidations from the config record. Mind-spec did not answer the fit question, and the guide took that silence as its answer. The operator approved spec-v18 at sha256 b56c0f3881f893a21ec236bbe839d652c501d4d74ae45c49689ad17b39618f35. Round-fourteen dispositions

Finding Change
A reentrant construction or the held generated initializer wrote a list into a recorded config (SEC-r14-1) The wrapper refuses a nested call; the record keeps the validated tuple; binding refuses unless the field is that tuple; the engine reads only _invalidations; test_key_reader[constructor_reentry_refused] and [config_invalidations_exact]
No test pinned "stores no record" (ST-r14-1, SP-r14-1) [config_invalidations_exact] builds each refused value through ManagedConfig.__init__ and asserts no record and a refused reopen
Container type before iteration was unpinned (SP-r14-2) The tuple subclass's __iter__ records and raises; the arm asserts it never ran
The static check saw only attribute syntax (SP-r14-3, SEC-r14-N1) The check also refuses a "config" string constant in src

A one-line mutant was run for each row, and each turns exactly one arm red. Three mutants (_same_config, _activate and the record read each taking the field) are caught only by the static check of .invalidations reads.

Guide verification on 7439267 before push: ruff, formatting and strict mypy passed; tests/test_recovery_transition.py and tests/test_recovery_crypto.py passed 861 cases.

Round-fifteen gate rework (spec-v19)

The round-fifteen reviews of 7439267 gave Spec FAIL, Standards FAIL and §19 Security FAIL. Every round-fourteen item was fixed, and no earlier item regressed. The config record and the frontier authority held the caller's own frozen values. A fault hook that called a value's dataclass-generated __init__ on the same instance dropped a revocation, so a revoked premise dispatched. On the frontier Namespace during the local commit, it persisted a durable quarantine that a good reopen kept (SEC-r15-1). No test pinned the bind identity check against an equality mutant (ST-r15-1) or the _same_config read against a getattr spelling (SP-r15-1). The operator ruled that the engine reads its own copies of the configured premise values. Mind-spec did not answer the fit question, and the guide took that silence as its answer. The operator approved spec-v19 at sha256 352affb462f5bc3942ab210074f7ac12c3d464a413105b0d85059a53384085b6. Round-fifteen dispositions

Finding Change
The record and the frontier authority held the caller's frozen values (SEC-r15-1) __post_init__ builds copies, and the engine binds _invalidations from them; _authority_premise is the engine's decoded copy at bind and at rebind; test_key_reader[premise_values_owned]
The bind identity check was unpinned (ST-r15-1, SP-r15-3) [config_invalidations_exact] writes an equal distinct tuple and a recording tuple subclass; each refuses at bind, and no comparison runs
The _same_config read was pinned against one spelling (SP-r15-1, ST-r15-2, SEC-r15-2) A sub-case on an engine not yet activated gives initialization_unproven; the static check is keyed by enclosing function and sees getattr, attrgetter and constant subscripts
The reentry record assertion was vacuous on the empty tuple (SP-r15-2) Both calls pass a non-empty tuple, and the record holds the outer call's

A one-line mutant was run for each change, and each turns at least one arm red. One mutant (_activate encoding the field by getattr) is caught only by the static check.

Guide verification on cc3ceb8 before push: ruff, formatting and strict mypy passed; tests/test_recovery_transition.py and tests/test_recovery_crypto.py passed 862 cases.

Merge Danger

The code merge is reversible while managed activation remains disabled. The affected paths are managed custody and served response release. Production managed activation remains disabled until all three gates are verified.

  1. Prove through cutover and restart that activation excludes other serving processes, stops new release permits, drains active handoffs, and discards unreleased buffers before PREPARED (P01, P03).
  2. Prove ownership release for stock S3, including observation and command sends, before releasing workspace charges.
  3. Implement bounded, proof-based command expiry and reclamation, including existing classless records. This slice gives zero expiry credit.

Carry-forwards

  • #34 owns P07 local retirement for Forget. The interim command hold must not block production Forget or reserved cleanup (#34 and #47).
  • #47 owns the backup lifecycle, combined staging-file and full-read charge, managed archive privacy controls, exact debt retirement with verified absence and delayed-create exclusion (P05.3), stock-S3 ownership release, and proof-based expiry and reclamation. The exact non-command certificate and any persisted class binding need section 4 ratification. #47 and #35 share the bounded terminal and disposition fact projection.
  • #35 owns R10, older-archive authority (P13), selected-artifact restore (P01, P10, P13), and E06/E14 at the maximum reachable joint profile. Keep the structural record ceiling separate and exercise reserved Forget and cleanup at ordinary saturation on either exact branch.
  • The #34, #47 and #35 gates check the sole command-prune dependency. Mind-spec 4adee8cd and 09e1ced4 record the expiry and profile decisions.
  • Mind-spec ec8036c8 ratified the narrow ineligible mapping. Under the operator's 17:20:18 ruling on 2026-11-21, mind-spec landed the canonical attention-v1 text in dev/mind-spec at f2d7a963.

Closes #33
Co-Authored-By: gpt-6.2-sol noreply@openai.com

## Summary ```text Managed recovery transition ├── Store, custody and transition engine — durable INITIALIZE, COMMAND and settlement ├── Archive transaction entry — managed snapshot reservation and identity check └── Service and MCP adapter — single-use release permits and handoff ``` The engine persists exact provider admissions and bounded recovery progress. It applies an authenticated candidate or cancellation marker once, preserves the original deadlines and charges, and retires required material before lifting quarantine. Fresh custody observations gate new managed commands independently of disclosure readiness. ## Evidence - **Before.** The revision-12 dispatches ended at the 2,700 s watchdog (`e83a3e6a`), the 5,400 s watchdog (`5afe3362`), and an incomplete declaration (`38768ce3`). The attempted resume of `e83a3e6a` was stopped. The operator ruled “Stop; fresh run” at 19:16, “double the stage budget” by 20:58:31, and “Add mcp_adapter.py (Recommended)” at 21:26:52–21:27:54 AEDT on 2026-11-21. Mind-spec records `9ccb4143`, `a03709b5`, `141b1a84` and `01ff94ec` cover those stops and the approved revision. - **After.** Revision-13 verify run `20261121T103517Z-cad8f175` was CLEAN on spec SHA-256 `10b8a09364771bb01ceb0730f08a710998fc92b962c4f32ffd3b3a029c399cf5`. Fresh dispatch `20261121T104247Z-d2b4c2a7` completed with a 10,800 s stage limit and default rework caps. Its evidence reports 1,317 unit, 66 transport, 416 transition, and 180 archive and staging tests passing, plus a 35-case final focused rerun, Ruff, strict mypy, and the native build. - Adapter gate follow-up on `b5cb5e2`. The transport exception handlers match base byte for byte. The adapter diff stays within the approved release ranges. The original integrate passed 1,317 unit and 66 transport tests, then stopped on Test Strategy naming and grouping and the runner's relative-path collection check. Mind-spec `8aa224d8` approved mapping the tests to the v13 names and rerunning with the absolute project interpreter and separate collection and run evidence. - Copy-release STOP on `b5cb5e2`. `test_exact_retirement_charges[copy]` found that both obsolete copy charges survived into unrelated admission retirement. Mind-spec classified this as implementation conformance in answer `feb7dfad` to ask `37661f35`. In `recovery_transition.py:633–646` and `2335–2381`, reopen reestablishes conservative reservations before synchronization, and each obsolete encrypted and decoded copy releases its charge at verified retirement. The winner stays charged. Interrupted sync or unlink and unproved worker ownership retain charges. - Follow-up verification passed 456 transition cases, 1,357 full unit tests and 66 transport tests. Separate collection matched all 94 named functions and all 72 spec filters, including the required parameter IDs. Ruff format and lint, strict mypy, and the offline lock check passed. Fourteen isolated rule removals made 18 targeted cases fail. - Exact-head integrate on `b1943a5` returned `readyForMerge=true` with zero blockers, zero rework and separate locked-interpreter collection and run evidence. Pipeline 73 passed on the same head. The lens initially recorded CI as pending and its `lensReadyForMerge` remains false. The final CI poll recorded green. The raw integrate log has zero command-start or collection-error signature hits. Receipt SHA-256 `496c3e17114b2c97dfdafc2894b68e5232745f7cafa78ce69f10cb10feb8ea7f`. ### Test Strategy ID mapping Each row accounts for IDs absent under the spec spelling at the previous head. | Test | IDs | Change | | --- | --- | --- | | `test_side_file_is_reserved_and_synced_before_use` | `retirement_sync` | Added an injected directory-sync failure. | | `test_settled_row_reopens_at_saturation` | `item_count-after_local_commit`, `item_count-pointer_replaced`, `item_bytes_submit-after_local_commit`, `item_bytes_replace-after_local_commit`, `lifetime-after_local_commit`, `lifetime-pointer_replaced`, `commands-after_local_commit`, `commands-marker_pointer_replaced` | Renamed and preserved the saturation schedules. | | `test_forged_settled_stage_refused` | `derived_stage` | Renamed the existing remote-committed stage case. | | `test_key_unavailable_is_transient` | `memory_error`, `os_error`, `missing_file` | Renamed the existing resolver exception cases. | | `test_wrong_key_or_corrupt_readback_is_durable_quarantine` | `corrupt_read` | Lowercase pytest ID for the spec table’s `Fault.CORRUPT_READ` scenario. | | `test_admission_namespace_binding` | `inventory_namespace`, `inventory_exact_request` | Added durable inventory-admission mismatch cases. | | `test_new_work_requires_bound_fresh_observations` | `unavailable`, `other_namespace`, `other_generation`, `other_frontier`, `disabled` | Added the five independent new-work hold cases. | | `test_managed_prepare_requires_own_slot` | `local_legacy` | Moved and renamed the existing local-mode control. | | `test_new_work_refresh_once` | `first_transaction_open`, `second_reentry` | Mapped the retained successful refresh and single re-entry checks. | | `test_new_work_refresh_once` | `release_rechecks`, `release_rechecks-list`, `release_rechecks-replay`, `release_rechecks-admit` | Injected an engine-not-READY barrier before releasing fresh submit, list, replay, and admit results. Replay and admit exercise the service check independently of the frozen query recheck. | | `test_exact_retirement_charges` | `copy`, `unused_position`, `settled_get` | Added exact retirement checks at the copy, unused position and settled GET boundaries. | | `test_worker_keeps_workspace_charge` | `stock_command_exit` | Mapped the existing stock command worker exit. | | `test_managed_expiry_prune_preserves_charges` | `expired_key_still_ineligible` | Mapped and strengthened the expired-key case after reopen. | L817 also has a distinct post-send stock observation worker exit checked across reopen, an extra stock observation return case and a separate test transport with absent ownership proof. ### Round-one rule-removal checks Each row was checked independently against this revision in a disposable source copy. With the rule removed, the named case failed. With the rule in place, the case exercises the original managed path. | Rule removed | Test that fails | | --- | --- | | Withhold the original ASGI start and body until managed release is decided | `test_protected_served_result_requires_release_metadata[obligation_before_start]` | | Reject an obligation stripped after buffering and before service recheck by checking `slot.obligation is None` and `initial_metadata[1] is not slot.obligation` | `test_protected_served_result_requires_release_metadata[obligation_after_buffer]` | | Match the buffered obligation to the exact obligation captured at response start | `test_protected_served_result_requires_release_metadata[obligation_restored]` | | Match the buffered permit to the exact permit captured at response start | `test_protected_served_result_requires_release_metadata[permit_restored]` | | Classify protected get and submit documents when both `queue.service._capture` and `mcp_adapter.obligation` registrations are skipped | `test_protected_served_result_requires_release_metadata[producer_skips_registration,producer_skips_registration_submit]` | | Require the first GET to prove F before entering the M send path | `test_recover_does_not_attempt_marker_without_get_and_premise[uncertain_get]` | | Recheck that the first GET succeeded with F's digest and ETag at durable M handoff | `test_marker_handoff_requires_exact_first_get[uncertain,wrong_digest,wrong_etag]` | | Require a qualified premise before attempting an unadmitted M | `test_recover_does_not_attempt_marker_without_get_and_premise[stale_premise]` | | Require exactly one hard link on an owned custody file | `test_custody_rejects_owned_file_with_external_hard_link` | | Require mode `0700` on a custody family directory | `test_custody_family_requires_private_directory[0755,0777,0750]` | Round-one fault checks also cover `EMFILE`, `EIO` and missing keys through the production resolver; SIGKILL before either staged write is durable at 0 and 64 bytes; and file and parent-directory sync failures on both C and M. The checks prove the request remains unspent before PREPARED and retries when authority is proved. The finite-headroom control retains `capacity_exceeded`. ### Round-two verification Round two checks capacity before the P01 hold under the same transaction and keeps a refused command unprepared, unspent, and unsent. Unsafe or unavailable custody stays fenced as derived quarantine. The four binding errors persist quarantine only after proof of the exact current or prepared authority. Reopen preserves staged files and their charge through failed inspection, unlink, or directory sync. Tests cover revoked custody during both PREPARED and MARKER_PREPARED. | Rule removed or changed independently | Cases that failed | | --- | --- | | Give the P01 hold precedence over an actual finite capacity refusal | 8, covering four commands with an untrusted clock or mismatched premise | | Classify a protected response by registration alone, skip the barrier-only service recheck, or ignore open prepare intent | 5 over three mutations | | Persist a post-send key I/O fault or a missing key, persist unsafe key descriptors, or persist a wrong-size key | 8 over four mutations | | Persist an unsafe family directory, treat an exact recorded binding as unproved, or treat an orphan binding as proved | 15 over three mutations | | Ignore a staged inspection error, release charge before verified retirement, or persist a store transaction failure | 7 over three mutations | | Preserve the caught exception as context on invalid prepared-state refusal | 2 | All 15 targeted mutations produced the expected failures in 45 test invocations. Fault injection used mode, descriptor, and I/O probes that also apply when tests run as root. Exact-head integrate on `0aad72b` returned `readyForMerge=true` with zero blockers and zero rework. Separate collection and execution used the absolute project interpreter. The raw log records 1,430 unit tests with exit code 0, while the receipt parser marks that background command opaque. All 66 transport tests passed. Hosted CI passed on the same head with 1,420 unit tests, 10 skips, and 66 transport tests. The raw integrate and CI logs had zero command-start or collection errors. Receipt SHA-256 `b5478ed74f442b7aac51ec1b9c8b817a13d9425abb68aee71e5b0a5795162ef9`. [Woodpecker pipeline 76](https://ci.groupthink.asia/repos/76/pipeline/76/1) ### Accepted round-two residuals - An activation parent-directory fsync EIO can leave only `custody.lock`. A retry refuses `initialization_unproven` with derived quarantine and a durable flag of zero. READY requires operator-assisted recovery. Automatic adoption is outside #33. - The key-file link-count check in `recovery_crypto._check_custody` is outside this write set and carries to #47. - The security review accepted the defence-in-depth or non-load-bearing survivors M7, M8, M10, M14–M16, and M18–M20. The spec review identified seven equivalent or unreachable survivors. ### Round-three verification - **R3-1 and R3-2.** Unsafe file metadata and short reads fence readiness without setting the durable flag. The sweep retains custody charges before inspecting or syncing owned files. Reopen preserves staged C/M copies with external hard links until the links are removed and retirement is verified. Unknown fault codes also give derived quarantine. Bounded content, name, size and digest contradictions still persist quarantine. The tests inject file metadata through stat and fstat, and exercise real external hard links on staged copies. - **R3-3.** Command preparation applies the actual occurrence, live and command delta to the ledger checked during reconciliation. It rechecks the exact frontier reference, authenticated header binding and local counters on each attempt, including refresh re-entry. Finite refusal precedes reservation and the P01 hold. Fresh, unavailable, missing and untrusted observations all leave provider calls, the prepared row and spend unchanged at the lifetime ceiling. A changed replacement still proceeds at the lifetime ceiling when its own budget permits it. - **R3-4.** Only a frame validator or authenticated plaintext decoder can establish a structural violation of digest-bound authority. The key resolver has a separate error vocabulary. Current and prepared tests seal real overlength plaintext, a long record line, an oversized spent record and certificate, an out-of-range counter, and an invalid lifetime value. The oversized plaintext is rejected before decryption. A valid maximum counter blocks only a proposed increment. - **R3-5 to R3-8.** The readback `envelope_unauthenticated` ID now injects `InvalidTag` after digest and key commitment checks. Wrong returned key ID and wrong key material have the separate `key_mismatch-id` and `key_mismatch-commitment` IDs. `full_length_unauthenticated_m` flips the tag byte of a full-length staged M and verifies retirement with durable zero. Stock and synthetic ownership failures keep durable zero before and after reopen. Pass exhaustion, an invalid marker certificate, lifetime regression, an invalid prepared admission, and a proved unsafe-document conflict each persist durable one across reopen. An S3 subclass returning UNSENT is settled as ambiguous and retains its charge. - **Standards and release check.** The adapter type-only import is in the import section. Status and refresh catch the expected FoundationError and OSError types. The barrier-only service test drives derived readiness with durable zero in the same epoch. Local verification passed 1,487 unit and 66 transport tests. The first transport run hit a read timeout in the existing `[none-list]` release-fence case. The isolated retry and the full transport rerun passed. The 17 targeted rule removals produced 34 expected failing test invocations. The removals covered file safety and charge retention, unknown faults, early budget and header checks, exact digest binding before framing checks, decoder and resolver provenance, authentication and ownership, terminal conflicts, and the S3 UNSENT proof. Ruff, strict mypy and the offline lock check passed. Exact-head integration on `502620ad65c5771bbfe406b8a79ad59556336e1e` in run `20261121T104247Z-d2b4c2a7` returned `readyForMerge=true` with zero blockers and zero runner rework. Separate collection and run evidence used the absolute project interpreter. Verification accounting passed. The raw log `integrate.r5.jsonl` records 1,487 unit and 66 transport tests passing. Woodpecker 77 passed on the same head (1,477 unit tests passed, 10 skipped, and 66 transport tests passed). Receipt SHA-256 `5d3c6cedb9200f1e22412823012565d9aa9c5afdcc717bc3db22a7da631f343c`. [Woodpecker 77](https://ci.groupthink.asia/repos/76/pipeline/77/1) · [SVD closeout](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-45672) ### Accepted round-three residuals - Round-two residuals above carry forward. A planted unknown name such as `admissions/stray.record` remains a durable conflict. - Envelope opening independently checks the digest. The earlier digest check binds authority before any framing rejection. The frontier decoder's whole-plaintext size check shares the envelope plaintext cap. The envelope cap fires first on the recorded path, so the real oversized fixture exercises that earlier validator. - The row cap precedes staging. The observation refresh path refuses an unrefreshable hold. The prior torn-envelope survivor is covered by independent durable readback and rowless staged M cases. ### Round-four gate rework The guide ruled all five §19 findings in scope. Mind-spec answer `ed6241ec` resolved the two key-evidence questions within the approved revision-13 spec and seven-file write set. [Round-four dispositions](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-45712) | Disposition | Result | | --- | --- | | R4-1 / SEC-r4-4 | Plain resolver-raised key mismatch, key-purpose mismatch and contradictory-custody codes give a derived fence. The opener's returned-key and commitment checks and the original KeyRing and KeyCustody comparisons still prove conflicts on a recorded digest. Tests cover plain forwarded codes, failed method lookup, a patched custody instance, the opener, KeyRing and different secure KeyCustody copies. | | R4-2 / SEC-r4-5 | An unbound staged frontier with a non-torn inspection failure stays on disk with the full prepared charge. Faulted and healthy reopens cover wrong material, purpose, unavailable keys and a forwarded torn-envelope code. The independently recorded activation digest still supports durable quarantine. | | R4-3 / SEC-r4-1 | After READY, drift either local counter or the current frontier size. Every case fences before reservation and provider dispatch, with no prepared row or command spend. | | R4-4 / SEC-r4-2 | Inject UID, type and size faults at stat and fstat, and short reads through the opened stream. All four owned file targets retain their evidence and applicable charges under a derived fence and recover once the fault clears. | | R4-5 / SEC-r4-3 | Seven cases pin the document class limit, stored invalidation filename digest and encoding round trip, unexpected root name, root and family partials missing an original, and unsupported partial with an original. Quarantine persists across reopen. The invalidation round trip uses encoder fault injection because the decoder already requires canonical framing. | | R4-6 | Translate recorded conflicts outside the handlers. All four boundaries assert both exception context and cause are empty. | The S3 test now covers instance overrides of both executor methods as well as a subclass. Authority classification uses one error-code helper and documents typed conflict precedence. The recorded-open split documents how it distinguishes framing from authenticated record limits. Document decode preserves `record_byte_limit`, and comments identify the activation returned by the sweep and the ledger check before reservation. The pre-staging CAPACITY path now restores the prior in-memory charge. A test injects the refusal after reservation, checks for no side effects and successfully retries the same command. Exact-head SVD integration on `8162065c7175e4a8d56ea0ab76a30b56ff5e2577` returned `readyForMerge=true` with zero blockers and zero runner rework. Raw log `integrate.r9.jsonl` records 98 round-four cases and the frozen wire reader passing, with accounted foreground verification and separate collection using absolute project Python paths. The full local suites independently passed 1,543 unit tests and 66 transport tests on the same commit. The initial local wheel test hit a sandbox cache permission error. The isolated and full reruns passed with a writable uv cache. Twenty-five isolated rule changes produced 31 expected test failures. Ruff, formatting, strict mypy and the offline lockfile check passed. Woodpecker 78 passed all four jobs with 1,533 unit tests passing, ten skipped, and 66 transport tests passing. Earlier SVD attempts hit accounting blockers from a relative supplemental collection command and explicit background execution. A subsequent full foreground run hit a pre-existing transport fixture race when reading the barrier file. The affected test passed in isolation and the fixture file stayed outside the round-four patch. The approved spec and frozen protocol hashes match. Receipt SHA-256 `3a9f87c20be59391d81eb7920f82e9a9a24bbdde28be5a1db065db3e8e3ea264`. [Woodpecker 78](https://ci.groupthink.asia/repos/76/pipeline/78/1) · [SVD closeout](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-45808) The round-two and round-three residuals still apply. Equivalent mutation survivors are `integer_out_of_range`, already classified as a contradiction, `frontier_byte_limit`, covered by the earlier envelope cap, and `counter_overflow`, an operation error outside decode. Seal-side `plaintext_too_large` follows an earlier check with the same cap. ### Round-five gate rework The round-five gate found the round-four key-provenance boundary sound for plain forwarded codes but open in three ways. Mind-spec answer `61eea58d` ruled both questions as clashes within the approved revision-13 spec and seven-file write set. The operator ruled all three items in scope and the F4 case a residual. OpenAI's content filter stopped the attention seat three times on this round's material, so under the operator's ruling the guide wrote and pushed commit `55db5f8`. [Round-five dispositions](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-45822) | Disposition | Result | | --- | --- | | R5-1 / SEC-r5-1 | `_code` reads `error.args` once. `_OpeningKeys.resolve` raises a fresh error carrying the checked code after the `try` and never re-raises the resolver's object. Tests cover an error whose `args` change after one read and after three reads, on the recorded current frontier (derived, then READY) and on an unbound staged frontier (file and full prepared charge kept, then retired). | | R5-2 / SEC-r5-3 F5 | A forwarded `key_custody_contradictory` counted as proof only when the configured KeyCustody directories were exact concrete `Path` objects. The check ran after the call, so a path that restored exact directories before it raised still passed (SP-r6-3). A Path subclass that raises during path conversion gives a derived fence, then READY. Different secure copies still persist quarantine. Round six replaces this check. | | R5-3 / SP-r5-1, SEC-r5-2, ST-r5-1 | New cases pin the function, receiver and exact-type checks: a class-level resolve patch and an instance-bound replacement (original function), the genuine resolve bound to another custody (receiver), and a KeyRing subclass (exact type). The bound-method type check stayed unpinned (SP-r6-4). Round six removes these checks. | | Nits 4 to 6 | `_code` moved next to `_fail`; `_KEY_VALIDATORS` annotated; comment on the `resolve = None` default. | Guide verification on `55db5f8` before push: ruff, formatting and strict mypy passed; `tests/test_recovery_transition.py` passed 657 cases. Seven isolated rule removals were checked against the key-resolution selection. Six fail the expected cases: reverting the fresh error on the forwarded-fault branch, a multi-read `_code`, and dropping the path, function, receiver or exact-type check. Accepted round-five residuals (the round-two, round-three and round-four residuals still apply): - F4: a KeyRing whose frozen private mapping is replaced through `object.__setattr__` after construction can report `key_purpose_mismatch` without a comparison. The configured-resolver boundary covers supported configuration and callbacks and assumes a trusted validator's private state stays intact (mind-spec `61eea58d`, operator ruling). If replaced inner state becomes supported, the source-proof rule applies. - Unverified equivalent survivor: dropping `code == validator[1]` appears equivalent, not proved for every input. Restoring the re-raise only in the validator-proof branch needs replaced validator state (the F4 case) to be observable. Round six removes both checks. - Integrate history on `8162065`: r6 held on a relative interpreter path, r7 on background test runs without exit status, and r8 on a transport fixture timing race under load (`test_writer_kill_and_retry[before_response-dispose]`, outside the write set; the uncontended rerun passed 66). r9 returned `readyForMerge=true`. ### Round-six gate rework All three round-six reviews failed `55db5f8` on the key-provenance boundary in `_OpeningKeys.resolve`. A configured resolver could still forge a conflict code that kept durable quarantine after a reopen with the good key. Six paths reached it: - a str-subclass path segment (SEC-r6-1); - an exception raised while the error was classified (SEC-r6-2, ST-r6-1); on an unbound staged frontier it also removed the file and released its charge; - a spoofed bound method (SEC-r6-3); - a metaclass alias of the validator type (SP-r6-1); - a class swap during the call (SP-r6-2); - a Path subclass that restored exact paths before it raised (SP-r6-3). Mind-spec answer `ad41dd8d` accommodated the corroboration design and the residual wording within the approved revision-13 spec and seven-file write set. The operator ruled all six in scope and F4 a residual. Under the operator's ruling the guide wrote and pushed commit `ad18dd6`. [Round-six dispositions](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-45952) The boundary no longer infers provenance from the resolver's type, bound method or paths: - Before the call, it captures the resolver's exact type. For an exact `KeyCustody` it also captures the configured directories as plain strings, but only from an exact tuple of exact concrete `Path` objects that format to an exact `str`. - A transient code passes through as a derived fault. Any other code only prompts corroboration. The genuine validator, captured at import, runs the comparison for the same purpose and key ID: `KeyRing.resolve` on a resolver that was an exact `KeyRing` before and after the call, or `KeyCustody.resolve` on a fresh custody rebuilt from the captured strings. The proof code is whatever that comparison raises as a plain FoundationError, `key_purpose_mismatch` or `key_custody_contradictory`; the claimed code is never compared with it or forwarded. Otherwise the result is `key_unavailable`. (Reworded in round seven; round six said the validator must reproduce "the same code".) - Any exception while capturing state or classifying the error gives `key_unavailable`. The boundary always raises a fresh error after the handler. - An unbound staged frontier keeps its file and full prepared charge even when the lookup corroborates a conflict. | Finding | Tests | | --- | --- | | SEC-r6-1 | `test_forged_validator_code_is_not_proof[text_subclass_segment]` | | SEC-r6-2 / ST-r6-1 | `test_resolver_classification_fault_is_derived[args:*]` ×3; `test_unbound_staged_key_fault_retains_file_and_charge[raising_args:envelope_*]` ×2. Regression guards that do not fire at head: `[type_hash:*]` and `[method_class]`. `[raising_args:key_custody_contradictory]` reads its args fault but stays green without the guard, because a contradiction on an unbound orphan is not torn (corrected in rounds seven and eight) | | SEC-r6-3 | `[spoofed_method_type]`, `[method_lookalike]` | | SP-r6-1 | `[keyring_alias]`; KeyCustody side `[custody_alias]` and `[foreign_decoy]` (round seven) | | SP-r6-2 | `[class_swap_to_keyring]`, `[keyring_swap_after_call]` | | SP-r6-3 | `[paths_restored_during_call]`, `[directories_swapped_during_call]`, `[fspath_redirect]`, `[directories_redirect]` | | Corroboration | `[keyring_without_key]`; `test_unbound_staged_key_fault_retains_file_and_charge[corroborated_contradiction]` | The `foreign_custody` case now records the genuine comparison instead of marking itself called. Comments in `src/` state invariants only. Guide verification on `ad18dd6` before push: ruff, formatting and strict mypy passed; `tests/test_recovery_transition.py` passed 679 cases. Fourteen of the 22 new cases fail at `55db5f8` and eight pass there (corrected in round seven; the round-six disposition said two). Fourteen isolated rule changes were checked against the key-resolution selection, and twelve fail the expected case. They cover the capture timing, both type checks, the captured functions, the rebuilt custody, the path, tuple and guard checks, proof matching, and the forwarded code. Accepted round-six residuals (the round-two to round-five residuals still apply): - F4: the boundary assumes that the trusted validator code and module globals, and the private normalized mapping of a KeyRing built through its constructor, stay intact. F4 replaces that mapping after construction and falls inside this assumption. A configured resolver callback, its exception accessors and caller-supplied path behavior stay inside the supported boundary, including during classification and path capture. None can stand in for the comparison (mind-spec `ad41dd8d`, operator ruling). - Equivalent survivors: the exact-`str` check, because an exact path always formats to an exact `str` on Python 3.14.5 (kept for other `pathlib` versions); and the exact error type in corroboration, because only `_fail` raises inside the boundary, so it is reachable only through the F4 case. ### Round-seven gate rework The round-seven reviews of `ad18dd6` found all six round-six items fixed in code and no earlier item regressed. Standards and Security passed; Spec failed on one test gap. Mind-spec answer `bf3ee04d` accommodated all three fit questions. The operator ruled SEC-r7-1 fixed in this child, the F4 residual extended, and every Spec and Standards item fixed this round. Under the operator's ruling the guide wrote and pushed commit `cec9e25`. [Round-seven dispositions](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-46061) - SEC-r7-1: the rebuilt custody resolved relative directory names against the working directory at corroboration time. A resolver callback that changed directory could point it at genuinely differing copies (durable 1). The boundary now captures the working directory with the names before the call and joins each name to it with no lexical normalization, so OS path semantics stay as they are. - SP-r7-1: the KeyCustody identity checks were unpinned, because `[custody_alias]` was refused by the tuple check first. `[custody_alias]` and the new `[foreign_decoy]` give an aliased and a plain foreign resolver an exact tuple of exact paths to a real contradiction. - ST-r7-2: the captured KeyRing validator was unpinned. `[keyring_class_patch]` patches the class `KeyRing.resolve`. - SP-r7-3: `test_resolver_error_is_checked_once` now runs the first read over every transient code, not only `key_unavailable`. - ST-r7-1, SP-r7-4: the classification test asserts which accessors it read. The args fault must be read; the type-hash and bound-method faults are regression guards and must stay unread. - SP-r7-2: the round-six wording above is corrected. - Nits: the redirect cases record their real reads; `[corroborated_contradiction]` asserts durable 0, the full charge and the staged file without reassigning its parameter; `cast` is gone and `names` is renamed `directories`. | Finding | Tests | | --- | --- | | SEC-r7-1 | `test_forged_validator_code_is_not_proof[relative_names_chdir]` | | SP-r7-1 | `[custody_alias]`, `[foreign_decoy]` | | ST-r7-2 | `test_resolver_overrides_cannot_prove_recorded_key_conflict[keyring_class_patch]` | | SP-r7-3 | `test_resolver_error_is_checked_once` ×24 (first read over `key_unavailable`, `key_custody_io`, `key_custody_insecure`, `key_custody_corrupt`) | | ST-r7-1 / SP-r7-4 | `test_resolver_classification_fault_is_derived` ×6 | Guide verification on `cec9e25` before push: ruff, formatting and strict mypy passed; `tests/test_recovery_transition.py` passed 700 cases. Against the `ad18dd6` code the key-resolution selection fails only `[relative_names_chdir]`; the other new cases pin checks that `ad18dd6` already had. Nineteen isolated rule changes were run against the key-resolution selection, and seventeen fail the expected case. They include the class `KeyRing.resolve`, both KeyCustody identity checks, a re-raise of a held non-`key_unavailable` transient error, and no working-directory capture. The two survivors are the equivalent ones recorded in round six. Accepted round-seven residuals (the round-two to round-six residuals still apply): - F4, extended (mind-spec `bf3ee04d` Q2 and Q3, operator ruling): the boundary assumes that the trusted validator code and module globals, and the private normalized mapping of a KeyRing built through its constructor with the frozen KeyEntry values in it, stay intact. It also assumes that its own frames and the objects it captured are not rewritten through interpreter introspection (frame locals, gc, ctypes). F4, the KeyEntry purpose flip (SP-r7-5) and the frame-locals rewrite (SEC-r7-2) fall inside these assumptions. Configured resolver callbacks, their exception accessors and caller-supplied path behavior remain in scope for every other behavior, including during classification and path capture. None can stand in for the comparison. - Ruled durable cases: a callback that plants a real contradictory copy reaches durable 1 through a genuine comparison, and a resolver that returns an entry with the wrong purpose reaches durable 1 (mind-spec `ed6241ec`). Corroboration closes forged proof by a raised code. It does not stop a hostile resolver from forcing durable quarantine through a real disagreement. - Equivalent survivors: the exact-`str` check and the exact error type in corroboration, as in round six. ### Round-eight gate rework The round-eight reviews of `cec9e25` found all round-seven items fixed in code, each pinned by its named test, and no earlier item regressed. Standards and Security passed; Spec failed on one test gap. Mind-spec answered the round-eight fit ask (`fd282c1a`) with three accommodations. The operator ruled all three security items fixed in this child. Under the operator's ruling the guide wrote and pushed commit `9d3f8a2`. [Round-eight dispositions](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-46100) - SEC-r8-1: `cec9e25` captured the working directory as a path string. A callback that renamed that directory away and planted differing copies at its old path redirected the rebuilt custody (durable 1). The boundary now records the identity of the working directory with its path before the call. When the path no longer names that directory at corroboration, the result is `key_unavailable`. - SEC-r8-2 / SP-r8-2: `cec9e25` read the working directory even when every name was absolute, so a deleted working directory turned a genuine absolute-path contradiction into a derived fault. The working directory is now read only when a name is relative. - SEC-r8-3 / SP-r8-1 / ST-r8-2: corroboration reads exactly the configured paths, as the OS reads them: absolute names as given and relative names joined to the captured working directory, with no normalization and no symlink resolution. Tests now pin this. - SP-r8-3: a genuine contradiction under relative names stays durable. - Nits: the corroborate-side type check is removed, because sources exist only for an exact `KeyCustody`; the corroborated orphan case asserts the genuine comparison's code. ST-r8-1 is declined: strict mypy narrows only on `type(resolver)`, so reusing the stored type needs `cast`. | Finding | Tests | | --- | --- | | SEC-r8-1 | `test_forged_validator_code_is_not_proof[relative_names_renamed]` | | SEC-r8-2 / SP-r8-2 | `test_bound_key_validator_conflict_survives_reopen[key_custody_deleted_cwd]` | | SEC-r8-3 / SP-r8-1 | `[symlink_dotdot_names]`, `[symlink_dotdot_absolute]`, `[symlinked_directory]`, `[symlinked_directory_relative]` | | SP-r8-3 | `test_bound_key_validator_conflict_survives_reopen[key_custody_relative]` | | ST-r8-4 | `test_unbound_staged_key_fault_retains_file_and_charge[corroborated_contradiction]` | Guide verification on `9d3f8a2` before push: ruff, formatting and strict mypy passed; `tests/test_recovery_transition.py` passed 707 cases. Against the `cec9e25` code the key-resolution selection fails only `[relative_names_renamed]` and `[key_custody_deleted_cwd]`. Ten isolated rule changes were run against the key-resolution selection, and eight fail the expected case: no rename check, normalization of relative or absolute names, `realpath` of relative or absolute names, always reading the working directory, refusing relative names, and never corroborating. Accepted round-eight residuals (the round-two to round-seven residuals still apply): - Equivalent survivors: taking the directory identity from the captured path instead of `.`, because both name the same directory at capture; and treating a failed stat as unchanged, because paths that are gone make the genuine lookup fail anyway. The exact-`str` check and the exact error type in corroboration stay equivalent, as in round six. ### Round-nine gate rework The round-nine reviews of `9d3f8a2` found all round-eight items fixed in code, each pinned by its named test, and no earlier item regressed. Standards passed with four nits. Spec and Security each failed on one test gap, and Security raised one should-fix. Mind-spec answered the round-nine fit ask (`e83aaeef`) with two accommodations (`b2f06ecd`). The operator ruled both security items fixed in this child. Under the operator's ruling the guide wrote and pushed commit `4982f3f`. [Round-nine dispositions](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-46153) - SEC-r9-1 / SP-r9-1: the round-eight nit removed the corroborate-side type check, so the capture-side exact-type check is the only KeyCustody provenance check. An `isinstance` mutant passed every case; under it a KeyCustody subclass that configures a real contradiction it never reads, then forges the code, reached durable 1. A new test pins exactness. - SEC-r9-2: `9d3f8a2` joined relative names to a captured `os.getcwd()` path. A deleted working directory with one relative name among disagreeing absolute directories, or a working directory whose path cannot be stat'ed, turned a genuine contradiction into a derived fault. The boundary no longer calls `os.getcwd()` and no longer joins names. Relative names stay exactly as configured. When any name is relative, the boundary records the identity of `.` before the call, and corroboration reads the relative names only while `.` is still that directory; otherwise the result is `key_unavailable`. Absolute-only custody records nothing. - Behavior change from `9d3f8a2` (`b2f06ecd` Q1): a working directory renamed during the call is read as the same directory, by identity, not refused. A chdir during the call is still refused. `[relative_names_renamed]` stays derived 0, then READY, because corroboration reads the agreeing copies that the process reads. - Nits: the capture comment names the working-directory failure; `_CustodySources` keeps one optional `identity` field; two tests no longer build a throwaway absolute `KeyCustody`; a redundant `proofs and` is dropped. - Correction: the round-eight records said `[custody_alias]` pins the remaining type check and that no KeyCustody identity check survives alone. `[custody_alias]` kills only the `==` form; `[custody_subclass]` now pins exactness. | Finding | Tests | | --- | --- | | SEC-r9-1 / SP-r9-1 | `test_forged_validator_code_is_not_proof[custody_subclass]` | | SEC-r9-2 | `test_bound_key_validator_conflict_survives_reopen[key_custody_mixed_deleted_cwd]`, `[key_custody_callback_chdir]` | Guide verification on `4982f3f` before push: ruff, formatting and strict mypy passed; `tests/test_recovery_transition.py` passed 710 cases. Against the `9d3f8a2` code the new and changed cases fail only `[key_custody_mixed_deleted_cwd]`. With `isinstance` in the capture-side type check, `[custody_subclass]` fails. Accepted round-nine residuals (the round-two to round-eight residuals still apply): - The unsearchable-parent route is fixed by construction, because the identity check stats `.` and makes no path lookup. It has no CI test, because CI runs as root and a chmod cannot make a parent unsearchable for root. - Comparing `st_ino` only is an untestable survivor. It matters only when another filesystem is mounted at the same place with the same inode number, which needs mount privilege. - Treating a failed stat of `.` as unchanged is an equivalent survivor: the rebuilt lookup of a relative name then fails too and never gives the proof code. The round-eight survivor "identity from the captured path instead of `.`" no longer exists, because no path is captured. - Unverified races, a callback thread that moves the directory between the identity check and the reads, or inode reuse, reach only the ruled P3 outcome, because the callback must write to custody. ### Round-ten gate rework (spec-v14) The round-ten reviews of `4982f3f` passed Spec and Standards. Security failed on one test gap and raised three should-fix items. They showed that reading relative key names through the process working directory could not be made sound within the seven-file write set (mind-spec `2576f406`). The operator ruled a spec amendment in this child. Spec-v14 adds `recovery_crypto.py` as the eighth primary file. Its scope is KeyCustody, KeyRing construction, the private directory helpers that KeyCustody calls, and the private record registry with its reader. Mind-spec accommodated the final text, and the operator approved spec-v14 at sha256 `ed311972b1265b9d51bed76bd26a863146a8ce4fbd644bd05a26a54a0e20fdef`. Under the operator's ruling the guide wrote and pushed commit `49f6f21`. [Round-ten dispositions](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-47303) - KeyCustody and KeyRing get private constructor records keyed by instance identity. Each record holds the kind and the exact type at construction. - KeyCustody reads relative names through a directory anchor opened at construction, one component at a time without following links. It never reads through the process working directory. The public `KeyCustody.resolve` reads the same way. `KeyCustody.close()` releases the anchor. - `ManagedConfig` records its key custody. Its wrapped initializer refuses reentry before any field write. A config built without its constructor has no record. - `QueueTransition` binds an engine-owned key reader once, at construction, from a snapshot of the config's instance dictionary with exact `str` keys. No later change to the config or the custody object reaches it. `_OpeningKeys` and `_CustodySources` are removed. | Finding | Tests | | --- | --- | | SEC-r10-1, SEC-r10-2, SEC-r10-3 / SP-r10-1 | custody matrix in `test_forged_validator_code_is_not_proof` and `test_bound_key_validator_conflict_survives_reopen` (absolute, relative and mixed; `chdir_before`, `chdir_during`, `renamed_anchor`, `deleted_cwd`, `callback_thread`, `close_during`, `copy_removed_during`; disagreeing and agreeing copies) | | Spec-v14 anchor | `test_key_custody_anchor` (11 cases) | | Spec-v14 reader and records | `test_key_reader` (15 cases, one per v14 arm) | SEC-r10-4 (`st_ino`), SP-r10-2 and ST-r10-1 are moot, because the working-directory identity check is removed. ST-r10-2 is declined as optional. Guide verification on `49f6f21` before push: ruff, formatting and strict mypy passed; the full suite passed 1791 cases. With the `4982f3f` source and the new test file, 108 of the key-resolution and key-reader cases fail and 34 pass. The passing cases guard behaviour that the base already had. Each named case has a one-line mutant that kills it, with two gaps. Eleven mutants also kill other named cases, because those cases share read paths. The four absolute `close_during` cases have no killing one-line mutant, because absolute custody holds no descriptor. Withdrawn residuals: the round-nine residuals on the unsearchable parent, `st_ino`, the failed stat of `.` and callback races no longer apply, because no working-directory check remains. Accepted round-ten residuals: the spec-v14 trust boundary is a closed Not-defended list. Every action not on it is Defended. The list: - changes to the trusted validation dependencies; - rewriting the boundary's own frames or captured state; - direct writes of protected state, for the state written only; - a hook's call to `engine._quarantine()`, for the durable mark only (the staged file and its full charge stay); - audit, trace or profile hooks; - writes to process memory or to engine-built objects; - closing or replacing a descriptor that the acting code did not open; - root-directory or mount-namespace changes; - in-thread asynchronous code (signal handlers, gc callbacks, finalizers, async exceptions); - resource exhaustion. ### Round-eleven gate rework (spec-v15) The round-eleven reviews of `49f6f21` failed all three lenses. Every round-ten item was fixed or moot, and no earlier item regressed. The failures had two causes. Four spec-v14 rules had no test that a one-line mutant turned red. A fault hook's thread could also set the engine's in-memory readiness, which spec-v14 did not list as protected state (SEC-r11-1, also present at `4982f3f`). The operator ruled to name every in-memory field of that kind. Mind-spec found the enumerated list fits as a closed set (`cfe007fb`) and accommodated the final text (`f5fc1de1`). The operator approved spec-v15 at sha256 `ca43e1e047ef1baf232ff08a4608e4e5d1e909e74c41ebbc0d5958ce19bc0853`. It differs from spec-v14 in the protected-state item only. Commit `ef49467` changes tests only. [Round-eleven dispositions](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-47473) | Finding | Test | | --- | --- | | A closed record never equals another reader (SP-r11-1, ST-r11-3, SEC-r11-2) | `test_key_reader[activate_compares_reader]` | | Anchor compared by device and inode (ST-r11-2, SEC-r11-2) | `test_key_reader[activate_compares_reader]` | | Intermediate descriptors close (SP-r11-2, ST-r11-1, SEC-r11-3) | `test_key_custody_anchor[no_leaked_descriptor]` | | Binding requires the exact `ManagedConfig` type (SP-r11-3) | `test_key_reader[config_dict_exact_keys]` | | An unrecorded instance never reads a relative name through the working directory (SP-r11-4) | `test_key_custody_anchor[public_resolve_anchored]` | Each one-line mutant that undoes one of these rules turns exactly its case red. The direct-quarantine case now asserts only the staged file and its full charge, and seven test comments no longer describe the removed corroboration. Guide verification on `ef49467` before push: ruff, formatting and strict mypy passed; `tests/test_recovery_transition.py` and `tests/test_recovery_crypto.py` passed 859 cases. Changed round-ten residual: "direct writes of protected state" now covers the spec-v15 closed set: the database rows, the bound reader and the records named before, plus the instance fields that spec-v15 names for `QueueTransition`, `Store`, `Service` and `_ReleaseGate`. Only the named fields are protected state. `engine.config` stays Defended. ### Round-twelve gate rework (spec-v16) The round-twelve reviews of `ef49467` gave Spec FAIL, Standards PASS and §19 Security FAIL. Every round-eleven item was fixed or moot, and no earlier item regressed. Configured code reached a result through code rebinding, a file write in the queue's custody directory, and an assignment of `engine.config` (SEC-r12-1 to SEC-r12-3). The operator ruled code changes and writes in the custody directory Not defended, and later the bound config's authority fields written around their freeze. Mind-spec accommodated the clauses (`8056d808`, `3d20b3b2`) and the final text (`7de7866c`). The operator approved spec-v16 at sha256 `5cf79bb485f411a0cb371a3b61179e2e6a999e5534e6629a48cf007f0d0871a8`. [Round-twelve dispositions](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-47566) | Finding | Change | | --- | --- | | The engine read `engine.config` live, including the archive namespace (SEC-r12-2) | The engine reads its configuration only from `_config`, bound at construction; `test_key_reader[config_assignment_has_no_effect]` | | An engine reader bound from a closed record (SP-r12-1) | `test_key_reader[activate_compares_reader]` | | The direct-quarantine hook was not shown to run (ST-r12-1) | `test_key_reader[direct_quarantine_keeps_unbound_charge]` asserts the hook fired | | The private-access hook rebound `_authority_premise` (SP-r12-2, SEC-r12-N1) | The hook no longer calls `_activation` | A one-line mutant was run for each of the first three rows, and each turns its case red. For the first row, those mutants put the invalidation read and the archive namespace read back on `engine.config`; round thirteen pins the other reads. The private-access arm asserts only that the result equals the run without the hook, so it does not detect a hook that writes protected state. Guide verification on `11fe9d2` before push: ruff, formatting and strict mypy passed; `tests/test_recovery_transition.py` and `tests/test_recovery_crypto.py` passed 860 cases. New residuals (spec-v16 Not-defended list): - changes to attention_mind_mcp code: a module global, a class attribute or a function's code rebound, an object's `__class__` assigned, or an instance attribute that hides a method or property; - creating, changing or deleting a file or directory in the queue's own custody directory; - writing around the freeze of the bound config's `premise`, `invalidations` or `frontier_key_id`, or of a field of the premise, namespace, principal or invalidation values they hold. The protected list adds `_config` and the three fields that `asyncio.Lock` assigns on `_ReleaseGate`. ### Round-thirteen gate rework (spec-v17) The round-thirteen reviews of `11fe9d2` gave Spec FAIL, Standards PASS and §19 Security FAIL. Every round-twelve item was fixed or moot, and no earlier item regressed. A fault hook could empty a list or change a tuple subclass that the config held as `invalidations`, so a revoked premise dispatched (SEC-r13-1). No test pinned the `_config` read in `_same_config` (SP-r13-1). The operator ruled that `ManagedConfig` refuses a mutable container. Mind-spec accommodated the text (`e3a6b5cd`). The operator approved spec-v17 at sha256 `048cc1ee8777624bb2992ac625aa514d8d580f19c55d3174431d1bb4a3584162`. [Round-thirteen dispositions](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-47667) | Finding | Change | | --- | --- | | A config accepted a list or a tuple subclass for `invalidations` (SEC-r13-1) | `ManagedConfig` refuses with `unsupported_type` unless `invalidations` is an exact tuple of exact `PremiseInvalidation` values; `test_key_reader[config_invalidations_exact]` | | The `_same_config` read had no test (SP-r13-1) | `test_key_reader[config_assignment_has_no_effect]` assigns the requested config before `activate` on an engine not yet activated | | Most `_config` reads had no test (SP-r13-2, ST-r13-1) | The same arm checks that no `src` module loads a `config` attribute | | The arm changed the premise and the invalidations together (SP-r13-3) | Part 1 drops the invalidations alone; a second reopen changes the artifact bucket | A one-line mutant was run for each row, and each turns exactly its case red: the exact check removed; the `_same_config` read, also with the static check off; the seal key ID and the invalidation read; and the premise and invalidation reads together, with the static check off. Guide verification on `e99c6fb` before push: ruff, formatting and strict mypy passed; `tests/test_recovery_transition.py` and `tests/test_recovery_crypto.py` passed 861 cases. ### Round-fourteen gate rework (spec-v18) The round-fourteen reviews of `e99c6fb` gave Spec FAIL, Standards FAIL and §19 Security FAIL. Every round-thirteen item was fixed or partly fixed, and no earlier item regressed. No test pinned that a refused `invalidations` value stores no record (ST-r14-1, SP-r14-1). A reentrant `ManagedConfig.__init__` call, and the generated initializer read from the wrapper's closure, could write a list into a recorded config, so a revoked premise dispatched (SEC-r14-1). The operator ruled that the engine binds the validated invalidations from the config record. Mind-spec did not answer the fit question, and the guide took that silence as its answer. The operator approved spec-v18 at sha256 `b56c0f3881f893a21ec236bbe839d652c501d4d74ae45c49689ad17b39618f35`. [Round-fourteen dispositions](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-47793) | Finding | Change | | --- | --- | | A reentrant construction or the held generated initializer wrote a list into a recorded config (SEC-r14-1) | The wrapper refuses a nested call; the record keeps the validated tuple; binding refuses unless the field is that tuple; the engine reads only `_invalidations`; `test_key_reader[constructor_reentry_refused]` and `[config_invalidations_exact]` | | No test pinned "stores no record" (ST-r14-1, SP-r14-1) | `[config_invalidations_exact]` builds each refused value through `ManagedConfig.__init__` and asserts no record and a refused reopen | | Container type before iteration was unpinned (SP-r14-2) | The tuple subclass's `__iter__` records and raises; the arm asserts it never ran | | The static check saw only attribute syntax (SP-r14-3, SEC-r14-N1) | The check also refuses a `"config"` string constant in `src` | A one-line mutant was run for each row, and each turns exactly one arm red. Three mutants (`_same_config`, `_activate` and the record read each taking the field) are caught only by the static check of `.invalidations` reads. Guide verification on `7439267` before push: ruff, formatting and strict mypy passed; `tests/test_recovery_transition.py` and `tests/test_recovery_crypto.py` passed 861 cases. ### Round-fifteen gate rework (spec-v19) The round-fifteen reviews of `7439267` gave Spec FAIL, Standards FAIL and §19 Security FAIL. Every round-fourteen item was fixed, and no earlier item regressed. The config record and the frontier authority held the caller's own frozen values. A fault hook that called a value's dataclass-generated `__init__` on the same instance dropped a revocation, so a revoked premise dispatched. On the frontier `Namespace` during the local commit, it persisted a durable quarantine that a good reopen kept (SEC-r15-1). No test pinned the bind identity check against an equality mutant (ST-r15-1) or the `_same_config` read against a `getattr` spelling (SP-r15-1). The operator ruled that the engine reads its own copies of the configured premise values. Mind-spec did not answer the fit question, and the guide took that silence as its answer. The operator approved spec-v19 at sha256 `352affb462f5bc3942ab210074f7ac12c3d464a413105b0d85059a53384085b6`. [Round-fifteen dispositions](https://git.groupthink.asia/dev/attention-mind-mcp/issues/33#issuecomment-47838) | Finding | Change | | --- | --- | | The record and the frontier authority held the caller's frozen values (SEC-r15-1) | `__post_init__` builds copies, and the engine binds `_invalidations` from them; `_authority_premise` is the engine's decoded copy at bind and at rebind; `test_key_reader[premise_values_owned]` | | The bind identity check was unpinned (ST-r15-1, SP-r15-3) | `[config_invalidations_exact]` writes an equal distinct tuple and a recording tuple subclass; each refuses at bind, and no comparison runs | | The `_same_config` read was pinned against one spelling (SP-r15-1, ST-r15-2, SEC-r15-2) | A sub-case on an engine not yet activated gives `initialization_unproven`; the static check is keyed by enclosing function and sees `getattr`, `attrgetter` and constant subscripts | | The reentry record assertion was vacuous on the empty tuple (SP-r15-2) | Both calls pass a non-empty tuple, and the record holds the outer call's | A one-line mutant was run for each change, and each turns at least one arm red. One mutant (`_activate` encoding the field by `getattr`) is caught only by the static check. Guide verification on `cc3ceb8` before push: ruff, formatting and strict mypy passed; `tests/test_recovery_transition.py` and `tests/test_recovery_crypto.py` passed 862 cases. ## Merge Danger The code merge is reversible while managed activation remains disabled. The affected paths are managed custody and served response release. Production managed activation remains disabled until all three gates are verified. 1. Prove through cutover and restart that activation excludes other serving processes, stops new release permits, drains active handoffs, and discards unreleased buffers before PREPARED (P01, P03). 2. Prove ownership release for stock S3, including observation and command sends, before releasing workspace charges. 3. Implement bounded, proof-based command expiry and reclamation, including existing classless records. This slice gives zero expiry credit. ### Carry-forwards - #34 owns P07 local retirement for Forget. The interim command hold must not block production Forget or reserved cleanup (#34 and #47). - #47 owns the backup lifecycle, combined staging-file and full-read charge, managed archive privacy controls, exact debt retirement with verified absence and delayed-create exclusion (P05.3), stock-S3 ownership release, and proof-based expiry and reclamation. The exact non-command certificate and any persisted class binding need section 4 ratification. #47 and #35 share the bounded terminal and disposition fact projection. - #35 owns R10, older-archive authority (P13), selected-artifact restore (P01, P10, P13), and E06/E14 at the maximum reachable joint profile. Keep the structural record ceiling separate and exercise reserved Forget and cleanup at ordinary saturation on either exact branch. - The #34, #47 and #35 gates check the sole command-prune dependency. Mind-spec `4adee8cd` and `09e1ced4` record the expiry and profile decisions. - Mind-spec `ec8036c8` ratified the narrow `ineligible` mapping. Under the operator's 17:20:18 ruling on 2026-11-21, mind-spec landed the canonical attention-v1 text in dev/mind-spec at `f2d7a963`. Closes #33 Co-Authored-By: gpt-6.2-sol <noreply@openai.com>
Implement durable managed recovery transitions and quarantine
Some checks failed
ci/woodpecker/pr/validation Pipeline was canceled
6b768bfd14
Persist INITIALIZE and COMMAND preparation, exact provider admissions, and bounded recovery progress. Apply an authenticated candidate or cancellation marker once, preserve the original deadlines and charges, and retire owned material before lifting quarantine. Resume settlement on startup and eligible requests.

Keep fresh custody observations independent of disclosure readiness. Fence managed snapshots and buffered MCP responses with exact reservations, single-use permits, and a Store-owned handoff lease.

Verified 1,317 unit tests, 66 transport tests, 416 transition tests, and 180 archive and staging tests. The final fixture updates passed a 35-case targeted rerun. Ruff, mypy, and the native package build passed. The seven-file footprint and frozen protocol hash matched the spec.

Closes #33
Co-Authored-By: gpt-6.2-sol <noreply@openai.com>
Restore adapter transport error handling
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
b5cb5e2efe
Release frontier copy charges at verified retirement
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
b1943a5cca
Fix retryable recovery custody failures
Some checks failed
ci/woodpecker/pr/validation Pipeline was canceled
96d320b184
Keep pass reservation limits as capacity refusals
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
cfae3861a1
Fix round-two managed recovery findings
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
0aad72bcb6
Fix round-three managed recovery findings
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
502620ad65
Fix round-four managed recovery findings
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
8162065c71
Fix round-five managed recovery findings
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
55db5f830f
Refs #33. Round-5 gate items R5-1 to R5-3 and nits 4 to 6
(issue comment 45822; mind-spec 61eea58d; operator ruling).

- _code reads error.args once and sits next to _fail.
- _OpeningKeys.resolve emits a fresh error carrying the checked
  code after the try, and never re-raises the resolver's object.
- A KeyCustody contradiction counts as proof only when every
  configured directory is an exact concrete Path.
- Regression tests pin each provenance check, the single args
  read, and the staged-file fence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix round-six managed recovery findings
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
ad18dd6424
Refs #33. Round-6 gate items R6-1 to R6-6 and nits 7 to 10
(issue comment 45952; mind-spec ad41dd8d; operator ruling).

- _OpeningKeys no longer infers validator provenance from the
  resolver's type, bound method or paths. A conflict code counts
  only when the genuine validator, captured at import, reproduces
  it on state captured before the call: the exact KeyRing, or a
  KeyCustody rebuilt from plain directory strings.
- Any exception while capturing state or classifying the error
  gives key_unavailable; the boundary raises a fresh error.
- Tests cover forged validator codes, classification faults on
  the current and staged frontiers, and a corroborated conflict
  on an unbound orphan, which stays fenced and charged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix round-seven managed recovery findings
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
cec9e255fb
Corroboration now resolves relative custody directory names against the
working directory captured before the resolver call, so a callback that
changes directory cannot point the rebuilt custody at other copies.

Tests pin the KeyCustody identity checks with exact decoy directories,
the captured KeyRing validator against a class patch, the fresh-error
rule for every transient first code, and the classification reads.

Refs #33 (dispositions comment 46061; mind-spec bf3ee04d; operator
ruling round 7: fix SEC-r7-1, extend the F4 residual).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix round-eight managed recovery findings
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
9d3f8a268f
Corroboration reads the working directory only when a configured custody
name is relative, so a deleted working directory no longer hides a
genuine contradiction between absolute directories. It also records the
identity of that directory before the resolver call and refuses proof
when the captured path names another directory afterwards.

Tests pin that corroboration reads exactly the configured paths, with no
normalization and no symlink resolution, that a relative-name
contradiction stays durable, and that the corroborated orphan case
reaches the genuine comparison.

Refs #33 (dispositions comment 46100; mind-spec reply to fd282c1a;
operator ruling round 8: fix SEC-r8-1, SEC-r8-2 and SEC-r8-3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix round-nine managed recovery findings
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
4982f3f098
Pin the exact KeyCustody type check with a subclass that configures a
real contradiction it never reads. Corroborate relative custody names
by the identity of the working directory instead of a captured path,
so a deleted or unnameable working directory no longer loses a proved
durable contradiction.

Refs #33
Dispositions: #33 comment 46153. mind-spec fit b2f06ecd (corr
pr48-r9-fit). Operator ruling, round nine: fix both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bind anchored key custody once per engine (spec-v14 I17)
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
49f6f21313
Implement the operator-approved spec-v14 (sha256 ed311972) key reader
for round 10:

- KeyCustody and KeyRing get private constructor records keyed by
  instance identity, holding the kind and exact type at construction.
- KeyCustody reads relative names through a directory anchor opened at
  construction, one component at a time without following links; the
  public resolve reads the same way; close() releases the anchor.
- ManagedConfig records its key custody; reentry refuses before any
  field write; configs built without the constructor have no record.
- QueueTransition binds an engine-owned reader once at construction
  from a tuple snapshot of the config dict with exact str keys; later
  config or custody changes do not reach it.
- Tests: test_key_custody_anchor, test_key_reader, and the custody
  matrix in the two key-validator tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test(#33): pin the round-11 key-reader rules (spec-v15)
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
ef49467d3d
Add tests for four spec rules that no test pinned at 49f6f21:

- a reader bound from a closed record never equals another reader in
  activate, even over the same absolute names;
- relative custody compares its anchor directory by device and inode:
  the same names over a copy elsewhere refuse with
  initialization_unproven, and over the same directory activate;
- a multi-component relative name closes each intermediate descriptor;
- binding refuses a ManagedConfig subclass with unsupported_type.

Also pin that an instance no constructor built never reads a relative
name through the working directory, drop the readiness assertion from
the direct-quarantine arm (the arm asserts only the staged file and
its full charge), and update seven comments that still described the
removed corroboration.

Each one-line mutant that undoes one of these rules now turns exactly
its arm red. No source change. Spec-v15 (sha256 ca43e1e0) lists the
engine, store and service in-memory fields as protected state.

Refs #33

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(#33): read engine configuration from the pinned _config (spec-v16)
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
11fe9d2b30
The engine read its configuration live from engine.config, and the
archive gate read its artifact namespace from it too (store.py). A
fault hook that assigned engine.config could drop an invalidation and
let a revoked command through, or move the archive namespace.

QueueTransition now binds _config at construction, beside config, and
reads its configuration only from _config: 17 engine reads and the
store's archive namespace read. Assigning engine.config stays possible
and changes nothing the engine reads. Tests that change a fault hook
or the transport after construction now set engine._config.

Tests:

- new key_reader arm config_assignment_has_no_effect: a hook assigns
  engine.config with no invalidations and another artifact bucket; a
  revoked premise still gives ineligible with no transport call, and a
  reservation in the other bucket refuses with archive_quarantined;
- activate_compares_reader: an engine reader bound from a closed
  record never equals a live custody over the same names; the old
  redundant closed sub-case is removed and names are no longer reused;
- the direct-quarantine arm asserts that its hook fired;
- the private-access hook no longer calls _activation, which rebinds a
  protected field;
- one comment now says the subclass type is not exact.

Each one-line mutant that undoes one of these rules turns exactly its
arm red. Spec-v16 (sha256 5cf79bb4) adds _config to protected state and
adds code changes, custody-directory writes and writes around the
freeze of the bound config's authority fields to the Not-defended list.

Refs #33

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(#33): refuse a mutable invalidations container in ManagedConfig (spec-v17)
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
e99c6fb3d1
The engine reads the configured invalidations on each premise check.
ManagedConfig accepted a list or a tuple subclass, so a fault hook that
emptied the container let a revoked premise dispatch. __post_init__ now
refuses with unsupported_type unless invalidations is an exact tuple of
exact PremiseInvalidation values (spec-v17 L492, operator ruling
2026-11-24).

Tests:
- new arm test_key_reader[config_invalidations_exact];
- config_assignment_has_no_effect drops invalidations alone, changes the
  artifact bucket in a second reopen, checks that activate compares with
  the engine's own config on an engine not yet activated, and checks
  that no src module loads a config attribute;
- shared _archive_scope and _capture_engines helpers;
- closed_reader rename and a readiness assertion.

Refs #33

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(#33): bind configured invalidations from the config record (spec-v18)
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
74392674fe
A reentrant ManagedConfig.__init__, or the generated initializer held in
the wrapper's closure, could write a list into a config that already had
a record, so a fault hook that emptied it let a revoked premise dispatch.

- The wrapper refuses a nested call while the construction mark is set.
- _ConfigRecord keeps the validated invalidations tuple.
- _bind_keys refuses with unsupported_type unless the config's field is
  that tuple.
- QueueTransition binds _invalidations from the record; _premise,
  _same_config and _activate read only it (spec-v18 L490-493, L543,
  operator ruling 2026-11-24).

Tests:
- constructor_reentry_refused makes the nested call from a keyword-name
  __eq__ and asserts the record keeps the outer exact tuple;
- config_invalidations_exact asserts that a refused value stores no
  record and that iteration never runs before the type check, and that
  the generated initializer during and after construction refuses at
  bind; a hook rewrite after binding still gives ineligible; a static
  check pins the .invalidations readers;
- config_assignment_has_no_effect also refuses a "config" string
  constant in src;
- _archive_scope names its parameter object_key.

Refs #33

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(#33): read engine-built copies of the configured premise values (spec-v19)
Some checks are pending
ci/woodpecker/pr/validation Pipeline is running
cc3ceb8fbc
The config record and the frontier authority held the caller's own
frozen values. A fault hook that called a value's dataclass-generated
__init__ on the same instance rewrote what the engine read: a revoked
PremiseInvalidation let a revoked premise dispatch, and a rewritten
frontier Namespace during the local commit persisted a durable
quarantine that a good reopen kept.

- __post_init__ builds copies of the validated invalidations, and
  _ConfigRecord keeps them as owned; _recorded_invalidations returns
  them, so _invalidations is the engine's tuple of copies.
- _bind_keys still requires the config's field to be the caller's
  validated tuple, by identity.
- QueueTransition binds _authority_premise to its own copy of the
  premise (decode of the encoding), at bind and at the prepared-record
  rebind (spec-v19 L492-493, L512, operator ruling 2026-11-24).

Tests:
- premise_values_owned: a hook rewrites the caller's
  PremiseInvalidation by its generated __init__ and by
  object.__setattr__ (revocation still ineligible, no transport call);
  an engine not yet activated holds a copy of the premise; a hook
  rewrites the frontier Namespace at before_local_commit and
  after_local_commit (ok, durable 0, good reopen READY);
- config_invalidations_exact: an equal distinct tuple and a recording
  tuple subclass refuse at bind with no comparison call; on an engine
  not yet activated a hook write of the field leaves activate at
  initialization_unproven; the static check is keyed by enclosing
  function and sees getattr, attrgetter and constant subscripts;
- constructor_reentry_refused uses a distinct non-empty tuple;
- refused() replaces bare pytest.raises; helpers sit by
  test_key_reader; static-check messages name the rule.

Refs #33

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Some checks are pending
ci/woodpecker/pr/validation Pipeline is running
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/svd-dev-attention-mind-mcp-33-dd-469-6-child-5-7-durable-d2b4c2a7:feat/svd-dev-attention-mind-mcp-33-dd-469-6-child-5-7-durable-d2b4c2a7
git switch feat/svd-dev-attention-mind-mcp-33-dd-469-6-child-5-7-durable-d2b4c2a7

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feat/svd-dev-attention-mind-mcp-33-dd-469-6-child-5-7-durable-d2b4c2a7
git switch feat/svd-dev-attention-mind-mcp-33-dd-469-6-child-5-7-durable-d2b4c2a7
git rebase main
git switch main
git merge --ff-only feat/svd-dev-attention-mind-mcp-33-dd-469-6-child-5-7-durable-d2b4c2a7
git switch feat/svd-dev-attention-mind-mcp-33-dd-469-6-child-5-7-durable-d2b4c2a7
git rebase main
git switch main
git merge --no-ff feat/svd-dev-attention-mind-mcp-33-dd-469-6-child-5-7-durable-d2b4c2a7
git switch main
git merge --squash feat/svd-dev-attention-mind-mcp-33-dd-469-6-child-5-7-durable-d2b4c2a7
git switch main
git merge --ff-only feat/svd-dev-attention-mind-mcp-33-dd-469-6-child-5-7-durable-d2b4c2a7
git switch main
git merge feat/svd-dev-attention-mind-mcp-33-dd-469-6-child-5-7-durable-d2b4c2a7
git push origin main
Sign in to join this conversation.
No description provided.