The TypeScript precision is currently at ~85.6%. Investigation reveals a mix of actual regex bugs in GitGalaxy and measurement gaps in the audit script:
GitGalaxy Regex Bugs:
- Assignment Regex Non-Consuming Lookahead: The assignment regex uses a non-consuming lookahead
(?=...) to skip optional type annotations (like : Type = () =>). Because it's optional, it can falsely anchor on the last word of a complex type annotation that precedes the = sign instead of the actual variable name (e.g., capturing B in reduce: <A, B>(...) => B = ...).
- Parameter Declarations Matched as Object Properties: The zero-prefix regex branch intended for object methods correctly matches things like
method: () => {}. However, lacking parenthesis boundaries, it falsely triggers on function arguments with an arrow-function type annotation defined at the start of a line (e.g., f: (...a: A) => B), mistaking a parameter declaration for an object property holding a function.
Audit Script Ground-Truth Gaps (Not GitGalaxy's fault):
- Missing Overload Signatures: The
tree_sitter_accuracy_audit.py script is missing function_signature and method_signature from its TypeScript node types. GitGalaxy correctly flags them, but the audit script incorrectly counts them as "extra".
- Missing Class Field Arrow Functions: Tree-sitter parses class fields like
onmessage = (message) => {}; as a public_field_definition containing an arrow_function. The _get_node_name function lacks the logic to extract names from this specific parent.
The TypeScript precision is currently at ~85.6%. Investigation reveals a mix of actual regex bugs in GitGalaxy and measurement gaps in the audit script:
GitGalaxy Regex Bugs:
(?=...)to skip optional type annotations (like: Type = () =>). Because it's optional, it can falsely anchor on the last word of a complex type annotation that precedes the=sign instead of the actual variable name (e.g., capturingBinreduce: <A, B>(...) => B = ...).method: () => {}. However, lacking parenthesis boundaries, it falsely triggers on function arguments with an arrow-function type annotation defined at the start of a line (e.g.,f: (...a: A) => B), mistaking a parameter declaration for an object property holding a function.Audit Script Ground-Truth Gaps (Not GitGalaxy's fault):
tree_sitter_accuracy_audit.pyscript is missingfunction_signatureandmethod_signaturefrom its TypeScript node types. GitGalaxy correctly flags them, but the audit script incorrectly counts them as "extra".onmessage = (message) => {};as apublic_field_definitioncontaining anarrow_function. The_get_node_namefunction lacks the logic to extract names from this specific parent.