Documentation / Reference

Review Distribution Inputs

06 - Reference · Explore documentation

Install reviewed distributions

The distribution name is context-coherence, the Python import namespace is co2, and the project brand is Co2. The base version is 0.1.0. Only base wheels and the source distribution belong on the public index. Native feature builds retain distinct private +native.* versions; see native variants and upgrade rules.

Install a reviewed local wheel matching your interpreter and platform:

python -m pip install /path/to/the/matching.whl
python tools/verify_installation.py --variant base --wheel /path/to/the/matching.whl

Install the base package or an optional framework extra from PyPI:

python -m pip install 'context-coherence==0.1.0'
python -m pip install 'context-coherence[langgraph]==0.1.0'
python -m pip install 'context-coherence[openai-agents]==0.1.0'
python -m pip install 'context-coherence[google-adk]==0.1.0'
python -m pip install 'context-coherence[claude-agents]==0.1.0'

Extras install optional Python dependencies; they cannot activate persistence or native providers absent from a base wheel. Build requirements and local installation remain in the installation guide.

Match supported platforms

Every release bundle must contain all of the following interpreter-specific base wheels and one context_coherence-0.1.0.tar.gz source distribution:

Build/installation runnerArchitectureCPython / ABI pairsExact platform tagWheel count
ubuntu-24.04x86_64cp311-cp311, cp312-cp312, cp313-cp313, cp314-cp314manylinux_2_34_x86_644
ubuntu-24.04-armARM64Same four pairsmanylinux_2_34_aarch644
macos-26Apple SiliconSame four pairsmacosx_11_0_arm644

Example: context_coherence-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl. Only standard GIL-enabled CPython 3.11–3.14 is in this matrix. There are no abi3, free-threaded, Windows, macOS Intel, musllinux or universal wheels. Configuring this matrix is not a claim that its unexecuted jobs passed. The capability matrix defines the qualified runtime and storage boundaries.

manylinux_2_34 promises a compatible glibc 2.34+ ABI on the named architecture, not glibc 2.17 / manylinux2014 or Alpine/musl portability. Retained native Linux artifacts have this tag and auditwheel reports identify GLIBC_2.34 requirements. The candidate must independently pass the same floor: mismatched tags or auditwheel reports block sealing. The publisher does not retag an artifact. A build on a newer host is not permission to claim an older manylinux floor. See PyPA compatibility tags.

The macOS tag is the binary deployment target, not evidence of tests on every macOS version from 11 onward. Hosted clean installation is tested on the named runner; existing runtime qualification remains limited to documented hosts. Source installs require the pinned Maturin build backend, Rust/Cargo 1.95+ and a native toolchain; unsupported platforms do not become qualified merely because an sdist is available.

Review source inputs

No package is published by these commands. Build proposed distributions from the reviewed source allowlist, then audit the actual archives. .gitignore and Maturin exclusions are additional safeguards; neither replaces inspecting built artifacts.

python -m pip install --require-hashes -r requirements/build.txt
python -m unittest tools.test_release tools.test_distribution_contract -v
python tools/prepare_source.py --out /tmp/co2-source-candidate

Use a previously nonexistent output directory. The helper stages reviewed inputs, builds and audits the source archive, safely extracts it, verifies every reviewed file hash and writes source.build.json. From the printed extracted source directory, build a candidate:

python tools/build_release.py --variant base --out /tmp/co2-base-candidate
python tools/check_release.py --artifact /path/to/the/actual.whl

Replace the artifact path with the actual output. Build optional native variants from the same extracted source using explicit variant names. Each wheel has a .build.json sidecar binding its complete SHA-256, version, native features, source file hashes, compiler and interpreter. Retain both files. The sidecar is unsigned build provenance for review; it neither proves a trusted build environment nor grants dependency assurance.

Install each candidate into a clean environment and execute tools/verify_installation.py from outside the source directory. Wasmtime variants also need the pinned Wasmtime Python runtime. Inspect native links with otool -L on macOS or ldd/readelf and auditwheel show on Linux; validate wheel tags on the actual interpreter/architecture. Audit-tool, build-tool and test-tool requirements have separate hash-locked files under requirements/.

release-manifest.txt enumerates reviewed regular files, including source, public guides, examples, tests, optional providers, pinned locks and licensing. The checker rejects private evidence directories, environment files, workstation references in public prose, archives, PDF design references, links and credential-shaped assignments. New active source/tests/workflows must be added explicitly. It audits archive members and bytes; it is a bounded hygiene check, not a universal secret detector or substitute for owner review of Git history.

