Skip to content

Rust calls_out: matches! pattern operand blanked by a depth-unbounded scan (Part of #6454) - #8371

Merged
squid-shepherd[bot] merged 2 commits into
mainfrom
churn/6454-20261112T1750Z
Nov 12, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
churn/6454-20261112T1750Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #6454. No checklist key was named; the item is partly addressed: the ledger's named residual (NotSpawned(e) if .. in bevy_ecs_world.rs) already no longer leaks; this closes the depth-bound leak and one real corpus leak. The remaining 40-odd token_tree<token_tree readings are expression constructors in macro arguments (correct calls, C3).

Class

Rust calls_out: the pattern operand of matches! / assert_matches! (and debug_ forms) is counted as a call when the operand cannot be reached by the depth- and length-bounded regex mask (_calls_out_masked_blocks). Same mechanism: any [debug_][assert_]matches! whose first operand nests 5+ parens deep, or holds a turbofish.

Change

rust.py: _blank_matches_patterns, a bounded linear scan (<= 4000 chars per call, stops at the first unclosed call) called from _blank_binding_patterns. It blanks the second top-level argument up to a depth-0 if, same length; first operand, guard and later args keep their calls. The regex mask stays. New test test_calls_out_rust_matches_depth_6454.py (deep operands, guards, strings/chars, trailing comma, unbalanced, unclosed-run and long-operand timing).

Golden drift

One line, both fixtures: bevy_reflect_path.rs parse_invalid loses callee InvalidIndex (Err(.. ParseError(Error::InvalidIndex(_))) is a pattern inside assert!(matches!(..))). Plus the derived graph_sqlite / llm_brief hashes.

Facts checked

  • ~70 probe shapes in macro token trees: all correct except 5+-deep operand (fixed) and the one corpus case above.
  • Known gap, not fixed: a 5+-deep operand combined with a turbofish f::<A, B>(g(h(i(j(1))))) is mis-parsed by the old regex mask (it masks the operand's calls); removing the mask breaks test_mask_redos_immunity, so it stays.
  • Gates: audit_check (ruff, mypy, dead-key, doc-refs, ast-accuracy, signal-coverage) all clear; tests/extraction/languages -k rust 502 passed; crucible_check showed only the drift above, then --update --yes.

Sibling gaps

  • turbofish + 5-deep first operand (above); no burned-estate program needs it.

Cross-repo

None.

Lessons for agents

  • git checkout <file> to "undo one experiment" discards all uncommitted work in that file: commit WIP first.

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 12, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 12, 2026 18:07
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 12, 2026 18:07
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Nov 12, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 76b83ba into main Nov 12, 2026
123 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/6454-20261112T1750Z branch November 12, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant