Skip to content

test(physics): refixture cospan contiguity guard with edge_split (#328) - #382

Merged
tsondru merged 2 commits into
mainfrom
audit/G13-T1
Sep 1, 2026
Merged

test(physics): refixture cospan contiguity guard with edge_split (#328)#382
tsondru merged 2 commits into
mainfrom
audit/G13-T1

Conversation

@tsondru

@tsondru tsondru commented Aug 31, 2026

Copy link
Copy Markdown
Member

Closes #328. Audit sweep G13-T1 (physics lane).

What changed

  • catgraph-physics/tests/catgraph_bridge.rscospan_chain_composability_contiguous_steps refixtured: RewriteRule::edge_split() on Hypergraph::from_edges(vec![vec![0, 1]]), run(.., 3); assert_eq!(cospans.len(), 3); the if cospans.len() >= 2 guard removed; per adjacent pair, the boundary-length equality plus cospans[i].composable(&cospans[i + 1]).is_ok() (use catgraph::category::Composable).
  • catgraph-physics/CHANGELOG.md — one bullet under [Unreleased] / Changed.

Prod diff: 0 lines (git diff --stat fb8426b..HEAD — 2 files, both tests/ and CHANGELOG.md).

Premise (measured)

On the pre-fix fixture (A→BB on [[0,1,2]], 3 steps), to_cospan_chain() returned a chain of length 1, so the guard body never ran: PROBE: chain len = 1 — perturbation assert!(cospans.len() >= 2, ...) in a cp -r copy of the base tree, /tmp/audit-reports/G13-T1/probe-guard.log:136.

Falsification (reviewer r1, /tmp/audit-reports/G13-T1/review-r1.md, quoted)

# Perturbation Site Tree Named test(s) reddened Observed Expected
1a to_cospan_chain closure changed to ignore its window and always rebuild the first pair (cardinality-breaking) evolution_cospan.rs:46-48 base-commit test file + mutated production catgraph_bridge.rs: none, 9/9 pass (guard dead: chain len 1 with wolfram_a_to_bb/ternary fixture). Unit: test_multi_step_cospan_chain, test_cospan_chain_composable_via_catgraph, test_compose_multi_step FAILED boundary "left: 3, right: 2"; composable panic; compose panic "Mismatch in cardinalities" Reproduces issue #328's measured evidence exactly.
1b Same mutation, post-fix test file same mutant-repeat-first cospan_chain_composability_contiguous_steps FAILED at catgraph_bridge.rs:99 (length assert_eq!) left: 3, right: 2 Fix catches what 1a's predecessor did not.
2a build_cospan_for_pair's right built via child_verts.iter().rev() (cardinality-preserving, label-order-breaking) evolution_cospan.rs:107 base-commit test file + mutated production catgraph_bridge.rs: none, 9/9 pass Same dead-guard blindness, independent of mutation kind.
2b Same mutation, post-fix test file same mutant-reverse-right cospan_chain_composability_contiguous_steps FAILED at catgraph_bridge.rs:106 (composable().is_ok()) — length assert at line 99 passed (3==3) panic "cospan 0 not composable with cospan 1" Shows composable() is independently load-bearing, not shadowed by the length assert (1b never reached line 106).

Implementer's falsification (three perturbations: repeat-first-cospan, deterministic_path truncated to 2 nodes, left/right swapped in build_cospan_for_pair; each reddened the refixtured test): /tmp/audit-reports/G13-T1/impl/.

Review rounds

  • r1 (54e2a52): 1 important — CHANGELOG bullet absent (applied in 67ba39c); 1 minor — the refixtured test duplicates evolution_cospan.rs unit tests test_multi_step_cospan_chain and test_cospan_chain_composable_via_catgraph assertion for assertion. Kept as the row's "reachable guard" option: it is the public-API (tests/) exercise of to_cospan_chain + Composable; deletion is the row's other option and remains an owner call.
  • r2 (67ba39c, delta): 0 findings.

Gates (worktree, --target-dir /tmp/cargo/catgraph-physics; logs under /tmp/audit-reports/G13-T1/)

  • cargo nextest run -p catgraph-physics: default 272 passed; --all-features 272 passed; --no-default-features 233 passed (impl/gate-01..03).
  • cargo clippy -p catgraph-physics --all-targets -- -D warnings on the same three lanes: clean (impl/gate-04..06).
  • RUSTDOCFLAGS="-D warnings" cargo doc -p catgraph-physics --no-deps: clean (impl/gate-07).
  • cargo fmt --all --check: clean (impl/gate-08).
  • cargo test --workspace -- --nocaptureworkspace-tests.log: 147 test result: ok lines, 0 test result: FAILED lines; scripts/check_measured_claims.py workspace-tests.log: exit 0.

🤖 Generated with Claude Code

tsondru and others added 2 commits August 31, 2026 17:41
`cospan_chain_composability_contiguous_steps` runs `edge_split` on a
single binary edge for 3 steps, asserts the chain length, and checks
adjacent cospans via `Composable::composable` alongside the boundary
length equality; the `len() >= 2` guard is removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tsondru
tsondru merged commit 937f34c into main Sep 1, 2026
6 checks passed
@tsondru
tsondru deleted the audit/G13-T1 branch September 1, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

physics: catgraph_bridge contiguity guard is statically false — the body is dead code

1 participant