python-semantic

command
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command python-semantic audits the exactness of the Python path over the fixtures of `testdata/python`, in both of the modes the path offers.

The Python path has two producers and they promise different things, so a single number would hide the interesting half. `fallback` runs the bundled AST worker `python-worker/index.py`, whose payload declares `authoritative: false`; the normaliser therefore stamps every relation it reports as CANDIDATE (`internal/pythonloader/loader.go:93` and `internal/facts/semantic.go:295`). Publishing one exact edge from that arm would break the promise, so this harness measures the absence as a first-class property instead of asserting it in a comment. `exact` runs `python-worker/pyright_index.py` against a Pyright language server, whose payload declares `authoritative: true`, and there the question is the usual one: how many of its exact edges are wrong.

The ground truth is written by hand from the fixture sources. Every expectation carries the file and the line it comes from; comparing an index against its own previous output proves nothing.

The artifacts are deterministic: no timestamps and no machine paths, so two runs on the same host produce byte identical files and a regression is visible in the diff. The two toolchain versions are the only host dependent fields, and they are recorded because a measurement of Pyright that does not name Pyright is not reproducible.

Exit status is about the measurement, never about the verdict: it is zero whenever the audit ran and wrote its artifacts, and the verdict lives in the gate token, which is printed on stdout and written into both files. A broken contract is `PYTHON_SEMANTIC_FAIL` there, not a missing report.

Usage:

go run ./benchmarks/python-semantic

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL