Repository navigation
fix(ci): run design-ledger touch-coupling on PRs, fail if unwired (RIG-3924) - #1799
Merged
Merged
Conversation
…G-3924) ci.yml never passed REPO/PR_NUMBER, so the touch-coupling leg silently no-oped on every PR. Pass them (plus GH_TOKEN) to the moon battery, and make the gate exit 2 when a pull_request event lacks them. Co-authored-by: Matt Wilkinson <matt@rigel.build>
|
😎 Merged successfully - details. |
|
Compass engineering docs preview: https://compass-comms-rig-3924-ledge.compass-eng-docs.pages.dev Deployed from |
rigel-mintaka
marked this pull request as ready for review
October 6, 2026 18:32
mattwilkinsonn
approved these changes
Oct 7, 2026
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.
Refs RIG-3924.
Problem
design-ledger-gate's touch-coupling leg checks that a PR touching a governed design record also touchesdocs/designs/DECISIONS.mdor declaresLedger-impact:. That leg readsREPOandPR_NUMBER, andci.ymlnever set either. With both unset the leg silently no-oped, so no compass PR has ever been checked for record/ledger coupling. #1315 passed CI with a real violation.Change
Options 1 and 2 from the issue.
.github/workflows/ci.yml: themoonjob'sMoon batterystep now sets:REPO: github.repositoryPR_NUMBER: github.event.pull_request.number || github.event.inputs.pr. The second term covers the base-re-point dispatch, which is otherwise a fresh green run that skips the leg.GH_TOKEN: github.token, but only for a leg whosematrix.targetscontainsdesign-ledger-gate:ci. The gate callsgh pr view/gh api .../files. Every other leg gets an empty string. The values go throughenv:, never inline inrun:.tools/design-ledger-gate/index.ts: new pureprContextFrom(env)decides whether the leg runs. It returns an error (exit 2) when:pull_requestevent lacksREPOor a numericPR_NUMBER; orPR_NUMBERwithout a valid pair.Without
PR_NUMBERoff a PR event (push, schedule, local) the leg skips, as before.tools/design-ledger-gate/index.test.ts:describe("prContextFrom")covers the run, error and skip cases. It was written first and failed (export missing; then 4 dispatch cases), and passes now.Open PRs that will go red
I ran the enabled gate (this branch,
GITHUB_EVENT_NAME=pull_request, each PR's real number) against every open compass PR that touchesdocs/designs/: 21 of 107 open PRs. 6 go red. Each touches a governed record with noDECISIONS.mdchange and noLedger-impact:line in its body. Each needs aDECISIONS.mdrow or aLedger-impact:line.compass-managed/rig-4323-turn-sequence-carrierinfra/runtime/compass-managed-settle-turn-order/design.mdcompass-server/rig-2863-gateway-credentials-protoserver/compass-server-llm-gateway/design.mdcompass-ux/4295-ui-message-channel-routeui/compass-global-search/design.mdcompass-server/rig-3937-teardown-group-deathinfra/release/compass-distribution/design.md,ui/compass-stack-cross-process-teardown/design.mdcompass-server/rig-4028-respawn-closeoutserver/compass-handle-addressing-cutover/design.mdcompass-server/rig-2864-gateway-tokensserver/compass-server-llm-gateway/design.mdThe other 15 pass: #1644, #1653, #1663, #1716, #1728, #1733, #1739, #1746, #1749, #1751, #1763, #1771, #1773, #1793 and #1796.
These PRs only go red on their next CI run after this merges. Their current checks stay green until then.
Verification
bun testintools/design-ledger-gate: 107 pass, 0 fail.tsc --noEmitis clean. biome reports the same 4noExcessiveCognitiveComplexitywarnings as main and nothing new.GATE_ROOT= workspace):pull_requestwith vars unset: exit 2, naming both vars.push/schedule: exit 0.pull_requestagainst docs(ci): describe the affected set as the project+task union (RIG-3420) #1796: exit 0.pull_requestagainst feat(comms): carry the agent turn sequence to the stored message and the settle sink (RIG-4323) #1602 exits 1 withPR touches a governed design record without DECISIONS.md or Ledger-impact declaration. Five more do the same (table above).moon run design-ledger-gate:checkpassesREPO/PR_NUMBER/GH_TOKENthrough to the task (checked with an env probe).Spec-impact: none (CI gate wiring; no product contract change).
Ledger-impact: none (no decision changed).
Co-authored-by: Matt Wilkinson matt@rigel.build