Skip to main content

loomweave-plugin-python

The Python language plugin for Loomweave. Extracts Python entities from source files and serves them to the Loomweave core over the JSON-RPC protocol defined in WP2 L4.

Status: Python structural extractor. It emits modules, classes, functions, contains, calls, references, imports, and versioned entity signatures for Stable Entity Identity (SEI) matching. It also reads Wardline's NG-25 trust-vocabulary descriptor without importing Wardline and emits source-observed Wardline decorator metadata/tags on decorated entities when a descriptor is available.

Install (development)

python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'

This places loomweave-plugin-python on your $PATH and installs the dev-time toolchain (ruff, mypy, pytest, pytest-cov, pre-commit).

ADR-023 tooling gates

Every commit must pass all four:

ruff check plugins/python
ruff format --check plugins/python
mypy --strict plugins/python
pytest plugins/python

CI runs the same four gates in the python-plugin job.

Interpreter discovery

pyright-langserver type-checks against whatever python it finds — the plugin points it at the project's own interpreter deterministically, rather than trusting whatever happened to be first on the launching process's PATH (clarion-5cf9643de9). discover_project_interpreter (src/loomweave_plugin_python/interpreter.py) walks a fixed order and stops at the first usable candidate — a regular file (Path.is_file()) that passes os.access(path, os.X_OK):

Rung Source Pinned?
1 LOOMWEAVE_PYTHON_INTERPRETER env var names an executable file yes
2 <project_root>/.venv/bin/python yes
3 $VIRTUAL_ENV/bin/python yes
4 $CONDA_PREFIX/bin/python yes
5 first python / python3 on PATH no
6 nothing found no

An empty env value counts as unset at every rung. The returned path is absolute and lexically normalised but never symlink-resolved — a venv's bin/python is typically a symlink to the base interpreter, and pyright needs the symlink path to stay inside the venv's site-packages.

This order is a cross-language contract shared with the Rust host (crates/loomweave-core/src/plugin/interpreter.rs); the host runs the same discovery and, for a [capabilities.runtime.pyright] plugin, exports its pinned answer to the child as LOOMWEAVE_PYTHON_INTERPRETER (unless the operator already set it). The plugin's own discovery therefore sees the host's choice at rung 1 whenever the host found one.

When discovery lands on rung 5 or 6 (no project-owned interpreter), an otherwise-complete calls/references facet is honestly demoted to degraded with reason interpreter_unpinned — cross-module call/reference targets may be missing because pyright resolved against a guessed interpreter, even though nothing else went wrong. Fix it by creating .venv in the project root or setting LOOMWEAVE_PYTHON_INTERPRETER to the project's interpreter. See ADR-058 for the full design and the interpreter_unpinned coverage semantics.

Design references

  • WP3 plan — task ledger, lock-ins, and UQ resolutions.
  • ADR-003 — 3-segment EntityId format this plugin produces.
  • ADR-018 — cross-product identity join with Wardline.
  • ADR-022 — manifest schema and ontology-boundary enforcement.
  • ADR-023 — the four Python gates and the pre-commit setup.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loomweave_plugin_python-1.5.1.tar.gz (213.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loomweave_plugin_python-1.5.1-py3-none-any.whl (81.8 kB view details)

Uploaded Python 3

File details

Details for the file loomweave_plugin_python-1.5.1.tar.gz.

File metadata

  • Download URL: loomweave_plugin_python-1.5.1.tar.gz
  • Upload date:
  • Size: 213.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for loomweave_plugin_python-1.5.1.tar.gz
Algorithm Hash digest
SHA256 084c9a92bc0aa98ff9fa166d219a09e416b75904c274afe4c1824edcb1d16a03
MD5 c298f19168536ad82d9b89c5a2624e2c
BLAKE2b-256 986c7f6c3fed667ecfcdf8777a1cb52cd0b850cc431f909563c5c41cdbc08d7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for loomweave_plugin_python-1.5.1.tar.gz:

Publisher: release.yml on foundryside-dev/loomweave

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file loomweave_plugin_python-1.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for loomweave_plugin_python-1.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a7084268b4903dd3bb7ce1ea1bd47d091ed8b95620f31ada5e0d5996a11c19c
MD5 60a23b2b073873d52edee94ac5d244f3
BLAKE2b-256 2add2f5296f82ef8c9e90fe2a2666321c810bb38abec5097917880b4ecb944ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for loomweave_plugin_python-1.5.1-py3-none-any.whl:

Publisher: release.yml on foundryside-dev/loomweave

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.6.1

2 files

1.6.0

2 files

This release

1.5.1 This release

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page