feat(linearagent): Linear Agent Session webhook types + API client (RIG-2717 T1/T2) - #638
Open
rigel-mintaka wants to merge 2 commits into
Open
feat(linearagent): Linear Agent Session webhook types + API client (RIG-2717 T1/T2)#638rigel-mintaka wants to merge 2 commits into
rigel-mintaka wants to merge 2 commits into
Conversation
|
Compass engineering docs preview: https://compass-server-rig-2717-stor.compass-eng-docs.pages.dev Deployed from |
…IG-2717 T1/T2) New go/internal/linearagent package for the Linear Agent Session responder: - webhook.go (T1): SessionEvent envelope (AgentSessionEventWebhookPayload shape), ParseSessionEvent, VerifySignature (constant-time HMAC-SHA256 over the raw body, false on hex-decode error), CheckTimestamp (bidirectional skew on the ms-epoch webhookTimestamp). - client.go (T2): client-credentials TokenSource (in-memory cache, singleflight-coalesced re-mint, pinned scope), and the Client emitter wrapping agentActivityCreate (the thought ack) + agentSessionUpdate (the external-URL deep link), re-minting once and retrying once on 401. Pure/unit-tested against httptest; no HTTP handler, store, or dispatcher yet (sibling tasks). Builds against the frozen record docs/designs/product/compass-linear-agent-responder/design.md. Ref: RIG-2717 Co-authored-by: Matt Wilkinson <matt@rigel.build>
…717 T3/T3a) Persistence for the Linear Agent Session responder: - T3: new 0002_linear_agent_sessions migration (association row keyed on the Linear session id; no dedup column — dedup is the comms rail's client_request_id), UpsertLinearAgentSession (ON CONFLICT DO NOTHING, created=false on replay) + LinearAgentSession lookup, and AuthoredArtifactByCoordinate (by-coordinate ownership read the router needs). - T3a: generalize the reserved system-account seed to a shared ensureSystemSubtypeAccount, add EnsureLinearBridgeAccount seeding @linear as a second system-subtype account, and reserve the 'linear' handle against user/agent registration. pgtest-covered (upsert/replay/lookup, by-coordinate hit/miss, @linear idempotent seed + structural exclusions + reserved-handle guard). Ref: RIG-2717 Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
compass-server/rig-2717-linearagent
branch
from
August 26, 2026 04:01
15102f9 to
012b113
Compare
rigel-mintaka
force-pushed
the
compass-server/rig-2717-store
branch
from
August 26, 2026 04:02
276657c to
dd0e7e7
Compare
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.
This PR is part of a stack containing 3 PRs:
mainPersistence for the Linear Agent Session responder:
Linear session id; no dedup column — dedup is the comms rail's
client_request_id), UpsertLinearAgentSession (ON CONFLICT DO NOTHING,
created=false on replay) + LinearAgentSession lookup, and
AuthoredArtifactByCoordinate (by-coordinate ownership read the router needs).
ensureSystemSubtypeAccount, add EnsureLinearBridgeAccount seeding @linear as
a second system-subtype account, and reserve the 'linear' handle against
user/agent registration.
pgtest-covered (upsert/replay/lookup, by-coordinate hit/miss, @linear
idempotent seed + structural exclusions + reserved-handle guard).
Ref: RIG-2717
Co-authored-by: Matt Wilkinson matt@rigel.build