Skip to content

docs(design): tier-2 forge e2e leg, agent to server (RIG-3823) - #1276

Draft
rigel-mintaka wants to merge 1 commit into
mainfrom
compass-forge/rig-3823-e2e-design
Draft

rigel-mintaka wants to merge 1 commit into
mainfrom
compass-forge/rig-3823-e2e-design

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

The design record for RIG-3823: a tier-2 e2e leg proving an agent's forge tool call traverses agent → server with its payload intact. Record only — no implementation.

Why

The forge chain is tested at every seam and assembled nowhere. Every layer is verified against a fake of its neighbour:

Layer Test Talks to
TS tool (12 forge tools) forge.test.ts FakeTransport
Runner gateway gateway/forge_test.go fakeForgeRelay
Server arm (forgeService) forge_transition_test.go (17 tests) forge.FakeProvider + fakeForgeStore
Provider → real API livegithub_test.go (RIG-3331 T7) REAL GitHub/Linear

grep -Ric 'forge' go/e2e/ returns zero files — control-verified (the same matcher finds func Test in harness_test.go; re-checked after #1258 landed). So a mis-plumbed ForgeCallRequest oneof arm or a field dropped between the TS tool and proto is invisible today.

Not hypothetical: RIG-3331 T7 found workflowStatesQuery declaring $team: String! against an ID position, 400ing the first hop of TransitionIssueState. The whole Linear transition path was dead in production, green in every test above it. Golden replay cannot catch that class — a fixture answers our request and prelude entries pin response bodies, never query text, which is DL-210's stated reason for two tiers.

The tiering (Matt's ruling)

Two tiers, not three. Tier 1 (provider ↔ real API) is done. Tier 2 is this record, and it stops at the provider boundary — so it needs no forge credentials and adds no egress, which is what made it feasible at all.

Load-bearing decisions

  1. Loopback HTTPS GitHub-shaped stub, not forge.FakeProvider. The server is a child process here, so the pgtest hub.SetForgeCaller seam is unreachable and config is the only injectable one. More importantly, the bug class this exists for lives in the bytes the real provider client emits — injecting a fake would reintroduce the blind spot at the exact layer the $team bug lived in.
  2. App credentials are feasible with throwaway keys. The mint endpoint derives from the same host; PrivateKey accepts any PKCS#1/chore: exclude vendored fork subtrees from secret scanning #8 PEM, so the fixture generates one per run (as testAppPEM already does); secrets ride the dotenv provider; mint is lazy and no boot path touches the forge with COMPASS_FORGE_REPOS unset, making the stub's request log a complete ledger. This was the main feasibility risk and it is resolved from code, not asserted.
  3. Three arms — create, get, transition — one per transport variant and payload shape. PR/review/comment add assertions but no new variant.
  4. The call comes from the canned model, not a direct gateway call: the container's TS-params-to-proto hop is the uncovered one.

A production bug found while grounding this

RIG-3870, filed separately and verified hop-by-hop: buildForgeWriteService registers the Linear coordinate with an empty host, register makes that empty string the provider's defaultHost (so the A3 fallback cannot rescue it), and record passes it to RecordAuthoredArtifact, whose validCoordinate rejects host == "". A Linear forge_create_issue creates the issue on Linear and then fails, leaving no DL-055 row and no F3 memo — so a retry authors a second issue. No test covers it: the only Linear call through that registry is the PR-unsupported case, which returns before record(). Out of scope here; tracked there.

Open questions for you

  • OQ-1 Linear coverage. Linear is infeasible in tier 2 today: buildLinearTokenSource hardcodes the token URL and mints at boot, failing Serve. Either expose an endpoint override as its own issue then add a Linear leg, or leave Linear on tier 1 + golden. I lean the former.
  • OQ-2 trust anchor. SSL_CERT_FILE (recommended, zero production surface) vs a --forge-ca server flag.
  • OQ-3 env delivery. t.Setenv in the fixture option (recommended) vs a ServerEnv field on stack.Config.
  • OQ-4 scope. Three arms vs adding comment/PR arms.

Verification

rumdl check clean. Every cited symbol verified present on origin/main (appAPIBase and the access_tokens mint path, testAppPEM, certgen.Generate, WithCannedScript, NewFixture, remainingHeader's -1 no-signal return). Zero path:line citations, per the house convention. Rebased onto f8b22385.

Ledger-impact: none — T4 proposes a row in the record for the driver to rule on rather than editing DECISIONS.md.

The forge chain is tested at every seam and assembled nowhere: the TS tool
against FakeTransport, the gateway against fakeForgeRelay, the server arm
against forge.FakeProvider, and the provider against the real API. A
mis-plumbed oneof arm or a field dropped between the TS tool and proto is
invisible today, and `grep -Ric forge go/e2e/` returns zero files.

RIG-3331 T7 found that class one layer down: workflowStatesQuery declared
$team as String! against an ID position, so the first hop of
TransitionIssueState 400d and the whole Linear transition path was dead in
production, green in every test above it.

Tier 2 stops at the provider boundary, so it needs no forge credentials and
adds no egress: a loopback HTTPS GitHub-shaped stub the real *forge.GitHub
dials via the configured host, with throwaway per-run RSA keys for the App
mint. Four open questions are parked for Matt, including Linear, which needs
a production config seam first.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@trunk-io

trunk-io Bot commented Sep 17, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@linear-code

linear-code Bot commented Sep 17, 2026

Copy link
Copy Markdown

RIG-3823

@github-actions

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-forge-rig-3823-e2e-d.compass-eng-docs.pages.dev

Deployed from compass-forge/rig-3823-e2e-design at 6c01f4a.

Changed pages:

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.

1 participant