forge-spec
Spec-Driven Development for the Forge agent harness.
Define what an agent run must achieve (spec.yaml), verify it against real
RunResult output, and generate SLSA Level 2-inspired attestations for
compliance and audit trails.
Installation
pip install forge-spec
# With LLM-assisted spec refinement:
pip install forge-spec[llm]
Quick start
from forge_spec import SpecDef, AcceptanceCriterion, SpecRunner
spec = SpecDef(
name="no-show-optimizer",
description="Reduce appointment no-show rate",
objectives=["Reduce no-show rate by 15%"],
acceptance_criteria=[
AcceptanceCriterion(
id="ac-001",
description="Run completes successfully",
check_type="assertion",
expected="run_result.status == 'completed'",
),
AcceptanceCriterion(
id="ac-002",
description="Output contains recommendations",
check_type="contains",
expected="recommendation",
),
],
)
runner = SpecRunner()
verify_result, attestation = await runner.run_pipeline(spec, run_result)
print(f"Compliance: {verify_result.compliance_rate:.0%}")
spec.yaml format
name: no-show-optimizer
version: "0.1.0"
description: Reduce appointment no-show rate
objectives:
- Reduce no-show rate by at least 15%
constraints:
- id: no-model-swap
description: Preserve the primary LLM model during evolution
mutation_kinds_blocked:
- model_swap
acceptance_criteria:
- id: ac-001
description: Run must complete successfully
check_type: assertion
expected: "run_result.status == 'completed'"
weight: 2.0
- id: ac-002
description: Output mentions recommendations
check_type: contains
expected: recommendation
risks:
- id: risk-001
description: Model hallucination in recommendations
likelihood: 0.3
impact: 0.8
mitigation: Use structured output validation
Technical debt
See DEVLOG.md for DT entries introduced in Phase 4.
Metadata
Release files for forge-spec 0.2.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 | Actions |
|---|---|---|---|---|
| forge_spec-0.2.0.tar.gz | 13.6 kB | Without provenance | Details for forge_spec-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| forge_spec-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for forge_spec-0.2.0-py3-none-any.whl |
Total release size: 24.7 kB
Release files / forge_spec-0.2.0.tar.gz
| Download URL | forge_spec-0.2.0.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fb4c9ca136cb487c717ceee3c7529371071be37335f36c712a45c914c009843
|
|
BLAKE2b-256 checksum How to use checksums |
9bd01ac5f3a984c1d43855589cbc7fd4200387f0b6e8abe832b145ec2e9f896a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / forge_spec-0.2.0-py3-none-any.whl
| Download URL | forge_spec-0.2.0-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df9a70a432c09afd81516dd2fd5c88215adbba68c4b70426d39e13830f7e60f8
|
|
BLAKE2b-256 checksum How to use checksums |
5af01cd0f9debb26b78898e3d1d77919e8852514dfa0c0ddfe751f081bbf7f5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for forge-spec 0.2.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.