chore(memory): V1-2.2 arbitration criteria, mutation script, TODO
This commit is contained in:
1 parent
93e4e81bda
commit
5281337412
3 files changed
+63
No files matched your search
@@ -0,0 +1,30 @@
|
||||
# V1-2.2 owner arbitrations, mutation run (evidence .claude/audits/2026-10-29-v1-2-2-evidence.md §7): each
|
||||
# mutant is applied to its source file, its cargo suite runs (`lib` = the crate's unit tests), the file is
|
||||
# restored. Run from the repo root.
|
||||
import subprocess
|
||||
muts=[
|
||||
('A1 reader accepts dangling','crates/core/src/anatomy/svg/mod.rs',' refs::check_targets(&sanitized.root)?;\n','','svg_scope'),
|
||||
('A2 cleaning accepts dangling','crates/core/src/anatomy/svg/clean.rs','check_targets(&read.root)','Ok::<(), super::tree::SvgRejection>(())','svg_clean'),
|
||||
('A3 canvas ids not scoped','crates/core/src/anatomy/compose.rs',' scope_ids(&mut root, &id_scope(view_id));\n','','svg_scope'),
|
||||
('A4 url() references not scoped','crates/core/src/anatomy/compose.rs'," _ if attr.value.contains('(') => scope_url_targets(&attr.value, scope),"," _ if false => scope_url_targets(&attr.value, scope),",'svg_scope'),
|
||||
('A5 verdict ignores the stored form','crates/core/src/domain/sheet/verdict.rs',' Ok(read) if stored_form(&read.root) != text =>',' Ok(read) if false && stored_form(&read.root) != text =>','sheet_verdict'),
|
||||
('A6 preview ignores the stored form','crates/core/src/domain/sheet/preview.rs',' if stored_form(&root) != text {',' if false {','sheet_preview'),
|
||||
('A7 cleaning uploads the original bytes','crates/core/src/anatomy/svg/clean.rs',' accepted(outcome, stored, preview, read.removed)',' accepted(outcome, String::from_utf8_lossy(bytes).into_owned(), preview, read.removed)','svg_clean'),
|
||||
('A8 removal ignores dependents','crates/core/src/domain/sheet/edit.rs',' if named_elsewhere {',' if false && named_elsewhere {','sheet_edit'),
|
||||
('A9 colour bound unchecked','crates/core/src/anatomy/svg/sanitize.rs',' if value > limit || bytes.get(index) != Some(&separator) {',' if bytes.get(index) != Some(&separator) {','svg_clean'),
|
||||
('A10 glued name accepted','crates/core/src/anatomy/svg/sanitize.rs',' _ if glued => return None,',' _ if false && glued => return None,','lib'),
|
||||
('A11 mixed units accepted','crates/core/src/anatomy/svg/sanitize.rs',' _ if *percentages.get_or_insert(percent) != percent => return None,',' _ if *percentages.get_or_insert(percent) != percent && false => return None,','lib'),
|
||||
('A12 rgba with three components','crates/core/src/anatomy/svg/sanitize.rs',' _ if rest.starts_with("rgba(") => (4, 5),',' _ if rest.starts_with("rgba(") => (3, 5),','svg_clean'),
|
||||
]
|
||||
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))
|
||||
target='--lib' if suite=='lib' else f'--test {suite}'
|
||||
try:
|
||||
r=subprocess.run(['bash','-c',f'. scripts/rust-env.sh && cargo test -q -p faunosteo-core {target} 2>&1 | tail -3'],capture_output=True,text=True)
|
||||
out=r.stdout
|
||||
print(f"{name} ({suite}): {'KILLED' if 'FAILED' in out else ('COMPILE-ERR' if 'could not compile' in out else 'SURVIVED')}", flush=True)
|
||||
finally:
|
||||
open(path,'w').write(src)
|
||||
Reference in new issue
Block a user