DD-469 #6: implement canonical managed-record profile primitives #25
Labels
No labels
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:fire
svd:go
svd:hold
svd:respec
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/attention-mind-mcp#25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Decision and authority
Fresh bounded production child of #6, following closed #23 and merged PR #24 at
1499001652392c3e4392417f325f35ea00a28c89. Implements the already reviewed P09 canonical record encoding/profile foundation under the #6 standing grant (parent comment 42500, SHA-256fc91e05e770da3139184c2ce21f74c2ccb141ffd3279f7f40cc6b86c249fd693). Exact transition protocol v2 has adversarial PASS 0, parent comment 42606; protocol SHA-2561aaab9cb149d2575879428eaa9ce42d9b401a582a2ffa9bb44c31d4b2ac82cc2, reviewfd7dec433c30a201584f98841283441289af01782736a0464aed2b1062e04e80. Frozen protocol/map/review bytes must remain unchanged. This is fresh work, not a continuation of exhausted #6/proof runners. Default SVD rework caps and delegated auto-gate apply.Result required
Add a private production module
src/attention_mind_mcp/managed_profile.pyproviding the common encoded-record and accounting primitives required by the subsequent logical SQLite exporter, encrypted frontier and restore implementation. It must have one deep, documented interface that canonicalizes a named record class and validates/charges complete encoded bytes and counts. This child establishes no new public MCP/CLI operation and does not enable managed mode.Use the exact reviewed P09 limits: 512 live records / 8 MiB aggregate canonical live candidate/provenance/disposition representation; 1,024 command records at most 64 KiB EACH including their complete record/framing; 65,536 lifetime opaque occurrence slots at most 128 encoded bytes EACH; 4,096 retained non-forgotten evidence facts at most 1 KiB EACH; 32 complete artifact inventory/location records at most 16 KiB EACH; one complete prepared record at most 64 KiB. Define stable named classes, explicit framing and a format version; reject unknown record classes and unknown framing fields. Semantic validation of each class's domain payload belongs to the later actual exporter/restorer; this primitive must not claim a semantically valid restore from structurally bounded JSON. Document exactly which class contains each current/future logical state record; no uncharged miscellaneous class. Binary payload fields must be explicitly base64 encoded with a canonical helper rather than implicitly stringified. Do not silently serialize unsupported Python objects.
Canonical representation is UTF-8 JSON, sorted keys, compact separators, no floats/NaN/Infinity, no duplicate object keys at any decode boundary, no non-string mapping keys, and bounded nesting. Restrict integers to the P02 signed-time/unsigned-counter envelope (negative values no lower than signed 64-bit; positives no larger than unsigned 64-bit); reject booleans where integer accounting is required. Reject malformed Unicode and ambiguous or noncanonical binary encodings. Caps apply AFTER encoding, including framing, escaping and base64; character count/Python-object size is not a byte charge. Account all framing used by the primitive; P09 reserves a header up to 64 KiB, footer up to 4 KiB and a hard 96 MiB plaintext cap. Expose these bounds and the 96 MiB + 8 KiB AEAD envelope bound to later callers without claiming encryption, authentication or complete-archive validation. Do not add a general unbounded parser or whole-artifact accumulator as a shortcut.
The accountant must be usable incrementally without retaining all payloads. A refused record must not partially consume a count/byte reservation. The primitive validates one archive's encoded occupancy against a caller-supplied high-water bound, and refuses decreases within that accountant instance. It neither establishes the authority or freshness of that bound nor enforces lifetime consumption across instances, processes, queue generations or restore. Durable non-reset remains an explicit integration requirement under P09 and is not discharged by this child. Keep the per-archive occurrence ceiling, range/type checks, in-instance monotonicity, atomic refusal and absence of decrement/refund/reset APIs. Existing installations above the managed profile remain untouched; later managed-mode migration must explicitly refuse or migrate rather than truncate. Do not change existing local-mode limits or behavior.
Scope correction and outstanding P09 obligation
Spec disposition
/private/tmp/attention6-child25-lifetime-disposition-20261119.md, SHA-256e96961eb3606ef7154787045c9ca5dd48b97dbfc3f8773abef78f9491d42da80, corrects the contradictory fresh-writer claim above. The original product requirement that a fresh writer cannot reset lifetime consumption is preserved as outstanding under parent #6/P09; closing this narrower child does not satisfy it. Future durable integration must reconcile the independent authoritative frontier and persistent original-admission reservations before restore or new admission. Neither an older authenticated archive nor reconstruction of an accountant may replenish capacity. Missing or inconsistent authority must refuse/quarantine; restart, stale-restore and fresh-writer tests remain owed under #6/P09. Header-counter consistency belongs to a later schema-aware archive validator, and is not added to this child.HEADER is a structural byte-charge home for queue/principals/grants only; it does not approve secret serialization or a final restore schema. Queue HMAC/suppression/signing-root custody remains separate, with no exporter here. Future delivery-intent mapping is explicitly UNASSIGNED: a later child must assign a named class and verify the complete reviewed bound before including those records. There is no miscellaneous uncharged class.
Malformed JSON, including malformed numeric syntax, maps to
noncanonical_record. A syntactically valid integer token outside the envelope, including one exceeding the runtime conversion-length limit, maps tointeger_out_of_range. Any disallowed record-class value or subclass maps tounknown_record_class. Do not map everyValueErrorto integer overflow, change the process-wide integer conversion limit, relax the envelope or leak input/library exception text; other specific refusal codes are unchanged.Validation
Add meaningful production-component tests in
tests/test_managed_profile.py, marked unit. Verify every count and encoded-byte boundary, including exactly-at-limit success and one-over refusal; two-byte and escaped Unicode; base64 expansion; unsupported/non-finite/floating/nested/duplicate-key input; unknown classes/framing fields; integer overflow; and failed-charge atomicity. Exercise simultaneous maximum class occupancy through the real incremental production primitive, not an algebraic stand-in or merely a reader refusing an oversize object. Verify aggregate measured encoded bytes remain inside the reviewed plaintext bound. Stream/discard encoded records instead of retaining the maximum archive in memory. This is component evidence only: successful encryption/decryption/restore at full profile, real SQLite/WAL/disk/RAM measurements and saturation Forget remain E06 owed.Run standard repository quality, unit and transport checks appropriate to the change. PR requires independent Standards and Spec reviews PASS 0, exact-head CI and full raw-log audit of
command not found,errors during collection,= not found, and"is_error":truebefore merge. No exception to those gates.Fixed write set and exclusions
Write only
src/attention_mind_mcp/managed_profile.py,tests/test_managed_profile.py, anddocs/planning/issue-6-review-register.md(append a concise component status and the operator-attested disposal update; preserve its historical facts). No contract/ADR/guarantee change, dependency/lock/build/CI change, schema migration, service wiring, filesystem staging, provider adapter, credential lookup, IAM, network/provider request, cleanup claim/reservation, observer replay, release or production deployment. No new API may claim content is erased, encrypted, recoverable, authenticated, current or usable before later required integration.All E01-E15 full-product rows remain owed. V7 overall remains UNQUALIFIED. Operator attested console disposal of
slotandidenticalat 21:51:52 +11:00, parent comment 42633; the former two-key debt is discharged by attestation only, with no sampled absence/version/physical-sanitization evidence. Scripted cleanup v1 is RETIRED UNUSED. Provider budget unchanged at 57 charged units / 1,943 remaining / 1,504 charged body bytes; cumulative actual wire count UNKNOWN. Report child/merge to guide t8t and spec t8g; do not close #6, #7, #8 or epic #1.Blocked by
⏸ SVD architect gate: dev/attention-mind-mcp#25 dd-469-6-implement-canonical-managed-record-profile-primitiv
Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity
standard· dispatch effortmediumRun:
20261119T105942Z-f3b9f4a6Held because: CLEAN but 6 open risk(s) (3 verification · 3 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
1499001before the first edit, runuv run python3 -m pytest -m unitanduv run python3 -m pytest -m transport; after the change, assert the failure set is unchanged and that tests/test_managed_profile.py passes in full. [verification]command not found,errors during collection,= not foundand"is_error":true. [verification]Change: New private module src/attention_mind_mcp/managed_profile.py, stdlib plus
from .contract import FoundationError. Contents:Files:
src/attention_mind_mcp/managed_profile.py·tests/test_managed_profile.py·docs/planning/issue-6-review-register.mdDecision: accept the 6 open risk(s) above and dispatch this spec (
svd:go), or park (svd:skip) / re-spec (svd:respec)?Your call (when this issue is held at the gate via
svd:hold):svd:go— approve; Half-B dispatch accepts exactly this spec (open risks accepted)svd:firebesidesvd:go— approve AND authorise the Half-B fire from the phone; never on its ownsvd:skip— park it; dispatch refuses it and the issue stays for a humansvd:respec— discard this spec; the next Half-A run re-produces it with this record as prior-attempt contextSpec:
/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-19-dd-469-6-implement-canonical-managed-record-profile-primitiv.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-19-dd-469-6-implement-canonical-managed-record-profile-primitiv.mdResumption gate after operator proceed
The operator's 22:19:52 +11:00 proceed permits resuming #25 under the registered #6 standing grant, delegated auto-gate and default caps. #25 is independent of E09's unreviewed custody seam: its fixed write set remains managed_profile.py, its unit tests and the append-only review register, with no provider adapter or E09 interface adoption. E09 setup, identities, policies and the proposed frontier-bucket grant extension remain unapproved.
Half-A run
20261119T105942Z-f3b9f4a6is CLEAN/0, with no degraded or inconclusive lenses and no rework rounds. The original result/spec are preserved. Auto-gate found a residual that CLEAN does not resolve: the draft's caller-supplied high-water limits one-archive occupancy but cannot prove durable lifetime non-reset across a new writer. The issue also defers durable admission. Spec t8g has the precise interpretation question (publication59e6acda-f402-4379-a67a-785408b32d77) before any acceptance is weakened or dispatch starts. This is a routine issue-contract interpretation gate, not an E09 dependency. Nosvd:goadded, no new runner or implementation dispatch; the same admitted run and default caps remain preserved.Before any production edit, pristine base
1499001652392c3e4392417f325f35ea00a28c89passed 359 unit tests and 64 transport tests under Python 3.12.12 with locked dependencies. Checkout remains clean. Receipt:/private/tmp/attention6-qualification-20261119/child25-pristine-test-baseline.json. These are baseline results only. Independent Standards/Spec PASS 0, exact-head CI and all four raw-log checks remain mandatory for any later PR.No Wasabi credential lookup, provider request, claim or reservation. Accounting remains 57 charged units / 1,943 remaining / 1,504 bytes; historical actual wire total UNKNOWN. #6 remains open and overall UNQUALIFIED; E01–E15 product acceptance remains owed.
Registered spec's 22:35 lifetime gate disposition, SHA-256
e96961eb3606ef7154787045c9ca5dd48b97dbfc3f8773abef78f9491d42da80, option (a). #25 acceptance has been amended and independently read back exactly.The primitive validates one archive's encoded occupancy against a caller-supplied high-water bound, and refuses decreases within that accountant instance. It neither establishes the authority or freshness of that bound nor enforces lifetime consumption across instances, processes, queue generations or restore. Durable non-reset remains an explicit integration requirement under P09 and is not discharged by this child.
The original fresh-writer non-reset requirement remains owed under parent #6/P09: independent authoritative frontier plus persistent original-admission reconciliation before restore or new admission; missing/inconsistent authority refuses/quarantines. Restart, stale-restore and fresh-writer integration tests remain owed. No header cross-check or interface expansion enters #25. HEADER charges are structural only, with no secret-export permission; future delivery-intent mapping remains UNASSIGNED.
The spec's normative module contract, acceptance and test descriptions now match, including
test_declared_occurrence_bound_and_in_instance_monotonicity. The production module and test file do not yet exist; their corrected requirements govern dispatch. Fixed codes: malformed JSON/numeric syntax →noncanonical_record; valid out-of-envelope integer token, including runtime digit-limit cases →integer_out_of_range; disallowed class value/subclass →unknown_record_class. No blanket ValueError mapping or process-wide integer-limit changes.Amended spec SHA-256
7dcbd361d9880feb6b44c5e47803442b3978eccb8413a8a24ef833b6b74eca81; original SHA-2566d580042a2a3a3aa5fc81de13b16b1c6fbff8aeafc59d1fb0d4facd15520ed82and complete original Half-A run are preserved at/private/tmp/attention6-child25-lifetime-correction/. Same run20261119T105942Z-f3b9f4a6, zero prior rework rounds consumed; default caps, engines, base and three-file write set unchanged. Affected correctness/spec/security verification is next; no GO or implementation dispatch yet. Existing pristine baseline remains 359 unit / 64 transport PASS.The eventual register change must be append-only and keep the outstanding P09 obligation traceable under #6. All E01–E15 remain owed; #6 remains UNQUALIFIED. No E09 dependency, provider request, credential lookup, reservation, cleanup, parent closure or release follows. Provider accounting unchanged: 57 charged units, 1,943 remaining, 1,504 charged body bytes; cumulative actual wire count UNKNOWN. Exact-head independent Standards and Spec PASS 0, CI and raw-log audit remain required before merge.
✅ SVD architect gate: dev/attention-mind-mcp#25 dd-469-6-implement-canonical-managed-record-profile-primitiv
Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity
unclassified· dispatch effortunclassifiedRun:
20261119T105942Z-f3b9f4a6Files:
src/attention_mind_mcp/managed_profile.py·tests/test_managed_profile.py·docs/planning/issue-6-review-register.mdWrite-set divergence: present table wins. 0 sourceHashes vs 14-row table.
Decision: dispatch this spec (
svd:go)?Your call (when this issue is held at the gate via
svd:hold):svd:go— approve; Half-B dispatch accepts exactly this spec (open risks accepted)svd:firebesidesvd:go— approve AND authorise the Half-B fire from the phone; never on its ownsvd:skip— park it; dispatch refuses it and the issue stays for a humansvd:respec— discard this spec; the next Half-A run re-produces it with this record as prior-attempt contextSpec:
/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-19-dd-469-6-implement-canonical-managed-record-profile-primitiv.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-19-dd-469-6-implement-canonical-managed-record-profile-primitiv.mdspec-verify-dispatch Half B for dev/attention-mind-mcp#25 dd-469-6-implement-canonical-managed-record-profile-primitiv completed integration verify.
92ecee55dccodex-svd ship --run-id 20261119T105942Z-f3b9f4a6 --confirm-merge)