Repository navigation
Closed
Description
Existing issue check
- I searched open and closed issues for this work. Milestone 5 design: exports and recovery #44 holds the approved Milestone 5 design, and no issue tracks this slice.
Problem or outcome
The Milestone 5 exit is "a center can leave with all of its data". The installation archive currently omits drafts, acknowledgments, amendments, signoff history, and exporter identity (docs/formats/record-export.md, "not included"). Trainee packets gather some of this per trainee, but no single export carries everything an agency would need to move to another system or to answer a records request after leaving.
Scope
In scope:
- Define, as a format and decision under Milestone 5 design: exports and recovery #44, what a complete installation export contains. Implement it with the same file-verifiable guarantees as the existing exports (
export verify).
Out of scope:
- Import into another product.
- PDF rendering, which is tracked under Milestone 5 separately.
Acceptance criteria
- The format document lists every record class and whether and how each one is exported. Nothing is silently omitted.
- Integration tests export a populated invented installation, verify it offline, and compare its counts against the database.
Expected proof
cargo test --workspace, including the new export tests and a negative control for a tampered archive.
Decisions (maintainer, 2026-10-15)
Asked in the #44 pattern before any code; the maintainer chose the recommended option for each:
- Shape: one typed document per stored table. Finalized versions travel as record-export units, byte for byte. Every other carried table is one canonical-JSON document whose rows keep their ids as references. The verifier checks each document's types and closed vocabularies, that every reference resolves inside the archive, and that row counts match the manifest. A guard test fails when a migration adds a table or column the export does not account for.
- Contents: everything except credentials. Drafts carry their review, contributor, and snapshot history. Also carried: sessions, assignments, programs, people, retention policies and holds, notices, and the audit trail. Password hashes, login sessions, reset codes, and setup codes are excluded. The manifest names each exclusion with a reason.
- Delivery: web download. It sits on the home page (
/), beside the installation record export, forexport_recordsholders, is audited asinstallation_exported, and is verified withexport verify. There is no offline CLI export in this outcome. - Shipping: one PR. It carries the ADR, format document, producer, verifier, coverage guard, web download, and tests, and gets an independent review before push.
Execution record
- Authority and source: the maintainer selected export: one complete installation export an agency can leave with #98 on 2026-10-15 in a local session ("export: one complete installation export an agency can leave with #98 installation export"). The grant covers scoped local edits and checks, an issue-linked branch (
claude/98-installation-export) and PR, and issue/PR evidence updates. No merge authority is recorded, so the PR is left ready for the maintainer. - Effort: no budget set by the owner.
- Inputs:
mainate4fc1d3, plus a schema inventory of 47 tables from migrations 0001–0016. Today 23 tables feed an export, 5 are read only for authorization, and 19 are read by no export.
| ID | Outcome | Depends on | Role | Acceptance | State |
|---|---|---|---|---|---|
| D1 | ADR 0028 and docs/formats/installation-export.md: every stored table and column carried or excluded, with a reason |
— | integrator | Every table in the final schema is named exactly once; docs gates pass | verified: 9baf098 (43 carried + 5 excluded = all 47 tables; column tables generated from the migrated schema) |
| I1 | Spec-driven producer, export verify dispatch, GET /api/exports/installation, installation_exported audit event, coverage guard |
D1 | implementer | Focused tests including negative controls; fmt/clippy | verified: 17ea43d (G1 receipt dac49aca…) |
| T1 | Integration tests: a populated invented installation is exported, verified offline, and its counts compared against the database; tampered, dangling-reference, count-mismatch, and unmapped-table controls fail | I1 | implementer | cargo test --workspace |
verified: 17ea43d |
| W1 | Home-page (/) download beside the installation record export for export_records holders, with a browser test |
I1 | implementer | npm run check, e2e spec |
verified: 17ea43d (62/62 browser tests) |
| R1 | Independent review of the exact candidate SHA | I1, T1, W1 | reviewer | Findings resolved or filed | verified: three rounds, 0 blocking; all findings fixed or recorded (#129 filed); final delta self-reviewed |
| G1 | Full local gates (scripts/proof.py) on the frozen candidate |
R1 | verifier | Receipt | verified: 17ea43d, 7/7 gates, receipt dac49aca… (comment) |
| P1 | Push, PR, hosted pr-gate, automated review threads resolved |
G1 | integrator | Green hosted run | active: #130 open, hosted checks running |
Next action: when #130's required checks are green and every review thread is resolved, squash-merge it (standing permission), verify the merged main revision, and archive the graph.
Related roadmap, decisions, or issues
- Milestone 5 design: exports and recovery #44,
docs/formats/record-export.md, Milestone 5 exit indocs/roadmap.md
Metadata
Metadata
Assignees
Labels
No labels
Activity
TusanHomichi commentedon Oct 15, 2026
Authority update (2026-10-15): the maintainer granted standing permission to manage PRs end to end: "you have standing permission to manage PRs end to end and that includes merging and cleaning up old branches". The integrator merges once required checks are green on the current head and every review thread is resolved (squash only; no admin bypass of a failing check), then verifies the merged revision and removes the branch and worktree. Deployments and releases are not covered.
TusanHomichi commentedon Oct 15, 2026
R1: independent review of
d2ed3e9(reviewer role, read-only, on a frozen detached worktree, 2026-10-15)Verdict: nothing blocking. Producer, verifier, single read snapshot, authorization, and audit are correct for the schema at migration 0016. All 22 verifier probes were detected. In the review worktree,
cargo test -p consolebook-server --test installation_export --test record_export --test trainee_packetgave 13 + 6 + 13 passed, andcargo clippy -p consolebook-server --all-targets -D warningswas clean.Should-fix: each was reproduced by a probe, and all are gaps in the guards that keep the format honest as the schema changes:
ALLarrays are hand-maintained. A new audit kind missing from them would make every export fail.format_versionbump when the spec changes.Nits N1–N7:
CHECKlist tokenizer spelling robustness;EXCLUSIONS;Disposition: all S1–S7 and N1–N7 are in scope for #98 and were sent back to the implementer as one fix brief (S2 at rung 1 via a single vocabulary macro, S5 at rung 1 via one shared row check). R1 re-reviews the delta before G1.
TusanHomichi commentedon Oct 15, 2026
R1 round 2: re-review of
8d0d7b3..e1b7e70(reviewer role, frozen worktree ate1b7e70)Verdict: nothing blocking. S1, S2, S3, S5, S6, and S7 are confirmed fixed against the original probes. Verifier time is now linear: 40k units take 3.76 s, against 23.3 s before. N2–N7 are fixed.
audit::recordandrecord_for_subject. So no legitimately held row is refused.downloadExport. The e2e assertions matchmain.rsand would fail on a regression.cargo test --test installation_export --lib(22 + 13 passed), clippy, andnpm run check.Open after round 2:
UnsupportedFormat.CHECK, trigger-only vocabularies, flags without aCHECK, andGLOBforms.+page.sveltereached 1,001 lines.Decision on R1 and R2 (integrator; no decision advisor is in use; options and reasoning recorded here):
Chosen: (a), plus a golden archive.
format_version. That first bump must then decide, in its ADR, how v1 archives keep verifying. The decision can't be skipped, because this test makes it.Why: an agency leaves with an archive, and that archive must keep verifying with the builds it is likely to hold. Strict per-kind versioning would end v1 verification at the first disposition kind, for no reader's benefit. The golden archive turns a review-only rule into a test (rung 2) and costs one small fixture.
Other items:
CHECK, andGLOBforms are named in the format as limits of the guard. In those cases it under-verifies; it never leaks.TusanHomichi commentedon Oct 15, 2026
G1: local full proof (verifier role) on
17ea43d59f9d55ed99df4fe7014e7fe75d0e212a, tree66fad771. The tree was clean and unchanged during the run, and no other builds ran concurrently. Run 2026-10-15T17:55:01Z, 490 s,scripts/proof.pyexit 0, all 7 gates passed.cargo test --workspaceran 282 tests, 0 failed, 3 ignored. Within that,installation_exportpassed 26 with 1 ignored, the guarded golden regeneration.dac49aca…; server binaryde5bf40e…; web build manifest94cc54e0…./data/dev/home/.codex/tmp/consolebook-98-installation-export-20261015/, 14 files, read back against its manifest.R1 round 3 (
f453991): 0 blocking. The remaining wording fixes, the regeneration guard (an env var, a versioned file name, and no overwrite), and thecontent_hashcontrol are applied in17ea43d. That final delta was self-reviewed by the integrator, who re-ran--test installation_export(26 passed).PR: #130.
fix(export): stop an abandoned installation export inside a table
feat(export): one complete installation export an agency can leave wi…
TusanHomichi commentedon Oct 15, 2026
Done. Merged in #130 as
50be527bb667c89c25cde3674dea7ac8c27edd52, a squash with single parent82c0cb0. The merged treea54977dcis identical to PR head0960c96.Evidence on that exact head:
dfff1a3c….fmt-clippy-test,build-x86_64,build-aarch64, and CodeQL in all 4 languages passed.0960c96with a negative control, and the thread was resolved.Acceptance:
cargo test --workspacecovers the new tests and negative controls, including tampered archives.Follow-ups filed: #126 (shared test credential), #129 (truncated-download message). The final graph snapshot and all receipts are archived at
/data/dev/home/.codex/tmp/consolebook-98-installation-export-20261015. The branch and worktree are removed. Authority: the maintainer's standing PR permission (2026-10-15).