HostContract
Evidence-backed OCI host requirement synthesizer.
HostContract answers: which host capabilities are actually necessary for this workload, versus merely observed?
The default policy promotes a capability to a hard requirement only when controlled withholding demonstrates that the workload fails without it.
Quick start
Python 3.10+. No Python runtime dependencies. readelf is optional but used by the included demo.
python -m pip install https://github.com/virajsabhaya23/hostcontract/releases/download/v0.2.0/hostcontract-0.2.0-py3-none-any.whl
gcc -O2 -o demo/probe demo/probe.c
python -m hostcontract synthesize \
--workload demo-image \
--static examples/static.json \
--dynamic examples/dynamic.json \
--experiments examples/experiments.json \
--coverage examples/coverage.json \
--elf demo/probe \
--out out/contract.json \
--nfd-out out/nfd-compat.yaml
Validate:
python -m hostcontract validate out/contract.json examples/good-host.json
python -m hostcontract validate out/contract.json examples/bad-host.json
The bad host exits 2.
Benchmark:
python -m hostcontract benchmark benchmark/corpus.json --out benchmark/results.json
Implemented: static/dynamic evidence ingestion, real ELF/GLIBC inspection with readelf, counterfactual necessity evidence, CPU/syscall/kernel/glibc/device/module/capability modeling, confidence/provenance, coverage-qualified certificates, host-profile capture, known-good/known-bad validation, NFD v1alpha1 YAML generation, and a 30-case static-vs-dynamic-vs-fused benchmark.
Limitations: strace is not bundled in this runtime, so the example imports deterministic syscall observations. GPU/module benchmark cases are controlled host-profile fixtures. NFD has no native matcher for every synthesized feature class; those are preserved under a documented custom feature namespace.
Metadata
Release files for hostcontract 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hostcontract-0.2.1.tar.gz | 12.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hostcontract-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.7 kB
Release files / hostcontract-0.2.1.tar.gz
| Download URL | hostcontract-0.2.1.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dbbe4439349dfaa8d9751493128350ffc44c4e14708d6b44aedb43456116335b
|
|
BLAKE2b-256 checksum How to use checksums |
e40d9c0553a8883364a713670f37fd5616eb3fd5cdaf37886270ca7627899151
|
| 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 16, 2026.
Transparency logRelease files / hostcontract-0.2.1-py3-none-any.whl
| Download URL | hostcontract-0.2.1-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef2dd33a3cbcf5caf0a325cf5b51c85c7076729865404b1c20a66b670c593cce
|
|
BLAKE2b-256 checksum How to use checksums |
3f95db0dc57582a8162fe0aa71013ed1523e74b3ecf95f18a7c4f48e54b8564d
|
| 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 16, 2026.
Transparency log