Skip to content

fix(core): wire embedded_python into Python-family indentation-scoping - #2548

Merged
squid-protocol merged 1 commit into
mainfrom
tri-comparison/embedded-python-validation
Aug 31, 2026
Merged

fix(core): wire embedded_python into Python-family indentation-scoping#2548
squid-protocol merged 1 commit into
mainfrom
tri-comparison/embedded-python-validation

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

  • embedded_python is 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 in detector.py/prism.py that 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).
  • Every real function body silently fell through to brace-based slicing, which only "succeeds" when a stray {/} happens to appear nearby — dropping the vast majority of real functions (13 of 82 found in the language-crucible/data/embedded_python/meow_turtle reference corpus before this fix).
  • Fixed by adding embedded_python alongside python to each tuple/allowlist — the same fix shape already established for abap/dockerfile/jcl/m4/yacc/haskell in this same dispatcher.
  • Validates both open tri_comparison_ledger.json shapes for embedded_python (function existence: 69 occurrences, function args: 1) and clears the mandatory recall audit (0 remaining misses). Full writeup in docs/language_status/embedded_python.md.

Test plan

  • tests/extraction/languages/test_embedded_python.py + test_embedded_python_strict.py (342 cases) pass, run alongside the python/python_strict suites as a shared-tuple regression check
  • python tests/ruff_audit.py --ci / python tests/mypy_audit.py --ci — no new findings
  • Direct gather_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 before
  • python tests/tools/crucible_check.py against 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 counts
  • Both golden masters (tests/golden_master_audit.json, tests/golden_master_zero_dep_audit.json) re-blessed via update_golden_master.py --yes, every mismatch line reviewed
  • tri_comparison_chart.py --all --write regenerated — embedded_python now shows 82/82 functions and 11/11 classes matching ctags exactly (was an unvalidated gap before)

🤖 Generated with Claude Code

…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>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit a31f354 into main Aug 31, 2026
30 checks passed
@squid-protocol
squid-protocol deleted the tri-comparison/embedded-python-validation branch August 31, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant