Skip to content

feat(comms): carry an optional issue or PR ref on asks (RIG-5173) - #2228

Merged
mattwilkinsonn merged 1 commit into
compass-server/rig-5170-board-storefrom
compass-comms/rig-5173-ask-ref
Oct 15, 2026
Merged

mattwilkinsonn merged 1 commit into
compass-server/rig-5170-board-storefrom
compass-comms/rig-5173-ask-ref

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)" (this PR)
  4. feat(board): derive board refs, PR gates and stacks from stored rows (RIG-5171) #2231
  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

What

First half of status-board T5: Ask.ref from end to end.

  • Proto: Ask gains string ref = 4, the issue or PR the ask concerns, in the board ref grammar (RIG-12 or owner/repo#12). Go and both TS clients are regenerated.
  • Edge: askFromWire canonicalizes the ref with refs.Parse (forge owner and repo lowercased). It refuses anything that is not exactly one ref with invalid_argument, and nothing is stored. askToWire returns the ref.
  • Store: no change. The base PR (feat(store): status board tables, patch merge and board reads (RIG-5170) #2212) already persists Ask.Ref in the ask JSONB, and AnswerAsk copies the ask, ref included, into the answer snapshot.
  • Spec: docs/specs/product/compass.md gains "An ask may name the issue or pull request it concerns", with two scenarios.
  • Every wire-to-ask path goes through blocksFromWire → askFromWire: PostMessage, PostAsAccount and PostAsAccountByName. The test-only agent-update helper uses it too.

Not in this PR: the board's asks section

T5's other half fills AgentBoard.asks from AsksByAuthor. Its only caller is T4's ListBoardsAsAccount (RIG-5172), which doesn't exist yet. Without that caller the function fails the unused lint and would do nothing. compass-server (T4 owner) and I agreed the interface: func (c *Comms) boardAsks(ctx, viewer, agent store.AccountID) ([]*compassv1.BoardAsk, error) (24h window, max 20, newest first, viewer-clipped). It lands with or right after T4, together with its viewer-clip test. RIG-5173 stays open until then.

The comms_post_ask ref parameter is T8 (agent lane).

Tests

  • Red first: the ask-field classification test failed on the new proto field. TestAskFromWireRef, TestAskRefRoundTrip and TestPostMessageRejectsMalformedAskRef were written before the mapping.
  • TestAskRefRoundTrip follows the ask through post → ListMessages → RespondToAsk → ListMessages. The ask and the answer snapshot both carry the canonical ref.
  • Mutations go red: dropping the outbound ref, skipping canonicalization, accepting a malformed ref, and the store read dropping ref.
  • Full internal/comms pgtest suite: 217 PASS, 0 FAIL, 0 SKIP. golangci-lint (with and without the pgtest tag) reports 0 issues. nilaway is clean. rumdl is clean, and design-ledger-gate passes.

Stacked on #2212 (T2, compass-server). Its head is unchanged.

Spec-impact: docs/specs/product/compass.md (new ask-ref requirement)
Ledger-impact: none

Refs RIG-5173

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

@linear-code

linear-code Bot commented Oct 12, 2026

Copy link
Copy Markdown

RIG-5173

@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Review at head 08881500: high 0, medium 0, low 0, nit 0

  • Scope: the whole diff, all lenses, 1 round. It covers T5 bullet 1 (Ask.ref from end to end) and the spec. The board-asks half is held back until T4, as the body explains.
  • Round 1: 3 low. (1) The malformed-ref test passed without checking when its read failed; fixed. (2) A test that only checked a field copy; deleted. (3) The test-only agent-update helper dropped ref; it now goes through askFromWire. All folded.
  • Checks: the internal/comms pgtest suite passes (217, 0 skipped). golangci-lint (with and without pgtest) reports 0 issues, nilaway is clean, rumdl is clean, design-ledger-gate passes. Red first; 4 mutations go red.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-comms-rig-5173-ask-r.compass-eng-docs.pages.dev

Deployed from compass-comms/rig-5173-ask-ref at 2484fb6.

Changed pages:

@rigel-mintaka
rigel-mintaka force-pushed the compass-comms/rig-5173-ask-ref branch from 0888150 to 7ab717a Compare October 12, 2026 20:53
@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Rebased onto #2212 at 51287001; head is now 7ab717a8. jj interdiff against the approved 08881500 shows 0 files changed. Re-requesting review on the new head.

@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Rebase note: restacked on #2212 (51287001). Interdiff from approved head 08881500 to 7ab717a8 is empty.

Ask gains ref = 4: the issue or pull request the ask concerns, in the board
ref grammar (RIG-12 or owner/repo#12). askFromWire canonicalizes it with
refs.Parse and refuses anything that is not exactly one ref with
invalid_argument; askToWire returns it. The store already persists Ask.Ref
in the ask JSONB, so it survives ListMessages and AnswerAsk, which copies
the ask (ref included) into the answer snapshot.

The product spec gains the requirement and two scenarios.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-comms/rig-5173-ask-ref branch from 7ab717a to 2484fb6 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 7ab717a8 to 2484fb68 is empty.

@mattwilkinsonn
mattwilkinsonn merged commit b8b15ef into main Oct 15, 2026
37 of 51 checks passed
@mattwilkinsonn
mattwilkinsonn deleted the compass-comms/rig-5173-ask-ref branch October 15, 2026 01:58
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