intentcis implemented in Python.- Use
uvfor environment management, dependency resolution, and command execution.
- Runtime manager:
uv - Pinned Python:
3.14.2 - Install or refresh the environment:
uv sync --dev - Run commands inside the environment:
uv run <command>
Core libraries:
PyYAMLfor intent authoring inputjsonschemafor schema validationtyperfor theintentcCLIpytestandrufffor test and lint workflows
- Keep modules small and organized around one compiler concern each.
- Use type hints on public functions and prefer explicit return types.
- Favor pure functions for normalization, validation, and artifact generation.
- Use
pathlibfor filesystem paths and keep I/O at the edges of the codebase. - Represent structured compiler data with dataclasses or typed mappings instead of loose dict mutation.
- Raise explicit, domain-specific errors for schema, normalization, and compile failures.
- Keep output deterministic by sorting keys and normalizing ordering before serialization.
- Cover behavior with
pytestand keepruffclean before committing.
- Intent example:
docs/intents/webhook-idempotency.intent.yaml - Implementation plan:
planning/intentc/implementation-plan.md - Execution backlog:
planning/intentc/backlog.yaml - Enforcement plan:
planning/intentc/enforcement-implementation-plan.md - Enforcement backlog:
planning/intentc/enforcement-backlog.yaml - Enforcement prompt:
prompts/02-intentc-enforcement.prompt.md - Traceability template:
planning/intentc/traceability-matrix-template.yaml - Risk/decisions:
planning/intentc/risk-and-decisions.md - Enforcement risks/decisions:
planning/intentc/enforcement-risk-and-decisions.md - Intent schema:
tools/intentc/schema/intent-package-v1alpha1.schema.json - Compiler spec:
tools/intentc/spec/compiler-pipeline.md - Generation manifest schema:
tools/intentc/spec/generation-manifest.schema.json
Use the sample intent in docs/intents/webhook-idempotency.intent.yaml.
Validate the raw intent package against the schema:
uv run python -m intentc validate docs/intents/webhook-idempotency.intent.yamlCompile the intent into normalized artifacts:
uv run python -m intentc compile docs/intents/webhook-idempotency.intent.yaml --out /tmp/intentc-buildThis writes:
/tmp/intentc-build/normalized.intent.json/tmp/intentc-build/traceability.graph.json/tmp/intentc-build/clauses.index.json/tmp/intentc-build/reports/coverage-map.json/tmp/intentc-build/reports/missing-coverage.json/tmp/intentc-build/tests/*.feature/tmp/intentc-build/tests/test_inv_*.py/tmp/intentc-build/policies/**/tmp/intentc-build/runtime/**/tmp/intentc-build/generation-manifest.json
Regenerate just the manifest from an existing normalized build:
uv run python -m intentc generation-manifest /tmp/intentc-build/normalized.intent.jsonRun the full executable enforcement stack:
uv run python -m intentc verify docs/intents/webhook-idempotency.intent.yaml --out /tmp/intentc-verifyintentc verify is the canonical local and CI entry point. It validates the intent, compiles deterministic artifacts, executes the generated pytest-bdd scenarios and invariant tests, runs OPA and Semgrep policy gates, enforces clause traceability and coverage thresholds, and writes the machine-readable verification result into /tmp/intentc-verify/generation-manifest.json.
The manifest verification block is the source of truth for enforcement status:
{
"verification": {
"status": "pass",
"stages": [
{"name": "bdd", "status": "pass"},
{"name": "invariants", "status": "pass"},
{"name": "policies", "status": "pass"},
{"name": "semgrep", "status": "pass"},
{"name": "traceability", "status": "pass"},
{"name": "coverage", "status": "pass"}
]
}
}Common local workflow:
uv sync --devuv run python -m intentc validate docs/intents/webhook-idempotency.intent.yamluv run python -m intentc compile docs/intents/webhook-idempotency.intent.yaml --out /tmp/intentc-builduv run python -m intentc verify docs/intents/webhook-idempotency.intent.yaml --out /tmp/intentc-verifyuv run python tools/intentc/scripts/ci_compile_gate.pyuv run pytestuv run ruff check intentc tests tools
Failure stage summaries are printed in a stable format such as bdd: fail - ... or coverage: fail - ..., and intentc verify exits non-zero whenever any enforcement stage fails.
Operator guidance and troubleshooting live in docs/intentc-enforcement-workflow.md, with pilot evidence in planning/intentc/webhook-idempotency-pilot.md and captured logs under logs/intentc/.
Run the repository smoke test for the full validate/compile/manifest flow:
uv run python tools/intentc/scripts/ci_compile_gate.py