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,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)