Skip to content

fix(typescript): resolve #2230 by ignoring multi-char operators in backward scanner - #2234

Merged
squid-protocol merged 24 commits into
mainfrom
fix/tri-comparison-sweep-final-issues
Aug 24, 2026
Merged

fix(typescript): resolve #2230 by ignoring multi-char operators in backward scanner#2234
squid-protocol merged 24 commits into
mainfrom
fix/tri-comparison-sweep-final-issues

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Resolves #2230

Problem:
GitGalaxy was incorrectly dropping typescript functions like createBinder when the backward scanner encountered bitwise operators (e.g. <<, <=) and misinterpreted them as generics.

Additionally, the tree-sitter accuracy audit script was incorrectly preserving bodyless overloads for typescript (e.g. pipeable in fp-ts) in its ground truth when they were represented as function_signature nodes without a semicolon, causing them to falsely appear in the _missing_examples list even though GitGalaxy correctly drops them.

Fix:

  • Updated the backward scanner in gitgalaxy/core/detector.py to ignore multi-character operators like <=, <<, =>, and -> instead of treating them as bracket boundaries.
  • Refined the bodyless overload filter in tests/tools/tree_sitter_accuracy_audit.py to intentionally drop function_signature nodes that do not end in a semicolon (aligning ground truth with GitGalaxy's own intentional drop of non-terminated prototypes).

All tests, golden masters, and accuracy baselines have been updated.

… Obj-C, Swift, Tcl, TS

This commit resolves a batch of unvalidated tri-comparison shapes by improving extraction accuracy:
- **Objective-C**: Updated `func_start` to correctly match unparenthesized return types (e.g., `- unsigned char next_input_block`).
- **Swift**: Modified `detector.py` normalizer to preserve standard operator characters (e.g., `==`), preventing them from collapsing into `Unknown_Block`.
- **Tcl**: Updated `func_start` to optionally consume the inline brace-wrapped argument list so it isn't mistaken for the function body by the balanced-brace finder.
- **TypeScript**: Fixed arrow function `func_start` branch to permit up to 3 levels of nested parentheses in the return type, enabling extraction of `const fn = <T>(): (returnType<...>) => {`.

Closes #2214
Closes #2217
Closes #2218
Closes #2220

Also updates all relevant baselines (Tree-sitter accuracy, Crucible Golden Masters, Tri-comparison Ledger/Chart).
@squid-protocol squid-protocol added the bug Unintended behavior or logic failure in the engine label Aug 24, 2026
…baseline

Resolves #2230 by ignoring multi-character operators like <=, <<, and => in the detector's backward scanner. Also adds tri_comparison baseline for typescript.
@squid-protocol
squid-protocol force-pushed the fix/tri-comparison-sweep-final-issues branch from 0cebaf1 to 9e8cadc Compare August 24, 2026 23:35
…eep-final-issues

# Conflicts:
#	docs/self_scan/tree_sitter_accuracy_chart.svg
#	docs/self_scan/tree_sitter_accuracy_history.csv
#	docs/self_scan/tri_comparison_chart.svg
#	docs/self_scan/tri_comparison_ledger.json
#	docs/self_scan/tri_comparison_points_of_interest.md
#	tests/golden_master_audit.json
#	tests/golden_master_zero_dep_audit.json
#	tests/tree_sitter_accuracy_baseline_typescript.json
@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 38ee922 into main Aug 24, 2026
30 checks passed
@squid-protocol
squid-protocol deleted the fix/tri-comparison-sweep-final-issues branch August 24, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unintended behavior or logic failure in the engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TS] Extraction misses bodyless overloads when << or >> appear earlier in file

1 participant