From 475a41d705177a38d139b0a030f5e53bf5e50b8f Mon Sep 17 00:00:00 2001 From: bchanot Date: Sun, 25 Oct 2026 04:18:52 +0100 Subject: [PATCH] fix(tests): R5.7 gate findings, digest typo, census needs #[test] fns RUST.md and FILES.tsv carry ba79698c...fde7; ledger cargo targets must name a #[test] function. Verifier and security reports recorded, journal entry. --- .claude/audits/2026-10-25-rust-r5-7-verify.md | 20 +++++++++++++++++++ .claude/memory/journal.md | 5 +++++ apps/app/tests/unit/r5.census.test.ts | 6 +++++- crates/core/tests/curation/FILES.tsv | 2 +- docs/development/RUST.md | 2 +- 5 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 .claude/audits/2026-10-25-rust-r5-7-verify.md diff --git a/.claude/audits/2026-10-25-rust-r5-7-verify.md b/.claude/audits/2026-10-25-rust-r5-7-verify.md new file mode 100644 index 00000000..46900554 --- /dev/null +++ b/.claude/audits/2026-10-25-rust-r5-7-verify.md @@ -0,0 +1,20 @@ +# R5.7 fresh verifier, 2026-10-25 (diff 756b7ef..4e0a6c0, contract `.claude/tasks/contracts/2026-10-25-rust-r5-7-cleanup.md`) + +VERDICT: ECARTS(2). C1-C5, C7, C9, C10 MET; C6 NOT-MET; C8 NOT-MET. + +- C6: `tsx@4.23.15` still in pnpm-lock.yaml (`packages:`, `snapshots:` with the diff's one added line `optional: true`, + peer suffix of vite@7.3.6 / vitest@3.2.7), installed under node_modules/.pnpm; declared by no manifest; documented + (RUST.md §11.23, CHANGELOG, r5.census asserts `optional: true`); `pnpm dedupe --check` clean. Contract says "tsx gone", + no Clarification → owner decision (accept residue, or a lockfile change). +- C8: RUST.md §11.23 abbreviated report-v2.minimal.json digest as `ba79698c…dfe7` (actual `…7399c33cfde7`). Fixed after + the pass (RUST.md, FILES.tsv note): `…fde7`. +- Evidence of the pass: cargo test core cli,upload 382 passed 1 ignored (pre-existing release-only timing); 154/154 ledger + targets in `--list`; vitest app 446, core-wasm 60, supabase 40, census 18/18; typecheck, lint rc 0; fmt, clippy ×2, deny + ok; `pnpm import:equine --check` 0 differences; fixtures sha256 equal before/after; no diff under oracles, goldens, + conformance, pdf ledger, app fixtures, supabase/seed, migrations, n-1, types; 18 seed hashes equal the §11.23 table; + every "ported at R5.7" ledger row checked TS-vs-Rust; random sample of other rows consistent. +- FLOOR: 42 `DELETED_TEST` hits, all files of the two deleted packages; covered by the contract's deletion clause and + LEDGER.tsv (verifier reading; orchestrator may require an explicit Clarification). +- Notes: leftover scratch worktrees (ts-repro, prev-59521dc, r56final, r56wt) and git-ignored + `packages/{anatomy,domain}/node_modules` = owner housekeeping. +- After the pass (not re-verified): security LOW "census accepts any `fn`" fixed, ledger cargo targets must be `#[test]` fns. diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 1b8175af..acaefac0 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -371,3 +371,8 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp - Owner authorised switch. Patch applied (sha = verified worktree), equivalence pub(crate), comments + trust boundary. Seed: fresh --out, 2 files copied (03e7f6ab, 0e991bc2), --check 0 diff. - Switch commit 9e87016: rust:check + check:all green; security PASS LOW; verifier 13/14, ECARTS(1)=S7 pre-activation wording → Clarification. - Rollback measured: new v1 report on pre-switch build → rebased, 0 unresolved, notice shown. BDR-070, LRN-077. STOP, no merge, no R5.7. + +## 2026-10-25 (R5.7) +- Owner validated R5.6, authorised R5.7. Census: anatomy 144 + domain 263 TS cases mapped; 15 anatomy contracts + 1 domain oracle only TS checked → ported to Rust first (+19 tests, curation_leaves.rs). +- Deleted anatomy, domain, TS upload script, legacy scripts; LEDGER.tsv 407 (256/149/2), FILES.tsv 112; fixtures moved sha kept; xmldom out; tsx left as vite optional peer. +- TS replay rehearsed at 59521dc + 756b7ef. check:all green 03:58:13; security PASS 2 LOW; verifier ECARTS(2): tsx residue (owner), digest typo fixed. STOP before merge. diff --git a/apps/app/tests/unit/r5.census.test.ts b/apps/app/tests/unit/r5.census.test.ts index bbc68171..76252c88 100644 --- a/apps/app/tests/unit/r5.census.test.ts +++ b/apps/app/tests/unit/r5.census.test.ts @@ -295,8 +295,12 @@ describe('the disposition of the deleted files and tests', () => { if (cargo) { const [, binary, test] = cargo const files = cargoTargetFile(binary!) + // A `#[test]` function of that name, not any `fn` (attributes and doc lines between). + const testFn = new RegExp( + `#\\[test\\]\\s*(?:(?:#\\[[^\\]]*\\]|///[^\\n]*)\\s*)*fn ${test}\\(`, + ) const defined = files.some( - (path) => exists(path) && read(path).includes(`fn ${test}(`), + (path) => exists(path) && testFn.test(read(path)), ) expect(defined, `${id}: ${part}`).toBe(true) continue diff --git a/crates/core/tests/curation/FILES.tsv b/crates/core/tests/curation/FILES.tsv index 5b7fafb1..e0eda295 100644 --- a/crates/core/tests/curation/FILES.tsv +++ b/crates/core/tests/curation/FILES.tsv @@ -97,7 +97,7 @@ packages/domain/tests/archive.envelope.test.ts replaced crates/core/tests/curati packages/domain/tests/archive.snapshot.test.ts replaced crates/core/tests/curation/LEDGER.tsv every case: one ledger row packages/domain/tests/fixtures/horse-slice.ts replaced crates/core/tests/fixtures/horse-slice.json the slice as Zod parsed it (R2) packages/domain/tests/fixtures/report-v2.full.json replaced crates/core/tests/fixtures/report-v2.full.json moved by git mv, sha256 e96b0882…729c kept (= apps/app/tests/fixtures copy) -packages/domain/tests/fixtures/report-v2.minimal.json replaced crates/core/tests/fixtures/report-v2.minimal.json moved by git mv, sha256 ba79698c…dfe7 kept (= apps/app/tests/fixtures copy) +packages/domain/tests/fixtures/report-v2.minimal.json replaced crates/core/tests/fixtures/report-v2.minimal.json moved by git mv, sha256 ba79698c…fde7 kept (= apps/app/tests/fixtures copy) packages/domain/tests/helpers/draft-sheet.ts replaced crates/core/tests/archive_support/mod.rs draft_sheet, draft_map packages/domain/tests/helpers/legacy-leaves.ts replaced crates/core/tests/archive_support/mod.rs legacy_leaves, leaves_as_v2_report packages/domain/tests/r2-characterisation.test.ts replaced crates/core/tests/curation/LEDGER.tsv every case: one ledger row diff --git a/docs/development/RUST.md b/docs/development/RUST.md index 71937f29..18be1549 100644 --- a/docs/development/RUST.md +++ b/docs/development/RUST.md @@ -3721,7 +3721,7 @@ duplicated on a root that holds it); `report_contract` (+1: `migration-map.draft the ledger (no business contract lost): the empty document's `view_box: null` literal, two relabel assertions, the `snapshotIndexSource` and `buildSheetIndex` TS-only adapters, JS identity probes. -**Fixtures.** `report-v2.full.json` (`e96b0882…729c`) and `report-v2.minimal.json` (`ba79698c…dfe7`) moved by `git mv` to +**Fixtures.** `report-v2.full.json` (`e96b0882…729c`) and `report-v2.minimal.json` (`ba79698c…fde7`) moved by `git mv` to `crates/core/tests/fixtures/`, sha256 equal before and after (also asserted by `r5.census`); identical to the app's copies under `apps/app/tests/fixtures/`, which stay. Kept untouched: the R2 oracles (`oracles/*.json`, `characterisation.json`, `verdicts.json`), R3 (`oracles/r3`), R4 (`oracles/r4`, `pdf/LEDGER.tsv`, the app goldens and `goldens/r4` digests), R5