Skip to content

makefile + ada: never routed off Mode_B_Braces slicer — functions_found is 0 despite func_start matching (13-14 hits each) #2648

Closed

Description

@squid-protocol

Found by the #2560 rosetta classification sweep (makefile tracking issue #2586): makefile records functions_found = 0 corpus-wide while its func_start regex correctly fires 14 times.

Cause

detector.py (~line 2392) special-cases assembly/agc_assembly/cobol/fortran/abap/dockerfile/jcl/m4/yacc into Mode_A_Labels because they lack brace-delimited bodies. Makefile was never added to that tuple despite the identical shape (target: deps is structurally the same as yacc's rule_name : or a jcl label). It falls through to Mode_B_Braces, which requires a literal {/} a Makefile recipe essentially never contains — _slice_by_braces finds zero bodies even though func_start matches.

This is the same mechanism as the already-fixed jcl/m4/yacc/dockerfile/abap cases (the code's inline comments document each as this bug class — #1975 lineage).

Evidence

Rosetta corpus (keyword-rosetta/data/makefile/): func_start signal = 14, file_data.function_count = 0 on every file (galaxyscope --db-only --debug WORKER-TRACE shows no extracted functions).

Fix shape

Add "makefile" to the Mode_A_Labels tuple in detector.py — one line, direct precedent to copy. Then the ci-push-checklist gauntlet: golden-master re-bless (makefile function counts rise corpus-wide) + strict tests.

Found via keyword-rosetta classification; cause-key mode-b-fallthrough-no-braces.

Activity

  1. added
    bug
    core-engine
    on Sep 2, 2026
  2. squid-protocol commented on Sep 2, 2026

    @squid-protocol
    OwnerAuthor

    The ada/fortran classification agent independently confirmed ada has the identical defect, with a complete evidence chain:

    1. ada's func_start regex matches 13/13 real procedures across the rosetta corpus when tested standalone (ada.py:83-90).
    2. galaxyscope --db-only --debug shows [WORKER-TRACE] extracted functions for main.adb: [] — the live pipeline drops 100%.
    3. Root cause: _function_slice's dispatcher — "ada" is absent from Mode_A_Labels, Mode_C_Indentation, ScopeParsingRegistry, and the column_sensitive family check; ada's lexical_family is line_exclusive_dash, so it falls through to Mode_B_Braces. Ada's procedure X is begin ... end X; syntax contains zero braces.

    Fix options per the agent: add "ada" to the Mode_A_Labels tuple (simplest; the greedy-to-next-func_start heuristic works for non-nested procedures, consistent with cobol/fortran) or build a proper begin/end keyword-depth tracker (more correct for real-world nested Ada, more work). Either way this issue should cover both makefile and ada — same tuple, one PR.

    Follow-up once fixed: ada's manifest claim that "ada procedures are not orphan-tracked by design" should be re-verified — it may be a symptom of this bug (orphan→api conversion depends on the function-slicer output that is currently empty for ada).

  3. changed the title [-]makefile: never routed to Mode_A_Labels slicer — functions_found is 0 despite 14 func_start matches[/-] [+]makefile + ada: never routed off Mode_B_Braces slicer — functions_found is 0 despite func_start matching (13-14 hits each)[/+] on Sep 2, 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