Repository navigation
feat(mirror): mirror asks and topics to forge issues and PRs (RIG-5181) - #2275
rigel-mintaka wants to merge 2 commits into
Conversation
Agent asks with a ref to an auto coordinate mirror once and edit on answer; users mirror a visible ask, topic or message set by click. A leased outbox with markers, client ids and a GitHub recheck keeps one comment per row. Admins set off/manual/auto per enabled repo. Co-authored-by: Matt Wilkinson <matt@rigel.build>
|
Compass engineering docs preview: https://compass-comms-rig-5181-ask-m.compass-eng-docs.pages.dev Deployed from Changed pages: |
- Mark the revision that was rendered, and re-drive while a newer one exists. - Keep stored channel/topic names; take only the URL from the link. - Back off failed rechecks, keep one timer per row, retry after lease loss. - Cap topic mirrors at the newest 50 messages with a note (spec updated). - Re-check channel membership after loading selected messages; canonicalize ids. - Skip the agent lookup when a message has no mirrorable ask. Co-authored-by: Matt Wilkinson <matt@rigel.build>
Review loop
Deferred by contract (design §T13 slice plan), not findings on this PR:
Not taken: the existing Gates on this head: |
Review round 4 on head
|
This PR is part of a stack containing 5 PRs:
mainWhat
Mirrors asks, topics and message sets to forge issues and PRs, per §D6 and §T13 of
docs/designs/agent/compass-agent-status-record/design.md.forge_mirror_settingsandforge_mirrorstables in0001_init.sql. Both have RLS (ENABLE and FORCE) and theupdated_attrigger.body_rev.lease_until.body_revmoved on during the drive. A pendingrecheck_atsurvives later edits until the recheck scan clears it.internal/mirror.RenderandRenderAskproduce bounded markdown that budgets for the marker. They neutralize quoted markers.Drive/DriveOnelease, post or edit, and retry 3× (1 s, 4 s, 16 s).<!-- compass-mirror:<row> -->marker. A Linear POST is made idempotent byclient_comment_id.mirrorAllowedchecks that the mode is at least what the post needs. It runs the agent forge scope check for agent actors.PostMirrorstamps the owner header for agents. A user click is attributed in the render header and carries no owner header.CommentOnPullRequestwhen a PR row exists, otherwise toCommentOnIssue. An existing key usesEditComment.ListForgeMirrorSettingsandSetForgeMirrorSetting: any user can list. Set requires the tenant'sUserRoleAdminand an enabled repo subscription.askFromWirederivesAsk.RefCoord, using the configured GitHub host for GHES.PostMessageandRespondToAskdrive mirrors after commit, on a genuine insert only.MirrorToForgeis user-only. It checks channel visibility before the mode check and before any claim.GET /appgives<slug>[bot]; Linear usesviewer.displayName.forge.MaxOwnerHeaderLenlets callers budget for the header before stamping.Deferred to the board slice (
ListBoardsAsAccount/UpdateBoardAsAccountland in RIG-5172): fillingBoardAsk.mirror_stateandmirror_url, and re-driving open rows on a board write. The proto fields ship now. The spec requirement for them waits for that slice.Tests
internal/store: append Auto/Manual/Off/user/replay; answer bump; conflict keys; agent-class isolation on source keys; source-2 requires a key; lease, attempt and expired-lease fencing; open rows; revision bump during Mark; recheck preserved until cleared; mixed-case settings join; tenant isolation; RLS and trigger catalog floors.internal/mirror: 17 Drive cases, among them lost-POST adoption after 60 comments, Linear client-id reuse, concurrent leases making one POST, recheck delete/repoint, foreign-marker immunity, and the stale-revision race. Render budget and neutralization.serverandinternal/comms:MirrorToForgeis user-only.RefCoord, Linear identity field.Spec-impact: docs/specs/product/compass.md (forge mirror settings, MirrorToForge, automatic ask mirroring)
Ledger-impact: none
Closes RIG-5181
Co-authored-by: Matt Wilkinson matt@rigel.build