Skip to content

Fix 1872 rust scala lifetime - #2137

Merged
squid-protocol merged 3 commits into
mainfrom
fix-1872-rust-scala-lifetime
Aug 22, 2026
Merged

Fix 1872 rust scala lifetime#2137
squid-protocol merged 3 commits into
mainfrom
fix-1872-rust-scala-lifetime

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #1872
Fixes #1853

This PR addresses the bug where Rust and Scala lifetime annotations (e.g. 'a, 'static, '_) caused function extraction to truncate signatures prematurely. Previously, the parser treated the single quote as the start of an unterminated string literal, causing it to consume the rest of the file until a closing quote or end of file was reached.

It also addresses #1853 where angle brackets used as math operators (<<, >>, >=, <=, ->, =>) or surrounded by whitespace incorrectly incremented bracket depth in generic languages, truncating signatures early.

Changes:

  • Modified _count_top_level_args and _matching_paren_end in gitgalaxy/core/detector.py to explicitly recognize Rust and Scala lifetime patterns and skip them instead of entering string-parsing mode.
  • Modified _count_top_level_args to intelligently skip angle brackets that are adjacent to math operators or whitespace, while perfectly preserving nested generic template closures (e.g. vector<vector<int>>).
  • Regenerated the golden master audits and tree-sitter accuracy baselines to reflect the accurate structural metrics.
  • Globally regenerated the tri_comparison_chart.svg across all languages to repair a previous overwrite that limited it to only Rust and Scala.
  • Added a new Claude rule (.claude/rules/tri-comparison-chart.md) to enforce that the tri-comparison chart must always be regenerated globally using --all.

Type of change

[x] Bug fix
[x] Parsing or engine logic (gitgalaxy/core/detector.py)

CI checklist

[x] python tests/tools/audit_check.py passes
[x] python tests/tools/crucible_check.py passes
[x] python tests/tools/tree_sitter_accuracy_audit.py --all --ci passes

@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 0c8c3f0 into main Aug 22, 2026
28 checks passed
@squid-protocol
squid-protocol deleted the fix-1872-rust-scala-lifetime branch August 22, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant