Skip to main content

Python SDK for COVENANT.md, the design contract layer for AI agent skills

Project description

covenant-md (Python SDK)

Python SDK for COVENANT.md, the design contract layer for AI agent skills. Alpha: Parser and validator at the Runtime conformance tier, producing identical verdicts to the TypeScript-compatible reference core on the shared spec/fixtures/ suite.

pip install covenant-md
from covenant_md import parse_file, validate_covenant

data = parse_file("path/to/COVENANT.md")
result = validate_covenant("path/to/COVENANT.md")
# result -> {"valid": True, "errors": [], "warnings": [...]}

What it covers

  • Frontmatter parsing (YAML).
  • JSON Schema structural validation (the canonical schema is bundled).
  • Conformance rules from docs/COVENANT.md §Conformance:
    • Required fields, kebab-case name, semver version, stability enum.
    • covenant_version handling per §Versioning (reject unrecognised majors, warn on newer minor under a recognised major, ignore unknown fields under known sections).
    • interface.surface[*].accepts and returns cross-references against contracts.inputs / contracts.outputs.
    • quality.fixtures[*].operation cross-references against interface.surface; quality.fixtures[*].input keys against contracts.inputs.

The contract-driven test runner, lint heuristics, semantic diff, and dependency graph (Full tier) are not yet implemented in Python and remain in @covenant-md/core.

Conformance parity

The test suite at sdks/python/tests/test_conformance.py runs the Python validator against the same spec/fixtures/ the JavaScript core passes and asserts identical verdicts.

Licence: MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

covenant_md-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

covenant_md-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file covenant_md-0.1.0.tar.gz.

File metadata

  • Download URL: covenant_md-0.1.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for covenant_md-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf18b39db078c00a0c85ca118967c6895994f901fb54e914965f8bd6b1d476de
MD5 a129b0046cf9b127b3143388da07bb09
BLAKE2b-256 e0b3853369dae4f2dbd25fce61ab8756e003cdb3da537075a7554665cbe72514

See more details on using hashes here.

File details

Details for the file covenant_md-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: covenant_md-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for covenant_md-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4dde5f100d0e21e37969d868c1cf83cc23489e4a1eac34c4f11498cdd7bea4e
MD5 26c644d1e6334ed1c97107fef56dad14
BLAKE2b-256 49a3e2e5fbb7bcdb49fa6490cf872e2054662863719addd5031fe82c7f21ed12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page