Skip to content

feat: add built-in Python 3 Language plugin with calibrated Reference ranges - #157

Merged
avidianity merged 1 commit into
mainfrom
feat/python-language-plugin
Nov 22, 2026
Merged

avidianity merged 1 commit into
mainfrom
feat/python-language-plugin

Conversation

@avidianity

Copy link
Copy Markdown
Owner

Summary

Add the built-in Python 3 Language plugin (plugins/languages/python, crate codeint-lang-python, plugin name python), register it in crates/cli and crates/plugin-host Seam 2 conformance tests, calibrate Python's Reference ranges across 20 pre-2023 public Python repositories (ADR 0013), and update all user-facing documentation.

Closes #154
Closes #155
Closes #156

Tier

Tier 3 from the tier check: crates/plugin-host/Cargo.toml and crates/plugin-host/tests/conformance.rs match crates/plugin-host/**, and crates/cli/tests/check.rs updates two existing tests that previously used python as an unknown language plugin.

Task

Spec #154 and Tickets #155 and #156:

  • Implement codeint-lang-python in safe Rust (#![forbid(unsafe_code)]) targeting the modern Python 3 superset (rejecting incompatible Python 2 syntax such as print '...' and <> as unparsable).
  • Measure .py files only, classify Test / Generated / Production Source sets, and discover pyproject.toml ([tool.uv.workspace].members) Workspace packages.
  • Exclude if TYPE_CHECKING: imports from runtime Import cycles and resolve relative, root, and src/-layout imports.
  • Implement five zero-false-positive Flagged-line rules (conditional-yields-boolean, else-after-return, except-only-reraises, if-else-returns-boolean, trailing-bare-return).
  • Wire python into crates/cli and crates/plugin-host Seam 2 conformance tests.
  • Run the 20-repository pre-2023 Python panel, record docs/adr/0013-python-reference-ranges.md, wire calibrated Reference ranges, and update docs (README.md, docs/guide/*, docs/reference.md, llms.txt).

Fail-first test

  • Test: crates/plugin-host/tests/conformance.rs::built_in_python_plugin_passes_seam_2_conformance
  • Before the change: failed with python: expected erosion reference range before wiring the calibrated Reference ranges from ADR 0013.
  • After the change: passed (6 passed; 0 failed across all built-in and Wasm conformance tests).

Checks

Check Result
cargo clippy --workspace --all-targets -- -D warnings passed
cargo test --workspace --locked passed
cargo run --package xtask -- merged-result passed
cargo run --package codeint-cli -- diff origin/main passed (0 new findings, all Production and Test ratios improved)
Pre-commit and commit-msg hooks (links, secrets, duplicates, format, repository, markdown, message) passed

Safety proof

  • Safety fact: codeint-lang-python compiles with #![forbid(unsafe_code)], performs zero filesystem/network I/O, never panics on malformed or Python 2 input, and leaves existing language plugins and the Wasm plugin host runtime untouched.
  • Proof: cargo test --package codeint-lang-python, cargo test --package codeint-plugin-host --test conformance, and cargo test --workspace --locked all passed; the release binary measured 20 public Python repositories (3.5M+ Production lines including home-assistant/core, huggingface/transformers, pytorch/pytorch, django/django, python/cpython) in 4.40s total with 0 panics and 0 unparsable files.
  • interrogate: verified via Seam 2 conformance tests, Python 2 rejection tests, malformed/unterminated string tests, and 20 real-world Python repositories.

Runtime evidence

  • Build revision: a282ce4 (release build on Apple Silicon)
  • Verified codeint check on 20 pre-2023 public Python repositories (docs/adr/0013-python-reference-ranges.md): django/django (116,838 Prod lines in 0.33s), home-assistant/core (671,942 Prod lines in 0.73s), huggingface/transformers (580,324 Prod lines in 0.85s), python/cpython (291,724 Prod lines in 0.46s), 0 unparsable files across the full 20-repository panel.

Gaps

  • Deferred coverage: none
  • Pre-existing failures: none
  • Environmental failures: none

@github-actions github-actions Bot added the tier-3 Tier 3 from the tier check label Nov 22, 2026
@avidianity
avidianity merged commit 5132520 into main Nov 22, 2026
13 checks passed
@avidianity
avidianity deleted the feat/python-language-plugin branch November 22, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tier-3 Tier 3 from the tier check

Projects

None yet

1 participant