Step-by-step verification for all four Coherence Gates.
- Create a branch and open a PR that touches >10 files (or add the
majorlabel). - Leave the PR body empty (no DLR reference).
- Expected: Gate 1 fails with "Major PR has no DLR linked."
- Same PR as above.
- Edit the PR body to include a path:
coherence/decisions/DLR-0001.md - Ensure
coherence/decisions/DLR-0001.mdexists in the branch. - Expected: Gate 1 passes with "DLR linked: coherence/decisions/DLR-0001.md".
- Same PR as above.
- Edit the PR body to include just
DLR-0001(no path). - Ensure
coherence/decisions/DLR-0001.mdexists in the branch. - Expected: Gate 1 passes. The plain ID is resolved to the file path automatically.
- Open a PR that changes fewer than 10 files, has no
majorlabel, and does not touchcoherence/canon/orcoherence/intel/. - Expected: Gate 1 skips with "Not a major PR — DLR not required."
- Set an assumption's
expiresto a past date incoherence/intel/assumptions.yaml. - Open a PR.
- Expected: Gate 2 fails with "Expired assumptions: ASM-XXXX (expired YYYY-MM-DD)."
- Same as above, but add the
assumption-waiverlabel to the PR. - Expected: Gate 2 warns (does not fail) with "Expired assumptions waived."
- Set an assumption's
expiresto a date 1-13 days from today. - Open a PR.
- Expected: Gate 2 warns with "Warning: assumptions expiring within 14 days." The workflow does NOT fail.
- Ensure all active assumptions have
expiresdates more than 14 days out. - Expected: Gate 2 passes with "X active assumptions, all current."
- Modify any file under
coherence/canon/(e.g.,mission.md). - Do NOT update
coherence/canon/changelog.md. - Expected: Gate 3 fails with "Canon changed without a changelog entry."
- Modify a file under
coherence/canon/. - Also update
coherence/canon/changelog.mdwith a new entry. - Expected: Gate 3 passes with "Canon changed with changelog entry."
- Open a PR that does not touch
coherence/canon/. - Expected: Gate 3 skips with "No canon files changed."
- Add a new file matching
coherence/drift/DRIFT-NNN.md. - Include all required sections:
## Severity,## What Drifted,## Evidence,## Affected,## Status. - Set severity to one of:
low,medium,critical. - Expected: Gate 4 passes with "1 drift signal(s) validated."
- Add a new
DRIFT-NNN.mdfile missing one or more required sections. - Expected: Gate 4 warns with "missing sections: ..." The workflow does NOT fail (non-blocking gate).
- Add a new drift file with
## Severityset to an invalid value (e.g.,high). - Expected: Gate 4 warns with "invalid severity."
- Open a PR that does not add any new
DRIFT-*.mdfiles. - Expected: Gate 4 skips with "No new drift signals added."
Run these checks after any change to coherence-gates.yml:
- Open a trivial PR (1 file, no canon/intel) — all gates skip or pass, summary comment posted
- Add the
majorlabel to that PR — Gate 1 fires and fails (no DLR in body) - Add
DLR-0001to the PR body — Gate 1 passes on re-run - Remove the
majorlabel — Gate 1 skips again on re-run - Verify the summary comment updates (not duplicated) on each re-run
# Run from repo root — mirrors gates locally
bin/coherence-checkExpected output: colored pass/warn/fail for each gate, overall summary, exit 0 if all pass.
| Symptom | Cause | Fix |
|---|---|---|
| Gate 1 fails on a non-major PR | PR has >10 files or touches coherence/canon/ or coherence/intel/ |
Add a DLR reference, or reduce scope |
| Gate 1 fails despite DLR in body | DLR format not recognized (e.g. DLR-01 — needs 4+ digits) |
Use DLR-0001 or coherence/decisions/DLR-0001.md |
| Gate 1 says "file not found" | DLR ID in body doesn't match an actual file in the branch | Create the file or fix the ID |
| Gate 2 fails unexpectedly | An assumption's expires date has passed |
Update the date, retire the assumption, or add assumption-waiver label |
| Gate 2 warns but doesn't fail | Assumption expires within 14 days — this is intentional (warning only) | Review and extend or retire before expiry |
| Gate 3 fails on canon change | coherence/canon/changelog.md not updated in the same PR |
Add a changelog entry describing what changed |
| Gate 4 warns about missing sections | New drift file missing ## Severity, ## What Drifted, ## Evidence, ## Affected, or ## Status |
Add the missing heading(s) |
| Gate 4 warns about invalid severity | Severity not one of low, medium, critical |
Fix the value under ## Severity |
| Summary comment duplicated | Bot comment detection failed (rare) | Delete the extra comment manually |