Repository navigation
retention: define portable disposition evidence and minimal event storage - #245
Conversation
…rage Adds the forward disposition evidence schema, closed vocabularies, versioned portable evidence format (v1), and installation-export format_version 3 coverage per ADR 0030, without exposing any destruction or event-expiry endpoint. - Forward migration 0018_disposition_evidence.sql creates disposition_run (monotonic state machine), disposition_event (minimal tombstone with independent evaluation-class and disposition_event policy triggers), disposition_version_hash (optional hash-continuity rows), and disposition_boundary_checkpoint (policy-required metadata closure), with zero narrative/display-name/free-form-reason columns. - Adds src/disposition_evidence.rs and src/disposition_evidence/verify.rs implementing consolebook-disposition-evidence v1 (canonical JSON, strict field allowlists rejecting content-bearing or false authenticity/signature claims, honest verdicts distinguishing retained hash continuity from unavailable content and intentional policy boundaries), documented in docs/formats/disposition-evidence.md with golden fixture tests/fixtures/disposition-evidence-v1.json. - Bumps installation-export format_version to 3 to carry all four new tables while preserving verification of v1 and v2 archives and committing v3 golden fixture. Closes #212 Refs #64, #44
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c8170fc54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Updated local proof receipt — passed (
|
Primary Issue
Closes #212
Refs #64, #44
Problem And Outcome
Before lawful disposition execution (
#214) and disposition-aware backup/restore (#213) can ship, Consolebook needs minimal, content-free disposition event storage and a versioned portable disposition evidence format that honestly distinguishes retained hash-lineage continuity from unavailable content verification and from policy-required metadata boundary closures — without claiming signatures or tamper-proofing Consolebook does not provide.This PR adds forward migration
0018_disposition_evidence.sql, closed vocabularies and theconsolebook-disposition-evidencev1 producer/parser/verifier with committed golden fixtures, and movesinstallation_exporttoformat_version: 3while keeping committed v1 and v2 archives verifying. No destruction endpoint or event-expiry mutation is exposed.Changes
0018_disposition_evidence.sql) (persisted schema & constraints)disposition_run: durable monotonic state machine (db_committed_vacuum_pending→copy_cleanup_pending→completed) with closedreason_code,method, andlast_error_codevocabularies, 64-hexconfirmation_digest, immutable identity trigger, and no-delete trigger.disposition_event: minimal tombstone carrying opaque IDs, closed codes, boundedauthority_reference, independentrecord_policy_id(trigger enforces matchingrecord_classandaction = 'destroy') and optionalmetadata_policy_id(trigger enforcesrecord_class = 'disposition_event'),hashes_retainedflag, and append-only triggers. Zero narrative, display-name, response, or free-form reason columns.disposition_version_hash: optional1..=version_countcontinuous version fingerprints (content_hash,chain_hash,predecessor_content_hash) gated onhashes_retained = 1, with append-only triggers.disposition_boundary_checkpoint: non-personal policy-required metadata closure marker referencing adestroydisposition_eventpolicy, with append-only triggers.src/disposition_evidence.rs,src/disposition_evidence/verify.rs,docs/formats/disposition-evidence.md)consolebook-disposition-evidenceformat_version: 1in canonical JSON with"authenticity": "self_consistency_only".narrative,display_name,reason,response,canonical_bytes,signature, etc.), refuses unknown format versions by name, refuses non-canonical bytes and false authenticity claims, verifies1..=Npredecessor hash continuity, and emits distinct honest verdicts (DisposedHashContinuityOnly,DisposedContentAndHashesUnavailable,IntentionalPolicyBoundary).tests/fixtures/disposition-evidence-v1.json.format_version: 3(installation_export,installation_verify,docs/formats/installation-export.md)INSTALLATION_FORMAT_VERSIONfrom2to3carrying all 47 tables (disposition_run,disposition_event,disposition_version_hash,disposition_boundary_checkpointadded), updated the normative format document, appended v3's fingerprint and vocabulary floor beside untouched v1 and v2, committedtests/fixtures/installation-export-v3.zip, and preserved verification of both v1 and v2 golden archives.Correction Ladder
Rung 1 & Rung 2: persisted schema CHECKs and append-only/policy-matching triggers (
0018_disposition_evidence.sql), strict allowlist parser/verifier (disposition_evidence/verify.rs), and integration/tamper tests (tests/disposition_evidence.rs,tests/installation_export/).Verification
cargo test -p consolebook-server --test disposition_evidence: 3/3 passed (positive golden fixture agreement & honest verdicts, tampered/content-injection/unknown-version/false-authenticity/broken-lineage negative controls, and DB schema/policy/immutability/monotonic-run invariants).cargo test -p consolebook-server --test installation_export: 29/29 passed (1 ignoredgolden::regenerate), includinggolden_v1,golden_v2, andgolden_v3, coverage, doc parity, and vocabulary floors.cargo test -p consolebook-server --test disposition_preview --test doctor_migrations --test retention --test upgrade_compat --test no_credential_literals: all passed.Local proof receipt — passed
5c8170fc54c9f006b58c7814273c7c9398313a92tree74616f77509edbe6d6fac38dad01beebd6e48d67; unchanged during run: truecargo xtask proofin/data/dev/src/consolebook87f297e8dad4868f1364b29eb9a45b372ca3dc34e8e205c3505d15883036daa5/home/dev/.cache/ms-playwright/chromium-1254/chrome-linux64/chrome(Google Chrome for Testing 158.0.8127.18)target/debug/consolebook-serversha256ac6a2d9c59f900fcf4c7ab1db4b1cbb2225de0a31e5c1137a0a4958c2c114bc4c40b0e3d879a0b6ba9f4274b8e9a0c0f252fe86049ed8c1f0943b849895fb8fd44332403d4449c04e6ac59bde75be0af9d5042dfaa8cde5241b191d1c64c54bbscripts/check-guidance-names.sh2b172a8e66c87574(cd web && npm ci && npm run check && npm run build)f374041293515399cargo fmt --checke3b0c44298fc1c14cargo clippy --workspace --all-targets -- -D warningsb9b92195c835db11cargo test --workspace5a474715694ad5b0cargo build -p consolebook-serverf2066ca264b9a859(cd web && npx playwright install chromium && npm run e2e)1e3e83ea640b8b56