Skip to main content

Backstitch style spec-code traceability checks and semantic review tooling

Project description

backstitch

Backstitch style spec-code traceability checks and semantic review tooling.

backstitch is a standalone developer tool. It owns the backstitch style v1 traceability grammar, deterministic trace graph construction, and semantic analysis result schemas. This repository's own specs are a primary acceptance corpus. Weft is an external target corpus and eventual consumer, not a package dependency.

Current implementation status: the deterministic checker (backstitch check), review-packet generation (backstitch packets), llm semantic analysis (backstitch analyze, backstitch summarize-analysis), and TOML configuration (backstitch config show|path) are implemented per docs/specs/02-backstitch-core.md, 03-backstitch-configuration.md, and 04-backstitch-traceability-exclusions.md. The invariant traceability spec (05-backstitch-invariants.md) is Proposed and not implemented. This repository dogfoods itself: uv run backstitch check must pass with zero errors and zero warnings.

Testing

The default suite is hermetic — no network, no provider credentials:

uv run pytest tests -q

Optional live LLM tests

tests/live/test_live_llm.py drives the real CLI (packetsanalyzechecksummarize-analysis) over this repository's own specs, calling a real provider through the production adapter. It is skipped unless you opt in with BACKSTITCH_LIVE_LLM=1, so it never runs in the default suite. It asserts structured contracts (one result row per packet, no error rows, schema-valid JSONL) — not model wording or classification, which are not API.

Model choice is intentionally explicit: the test does not fall back to your global llm default, so CI and local runs are reproducible. Use a current GPT-5-series mini model; verify availability with uv run llm models list.

# Using a key stored by `llm` (run once):
uv run llm keys set openai
BACKSTITCH_LIVE_LLM=1 LLM_MODEL=<configured-model> \
  uv run pytest tests/live/test_live_llm.py -q

# Using a provider environment variable instead of a stored key:
OPENAI_API_KEY=... BACKSTITCH_LIVE_LLM=1 LLM_MODEL=gpt-5.4-mini \
  uv run pytest -m live_llm -q

These tests cost money (real provider calls) and can be flaky for reasons unrelated to Backstitch — provider outages, rate limits, model retirement, and nondeterministic output. Keep the packet set small; the live test is a smoke and contract check, not an exhaustive semantic review. In CI the live job is a post-merge canary on main plus an on-demand workflow_dispatch run; it never gates pull requests. See docs/implementation/04-backstitch-style-traceability.md for the boundary rationale.

Release

Backstitch releases use bin/release.py locally and a tag-triggered GitHub release gate. The helper updates pyproject.toml and backstitch/__init__.py together, runs local checks, creates the release commit when needed, and pushes the vX.Y.Z tag. The GitHub workflow publishes to PyPI through Trusted Publishing and creates the GitHub Release.

bin/release.py --version X.Y.Z --dry-run
bin/release.py --version X.Y.Z

See docs/implementation/05-release-publishing.md for setup, rollback, and verification details.

Project details


Download files

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

Source Distribution

backstitch-0.1.0.tar.gz (291.9 kB view details)

Uploaded Source

Built Distribution

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

backstitch-0.1.0-py3-none-any.whl (59.2 kB view details)

Uploaded Python 3

File details

Details for the file backstitch-0.1.0.tar.gz.

File metadata

  • Download URL: backstitch-0.1.0.tar.gz
  • Upload date:
  • Size: 291.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for backstitch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bd123c1a928b210b59b176212e3052c26da59bac800189f3c3238b03524d0bc0
MD5 057d0efb319f43ba20e381f8ca77d9b1
BLAKE2b-256 49983541451ea2e7ac1a8aa900455bb8d02ffcda866a131140131e09d2d5758c

See more details on using hashes here.

File details

Details for the file backstitch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: backstitch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 59.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for backstitch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee06448bab3de71d84b2b4af2da87865a04b8ae404654e22f1287b3cfbb18295
MD5 ce1c1051754f3dc00e778f6488a1c182
BLAKE2b-256 fefe061133af82b03de5e421724e363c18d53d9b941ea511a9ad33166819af9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page