Spine
Turn any repository into a queryable Program Knowledge Graph — symbols, calls, imports, database schema, and documentation, as universal facts that carry provenance back to the line they came from.
Everything here is deterministic and model-free — extraction and the synthesis on top of it. The same commit in always yields the same bytes out, so the output is diffable, cacheable, and safe to gate CI on.
pip install 'spine-pkg[all]'
spine understand . # writes episteme/ — a code-true knowledge base
spine state . # what this repo is today, and how healthy
spine extract . -q handleRequest # who calls it, and what it touches
Because understand is deterministic, spine understand --check belongs in CI: it
re-renders and diffs against the committed episteme, exiting non-zero when the
docs and the code have drifted apart. That makes the knowledge base provably
current rather than hopefully current.
Commands
spine extract [path] |
Scan a repo, print a summary. --query <symbol> shows callers and blast radius; --json dumps facts. |
spine verify [path] |
Check graph invariants — dangling edges, unresolvable provenance, unjoined imports. Exits non-zero on error, so it can stand guard in CI. |
spine export [path] |
Export the whole graph as sqlite, graphml, dot, or json. Writes spine-facts.<ext> unless you pass --out. Never truncated. |
spine understand [path] |
Build a committed episteme knowledge base — architecture, domain model, tech context, conventions, glossary, per-module pages. --check verifies it still matches the code. |
spine state [path] |
A snapshot of what the repo is today and how healthy it looks. --lens developer|stakeholder; --out report.html for a self-contained shareable report. |
spine profile [path] |
Languages, framework, database, test runner, task type. |
spine docs [path] -d FILE |
Reconcile documentation claims against the code graph and report drift. |
spine languages |
Show which language front-ends are active in this install. |
spine media extract PATHS |
OCR images and transcribe audio/video into reviewable artifacts. Opt-in; see below. |
Languages
Python works out of the box with no extra dependencies. Every other front-end lazy-imports its parser, so the base install stays small and you pay only for what you use:
pip install 'spine-pkg[java]' # or typescript, csharp, c, cpp, go, sql
pip install 'spine-pkg[all]' # every front-end at once
If a language's extra isn't installed, its files are invisible to the graph rather
than an error — so spine extract counts them and tells you what to install:
Scanned . — 0 grounded nodes, 0 external, 0 edges.
! 103 Go file(s) found but NOT extracted — install the front-end: pip install 'spine-pkg[go]'
spine languages shows the same thing ahead of time. Both warnings go to stderr, so
extract --json and export stay pipe-safe.
Documents and media
Markdown, reStructuredText, plain text, and HTML parse with the standard library.
PDF needs [docs]; Word and Excel need [office].
spine media extract is deliberately separate from the graph build. It MAY run a
model and be slow, so it is explicit and opt-in: it creates a .spine-media directory
on first run, writes reviewable artifacts there for you to commit, and the
deterministic extractor only ever reads those. Image OCR ([media], plus a system
tesseract binary) and --asr local ([asr]) run entirely on your machine.
--asr api uploads audio and video off-machine and refuses to run without an
explicit --allow-remote.
Caching
Facts are cached per commit under ~/.cache/spine/, and the cache is trusted only on
a clean working tree — a dirty tree always re-extracts, because a stale graph is
worse than a slow one.
Design notes
- The graph is the source of truth. Consumers render facts; they never re-derive
them from paths or filenames. A new fact means extending
facts.pyand the front-ends, not the renderer. - Bounded output is honest output. Aggregations cap their results and record what was elided. Exports are the exception — they are always complete, because the point of handing the graph to another tool is that its filtering is better than ours.
- Local paths only.
spinescans a checkout on disk and never clones for you. - Calls resolve where the source states a type. A method called on a variable
binds when that variable has a parameter or assignment annotation, or comes from a
constructor for a class in the same module. A union of two real types, a rebound
variable, or a
withtarget resolves to nothing — a fabricated edge is worse than a missing one. Annotating a local is what makes its calls visible, which is a good reason to annotate it.
License
MIT
Metadata
Release files for spine-pkg 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| spine_pkg-0.3.0.tar.gz | 267.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spine_pkg-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 485.4 kB
Release files / spine_pkg-0.3.0.tar.gz
| Download URL | spine_pkg-0.3.0.tar.gz |
|---|---|
| Size | 267.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f20382880ad49cc8bf5a3c5cab979af70d58c80571104431bd4c85dcd19a33da
|
|
BLAKE2b-256 checksum How to use checksums |
6ef9d96f0ae5b240ea6fde1db7f1bba9ba029c6a86a3e61a9a469e9af8ff2dea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.
Transparency logRelease files / spine_pkg-0.3.0-py3-none-any.whl
| Download URL | spine_pkg-0.3.0-py3-none-any.whl |
|---|---|
| Size | 217.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ff75231e93d98d3238974e9ca023f3e89990b2e214db9264e7db6afa1faa646
|
|
BLAKE2b-256 checksum How to use checksums |
272e24f3eb0e1eb3153ffa227190d0b5c1e8fc86c616bdd304de25f006757f4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.
Transparency logSecurity for spine-pkg 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for spine_pkg-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.