Skip to main content

astp-docs

The retrieval core library behind the ASTP documentation servers. Corpus-agnostic and transport-agnostic: it turns a specification corpus into exactly-citable retrieval, and the servers are thin packages on top.

  • Open server (public): astp-docs-server — MCP transport for coding agents + a web-chat head.
  • Enterprise server (private): a separate license-gated server over the proprietary corpus.

Both depend on this library; neither logic nor corpus content crosses between them. The open/proprietary boundary is enforced by separate corpora, not a runtime filter.

What's in here

astp_docs/
  toolkit.py            # shared tool logic — search_spec / get_governance_rule /
                        #   get_conformance_vectors / get_section / get_hash_preimage /
                        #   corpus_info; pure functions over a Retriever, no transport dep
  core/
    corpus.py           # CorpusSpec + loader (the only thing that differs per server)
    chunker.py          # structure-aware chunker for the specification genre
    index.py            # exact-lookup index (sections, governance rules, conformance vectors)
    retriever.py        # query API: exact lookup + vector search
    embeddings.py       # pluggable Embedder (offline TF-IDF default; OpenAI optional)
    store.py            # pluggable VectorStore (in-memory default)
    models.py, text.py

The chunker is structure-aware

The corpus is a specification, not prose. Its retrieval units are exact objects, and the chunker splits on their real boundaries so lookups are deterministic:

  • numbered sections — ## 6. Governance Rules, ### 2.5.1 …
  • governance rules G-1 … G-43 (as of SPEC 6.0.0) — written four ways (heading, bold paragraph, bullet, blockquote), all normalized to one anchor space
  • conformance vectors — **WF-001** — …, CEL-003, …

Vector search (Retriever.search) is a pluggable Embedder + VectorStore; the default is an offline, keyless TF-IDF model over a numpy in-memory store, so the deterministic exact-lookup path never depends on an embedding backend.

Develop

pip install -e '.[embeddings,dev]'
python -m pytest tests/ -q     # self-contained (synthetic corpora; no external deps)

Live-corpus checks (against a real astp checkout) live in the server repos, since the corpus spec is a server concern.

Metadata

Release files for astp-docs 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for astp-docs 0.2.0
File Size Uploaded
astp_docs-0.2.0.tar.gz 24.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for astp-docs 0.2.0
File Interpreter ABI Platform
astp_docs-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 49.5 kB

Release files / astp_docs-0.2.0.tar.gz

Download URL astp_docs-0.2.0.tar.gz
Size 24.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d8a36fe7e85f8386c287543ec8267b59bdbfa257539003697324b017aa22cafc
BLAKE2b-256 checksum
How to use checksums
c26ceed8dd6af28344571cd76303f468a784145b378a0ce80e14c54ae7f03d21
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 Oct 8, 2026.

Transparency log

Release files / astp_docs-0.2.0-py3-none-any.whl

Download URL astp_docs-0.2.0-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5021418f7d7e774593e1fc8336d669e2f9a0a4a515e5fdd8c4a36e0bdda5cbb0
BLAKE2b-256 checksum
How to use checksums
78e56f1ee2831a6f93eafbc60a23a23c31d3c6b317f6abb15306d6655a6ef6ed
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 Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release 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