tools/build_release.py rejects unreviewed caller compiler/cross-build overrides and supplies source/home/temporary-directory remappings for Rust and bundled C diagnostics. The audit rejects known workstation/build paths in native binaries. Raw development builds can retain such paths; audit proposed release wheels rather than assuming that stripping debug symbols removes them.

Base wheels contain no runtime providers or SQLite feature. For a feature build, select an explicit --variant from the installation contract; its private local version identifies the selected native features. Verify co2.persistence_available() and available_provider_implementations() in each installed wheel; an extra cannot change a wheel's compiled features. Clean base and durable installations are distinct validation cases.

Review release security

The public base candidate uses GitHub-hosted runners and promotes source-bound artifacts without rebuilding during publication. Checks cover the complete supported base-wheel matrix, clean installations, native/provider regressions, dependency policies, package identities, source revisions, checksums and candidate freshness. Private feature wheels are excluded from public publication. Routine CI uses path selection; every release candidate runs the complete routine suites again for its exact source commit before it can be promoted.

Publication is manual. The same validated artifact bytes must pass TestPyPI installation checks before administrator-authorised production publication. SHA-pinned actions use short-lived OIDC credentials only in publishing jobs and produce provenance attestations; persistent PyPI API tokens are not required. Administrator-owned manual dispatch, main-only deployment restrictions, serialized publication and duplicate rejection remain enforced by the release workflow. No push or tag automatically publishes a package.

Audit Locked Components

Install the pinned Rust scanner with cargo install --locked cargo-deny --version 0.22.2. Run python tools/audit_dependencies.py --out /tmp/co2-audit with a new output directory. Cargo-deny performs RustSec advisory, licence, source and dependency-ban checks; no other Rust advisory executable is required.

The runner covers every public Cargo lock: Core, Python bridge, provider host, provider SPI, expression provider and Wasmtime provider. It checks default/all-feature graphs, Core admission/persistence and all eight bridge variants (21 configurations). Metadata resolution is locked and no target filter is applied.

Per-lock inventory checks make every captured package an audit root, preserving its real identity, version, source, features and dependency edges; the scanner must confirm that it received every locked package. This includes optional packages that ordinary reachability pruning could omit. The audit-root projection does not change Cargo manifests/locks or claim that every inventoried crate is linked in a binary.

Unknown/new public lock files fail until coverage is explicitly added. This is dependency-graph validation, not additional platform execution.

Vulnerability/notice advisories fail. Transitive unsoundness and unmaintained advisories are included with no advisory ignores or severity suppression. The existing licence allowlist, source restrictions, duplicate-version warnings and yank warnings are retained.

Known yanked packages remain visible; a warning is not silently converted into a vulnerability exemption. The runner checks the exact scanner version and complete check summaries, refreshes the official RustSec/index data once, then evaluates all graphs against that snapshot. JSON reports identify the database revision/date, policy/lock hashes, scanner binary and individual check results.

--offline explicitly uses cached data with the configured freshness limit; missing/invalid advisory data fails.

For scanner self-verification, pass --tool-manifest pointing to the installed cargo-deny-0.22.2/Cargo.toml in Cargo's registry source cache. Candidate CI requires this additional advisory check and complete scanner-lock coverage. Tool dependencies belong in a separate tooling inventory, not the Co2 product inventory. Optional Python packages and Python build/test tools retain their separate audit/licence requirements.

Security-only runs do not regenerate product SBOMs. Use --write-native-sbom explicitly only when the independent native inventory needs updating. That CycloneDX 1.6 inventory covers all native features and target/build dependencies, bundled SQLite and Rust std; each wheel links its enabled subset. Retain the original product inventories and wheel provenance when reviewing tooling-only or documentation-only source changes. THIRD_PARTY_NOTICES.md and LICENSES/ preserve bundled notices; optional Python packages retain their own distribution notices. Automated audit results are time-bound evidence, not a guarantee of vulnerability or secret absence.

A source archive refreshed after a tooling-only change has a new source hash. Preserve earlier wheel hashes/sidecars against their original source baseline and record the source delta; do not relabel old wheels as builds of the refreshed source or rebuild product artifacts solely to change tooling provenance.

Keep the exact source hashes, locks, source archive, wheel sidecars, native link reports, audit database revision, test results and SHA-256 artifact inventory together. Independently repeat builds before asserting byte reproducibility. Review proposed tracked files and available Git objects separately: an archive allowlist cannot sanitize existing repository history. A committed reviewed baseline, repository ownership, platform gates and explicit owner publication approval remain separate release prerequisites.

Advisory behavior is documented in the official cargo-deny guide and configuration reference. Release validation uses pinned 0.22.2; future tool upgrades require renewed coverage/rejection checks.