Skip to content

Commit feb4257

Browse files
authored
Merge pull request #337 from PhysShell/claude/p-022-checkpoint-census
docs(P-022): generate the cp4 census and mutation evidence from the tree
2 parents 3fc1246 + 87bcd27 commit feb4257

14 files changed

Lines changed: 2033 additions & 177 deletions

‎.github/workflows/ci.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ jobs:
146146

147147
steps:
148148
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
149+
with:
150+
# tests/test_checkpoint_status.py verifies that a recorded mutation
151+
# campaign names a commit that exists and is an ancestor of HEAD;
152+
# a depth-1 checkout cannot answer that, so this job takes the history.
153+
fetch-depth: 0
149154

150155
- name: Set up Python ${{ matrix.python-version }}
151156
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
Lines changed: 344 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,344 @@
1+
{
2+
"schema": 1,
3+
"comment": "Mutation campaign definition for #259 checkpoint 4 (P-022 discipline rules 2 and 3). Each entry is a source mutation: a regex that must match `target` exactly once, its replacement, the Bridge.md rule it attacks, and the tests expected to fail. Replay: python scripts/mutate_campaign.py --campaign docs/evidence/p022-cp4-mutations.json --run (on a clean tree). The recorded run lives beside this file as p022-cp4-mutations.result.json; counts are derived from it by scripts/render_checkpoint_status.py, never typed.",
4+
"campaign": "p022-cp4",
5+
"description": "#259 cp4 analysis wiring: the BR-V1..V8 verdict mapping in own-bridge (skip list, map-or-raise subject, anchors, tiering, dedup key member by member, stable sort), the BR-D2/L8/M1 side paths, the two declared boundaries (protocol refusal, u32 coordinate refusal) and the own-analysis subject stamping the mapping rests on.",
6+
"workspace": "rust",
7+
"control": {
8+
"id": "M00",
9+
"description": "no mutation — the unmutated tree must pass (harness honesty control)"
10+
},
11+
"mutations": [
12+
{
13+
"id": "M01",
14+
"rule": "BR-V2",
15+
"description": "BR-V2 skip list: OWN033 no longer skipped (maps or raises)",
16+
"target": "rust/crates/own-bridge/src/verdict.rs",
17+
"pattern": "\\[\"OWN033\", \"OWN034\", \"OWN035\", \"OWN040\", \"OWN041\"\\]",
18+
"replacement": "[\"OWN032\", \"OWN034\", \"OWN035\", \"OWN040\", \"OWN041\"]",
19+
"expected_catchers": [
20+
"own-bridge/src/lib.rs::verdict::tests::only_error_severity_core_verdicts_are_mapped",
21+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
22+
]
23+
},
24+
{
25+
"id": "M02",
26+
"rule": "BR-V5",
27+
"description": "BR-V5 flow-local anchor at the core's line instead of the acquire record",
28+
"target": "rust/crates/own-bridge/src/verdict.rs",
29+
"pattern": "Finding::new\\(\\s*file,\\s*anchor,\\s*&d\\.code,(\\s*if pool)",
30+
"replacement": "Finding::new(file, i64::from(d.line), &d.code,\\1",
31+
"expected_catchers": [
32+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
33+
]
34+
},
35+
{
36+
"id": "M03",
37+
"rule": "BR-V5",
38+
"description": "BR-V5 OWN025 anchored at the acquire instead of the view site",
39+
"target": "rust/crates/own-bridge/src/verdict.rs",
40+
"pattern": "Finding::new\\(file, i64::from\\(d\\.line\\), \"OWN025\", \"pooled buffer\"\\)",
41+
"replacement": "Finding::new(file, anchor, \"OWN025\", \"pooled buffer\")",
42+
"expected_catchers": [
43+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
44+
]
45+
},
46+
{
47+
"id": "M04",
48+
"rule": "BR-V7",
49+
"description": "BR-V7 dedup key drops column",
50+
"target": "rust/crates/own-bridge/src/verdict.rs",
51+
"pattern": "(\\n\\s+)f\\.column,(\\n\\s+f\\.code\\.clone\\(\\),)",
52+
"replacement": "\\1None,\\2",
53+
"expected_catchers": [
54+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
55+
]
56+
},
57+
{
58+
"id": "M05",
59+
"rule": "BR-V8",
60+
"description": "BR-V8 sort key drops column",
61+
"target": "rust/crates/own-bridge/src/verdict.rs",
62+
"pattern": "\\.then_with\\(\\|\\| a\\.column\\.unwrap_or\\(0\\)\\.cmp\\(&b\\.column\\.unwrap_or\\(0\\)\\)\\)",
63+
"replacement": ".then_with(|| 0_i64.cmp(&0_i64))",
64+
"expected_catchers": [
65+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
66+
]
67+
},
68+
{
69+
"id": "M06",
70+
"rule": "BR-V7",
71+
"description": "BR-V7 dedup key drops event",
72+
"target": "rust/crates/own-bridge/src/verdict.rs",
73+
"pattern": "(\\n\\s+)f\\.event\\.clone\\(\\),(\\n\\s+f\\.handler\\.clone\\(\\),)",
74+
"replacement": "\\1String::new(),\\2",
75+
"expected_catchers": [
76+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
77+
]
78+
},
79+
{
80+
"id": "M07",
81+
"description": "DI004/DI005 duplicate site: last-wins becomes first-wins (own-analysis)",
82+
"target": "rust/crates/own-analysis/src/di.rs",
83+
"pattern": "sites\\.iter\\(\\)\\.rev\\(\\)\\.find\\(\\|\\(ty, _, _\\)\\| ty == entry\\)",
84+
"replacement": "sites.iter().find(|(ty, _, _)| ty == entry)",
85+
"expected_catchers": [
86+
"own-analysis/tests/fact_parity.rs::di_fact_parity",
87+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
88+
]
89+
},
90+
{
91+
"id": "M08",
92+
"rule": "BR-V6",
93+
"description": "BR-V6 DI001 graded warning like DI002-005",
94+
"target": "rust/crates/own-bridge/src/verdict.rs",
95+
"pattern": "if c\\.code != \"DI001\" \\{",
96+
"replacement": "if c.code != \"DI999\" {",
97+
"expected_catchers": [
98+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
99+
]
100+
},
101+
{
102+
"id": "M09",
103+
"rule": "BR-D2",
104+
"description": "BR-D2 effect deps coerced instead of skipped (raw-document path)",
105+
"target": "rust/crates/own-bridge/src/verdict.rs",
106+
"pattern": "Some\\(_\\) => continue,\\n(\\s+)\\};\\n(\\s+)let io = match",
107+
"replacement": "Some(v) => vec![py_str(v)],\\n\\1};\\n\\2let io = match",
108+
"expected_catchers": [
109+
"own-bridge/src/lib.rs::verdict::tests::malformed_effect_entries_are_skipped_not_coerced"
110+
]
111+
},
112+
{
113+
"id": "M10",
114+
"rule": "BR-L8",
115+
"description": "BR-L8 OWN051 owned-local gate dropped",
116+
"target": "rust/crates/own-bridge/src/lower.rs",
117+
"pattern": "if !owned_here\\.contains\\(arg\\) \\{",
118+
"replacement": "if false && !owned_here.contains(arg) {",
119+
"expected_catchers": [
120+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
121+
]
122+
},
123+
{
124+
"id": "M11",
125+
"rule": "BR-M1",
126+
"description": "BR-M1 OWN052 note never minted",
127+
"target": "rust/crates/own-bridge/src/verdict.rs",
128+
"pattern": "for _reason in &lowering\\.mos_notes \\{",
129+
"replacement": "for _reason in lowering.mos_notes.iter().skip(usize::MAX) {",
130+
"expected_catchers": [
131+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
132+
]
133+
},
134+
{
135+
"id": "M12",
136+
"rule": "BR-V3",
137+
"description": "BR-V3 OWN001 leak emitted without a subject (own-analysis)",
138+
"target": "rust/crates/own-analysis/src/ownership.rs",
139+
"pattern": "emit\\.push_at\\(\"OWN001\", at_line, Some\\(SymId\\(rid\\)\\)\\);",
140+
"replacement": "emit.push_at(\"OWN001\", at_line, None);",
141+
"expected_catchers": [
142+
"own-analysis/tests/subject.rs::leak_carries_the_acquire_origin",
143+
"own-analysis/tests/subject.rs::origin_is_inherited_across_a_move",
144+
"own-analysis/tests/subject.rs::param_leak_carries_the_param_origin",
145+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
146+
]
147+
},
148+
{
149+
"id": "M13",
150+
"rule": "BR-V3",
151+
"description": "BR-V3 OWN014 emitted without a subject (own-analysis)",
152+
"target": "rust/crates/own-analysis/src/lifetime.rs",
153+
"pattern": "Ok\\(d\\) => diags\\.push\\(d\\.with_subject\\(format!\\(\"\\{\\}#\\{\\}\", sub\\.source, sub\\.line\\)\\)\\),",
154+
"replacement": "Ok(d) => diags.push(d),",
155+
"expected_catchers": [
156+
"own-analysis/tests/subject.rs::region_escape_carries_the_source_identity",
157+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
158+
]
159+
},
160+
{
161+
"id": "M14",
162+
"description": "protocol boundary: a protocol-bearing document is no longer refused",
163+
"target": "rust/crates/own-bridge/src/verdict.rs",
164+
"pattern": "Some\\(Value::Array\\(items\\)\\) if !items\\.is_empty\\(\\) => Err\\(",
165+
"replacement": "Some(Value::Array(items)) if items.is_empty() => Err(",
166+
"expected_catchers": [
167+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
168+
]
169+
},
170+
{
171+
"id": "M15",
172+
"description": "coordinate boundary: core_line clamps instead of refusing",
173+
"target": "rust/crates/own-bridge/src/ast.rs",
174+
"pattern": "u32::try_from\\(line\\)\\.map_err\\(",
175+
"replacement": "u32::try_from(line.clamp(0, i64::from(u32::MAX))).map_err(",
176+
"expected_catchers": [
177+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
178+
]
179+
},
180+
{
181+
"id": "M16",
182+
"rule": "BR-V6",
183+
"description": "BR-V6 source tiering inverted (static warns, injected does not)",
184+
"target": "rust/crates/own-bridge/src/verdict.rs",
185+
"pattern": "_ if injected => Some\\(\"warning\"\\.to_owned\\(\\)\\),",
186+
"replacement": "_ if !injected => Some(\"warning\".to_owned()),",
187+
"expected_catchers": [
188+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
189+
]
190+
},
191+
{
192+
"id": "M17",
193+
"rule": "BR-V6",
194+
"description": "BR-V6 an empty ignore_reason suppresses",
195+
"target": "rust/crates/own-bridge/src/verdict.rs",
196+
"pattern": "\\.filter\\(\\|v\\| truthy\\(Some\\(v\\)\\)\\)",
197+
"replacement": ".filter(|v| !v.is_null())",
198+
"expected_catchers": [
199+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
200+
]
201+
},
202+
{
203+
"id": "M18",
204+
"rule": "BR-V7",
205+
"description": "BR-V7 dedup removed",
206+
"target": "rust/crates/own-bridge/src/verdict.rs",
207+
"pattern": "findings\\.retain\\(\\|f\\| seen\\.insert\\(dedup_key\\(f\\)\\)\\);",
208+
"replacement": "findings.retain(|f| { let _ = seen.insert(dedup_key(f)); true });",
209+
"expected_catchers": [
210+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
211+
]
212+
},
213+
{
214+
"id": "M19",
215+
"rule": "BR-V1",
216+
"description": "BR-V1 ERROR-only half of the mapping predicate removed",
217+
"target": "rust/crates/own-bridge/src/verdict.rs",
218+
"pattern": "d\\.severity == Severity::Error && !SKIP",
219+
"replacement": "true && !SKIP",
220+
"expected_catchers": [
221+
"own-bridge/src/lib.rs::verdict::tests::only_error_severity_core_verdicts_are_mapped"
222+
]
223+
},
224+
{
225+
"id": "M20",
226+
"description": "_as_col accepts 0 as a coordinate",
227+
"target": "rust/crates/own-bridge/src/lower.rs",
228+
"pattern": "v\\.and_then\\(Value::as_i64\\)\\.filter\\(\\|c\\| \\*c >= 1\\)",
229+
"replacement": "v.and_then(Value::as_i64).filter(|c| *c >= 0)",
230+
"expected_catchers": [
231+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
232+
]
233+
},
234+
{
235+
"id": "M21",
236+
"description": "guarded DI site line: a negative site line becomes 1 instead of 0",
237+
"target": "rust/crates/own-bridge/src/verdict.rs",
238+
"pattern": "if line < 0 \\{\\n(\\s+)Ok\\(0\\)",
239+
"replacement": "if line < 0 {\\n\\1Ok(1)",
240+
"expected_catchers": [
241+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
242+
]
243+
},
244+
{
245+
"id": "M22",
246+
"description": "OWN050 advisory never minted",
247+
"target": "rust/crates/own-bridge/src/verdict.rs",
248+
"pattern": "!= Some\\(\"unresolved-subscription\"\\) \\{",
249+
"replacement": "!= Some(\"unresolved-subscription-x\") {",
250+
"expected_catchers": [
251+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
252+
]
253+
},
254+
{
255+
"id": "M23",
256+
"rule": "BR-V3",
257+
"description": "BR-V3 handle recovered from the wrong subject separator",
258+
"target": "rust/crates/own-bridge/src/verdict.rs",
259+
"pattern": "\\.map\\(\\|s\\| s\\.split\\('#'\\)\\.next\\(\\)\\.unwrap_or\\(s\\)\\)",
260+
"replacement": ".map(|s| s.split('@').next().unwrap_or(s))",
261+
"expected_catchers": [
262+
"own-bridge/src/lib.rs::verdict::tests::only_error_severity_core_verdicts_are_mapped",
263+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
264+
]
265+
},
266+
{
267+
"id": "M24",
268+
"description": "OWN051 line taken from the callee record instead of the call",
269+
"target": "rust/crates/own-bridge/src/lower.rs",
270+
"pattern": "line: \\*cline,",
271+
"replacement": "line: 0,",
272+
"expected_catchers": [
273+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
274+
]
275+
},
276+
{
277+
"id": "M25",
278+
"rule": "BR-V7",
279+
"description": "BR-V7 dedup key drops handler",
280+
"target": "rust/crates/own-bridge/src/verdict.rs",
281+
"pattern": "(\\n\\s+)f\\.handler\\.clone\\(\\),(\\n\\s+f\\.kind\\.clone\\(\\),)",
282+
"replacement": "\\1String::new(),\\2",
283+
"expected_catchers": [
284+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
285+
]
286+
},
287+
{
288+
"id": "M26",
289+
"rule": "BR-V7",
290+
"description": "BR-V7 dedup key drops component",
291+
"target": "rust/crates/own-bridge/src/verdict.rs",
292+
"pattern": "(\\n\\s+)f\\.component\\.clone\\(\\),(\\n\\s+f\\.event\\.clone\\(\\),)",
293+
"replacement": "\\1String::new(),\\2",
294+
"expected_catchers": [
295+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
296+
]
297+
},
298+
{
299+
"id": "M27",
300+
"rule": "BR-V7",
301+
"description": "BR-V7 dedup key drops kind",
302+
"target": "rust/crates/own-bridge/src/verdict.rs",
303+
"pattern": "(\\n\\s+)f\\.kind\\.clone\\(\\),(\\n\\s+f\\.advisory,)",
304+
"replacement": "\\1String::new(),\\2",
305+
"expected_catchers": [
306+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
307+
]
308+
},
309+
{
310+
"id": "M28",
311+
"rule": "BR-V7",
312+
"description": "BR-V7 dedup key drops severity",
313+
"target": "rust/crates/own-bridge/src/verdict.rs",
314+
"pattern": "(\\n\\s+)f\\.severity\\.clone\\(\\),(\\n\\s+f\\.ignore_reason\\.clone\\(\\),)",
315+
"replacement": "\\1None,\\2",
316+
"expected_catchers": [
317+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
318+
]
319+
},
320+
{
321+
"id": "M29",
322+
"rule": "BR-V7",
323+
"description": "BR-V7 dedup key drops ignore_reason",
324+
"target": "rust/crates/own-bridge/src/verdict.rs",
325+
"pattern": "f\\.ignore_reason\\.clone\\(\\),(\\n\\s+\\)\\n\\})",
326+
"replacement": "None,\\1",
327+
"expected_catchers": [
328+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
329+
]
330+
},
331+
{
332+
"id": "M30",
333+
"rule": "BR-V5",
334+
"description": "BR-V5 DI/effect finding line taken from the registration instead of the finder's anchor",
335+
"target": "rust/crates/own-bridge/src/verdict.rs",
336+
"pattern": "Finding::new\\(c\\.file, i64::from\\(c\\.line\\), c\\.code, \"DI lifetime\"\\)",
337+
"replacement": "Finding::new(c.file, 0, c.code, \"DI lifetime\")",
338+
"expected_catchers": [
339+
"own-bridge/src/lib.rs::verdict::tests::di_coercions_match_the_reference",
340+
"own-bridge/tests/verdicts.rs::replays_every_case_to_its_golden"
341+
]
342+
}
343+
]
344+
}

0 commit comments

Comments
 (0)