Skip to content

typescript class_start: export/declare const enum not recognized (recall gap) #1348

Closed

Description

@squid-protocol

What

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:

assemblyscript/ast.ts:2048:  export const enum ArrowKind {
typescript_compiler/binder.ts:  const enum ContainerFlags {
vscode/ipc.ts:  const enum RequestType {

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).

Related: #1338

Activity

  1. added
    bug
    core-engine
    on Aug 12, 2026
  2. added this to the v2.4.8 milestone on Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-engine

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions