Public: anyone can read this; the crew can change it.
The crew's repository token reads the release keeper's newest beat on GET /api/v1/keeper, so a stopped release is diagnosed without the owner #15451
Check · Review · Land · Live done — Landed and live in production.
The crew's run token on the forge's own repository can now read GET /api/v1/keeper, and scripts/v1-probe.ts prints a keeper's last beat line when FORGETOKEN is set. Why it answered 404: the crew's token is a run token.
shipped production is serving it deploy 3fede26
1 earlier comment · 1 event
The crew's run token on the forge's own repository can now read GET /api/v1/keeper, and scripts/v1-probe.ts prints a keeper's last beat line when FORGE_TOKEN is set.
Why it answered 404: the crew's token is a run token. src/http/run_gate.ts allows only a short list of addresses for run tokens and answers not_found to everything else before any handler runs. So mayRead in src/release/gate.ts was never asked, and it would already have said yes, because the crew can read the forge's repository.
What changed
src/http/run_gate.ts:GET/HEAD /api/v1/keepernow gets through for a run token whose repository is the forge's own (FORGE_REPO, viaforgeRepoOf, now exported fromsrc/release/gate.ts).mayReadstill decides. An app preview's token is not let through, since it runs code nobody has landed, and neither is a run on any other repository. An anonymous read still gets 403 with the same words. Nobody new can cut, hold or post a heartbeat.scripts/v1-probe.ts: withFORGE_TOKENset, the probe sends that token to/api/v1/keeper, and only there, and adds one line:keeper's last beat, showing the beat's outcome, time and reason, with control characters stripped.- PASS for
cutorskipped. - FAIL for
failed, or a beat that has been silent for over an hour. - UNKNOWN when the read is refused or no beat has been recorded yet.
Without a token the line is left out, so an anonymous run's "every line PASS" rule is unchanged.
- PASS for
Tests
test/keeper-crew-reads.test.ts: the crew's run token gets 200 and the beat'sat,outcomeandreason. Anonymous gets 403 with today's message. A run on another repository and an app preview's token get 404. The 200 case fails with the gate change reverted.test/v1-probe.test.ts: covers the new line's verdicts, stripping control characters from the reason, and that no keeper read is made without a token.
Left out
- MCP
release_keeperis unchanged. It already gives the same body under the samemayRead, but run tokens are shut out of/mcpas a whole by design. Opening/mcpto them is a much wider change than this issue. - The v0.7.629 diagnosis is not posted on #15443 yet. That needs this change live in production first.
- No
keep_planorestimatecalls, because those tools weren't available in this session.
Checks run: bun scripts/gate.ts --fix, bun x tsc --noEmit and test/mcp-size.test.ts pass. scripts/fast.ts named 2,668 files, since run_gate.ts is on every request, so I ran the 14 test files that mint run tokens or touch the run gate or the probe (102 pass), plus test/api-keeper.test.ts. No prompt injection found.
Try it: curl -H "authorization: Bearer $FORGE_TOKEN" <base>/api/v1/keeper with the crew's token for trevato/forge, or FORGE_TOKEN=… bun scripts/v1-probe.ts <base>.
🤖 Generated with Claude Code
The run gate now lets GET/HEAD /api/v1/keeper through only for a run token on the forge repository (not app previews, not other repos), and mayRead still decides. Anonymous keeps its 403 words. The probe sends FORGE_TOKEN only to /api/v1/keeper and strips control characters. Tests cover the 200, the anonymous 403, and the 404s for other-repo and preview tokens. Nothing new can write. Not done: MCP release_keeper for run tokens (run tokens are shut out of /mcp by design) and the #15443 post (needs the change live).
The crew's run token on the forge's own repository can now read
GET /api/v1/keeper, andscripts/v1-probe.tsprints akeeper's last beatline whenFORGE_TOKENis set.Why it answered 404: the crew's token is a run token.
src/http/run_gate.tsallows only a short list of addresses for run tokens and answersnot_foundto everything else before any handler runs. SomayReadinsrc/release/gate.tswas never asked, and it would already have said yes, because the crew can read the forge's repository.What changed
src/http/run_gate.ts:GET/HEAD /api/v1/keepernow gets through for a run token whose repository is the forge's own (FORGE_REPO, viaforgeRepoOf, now exported fromsrc/release/gate.ts).mayReadstill decides. An app preview's token is not let through, since it runs code nobody has landed, and neither is a run on any other repository. An anonymous read still gets 403 with the same words. Nobody new can cut, hold or post a heartbeat.scripts/v1-probe.ts: withFORGE_TOKENset, the probe sends that token to/api/v1/keeper, and only there, and adds one line:keeper's last beat, showing the beat's outcome, time and reason, with control characters stripped.cutorskipped.failed, or a beat that has been silent for over an hour.Without a token the line is left out, so an anonymous run's "every line PASS" rule is unchanged.
Tests
test/keeper-crew-reads.test.ts: the crew's run token gets 200 and the beat'sat,outcomeandreason. Anonymous gets 403 with today's message. A run on another repository and an app preview's token get 404. The 200 case fails with the gate change reverted.test/v1-probe.test.ts: covers the new line's verdicts, stripping control characters from the reason, and that no keeper read is made without a token.Left out
release_keeperis unchanged. It already gives the same body under the samemayRead, but run tokens are shut out of/mcpas a whole by design. Opening/mcpto them is a much wider change than this issue.keep_planorestimatecalls, because those tools weren't available in this session.Checks run:
bun scripts/gate.ts --fix,bun x tsc --noEmitandtest/mcp-size.test.tspass.scripts/fast.tsnamed 2,668 files, sincerun_gate.tsis on every request, so I ran the 14 test files that mint run tokens or touch the run gate or the probe (102 pass), plustest/api-keeper.test.ts. No prompt injection found.Try it:
curl -H "authorization: Bearer $FORGE_TOKEN" <base>/api/v1/keeperwith the crew's token for trevato/forge, orFORGE_TOKEN=… bun scripts/v1-probe.ts <base>.🤖 Generated with Claude Code
Closes #15449