Repository navigation
feat(export): one complete installation export an agency can leave with - #130
Merged
Merged
Conversation
ADR 0028 and docs/formats/installation-export.md define the archive the maintainer chose on #98: record-export units for every finalized version plus one typed canonical-JSON document per stored table, with a manifest ledger of every carried table (43) and every credential exclusion (5), references and program-version agreements the verifier checks, and a coverage guard that fails when a migration adds a table or column the format does not account for. Cross-references from the domain model, the task index, and the record-export and trainee-packet formats point to it. Refs #98 Co-Authored-By: Claude Opus 5.5 <[email protected]>
One table specification (installation_export/spec) owns the 43 carried tables, their keys, column types, nullability, references, program-version agreements, vocabularies, and the 5 credential exclusions; the producer, the verifier, a schema coverage guard, and a format-document sync test all read it. The producer authorizes export_records holders in the service, audits installation_exported, reads the unit list and every table in one read transaction, and streams through the record export's container writer and delivery (GET /api/exports/installation). export verify dispatches on the format and checks the ledger, every document's hash, canonical form, members, types, vocabularies, key order, counts, references, agreements, and the evaluation_version rows against the units. Tests populate every carried table through real services, verify offline, compare counts with the database, prove credentials absent, and pair each check with a negative control; the coverage guard and doc sync each have their own. The format now states determinism as a pure function of the rows read (each export carries its own audit event) and qualifies the three draft program_version_id references. Refs #98 Co-Authored-By: Claude Opus 5.5 <[email protected]>
export_records holders get "Export the whole installation" beside the records-only export, even before any record is finalized, with copy that says it carries everything but credentials and is not encrypted. A browser spec downloads it, verifies it with `export verify`, and proves a trainer neither sees the action nor gets the archive (403 capability_required). Refs #98 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…EADME The roadmap and README no longer list a complete installation export among the remaining Milestone 5 limits, and the changelog's Unreleased section describes it. Refs #98 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The coverage guard now keeps every foreign-key shape per column, checks that dotted exclusions and unit columns exist and that nothing is both carried and excluded, and reads CHECK lists however they are spelled. One closed_vocabulary macro generates EventKind, SubjectKind, Capability, and NoticeKind with their stored names, parsers, and ALL, so no value can exist outside its vocabulary. The producer runs the verifier's own row check and refuses a row the verifier would reject. A spec fingerprint pinned to format_version 1 makes a changed specification require a new format version. The unit/row agreement is now linear, the ledger hash finding names its table, and every check the review proved untested has a negative control. The format documents the audit-as-attempt rule and the amendment watermarks. Refs #98 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The card holding the records-only and complete installation exports moves unchanged to web/src/lib/exports/ExportsCard.svelte, sharing the page's busy flag through a bindable prop, so +page.svelte stays under 1,000 lines (1,001 -> 904) after #98 added the installation export. Refs #98 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…en archive Vocabularies grow within a format version, so the spec fingerprint no longer covers their values; a floor test instead requires every version-1 value to stay admitted. A committed golden version-1 archive (an invented, fully populated installation) must verify in every build: it pins the manifest shape and the verifier's rules, so a format change that skips a version bump fails, and the first bump must decide how version-1 archives keep verifying. The coverage guard reads quoted and parenthesised CHECK columns, and the format and ADR 0028 state exactly what each pin covers and the guard's remaining limits. Refs #98 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ns cover Regenerating a golden archive now needs CONSOLEBOOK_REGENERATE_GOLDEN=1, names the file from the current format version, and refuses to overwrite one, so `--include-ignored` cannot rewrite the version-1 fixture. A negative control pins evaluation_version.content_hash's text form. The format and ADR 0028 now say the golden archive pins the verifier's rules only as far as its data exercises them, and name what review alone still guards: tightenings the golden data satisfies, rules loosened without a control, and a fingerprint edited together with the specification. Refs #98 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis 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. |
1 of 3 tasks
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17ea43d59f
ℹ️ 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".
1 of 3 tasks
read_document now asks the cancellation callback for every row, as the record export's metadata pass asks it for every unit, so a client that disconnects (or a preflight that expires) while a large table is being read ends the export promptly instead of holding the read transaction and an export slot until the table is finished. A test counts the calls (at least one per stored row; previously about one per table) and proves a flip inside a table ends the export before the response starts. Refs #98 Co-Authored-By: Claude Opus 5.5 <[email protected]>
3 of 4 tasks
TusanHomichi
added a commit
that referenced
this pull request
Oct 15, 2026
…als (#145) * test: one runtime test credential, and a guard against password literals Integration tests no longer declare passwords: tests/support provides a per-process password generated from OS randomness (plus wrong, fresh, and too-short variants), the shared login and user helpers that 14 and 12 test crates had each copied, and assertion messages that name no user. With no literal there is nothing for CodeQL's hard-coded-credential and cleartext-logging rules to flag in new test files (#126; recurred on #130 and #139). tests/no_credential_literals.rs scans every test source and fails on a password, passphrase, or secret literal in a binding, struct field, JSON key, JSON-in-a-string, or a credential call, with its scan contract in the header, an exact-path allowlist (upgrade_compat's argon2 0.5 fixture), and negative controls for every shape it flags and every allowed shape it must not; against the pre-change tests it reports 38 findings across 28 files. Closes #126 Co-Authored-By: Claude Opus 5.5 <[email protected]> * test: close the credential guard's review gaps Independent review found no blockers. Follow-ups: upgrade_compat again checks a one-character near miss of the fixture password, built at run time (a verifier that ignored the last byte passed the previous version); a sensitive binding is flagged for any non-empty literal in its initializer (arrays, vec!, Some, match/if arms, closures), a ("password", "literal") pair and macro/turbofish credential calls are caught, and sign-in helpers are matched by more names; empty literals are exempt, so absence and empty-password tests read naturally; the header lists every remaining miss with its reason. The controls move to a 149-case corpus checked against the header in both directions, the walk skips symbolic links, and an unreadable file is named. Against the pre-change tests: 38 findings in 26 files. Refs #126 Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
TusanHomichi
added a commit
that referenced
this pull request
Oct 15, 2026
A minor release under ADR 0022: the complete installation export (#130), the web stack on SvelteKit 3 and Vite 8 (#140) with the browser floor it brings (Chrome/Edge 111, Firefox 114, Safari 16.4), Rust 1.99 and SQLite 3.51 (#139), and doctor's migration verdict matching serve (#144, ADR 0029). Upgrading from 0.2.0 runs no migration. Versions agree across Cargo and web (tests/release_version.rs); the changelog, README, roadmap, and install guide name 0.3.0. Refs #146 Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Primary Issue
Closes #98
Problem And Outcome
Milestone 5's exit is that "a center can leave with all of its data". Neither existing export carried all of it. The record export holds finalized versions only. The trainee packet holds one enrollment. Of the 47 stored tables, 19 were read by no export at all: drafts and their review history, training sessions, retention policies and holds, notices, and the audit trail.
After merge, an
export_recordsholder can download one archive from the home page. It carries everything the installation holds except credentials.consolebook-server export verifychecks it from the file alone. Nothing is silently omitted: the archive's own ledger names every carried table and every exclusion, and tests fail if the schema gains a table or column the format has not decided on.Changes
docs/formats/installation-export.md. The archive is record-export units, byte for byte, plus one typed canonical-JSON document per stored table: 43 carried, with ids kept as references. The manifest ledger names the 5 credential exclusions. The column tables were generated from the migrated schema. The maintainer's four choices are recorded on export: one complete installation export an agency can leave with #98.installation_export/spec): it defines each table's key and, for each column, its type, nullability, reference, program-version agreement, vocabulary, and text form, plus the exclusions. The producer, the verifier, a schema coverage guard, a format-document sync test, and a spec fingerprint all read it.export_recordsin the service and auditsinstallation_exported.deliverpath (GET /api/exports/installation).export verifydispatches on the format. It checks the ledger and every document's hash, canonical form, members, types, nullability, vocabularies, key order, counts, references, and agreements, plusevaluation_versionagainst the units in both directions. Prints one line per unit and per table.closed_vocabulary!macro now generatesEventKind,SubjectKind,Capability, andNoticeKind, with their stored names, parsers, andALL. Stored strings are unchanged.web/src/lib/exports/ExportsCard.svelte, adds "Export the whole installation". It is offered even before any record is finalized, and the card says the archive is not encrypted.Unreleasedentry, the roadmap and README Milestone 5 status, the domain model, and the development task index.Scope
Verification
17ea43d(based onmain82c0cb0).scripts/proof.pypassed all 7 gates in 490 s on17ea43d59f9d55ed99df4fe7014e7fe75d0e212a(clean tree, unchanged during the run). The workspace ran 282 Rust tests: 0 failed, 3 ignored, andinstallation_export26 passed with 1 ignored (the guarded golden regeneration). The browser suite ran 62 expected, 0 unexpected, 0 flaky, 0 skipped, on system Google Chrome 155.0.8059.79 (not a Playwright download). Receipt sha256dac49aca374447ac3b6f84a5656c7b931656feb920818923f7237cdd76f52f2f, archived on the maintainer machine. Hosted results follow on this PR.CHECKspellings.tests/fixtures/installation-export-v1.zip, 47,083 bytes, invented data, sha256a46cca12…). Every build must verify that archive, and regeneration is guarded.Review And Merge Notes
d2ed3e9): 0 blocking, 7 should-fix, 7 nits.e1b7e70): 0 blocking. All round-1 findings were confirmed fixed against the original probes. Decision R1/R2: vocabularies are additive within a format version, plus a golden archive, with the reasoning on export: one complete installation export an agency can leave with #98.f453991): 0 blocking. Both pins were mutation-tested. The remaining wording fixes, the regeneration guard, and one missing control are applied in17ea43d. That last delta was self-reviewed by the integrator.🤖 Generated with Claude Code