Specification engineering plane — PRD-to-SpecPack compiler for the ABI ecosystem
Project description
abi-spec
Specification compiler with content-addressed SpecPacks, requirements traceability, and spec-driven development with drift detection. Part of the Planning Pack (Layer 2).
Depends on abi-control-core for schema validation.
Install (after PyPI publication)
pip install abi-spec
Status: Not yet published to PyPI. Install from source:
pip install -e .from the repo root. Requiresabi-control-core.
Quick start
Compile a SpecPack from PRD JSON
from abi_spec.compiler import compile_prd_json_to_specpack
# Compile a PRD JSON file into a content-addressed SpecPack
result = compile_prd_json_to_specpack(
prd_json_path="runs/latest/prd.json",
out_dir="specs/feature_x/",
)
print(result["manifest_hash"]) # SHA-256 of the spec manifest
print(result["prd_hash"]) # SHA-256 of the input PRD
Spec-driven development with drift detection
from pathlib import Path
from abi_spec.sdd.spec_tracker import SpecTracker
# Initialize tracker (stores metadata in .abi/ by default)
tracker = SpecTracker(tracking_dir=Path(".abi"))
# Track a spec and link it to implementing code paths
tracker.track(spec_path="specs/auth.md", code_paths=["src/auth/"])
# Detect drift between spec and code (time-based + hash-based)
drift = tracker.detect_drift(spec_path="specs/auth.md", code_paths=["src/auth/"])
if drift.has_drift:
print(drift.details) # e.g., "Code updated without spec update — drift detected"
Requirements traceability
from abi_spec.traceability import generate_requirements_index
# Generate a traceability index from structured requirements
requirements = [
{
"id": "REQ-001",
"title": "User Authentication",
"text": "System shall authenticate users",
"acceptance": ["Given valid token, When request, Then access granted"],
"source_prd_section": "Security.Authentication",
},
]
index = generate_requirements_index(requirements)
# Returns list of dicts with req_id, title, acceptance_criteria, source_prd_section
What's included
- SpecPack compiler -- compile PRD JSON into content-addressed, schema-validated specification packages
- Requirements traceability -- REQ-ID tracking with structured index generation
- Acceptance criteria parsing -- Given/When/Then extraction from structured requirements
- Spec-driven development --
SpecTrackerwith SHA-256 content hashing for drift detection - Drift detection -- identify when specs and code are out of sync (time-based and hash-based)
ABI ecosystem
abi-spec is part of the Planning Pack (Layer 2), built on top of abi-control-core (Layer 1).
Related packages:
- abi-control-core -- contracts and audit trail SDK (Layer 1, required)
- abi-prd -- structured PRD generation (Layer 2)
- abi-evals -- eval runner for validating spec compliance
Versioning
Follows Semantic Versioning. Current version: 0.2.0. See CHANGELOG.md for release notes.
License
MIT License (see LICENSE file).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file abi_spec-0.3.0.tar.gz.
File metadata
- Download URL: abi_spec-0.3.0.tar.gz
- Upload date:
- Size: 60.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
543ef7a0aebae3b1109f3afcace24704db55762b22ebd3124180d2a9cbe0a75f
|
|
| MD5 |
55e607358e4d4f4e180079c624028e0e
|
|
| BLAKE2b-256 |
3ecaee89b5753859caca8a1af887fd8a904649aca408696e1cce256ea59fe77f
|
Provenance
The following attestation bundles were made for abi_spec-0.3.0.tar.gz:
Publisher:
publish.yml on AbilityBI/abi-spec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abi_spec-0.3.0.tar.gz -
Subject digest:
543ef7a0aebae3b1109f3afcace24704db55762b22ebd3124180d2a9cbe0a75f - Sigstore transparency entry: 1102554984
- Sigstore integration time:
-
Permalink:
AbilityBI/abi-spec@97915ac495faa4d9775d83fcbe8712e4452b896f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/AbilityBI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@97915ac495faa4d9775d83fcbe8712e4452b896f -
Trigger Event:
push
-
Statement type:
File details
Details for the file abi_spec-0.3.0-py3-none-any.whl.
File metadata
- Download URL: abi_spec-0.3.0-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e3b7142f1b715c1c426df2d99158bb38d57325a40cefd18223020ff412cef45
|
|
| MD5 |
b3b7d23c9341e3006b33ecba83e7e6ff
|
|
| BLAKE2b-256 |
eb05bf0177fad860383ab3b98c66c9becccf1fe495c54a0e0e612ded94d3e502
|
Provenance
The following attestation bundles were made for abi_spec-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on AbilityBI/abi-spec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abi_spec-0.3.0-py3-none-any.whl -
Subject digest:
7e3b7142f1b715c1c426df2d99158bb38d57325a40cefd18223020ff412cef45 - Sigstore transparency entry: 1102554985
- Sigstore integration time:
-
Permalink:
AbilityBI/abi-spec@97915ac495faa4d9775d83fcbe8712e4452b896f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/AbilityBI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@97915ac495faa4d9775d83fcbe8712e4452b896f -
Trigger Event:
push
-
Statement type: