Skip to content

retention: define portable disposition evidence and minimal event storage - #245

Merged
TusanHomichi merged 2 commits into
mainfrom
issue-212-disposition-evidence-storage
Nov 20, 2026
Merged

TusanHomichi merged 2 commits into
mainfrom
issue-212-disposition-evidence-storage

Conversation

@TusanHomichi

Copy link
Copy Markdown
Member

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 the consolebook-disposition-evidence v1 producer/parser/verifier with committed golden fixtures, and moves installation_export to format_version: 3 while keeping committed v1 and v2 archives verifying. No destruction endpoint or event-expiry mutation is exposed.

Changes

  • Minimal disposition event storage (0018_disposition_evidence.sql) (persisted schema & constraints)
    • disposition_run: durable monotonic state machine (db_committed_vacuum_pending → copy_cleanup_pending → completed) with closed reason_code, method, and last_error_code vocabularies, 64-hex confirmation_digest, immutable identity trigger, and no-delete trigger.
    • disposition_event: minimal tombstone carrying opaque IDs, closed codes, bounded authority_reference, independent record_policy_id (trigger enforces matching record_class and action = 'destroy') and optional metadata_policy_id (trigger enforces record_class = 'disposition_event'), hashes_retained flag, and append-only triggers. Zero narrative, display-name, response, or free-form reason columns.
    • disposition_version_hash: optional 1..=version_count continuous version fingerprints (content_hash, chain_hash, predecessor_content_hash) gated on hashes_retained = 1, with append-only triggers.
    • disposition_boundary_checkpoint: non-personal policy-required metadata closure marker referencing a destroy disposition_event policy, with append-only triggers.
  • Portable disposition evidence format (src/disposition_evidence.rs, src/disposition_evidence/verify.rs, docs/formats/disposition-evidence.md)
    • Defines consolebook-disposition-evidence format_version: 1 in canonical JSON with "authenticity": "self_consistency_only".
    • Enforces strict per-object field allowlists rejecting unknown or content-bearing fields (narrative, display_name, reason, response, canonical_bytes, signature, etc.), refuses unknown format versions by name, refuses non-canonical bytes and false authenticity claims, verifies 1..=N predecessor hash continuity, and emits distinct honest verdicts (DisposedHashContinuityOnly, DisposedContentAndHashesUnavailable, IntentionalPolicyBoundary).
    • Committed invented golden fixture tests/fixtures/disposition-evidence-v1.json.
  • Installation export format_version: 3 (installation_export, installation_verify, docs/formats/installation-export.md)
    • Bumped INSTALLATION_FORMAT_VERSION from 2 to 3 carrying all 47 tables (disposition_run, disposition_event, disposition_version_hash, disposition_boundary_checkpoint added), updated the normative format document, appended v3's fingerprint and vocabulary floor beside untouched v1 and v2, committed tests/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 ignored golden::regenerate), including golden_v1, golden_v2, and golden_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

  • Candidate: 5c8170fc54c9f006b58c7814273c7c9398313a92 tree 74616f77509edbe6d6fac38dad01beebd6e48d67; unchanged during run: true
  • Scope: local (local run; hosted pr-gate results are separate evidence, linked not copied)
  • Command: cargo xtask proof in /data/dev/src/consolebook
  • Started 2026-11-20T19:15:39Z, finished 2026-11-20T19:23:47Z, 487.5s
  • Sequence source: CONTRIBUTING.md sha256 87f297e8dad4868f1364b29eb9a45b372ca3dc34e8e205c3505d15883036daa5
  • Browser: playwright-managed /home/dev/.cache/ms-playwright/chromium-1254/chrome-linux64/chrome (Google Chrome for Testing 158.0.8127.18)
  • Host: Linux-6.18.64-x86_64; euid 1001; can bypass file permissions: false (from CapEff)
  • Toolchain: rustc 1.99.1 (58cf8f9c3 2026-10-13); node v22.23.5; npm 10.9.9
  • Binary: target/debug/consolebook-server sha256 ac6a2d9c59f900fcf4c7ab1db4b1cbb2225de0a31e5c1137a0a4958c2c114bc4
  • Web build manifest: 54 files, sha256 c40b0e3d879a0b6ba9f4274b8e9a0c0f252fe86049ed8c1f0943b849895fb8fd
  • Browser suite: 74 expected, 0 unexpected, 0 flaky, 0 skipped; report sha256 44332403d4449c04e6ac59bde75be0af9d5042dfaa8cde5241b191d1c64c54bb
# Command Status Exit Seconds Log sha256 (prefix)
1 scripts/check-guidance-names.sh passed 0 0.081 01.log 2b172a8e66c87574
2 (cd web && npm ci && npm run check && npm run build) passed 0 20.341 02.log f374041293515399
3 cargo fmt --check passed 0 0.912 03.log e3b0c44298fc1c14
4 cargo clippy --workspace --all-targets -- -D warnings passed 0 10.489 04.log b9b92195c835db11
5 cargo test --workspace passed 0 145.815 05.log 5a474715694ad5b0
6 cargo build -p consolebook-server passed 0 0.303 06.log f2066ca264b9a859
7 (cd web && npx playwright install chromium && npm run e2e) passed 0 309.568 07.log 1e3e83ea640b8b56

…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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T19:32:05.519320Z 6bc0666 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@fieldmouseworks-steward fieldmouseworks-steward Bot added the waiting: review Its reviewers, or a Claude job judging it, are looking at this head label Nov 20, 2026
@TusanHomichi

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 6bc0666449

ℹ️ 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".

@TusanHomichi

Copy link
Copy Markdown
Member Author

Updated local proof receipt — passed (6bc0666449e49b5f666e5dcdcbcc55e131b9c109)

  • Candidate: 6bc0666449e49b5f666e5dcdcbcc55e131b9c109 tree 61a1d7bb5f5f1bc8f0487fab93a25b1301a4d5c3; unchanged during run: true
  • Scope: local (local run; hosted pr-gate results are separate evidence, linked not copied)
  • Command: cargo xtask proof in /data/dev/src/consolebook
  • Started 2026-11-20T19:30:23Z, finished 2026-11-20T19:37:25Z, 420.6s
  • Browser suite: 74 expected, 0 unexpected, 0 flaky, 0 skipped; report sha256 98e89aa811d9033660c1d2dc666fac46bdd3609a22f3db581e5f2f554abbfa58
  • Receipt: .proof/20261120T193023Z-6bc0666449e4/receipt.json sha256 94b7f5f9602c35d37f0b68679cd848070293b42669ab3cfe2999b52eef2050fb
  • All 7 steps exited 0.

@TusanHomichi
TusanHomichi merged commit 50b0c26 into main Nov 20, 2026
23 of 24 checks passed
@TusanHomichi
TusanHomichi deleted the issue-212-disposition-evidence-storage branch November 20, 2026 19:38
@fieldmouseworks-steward fieldmouseworks-steward Bot removed the waiting: review Its reviewers, or a Claude job judging it, are looking at this head label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

retention: define portable disposition evidence and minimal event storage

1 participant