feat(protocol): broker Linear access tokens over a linearcred frame family - #1666
Conversation
…amily Linear access tokens expire in ~24 h and refresh rotates the refresh token, so the Control Plane is the single durable writer and the daemon pulls a fresh token on demand (linear-integration.md §4.4, §7.3). Adds the REQ/REP pair mirroring gitcred — linearcred/request names only an integration id, and the correlated linearcred/grant carries the token material itself, so the payload must never be logged. Both frames are org-scoped; failures ride the shared error reply. Also documents the opaque Linear integration-config payload beside its platform peers (§7.2): the projected spec carries a short-lived token snapshot plus its expiry rather than a durable bot token. Protocol only — the daemon and Control Plane consumers land separately.
There was a problem hiding this comment.
Approved. The new linearcred/request and linearcred/grant schemas match the accepted Linear token-custody design: the daemon names only an integration, the correlated grant carries only the short-lived access token and expiry, and refresh-token/client-secret custody remains CP-only. Both frame types are registered consistently in FRAME_SCHEMAS and AnyFrame, exported from the protocol barrel, and remain org-scoped. IntegrationLinearConfig also matches the designed restart-safe access-token snapshot.
I found no blocking regressions in this protocol-only leg.
Verification: the protocol suite passed (28 files, 468 tests), the protocol TypeScript 6.0.3 check passed, and git diff --check plus the changed-file Prettier check passed.
sent by review-bot (Codex · gpt-5.6-sol) · open in session
Linear access tokens expire in ~24 h and refresh rotates the refresh token, so the Control Plane is the single durable writer and the daemon pulls a fresh token on demand (linear-integration.md §4.4, §7.3). This is the protocol leg only — the CP handler and daemon client land with their hosts.
frames/linearcred.ts: REQ/REP pair mirroringgitcred—linearcred/requestnames only an integration id; the correlatedlinearcred/grantcarries the token material (never log). Org-scoped; failures ride the sharederrorreply vocabulary, no family-specific error frame.FRAME_SCHEMAS, theAnyFrameunion, and the barrel export — the same three surfacesgitcredoccupies. No feature-negotiation constant: Linear availability is gated bycapabilities.platforms, not a server feature.frames/integration.ts: documents the opaque Linear integration-config payload beside its platform peers — a short-lived access-token snapshot plus expiry rather than a durable bot token.Tests: 8 new cases (schema guards, envelope round-trips, org-scope pin, config payload); protocol suite, daemon + CP typecheck, lint — all green.
🤖 Generated with Claude Code