Skip to content

fix(ci): run design-ledger touch-coupling on PRs, fail if unwired (RIG-3924) - #1799

Merged
trunk-io[bot] merged 1 commit into
mainfrom
compass-comms/rig-3924-ledger-coupling-wired
Oct 7, 2026
Merged

trunk-io[bot] merged 1 commit into
mainfrom
compass-comms/rig-3924-ledger-coupling-wired

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Refs RIG-3924.

Problem

design-ledger-gate's touch-coupling leg checks that a PR touching a governed design record also touches docs/designs/DECISIONS.md or declares Ledger-impact:. That leg reads REPO and PR_NUMBER, and ci.yml never 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: the moon job's Moon battery step now sets:

    • REPO: github.repository
    • PR_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 whose matrix.targets contains design-ledger-gate:ci. The gate calls gh pr view / gh api .../files. Every other leg gets an empty string. The values go through env:, never inline in run:.
  • tools/design-ledger-gate/index.ts: new pure prContextFrom(env) decides whether the leg runs. It returns an error (exit 2) when:

    • a pull_request event lacks REPO or a numeric PR_NUMBER; or
    • any event sets PR_NUMBER without a valid pair.

    Without PR_NUMBER off 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 touches docs/designs/: 21 of 107 open PRs. 6 go red. Each touches a governed record with no DECISIONS.md change and no Ledger-impact: line in its body. Each needs a DECISIONS.md row or a Ledger-impact: line.

PR Branch Record(s) touched
#1602 compass-managed/rig-4323-turn-sequence-carrier infra/runtime/compass-managed-settle-turn-order/design.md
#1611 compass-server/rig-2863-gateway-credentials-proto server/compass-server-llm-gateway/design.md
#1646 compass-ux/4295-ui-message-channel-route ui/compass-global-search/design.md
#1657 compass-server/rig-3937-teardown-group-death infra/release/compass-distribution/design.md, ui/compass-stack-cross-process-teardown/design.md
#1750 compass-server/rig-4028-respawn-closeout server/compass-handle-addressing-cutover/design.md
#1752 compass-server/rig-2864-gateway-tokens server/compass-server-llm-gateway/design.md

The 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

Spec-impact: none (CI gate wiring; no product contract change).

Ledger-impact: none (no decision changed).

Co-authored-by: Matt Wilkinson matt@rigel.build

…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>
@trunk-io

trunk-io Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

😎 Merged successfully - details.

@linear-code

linear-code Bot commented Oct 6, 2026

Copy link
Copy Markdown

RIG-3924

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-comms-rig-3924-ledge.compass-eng-docs.pages.dev

Deployed from compass-comms/rig-3924-ledger-coupling-wired at efad3bd.

@rigel-mintaka
rigel-mintaka marked this pull request as ready for review October 6, 2026 18:32
@trunk-io
trunk-io Bot merged commit e9aea23 into main Oct 7, 2026
16 checks passed
@trunk-io
trunk-io Bot deleted the compass-comms/rig-3924-ledger-coupling-wired branch October 7, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants