chore(memory): V1-2.2 checkpoint, evidence, BDR-086, LRN-097/098, TODO

This commit is contained in:
bchanot committed 2026-10-29 14:05:28 +01:00
1 parent ca31b787b6
commit 17d919971e
8 files changed
+213 -4

No files matched your search

@@ -0,0 +1,81 @@
# V1-2.2 evidence (2026-10-29)
Owner brief « Autorisation de démarrer V1-2.2 », V1-2.1 VERIFIED at `ac71c5b`. Worktree
`feature/v1-2-anatomical-sheets`. Code commits `64a4384`, `cf37aa2`, `8ae7565`, docs `741c25c`.
Contract `docs/development/V1-2_ANATOMICAL_SHEETS.md` §16.3; verifier contract
`.claude/tasks/contracts/2026-10-29-v1-2-2-core.md`; record `docs/development/RUST.md` §12.
## 1. Owner answers taken before the code (contract §17.4)
| Question | Answer |
|---|---|
| No Inkscape, Illustrator, Figma or Affinity on the machine: how to get real editor exports | the owner supplies them (`crates/core/tests/fixtures/svg/exports/owner/`); cairo and ImageMagick exports committed meanwhile |
| Strict-parse failure code (§6.5 vs §6.7) | `verification.integrity.document` |
| Draft preview with caps excess or missing drawings | reported for drafts, refused for published and deprecated versions |
## 2. Gates on the working tree before the commits
| Gate | Result |
|---|---|
| `pnpm rust:check` | exit 0; 201 cargo result lines, 1 849 passed, 0 failed, 3 ignored (every feature run of the script); clippy `-D warnings` clean; `cargo deny`: bans, licenses, sources ok |
| `pnpm wasm:build` | 1 771 003 B raw, 582 722 B gzip -9 (script); core-wasm proofs green |
| `pnpm check` | exit 0; core-wasm 16 files 65 tests, supabase 11 files 128 tests, app 65 files 566 tests; lint clean; app build done |
| size budget (`packages/core-wasm/tests/size.test.ts`) | 592 136 B by Node's gzip ≤ 600 000 B (531 715 B before V1-2.2) |
The first build was 635 654 B gzip (over budget): serde's tagged readers for `EditCommand` /
`NewElement` and an owned-`Value` read of the document each compiled a second copy of the
schema's reader. Reading both through `&Value` gave 606 750 B, then 582 722 B.
## 3. New suites (cargo, debug)
| Suite | Tests | Notes |
|---|---|---|
| `sheet_size` | 6 | 17 PostgreSQL vectors (PGlite 17.5, `oracles/v1-2-2/size.json`); seed 184 105 B = the real image's value |
| `sheet_review` | 9 | equine 188 / 31 / 620 over 839 elements, 30 groups |
| `sheet_verdict` | 13 | at every cap: 493 ms debug, 107 ms release, document 1 165 850 B |
| `sheet_preview` | 8 | index tables and canvases equal to the bundled `LoadedSheet` |
| `sheet_edit` | 11 | 400 random commands on two documents |
| `svg_clean` | 8 | 42 hostile files; 3 000 generated: 123 clean, 2 697 cleanable (fixpoint), 180 cycles refused |
| `packages/core-wasm/tests/preview.test.ts` | 5 | shipped module; `clean_svg` slowest 0.4 ms over 45 inputs |
## 4. Mutation run
Script: `.claude/audits/2026-10-29-v1-2-2-mutations.py` (run from the repository root: each mutant applied, its suite run, the file restored).
| Mutant | Suite | Result |
|---|---|---|
| caps `>` → `>=` | sheet_verdict | killed |
| digest without its group key | sheet_review | killed by `a_removal_digest_is_bound_to_its_group_key`, written for it before the run |
| event handlers not active | svg_clean | killed |
| drawing hash unchecked | sheet_verdict | killed |
| content update keeps `reviewed` | sheet_edit | killed |
| fingerprint unchecked at load | sheet_preview | killed |
| `inherited` counted as read | sheet_review | survived the first run; killed once `an_inherited_element_alone_keeps_its_group_uncoverable` was added |
| redrawn views ignored | sheet_edit | killed |
| numeric scale ignored | sheet_size | killed |
| removal groups never made | sheet_review | killed |
## 5. DEV and protected branches
- No Supabase CLI call, no SQL, no migration, no seed, no worker start in this step. The DEV
containers (`supabase_*_faunosteo`) were read with `docker ps` / `docker inspect` only: started
2026-10-28 14:45 UTC, before this session (`supabase_auth_faunosteo` restarts=3 already then).
Snapshot before the gate: `scratchpad/docker-inspect-before.txt`; after: section 6.
- No merge, no checkout of `develop`, `main` or `release/*`; commits only on
`feature/v1-2-anatomical-sheets`, pushed by the post-commit hook.
## 6. Gates on the committed branch and reviews
| Commit | `pnpm check:all` | Reviews |
|---|---|---|
| `741c25c` | exit 0, every stage, e2e:ui PASSED | verifier ECARTS(6); security PASS (2 MEDIUM, 2 LOW) — fixed in `8294d54` |
| `8294d54` | exit 0 | verifier ECARTS(3) (A6 owner exports, A12 outside its commands, helper unrecorded); security PASS (4 MEDIUM, 8 LOW) — fixed in `ca31b78` except the owner decisions of RUST.md §12.6 |
| `ca31b78` | exit 0; cargo 1 879 passed 0 failed; vitest core-wasm 65, supabase 128, app 566; e2e:ui PASSED; module 596 671 B (Node gzip) ≤ 600 000 | — |
The first two reviewers (Fable 5.1) stopped at once on exhausted usage credits and produced nothing; they ran again on Opus.
`e2e:shell` not run (needs the sandbox stack; no screen changed).
Containers after the gates (`docker inspect`, read-only): identical to the snapshot of section 5 (DEV
`supabase_*_faunosteo` and the V1-2.1 sandbox: same start times and restart counts).
Known: commit `64a4384` alone does not build (`facade::clean_svg` names the module of `cf37aa2`); the branch head does.
@@ -0,0 +1,28 @@
# V1-2.2 mutation run (evidence .claude/audits/2026-10-29-v1-2-2-evidence.md §4): each mutant is
# applied to its source file, its cargo suite runs, the file is restored. Run from the repo root.
import subprocess, shutil, sys
root='.'
muts=[
('M1 caps off by one','crates/core/src/domain/sheet/caps.rs','.filter(|&(_, value, limit)| value > count(limit))','.filter(|&(_, value, limit)| value >= count(limit))','sheet_verdict'),
('M2 digest without key','crates/core/src/domain/sheet/review.rs',' object.insert("group".to_owned(), Value::String(key.to_owned()));\n','','sheet_review'),
('M3 no active class','crates/core/src/anatomy/svg/sanitize.rs',' if local.starts_with("on") {\n return true;\n }',' if local.starts_with("on") {\n return false;\n }','svg_clean'),
('M4 hash unchecked','crates/core/src/domain/sheet/verdict.rs',' if sha256_hex(bytes) != row.sha256 {',' if false && sha256_hex(bytes) != row.sha256 {','sheet_verdict'),
('M5 update keeps reviewed','crates/core/src/domain/sheet/edit.rs',' if changed {\n set_annotation_status(&mut next, ReviewStatus::ToConfirm);\n }','','sheet_edit'),
('M6 fingerprint unchecked','crates/core/src/domain/sheet/preview.rs',' if stored.is_none() || stored != self.fingerprint.as_deref() {',' if false {','sheet_preview'),
('M7 inherited not counted unread','crates/core/src/domain/sheet/review.rs',' self.to_confirm == 0 && self.inherited == 0',' self.to_confirm == 0','sheet_review'),
('M8 redrawn views ignored','crates/core/src/domain/sheet/edit.rs',' reconfirm_redrawn_views(&mut next, &drawn_before);\n','','sheet_edit'),
('M9 numeric scale ignored','crates/core/src/domain/sheet/size.rs','if scale > 0 {','if false {','sheet_size'),
('M10 removal never made','crates/core/src/domain/sheet/review.rs',' if !groups.iter().any(|g| g.key == key) {',' if false {','sheet_review'),
]
for name,path,old,new,suite in muts:
src=open(path).read()
if src.count(old)!=1:
print(name,'ANCHOR NOT FOUND x',src.count(old)); continue
open(path,'w').write(src.replace(old,new))
try:
r=subprocess.run(['bash','-c',f'. scripts/rust-env.sh && cargo test -q -p faunosteo-core --test {suite} 2>&1 | tail -3'],capture_output=True,text=True)
out=r.stdout
killed=('FAILED' in out) or ('error' in out.lower() and 'could not compile' in out)
print(f"{name}: {'KILLED' if 'FAILED' in out else ('COMPILE-ERR' if 'could not compile' in out else 'SURVIVED')}")
finally:
open(path,'w').write(src)