Repository navigation
fix(abap): named class list and class-scope-end truncation (found regenerating the chart) - #1908
Merged
Merged
Conversation
…hart Found while regenerating docs/self_scan/tri_comparison_chart.svg after #1898/#1899 merged -- Functions Found correctly jumped to 124, but Classes Found stayed blank despite struct_class_start already showing 2 per file. Fixes #1904: detector.py's named-class extraction only reuses a language's own class_start rule when it's listed in _CLASS_START_NAMED_EXTRACTION_LANGS (epic #1295) -- every other language falls through to a generic legacy regex (class|struct|interface|trait|enum, no re.I). ABAP was never added, likely because the epic's own verification method (tree_sitter_accuracy_audit.py against tree-sitter ground truth) structurally can't run for a language with no tree-sitter grammar. Real ABAP classes are always uppercase (CLASS <name> DEFINITION), so the case-sensitive fallback could never match regardless of #1898's fix -- class_data stayed permanently empty. Added abap to the allowlist, using the verification already done in docs/language_status/abap.md (100% precision, direct source cross-check) in place of the epic's tree-sitter method. Fixes #1907: found while verifying #1904's fix -- zcl_abapgit_objects has 30 real methods but its class entry showed method_count=2. splice()'s class-boundary resolver tries a brace-delimited body search first and only falls back to the flat "next class match" boundary if no brace is found. ABAP has no brace-delimited bodies, but DOES have string-template interpolation syntax (|Object { name }|) containing real braces that _build_brace_safe_stream doesn't know to shield -- the search mistook the interpolation brace for the class's real body opener and truncated the scope after the first couple of methods. Since ABAP classes are never nested, the existing flat fallback is always correct -- skip the brace search entirely for abap. Both bugs live in the SQLite recorder's named-class-list path (class_data), which golden_master_audit.json doesn't exercise at all -- crucible_check.py passes with zero drift both before and after, verified instead via tri_comparison_gatherer.gather_language() and a direct --db-only scan. Full extraction suite (6128 tests) and full test suite (7004 tests) both pass clean. Regenerated docs/self_scan/tri_comparison_chart.svg and tri_comparison_ledger.json -- abap now shows Functions Found: 124, Classes Found: 12 (DEFINITION+IMPLEMENTATION pairs, matching the engine-wide convention already established for objective-c). Diff confirmed scoped to abap only; no other language's row changed. Updated docs/language_status/abap.md with both fixes' evidence, and added a "re-verify after every fix, not just once" gotcha to tri-comparison-ledger-sweep's SKILL.md -- this session found 4 independent bugs by re-checking each fix against real output instead of stopping at the first green result. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Found while regenerating
docs/self_scan/tri_comparison_chart.svgafter #1898/#1899 merged: "Functions Found" correctly jumped to 124, but "Classes Found" stayed blank despitestruct_class_startalready showing 2 per file. Root-caused two more real, independent bugs.detector.py's named-class extraction only reuses a language's ownclass_startrule when it's listed in_CLASS_START_NAMED_EXTRACTION_LANGS(epic Extend #1264's per-language class_start named-entity extraction to the remaining 13 languages #1295); every other language falls through to a generic legacy regex (class|struct|interface|trait|enum, nore.I). ABAP was never added -- likely because the epic's own verification method (tree_sitter_accuracy_audit.pyagainst tree-sitter ground truth) structurally can't run for a language with no tree-sitter grammar. Real ABAP classes are always uppercase (CLASS <name> DEFINITION), so the case-sensitive fallback could never match regardless of prism.py: ABAP's positional comment stripper reuses Fortran/COBOL's column-1 anchor set, erasing real code as comments #1898's fix --class_datastayed permanently empty. Addedabapto the allowlist, using the verification already done indocs/language_status/abap.md(100% precision, direct source cross-check) in place of the epic's tree-sitter method.zcl_abapgit_objectshas 30 real methods but its class entry showedmethod_count=2.splice()'s class-boundary resolver tries a brace-delimited body search first and only falls back to the flat "next class match" boundary if no brace is found. ABAP has no brace-delimited bodies, but DOES have string-template interpolation syntax (|Object { name }|) containing real braces that_build_brace_safe_streamdoesn't know to shield -- the search mistook the interpolation brace for the class's real body opener and truncated the scope after the first couple of methods. Since ABAP classes are never nested, the existing flat fallback is always correct -- skip the brace search entirely forabap.Verification
Both bugs live in the SQLite recorder's named-class-list path (
class_data), whichgolden_master_audit.jsondoesn't exercise at all --crucible_check.pypasses with zero drift both before and after this change, verified instead viatri_comparison_gatherer.gather_language()and a direct--db-onlyscan. Regeneratedtri_comparison_chart.svg/tri_comparison_ledger.json-- abap now showsFunctions Found: 124,Classes Found: 12(DEFINITION+IMPLEMENTATIONpairs, matching the engine-wide convention already established for objective-c). Diff confirmed scoped to abap's own row only; no other language changed (ledger diff is timestamp/anonymous-placeholder-hash noise from the full re-gather, not content changes).Test plan
tests/extraction/languages/(6128 tests) pass.python -m pytest tests/-- 7004 passed, 2 skipped, 11 xfailed, 3 xpassed.python tests/tools/crucible_check.py-- both modes pass, zero drift (expected -- these bugs aren't in the fixtures' coverage).python tests/tools/audit_check.py-- ruff/mypy/dead-key/ast-accuracy all clear.docs/language_status/abap.md§9 updated with both fixes' evidence.tri-comparison-ledger-sweep'sSKILL.mdupdated with a "re-verify after every fix" gotcha -- this investigation found 4 independent bugs total by re-checking each fix against real output instead of stopping at the first green result.🤖 Generated with Claude Code