Skip to content

build: translator extra (tree-sitter-language-pack) with a clear missing-install error - #4430

Merged
squid-protocol merged 1 commit into
mainfrom
feat/translator-extra
Oct 5, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
feat/translator-extra

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Adds an opt-in translator extra for the deterministic COBOL-to-Java translator (gitgalaxy/tools/cobol_to_java/det).

  • pyproject.toml: translator = ["tree-sitter-language-pack"] under [project.optional-dependencies]. Not added to full, which holds the scan engines only. dependencies = [] is unchanged, so a plain pip install gitgalaxy still installs nothing.
  • det/source.cobol_parser() is now the single lazy loader. det/layout._parser() and det/stmt.parse() both go through it. A missing install raises ImportError("the COBOL-to-Java translator needs tree-sitter-language-pack: pip install gitgalaxy[translator]") instead of a bare ModuleNotFoundError. stmt.parse still loads the parser first, before doing any other work.
  • README install block: one line for the extra.
  • Test: test_missing_language_pack_names_the_translator_extra blocks the import and checks that both entry points give the message.

Translator output is unchanged: it is the same parser, loaded the same lazy way.

Other code that loads tree-sitter-language-pack. Nothing else under gitgalaxy/. Outside the package it is loaded only by verification tooling under tests/tools/: tri_comparison_gatherer.py, tri_comparison_ledger.py, tree_sitter_accuracy_audit.py, unicode_gauntlet_vs_treesitter.py, class_start_diff.py, call_graph_accuracy.py, import_graph_accuracy.py, plus their tests. The existing tri-comparison extra and the audit workflows cover those. The det tests importorskip it, and CI's smoke-test pins tree-sitter-language-pack==1.20.0.

Gates: pr_gates.py --fast 5/5 pass. det tests: 29 passed; the JDK and Docker tests skip locally.

🤖 Generated with Claude Code

pyproject gains `translator = ["tree-sitter-language-pack"]` (not in `full`,
dependencies stay empty). det/layout._parser and det/stmt.parse load the
parser through det/source.cobol_parser, which turns a missing install into
"the COBOL-to-Java translator needs tree-sitter-language-pack: pip install
gitgalaxy[translator]". README's install block lists the extra.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 5, 2026 11:23
@squid-protocol
squid-protocol merged commit 367ad90 into main Oct 5, 2026
38 checks passed
@squid-protocol
squid-protocol deleted the feat/translator-extra branch October 5, 2026 11:23
squid-protocol added a commit that referenced this pull request Oct 5, 2026
squid-protocol added a commit that referenced this pull request Oct 5, 2026
Imports: union of #4412's as_fixed_rows/unwrap and #4430's cobol_parser.
Error lines keep #4412's line_of row map. Tests: keep both blocks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz
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