feat(standards): Phase 7 CLI — --strict-standards #21
phase-7-standards-enforcement-cli
into main
Companion to fangorn/anvil#156 (Phase 7 server side of #257). Adds the CLI half of the standards CI gate.
Summary
New flag on the existing status command:
anvil requirement status --strict-standards --organization <slug>
Hits the new GET /api/v1/:org/standards/strict endpoint, exits 1 on
any uncovered mandatory standard (matrix-wide, not per-repo), and
prints a per-(standard, repo) failure table so the CI log shows
exactly what regressed.
Pure-additive — the existing per-repo
anvil requirement status --repo <r> behavior is untouched. The new
flag is rejected without --organization with a clear actionable
message before any HTTP call is made.
Requirements covered
- REQ-STD-038 — CLI
--strict-standardsflag exits non-zero on uncovered
Test plan
-
cargo test --release— 68 passing (4 new + 64 existing) -
cargo clippy --all-targets -- -D warningsclean -
cargo fmt --allclean - Unit tests cover: missing
--organizationrejection, 2xx ok path, 422 uncovered path (exit non-zero + parsed body), non-422 error pass-through. All usewiremockagainst the existingClient::for_testhelper.
Usage
CI snippet for a block-policy org:
anvil requirement status --strict-standards --organization fangorn
Output on failure (exit 1):
Standards Strict Coverage — FAILED
1 uncovered mandatory pair(s):
STANDARD TITLE REPO STATUS
STD-GDPR-017 Right to erasure customer-app uncovered
Error: 1 uncovered mandatory standard(s)
Skipping the flag preserves existing CI scripts verbatim.