Repository navigation
feat(ci): add shared measurement inventory and mechanism gate - #804
Merged
Merged
Conversation
Add a shared AST/config measurement discovery layer and wire the POAM-2026-222 mechanism-reference and TTM signing-hold gate: - Add scripts/measurement_inventory.py discovering all four repository measurement surfaces directly from source and declarative config (PrometheusMetric >= 42, AlertPolicy >= 8, LulaBridgeSpec >= 4, BridgeScoreSurface >= 51) with non-vacuous CorpusFloorError floors for consumption by both POAM-2026-222 and POAM-2026-234. - Add scripts/check_mechanism_references.py (zero waivers) verifying alert-policy/dashboard Prometheus series, active Lula compliance-bridge payload fields, OSCAL and DOC_SCOPE metric/alert citations, and CAGE-TTM-001 signing-hold / POAM-2026-222 closure invariants. - Correct two stale documentation metric citations caught by the new gate in docs/architecture/EVIDENCE_CHAIN.md (cage_evidence_custody_batches_total) and docs/architecture/GATEWAY_ARCHITECTURE.md (cage_ftra_parse_failures_total). - Wire check_mechanism_references.py into .github/workflows/ci.yml (lint), Makefile (docs-check), scripts/setup_git_hooks.sh, and tests/test_ci_gate_effectiveness.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the shared AST/config measurement discovery layer (
POAM-2026-222&POAM-2026-234) and wires the zero-waiver mechanism-reference and TTM signing-hold gate (POAM-2026-222):scripts/measurement_inventory.py: Discovers all four repository measurement surfaces directly from source and declarative configuration —PrometheusMetric(>= 42),AlertPolicy(>= 8),LulaBridgeSpec(>= 4), andBridgeScoreSurface(>= 51) — with non-vacuousCorpusFloorErrorfloors and zero hard-coded lists, ready for independent consumption byPOAM-2026-222andPOAM-2026-234's bidirectional failure-direction gate.scripts/check_mechanism_references.py: Zero-waiver CI and pre-commit gate verifying:cage_*Prometheus series inAlertPolicy.referenced_metrics,infra/**/*.tfPromQL/MQL/GMP descriptors, andinfra/**/*.{json,yaml,yml}dashboards/relabeling manifests resolves to a discoveredPrometheusMetric.LulaBridgeSpectargets a real compliance-bridge route and reads fields produced byBridgeScoreSurface.google_monitoring_alert_policy.<label>andcage_<metric>series cited acrosscompliance/oscal/**/*.yamland livingDOC_SCOPEdocuments resolves in the discovered inventory.CAGE-TTM-001(compliance/risk_acceptance/THRESHOLD_TRACEABILITY_MATRIX.md) keeps itsEvidence Withdrawal and Signing Holdnotice and unsigned §5RA-001..RA-004/ §6 Approval Block whilePOAM-2026-222isOpen, and fails closed ifPOAM-2026-222is marked closed while anycage.<subsystem>.*un-emitted metric citation remains in §2.1 or Appendix B.docs/architecture/EVIDENCE_CHAIN.md(cage_evidence_custody_batches_total) anddocs/architecture/GATEWAY_ARCHITECTURE.md(cage_ftra_parse_failures_total{failure_class})..github/workflows/ci.yml(lintjob),Makefile(docs-check),scripts/setup_git_hooks.sh, andtests/test_ci_gate_effectiveness.py.Verification
CAGE_DEPLOYMENT_REGION=US_FED uv run pytest tests/unit/test_measurement_inventory.py tests/unit/test_check_mechanism_references.py tests/test_ci_gate_effectiveness.py -q-> 58 passed, 0 faileduv run python scripts/check_mechanism_references.py --verbose-> pass (43 Prometheus metrics, 8 alert policies, 4 Lula bridge specs, 53 compliance-bridge score surfaces; 0 waivers)uv run bandit -r src/ scripts/ -c pyproject.toml -ll -ii-> 145,891 lines scanned, 0 Medium / 0 High issues