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
This is "Check 1" of entry-point detection. It only fires when the function's metadata has a unit_type key in snake_case.
The gap
Different parsers emit different shapes:
Parser
unit_type key shape
Python (function_extractor.py)
unit_type (snake_case) ✅
C / Ruby / PHP (builder.export())
unit_type (snake_case) ✅
Zig
unit_type (snake_case) ✅
JavaScript (typescript_analyzer.js)
unitType (camelCase) ❌
Go (normalized in parsers/go/test_pipeline.py)
unitType (camelCase) ❌
For JS and Go scans, func_data.get('unit_type', '') returns '' and Check 1 silently fails. Only Check 3 (input patterns like req.body / req.params) actually catches anything.
Practical impact
Express handler bodies that touch req.body get caught by Check 3 — fine in practice
Minimal Express middleware (async (req, res, next) => next();) has no body content matching input patterns → silently dropped from analysis
#49's regression test test_route_middleware_is_entry_point passes in isolation (constructs unit_type snake_case directly) but the full JS pipeline gap remains.
This is documented
_docs/internal/parser-issues.md items #23-26 describe the broader normalization gap. _docs/internal/how-openant-works.md Room-for-Improvement #10 lists "Fix test_pipeline.py normalization in ALL parsers" as the highest-impact fix.
Proposed approaches
Option A — Normalize at parser output time (preferred)
Each parser's test_pipeline.py should emit unit_type (snake_case). Python / C / Ruby / PHP / Zig already do. JS and Go don't.
Concrete fix:
parsers/javascript/test_pipeline.py:497: normalize unitType → unit_type before passing to EntryPointDetector
Context
utilities/agentic_enhancer/entry_point_detector.py:176reads:This is "Check 1" of entry-point detection. It only fires when the function's metadata has a
unit_typekey in snake_case.The gap
Different parsers emit different shapes:
unit_typekey shapefunction_extractor.py)unit_type(snake_case) ✅builder.export())unit_type(snake_case) ✅unit_type(snake_case) ✅typescript_analyzer.js)unitType(camelCase) ❌parsers/go/test_pipeline.py)unitType(camelCase) ❌For JS and Go scans,
func_data.get('unit_type', '')returns''and Check 1 silently fails. Only Check 3 (input patterns likereq.body/req.params) actually catches anything.Practical impact
req.bodyget caught by Check 3 — fine in practiceasync (req, res, next) => next();) has no body content matching input patterns → silently dropped from analysisroute_middlewareunits (added in fix: extract Express.js anonymous route handler callbacks #49) have the same issue — Check 1 should catch them but doesn't due to camelCase#49's regression test
test_route_middleware_is_entry_pointpasses in isolation (constructsunit_typesnake_case directly) but the full JS pipeline gap remains.This is documented
_docs/internal/parser-issues.mditems #23-26 describe the broader normalization gap._docs/internal/how-openant-works.mdRoom-for-Improvement #10 lists "Fixtest_pipeline.pynormalization in ALL parsers" as the highest-impact fix.Proposed approaches
Option A — Normalize at parser output time (preferred)
Each parser's
test_pipeline.pyshould emitunit_type(snake_case). Python / C / Ruby / PHP / Zig already do. JS and Go don't.Concrete fix:
parsers/javascript/test_pipeline.py:497: normalizeunitType→unit_typebefore passing toEntryPointDetectorparsers/go/test_pipeline.py:296: change'unitType': ...→'unit_type': ...call_graph.jsonwrites added in feat: LLM review stage for enhanced reachability detection #50 (soapply_reachability_filterre-filter also gets snake_case)Option B — Make EntryPointDetector accept both
One-line change but doesn't align the underlying schema.
Recommendation
Option A. Establish snake_case as the canonical schema, update
tests/test_call_graph_output.pyto assertunit_typeexists in each function entry.References
utilities/agentic_enhancer/entry_point_detector.py:176parsers/javascript/test_pipeline.py:497parsers/go/test_pipeline.py:296