fix(core): wire embedded_python into Python-family indentation-scoping - #2548
Merged
Merged
Conversation
…tion-scoping (tri-comparison sweep) embedded_python is real, brace-less, indentation-scoped Python syntax, but it was registered as a language definition and never added to any of the Python-specific special-case tuples in detector.py/prism.py that make brace-less parsing work: Mode C function-body dispatch, class-body use_indentation_scoping, _CLASS_START_NAMED_EXTRACTION_LANGS, the docstring-harvest-below-signature tuple, the single-line-function bypass tuple, and prism.py's docstring/carry-aware-quote gates (which referenced a stale "micropython" id instead of the real "embedded_python" one). Every function body silently fell through to brace-based slicing, dropping the vast majority of real functions (13 of 82 found in the language-crucible/meow_turtle reference corpus). Fixed by adding embedded_python alongside python in each tuple/allowlist -- the same fix shape already proven for abap/dockerfile/jcl/m4/yacc/haskell in this same dispatcher. Verified: 82/82 functions and 11/11 classes now match ctags exactly (was 13/82), zero args mismatches, 342 extraction/strict tests pass, ruff/mypy clean, full 80-repo crucible_check diff traces entirely to the corrected counts and expected downstream ripple, both golden masters re-blessed. Validates both open tri-comparison ledger shapes for embedded_python (existence: 69 occurrences, args: 1) and closes the recall audit (0 remaining misses). See docs/language_status/embedded_python.md for the full writeup. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
embedded_pythonis real, indentation-scoped Python syntax (no braces at all), but it was registered as a language definition and never added to any of the Python-specific special-case tuples indetector.py/prism.pythat make brace-less parsing actually work (Mode C function-body dispatch, class-body indentation-scoping, the named-class-extraction allowlist, docstring-harvest, single-line-function bypass, and prism's docstring/carry-aware-quote gates, the last of which referenced a stale"micropython"id that isn't a registered language anywhere).{/}happens to appear nearby — dropping the vast majority of real functions (13 of 82 found in thelanguage-crucible/data/embedded_python/meow_turtlereference corpus before this fix).embedded_pythonalongsidepythonto each tuple/allowlist — the same fix shape already established for abap/dockerfile/jcl/m4/yacc/haskell in this same dispatcher.tri_comparison_ledger.jsonshapes for embedded_python (function existence: 69 occurrences, function args: 1) and clears the mandatory recall audit (0 remaining misses). Full writeup indocs/language_status/embedded_python.md.Test plan
tests/extraction/languages/test_embedded_python.py+test_embedded_python_strict.py(342 cases) pass, run alongside thepython/python_strictsuites as a shared-tuple regression checkpython tests/ruff_audit.py --ci/python tests/mypy_audit.py --ci— no new findingsgather_language('embedded_python')name-diff vs. ctags: 0 missing/extra functions, 0 class diffs, 0 args mismatches (per-occurrence, name+line-rank paired) across the whole corpus — was 64 missing beforepython tests/tools/crucible_check.pyagainst the full ~80-repo corpus: 53 mismatches, all traced to embedded_python's own corrected counts or expected downstream ripple (repo-wide aggregates, 3D topology repositioning); zero regressions in any other language's function/class countstests/golden_master_audit.json,tests/golden_master_zero_dep_audit.json) re-blessed viaupdate_golden_master.py --yes, every mismatch line reviewedtri_comparison_chart.py --all --writeregenerated — embedded_python now shows 82/82 functions and 11/11 classes matching ctags exactly (was an unvalidated gap before)🤖 Generated with Claude Code