mirror of
https://github.com/magnus919/agent-skills.git
synced 2026-09-11 19:47:12 +03:00
Add promise-contract.py, a stdlib-only Python 3.10+ CLI that lints
promise-manifest v1 contracts (restricted-YAML or JSON) against the pinned
schema and renders a promise-graph summary. lint exits 0 on valid + full
coverage, 1 on lint errors/coverage gaps (accumulated, no fail-fast), and 2
on usage/IO errors; --json preserves the {valid, errors, warnings, coverage,
bindings} shape even on parse errors; --dry-run is a no-op guard. Robustness
handles empty/whitespace files, non-UTF-8 bytes, CRLF/BOM, JSON type errors,
and deep nesting without Python tracebacks.
Add tests/test_promise_contract.py covering valid contracts (YAML + JSON),
coverage gaps, schema violations, malformed input, --json, --dry-run, render,
and the robustness cases (empty, dup ids, bindings, enums, expires, encoding,
usage errors). 36 tests pass via unittest discover.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>