csd-intent
Cross-runtime audit tool for CSD intent specifications. Validates intent.yaml
against CSD-INTENT-01 and confirms every
claim is attested by at least one test marker across any test runner -
pytest, vitest, Playwright, Jest, or anything that uses the standard intent()
/ @intent() marker shape.
This tool is standalone. It does not run inside your project's test suite; it is invoked separately (CLI, CI step, or pre-commit hook).
Why it exists
pytest-intent, vitest-intent, and playwright-intent provide the test-side
marker helpers - they let a test declare which intent claim it attests. They
deliberately know nothing about other runtimes, schema validation, or whether a
claim is unattested.
csd-intent owns the cross-runtime auditing: it walks every test file in the
project (Python via AST, TS/JS via regex), reads intent.yaml, and answers:
- Schema - does every claim match CSD-INTENT-01?
- Orphan - does every test marker reference a real claim?
- Coverage - does every claim have at least one attesting test, anywhere?
Install
# From PyPI:
pip install csd-intent
# Local dev against a csd-library checkout:
pip install -e path/to/csd-library/csd-intent
Use
# Audit the current directory (expects intent.yaml at the root):
csd-intent
# Audit a specific project:
csd-intent /path/to/project
# Audit but tolerate unattested claims (the "intent before test" workflow):
csd-intent --fail-on schema
# Constrain the scan to specific directories:
csd-intent --tests-dir backend/tests --tests-dir frontend/src --tests-dir e2e
# Quiet summary only:
csd-intent --quiet
Exit code is 0 on a clean audit, 1 when any violation falls into the
configured --fail-on set (any by default).
Output
intent.yaml (/path/to/project/intent.yaml): 24 claims, 2 violation(s).
UNATTESTED (2):
[unattested] INT-SB-018: no @intent / intent() marker references this claim
[unattested] INT-SB-029: no @intent / intent() marker references this claim
What it scans
- Python: any file matching
test_*.pyor*_test.py, walked via AST for@intent("INT-...")decorators on functions starting withtest_. - JS/TS: any file matching
*.test.{ts,tsx,js,jsx,mts,cts}or*.spec.{ts,...}, scanned by regex forintent('INT-...', 'name', fn)calls (single-ID and array-of-IDs forms both supported). - Excluded directories:
node_modules,.venv,venv,dist,build,.git,__pycache__,.pytest_cache,.mypy_cache,.ruff_cache,.tox.
CSD-INTENT-01 conformance
The schema check validates each claim against the canonical fields per CSD-INTENT-01 §4.1:
INT-NNN:
version: 1.0.0
status: active # draft | active | deprecated
statement: "..." # >= 10 chars, RFC 2119 language
rationale: "..." # optional but recommended
test:
scope: integration # unit | integration | e2e | llm
component: SwitchFlow
type: behavior # invariant | behavior | contract
criticality: critical # critical | high | medium | low
For projects still on the legacy flat-scope: shape, the tool accepts it (with
no warning) - that's a migration concession, not a recommendation.
Duplicate keys are refused
intent.yaml is parsed with a loader that raises on a repeated key rather than
resolving it last-wins. A claim id reused by accident would otherwise delete the
earlier claim before any check could see it - and every marker written for that
claim would silently start attesting the survivor, with the audit still printing
CLEAN. The duplicate is reported as a schema violation naming both lines:
SCHEMA (1):
[schema] intent.yaml: duplicate key `INT-GATE-006` (first declared on line 42,
declared again on line 187); YAML would silently keep only the last one
Merge keys still work: <<: *base plus an explicit override is not a duplicate.
License
MIT.
Metadata
Release files for csd-intent 0.5.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 | Provenance | Actions |
|---|---|---|---|---|
| csd_intent-0.5.1.tar.gz | 22.9 kB | With provenance | Details for csd_intent-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| csd_intent-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for csd_intent-0.5.1-py3-none-any.whl |
Total release size: 39.3 kB
Release files / csd_intent-0.5.1.tar.gz
| Download URL | csd_intent-0.5.1.tar.gz |
|---|---|
| Size | 22.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68899312eb7a8a770e695991a1b1090ffaf22774f9d9b7eaa5427fa294ad0e3d
|
|
BLAKE2b-256 checksum How to use checksums |
184e580b659a815f9e6c5cc25ffb007b042f1e2fdc411571c48c356539334b2f
|
| 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 Sep 16, 2026.
Transparency logRelease files / csd_intent-0.5.1-py3-none-any.whl
| Download URL | csd_intent-0.5.1-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6bab3d55427f84eec5dc7eece920934f1ad17a206d7fc5a1e9bd586eb2f45a8
|
|
BLAKE2b-256 checksum How to use checksums |
595f42fc6af30680e593288a8972e35dbf580fbe520a4d86843fadd16b6d26d0
|
| 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 Sep 16, 2026.
Transparency logSecurity for csd-intent 0.5.1
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for csd_intent-0.5.1.tar.gz
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 Sep 16, 2026.
Transparency logA 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.