Files
stack/docs/ADMIN-GUIDE/quality-gate-registry.md
coder-mos2 e910a45ab3
ci/woodpecker/pr/ci Pipeline was successful
fix(rm-02): narrow inventory drift guarantee
2026-08-01 15:09:57 -05:00

3.9 KiB

Gate Registry Operations

Routine verification

Run pnpm gate:verify from a dependency-installed checkout. Exit zero means registry observations matched their declared actual values; it does not assert required-behavior conformance while deltas remain. Open DEFECT records are checked descriptions of current behavior with tracked owners, never successful gate outcomes.

Investigate any of these immediately:

  • GATE VERIFY FAILED — registry structure, observed behavior, provenance, claim binding, source/deployment identity, or negative-control detection changed. The verifier aggregates independent phase failures, so repair the responsible stable-ID diagnostics as well as any accompanying stale-fixture error; do not treat the generic error as a substitute.
  • unregistered gate — an executable appeared under a declared gate root without a registry entry.
  • no negative control — a gate has no must-fail case.
  • DEPLOYED IDENTITY UNAVAILABLE — the runner cannot reach the installed enforcing copy. The pinned observation is checked, but live equality is not asserted.
  • HISTORY_PROVENANCE_FORBIDDEN — a history assertion path was reintroduced at the repository layer; remove it and keep RM-60 as the tracked external-boundary owner.

Updating a gate

  1. Add or change the criterion, its exact criterion-side caseRefs, and matching case-side criterionIds. Preserve recursive closed-schema validation for every nested object; new fields require explicit key and type handling.
  2. Observe the must-fail case fail for its own stated reason; moving the binding to any undeclared case must fail verification.
  3. Declare an exact inerting mutation and observe the verifier detect it.
  4. If required and actual behavior differ, add a tracked remediation owner and justification.
  5. If meaning changed, append provenance; never replace the original silently.
  6. For an installed counterpart, verify live byte identity and update the observed digest only from measured evidence.
  7. Run focused verifier tests, pnpm gate:verify, and the repository baseline gates.

Do not add an ownerless exception or describe an open delta as pass/green/OK.

CI behavior

Woodpecker runs gate-verify on every pull request and protected-main push without path filtering. This is deliberate: changes outside gate files can make a gate inert. The step needs no local history preparation because RM-02 asserts no history-provenance property.

DOES: PR CI executes current-tree verification unprivileged and fail-closed. It compares the manifest and verifier inventory separately with gates/required-gates.baseline.json, and consumed case evidence carries a subject checked against its gate definition. Detects accidental and incompetent inventory drift within a checkout; does NOT survive an adversary who rewrites baseline, manifest, and verifier consistently — that guarantee requires RM-60's external boundary. The registered shrink-both, overclaim, and per-gate evidence-subject controls must remain red for their stated reasons.

DOES NOT: No local git state in the PR checkout is trustworthy as a history anchor because PR-controlled lifecycle code executes before the gate. The verifier has no history-verification path, and its closed current-tree observation renderer has no history/ancestry/lineage success class. Do not add a local ref, config, remote URL, source constant, or author-positioned path as a replacement anchor.

scripts/gate-history-exclusion-control.mjs enforces the output incapacity by testing alternate success wording and production renderer wiring; its registered fixture proves adding a prohibited success class goes red. RM-60 is the tracked owner of the provider-controlled/protected pre-execution boundary. If a bootstrap override is ever proposed before RM-60, it requires a separate explicit, loud, audited, retiring, negative-controlled design; RM-02 contains no override.