Skip to content

feat(board): derive board refs, PR gates and stacks from stored rows (RIG-5171) - #2231

Merged
mattwilkinsonn merged 1 commit into
compass-comms/rig-5173-ask-reffrom
compass-server/rig-5171-board-derive
Oct 15, 2026
Merged

mattwilkinsonn merged 1 commit into
compass-comms/rig-5173-ask-reffrom
compass-server/rig-5171-board-derive

Conversation

@rigel-mintaka

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

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 5 PRs:

  1. main
  2. feat(store): status board tables, patch merge and board reads (RIG-5170) #2212
  3. feat(comms): carry an optional issue or PR ref on asks (RIG-5173) #2228
  4. "feat(board): derive board refs, PR gates and stacks from stored rows (RIG-5171)" (this PR)
  5. feat(mirror): mirror asks and topics to forge issues and PRs (RIG-5181) #2275
  6. feat(board): agent board RPCs, roster summary and board events (RIG-5172) #2285

Summary

Status board T3: derive board refs, PR gates and stacks from stored rows, with no forge calls. It is stacked on T5 (#2228) and T2 (#2212).

  • DeriveRefs resolves each task ref with one batched read per kind: PRs, issues, open authored refs, and authored coordinates.
    • GitHub owner/repo#N: a PR row wins, then an issue row.
    • Linear KEY-N maps to provider 4 / linear.app.
    • Unknown, number-0 or unconfigured refs are UNSPECIFIED, with no error.
    • owned comes from the authorship row regardless of forge state.
    • untracked_refs lists open authored artifacts that no task names, matched on the full coordinate plus kind.
    • observed_at_unix_ms comes from forge_updated_at.
  • PrGate, first match wins: merged, closed, queued / queue-failed / queue-removed, draft, conflicts, checks failed or pending, changes requested, awaiting review, awaiting enqueue.
    • Latest decision per human author; commented reviews never replace a decision, and dismissed clears one.
    • Required checks are read first, then the roll-up. A missing or empty roll-up is pending.
    • An approval on an older commit is stale. An unresolved thread holds the PR at awaiting review.
  • StackOf: bottom-up positions, and the PR with no child is the tip. At a fork, each leaf is a tip and a shared ancestor takes the lexically first leaf. DeriveRefs calls it per provider and host.
  • Store:
    • Issue.ForgeUpdatedAt is threaded through every issue read.
    • New batched AuthoredCoordsForAgent query.

Not here:

Tests

  • Unit tests:
    • PrGate: each gate, overlapping precedence cases, required check vs roll-up, latest decision per author with comment and dismissal, stale approval, unresolved thread.
    • StackOf: chain, fork, host and provider separation.
    • DeriveRefs with a recording fake: batching, unknown and number-0 refs, Linear and mixed-case GitHub coordinates, PR over issue at one coordinate, untracked suppression across host, provider and kind, owned for a merged PR.
  • pgtest TestDeriveRefsFromStore runs on seeded rows, including issue observed_at.
  • Store pgtest TestBoardCoordinateReadsAndOpenAuthoredRefs.
  • Red checks were run on each regression fix.
  • Gates: golangci-lint (with and without the pgtest tag), build, vet, sqlc-drift, inline-sql-gate, and the moon ci pre-push gate.

Refs RIG-5171

Ledger-impact: none

@linear-code

linear-code Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

RIG-5171

RIG-5173

@rigel-mintaka
rigel-mintaka changed the base branch from compass-server/rig-5170-board-store to compass-comms/rig-5173-ask-ref October 12, 2026 04:59
@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Review result: head ab9ea29

Review-lead fan-out (correctness, security, design, style).

Round High Medium Low Outcome
R1 0 4 accepted 4 accepted fixed (number-0 refs, empty roll-up is pending, host-isolated stacks, precedence tests); commit_id/head_sha ingestion deferred to T14 (RIG-5182)
R2 1 2 3 fixed (commented reviews keep a decision, durable ownership, stack key isolation, all parseable refs suppress)
R3 0 1 1 fixed (untracked match on full coordinate plus kind; driver red-checked)
R4 0 1 2 fixed (GitHub refs suppress both PR and issue keys, independent subtest, test rename)
R5 0 2 (test gaps) 0 fixed (PR-over-issue precedence test, configured-host suppression test)

Dismissed with reasons: tracker_status (a later task adds its columns), per-ref recovery from corrupt stored rows (failing closed is intended), and the Linear fallback URL route (unspecified).

No open findings.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-server-rig-5171-boar.compass-eng-docs.pages.dev

Deployed from compass-server/rig-5171-board-derive at 0d78f52.

@rigel-mintaka
rigel-mintaka marked this pull request as ready for review October 12, 2026 05:37
@mattwilkinsonn
mattwilkinsonn added this pull request to stack #2242 October 12, 2026 19:18
@rigel-mintaka
rigel-mintaka force-pushed the compass-server/rig-5171-board-derive branch from ab9ea29 to 1b9db2f Compare October 12, 2026 20:53
@rigel-mintaka rigel-mintaka changed the title feat(comms): carry an optional issue or PR ref on asks (RIG-5173) feat(board): derive board refs, PR gates and stacks from stored rows (RIG-5171) Oct 12, 2026
@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Rebase note: restacked on #2228 (7ab717a8). Interdiff from reviewed head ab9ea29b to 1b9db2f3 is empty. Title fixed to RIG-5171; it had inherited #2228's.

…(RIG-5171)

DeriveRefs resolves each task ref against stored pull request and issue rows
in one batched read per kind, with no forge calls. PrGate applies the gate
order (merged, closed, queue states, draft, conflicts, checks, changes
requested, awaiting review, awaiting enqueue). An approval on an older commit
is stale, and an unresolved thread holds a PR at awaiting review. StackOf
orders an agent's open PRs by base/head ref. Issue reads now carry
forge_updated_at for observed_at.

Ledger-impact: none

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-server/rig-5171-board-derive branch from 1b9db2f to 0d78f52 Compare October 13, 2026 08:43
@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Rebase note: rebased onto main (b1e8515) after RIG-5326 and RIG-5324 landed. Interdiff from approved head 1b9db2f3 to 0d78f527 is empty.

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