You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
typescript class_start: export/declare const enum not recognized (recall gap) #1348
Found while diagnosing #1338 (class precision). After fixing the audit tool's ground-truth
gap for typescript classes (interfaces/enums are intentional class_start matches, see #1338), 20 of 842 measured real classes are still genuinely missing from GitGalaxy's output
-- a real (small) recall gap, not a ground-truth issue this time.
All 20 trace to the same shape: export const enum X { ... } / const enum X { ... }
(TypeScript's compile-time-only enum variant). Examples from language-crucible's typescript
corpus:
gitgalaxy/standards/language_standards.py's typescript class_start rule's modifier group
is (?:export|default|abstract|declare){0,4}, which doesn't include const -- so export const enum Foo never matches at all (the mandatory class|enum|interface token
never gets reached because const isn't a recognized modifier and isn't the entity keyword
either).
Suggested fix
Add const to the modifier alternation: (?:export|default|abstract|declare|const). Since the entity keyword (class|enum|interface)
is still mandatory after the modifier group, this can't introduce new false matches on
unrelated const x = ... statements -- the regex only fires when a literal class/enum/ interface token follows the modifier run.
Needs the standard extraction-hardening test additions (valid case: export const enum Foo {, const enum Foo {) in tests/extraction/languages/test_typescript.py's CLASS_CASES, a tree_sitter_accuracy_audit.py --lang typescript --regenerate (recall should move
822/842 -> 842/842), and the Differential Scan protocol since this touches parsing logic
(crucible_check.py before push).
Activity
fix(tools): typescript class_start ground truth was missing interface…
fix(core): typescript class_start now recognizes const enum (#1348) (#…