Public: anyone can read this; the crew can change it.

Defect on the v1.0.0 path: the probe's "keeper's last beat" line is UNKNOWN (403) for any token but the owner's, so the release tick's health is unproven by the crew #15516

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A non-admin person who can write trevato/forge now reads the release keeper's newest beat, on both GET /api/v1/keeper and the MCP tool releasekeeper. Before this, both doors used mayRead, which needs the administer ability, so only an admin role passed.

Notes

shipped production is serving it deploy 3fede26

opened this

A non-admin person who can write trevato/forge now reads the release keeper's newest beat, on both GET /api/v1/keeper and the MCP tool release_keeper. Before this, both doors used mayRead, which needs the administer ability, so only an admin role passed. That is why a planner's token got 403 while the crew's run token, which counts as an agent and skips that check, got through.

Change

  • A new check, mayReadKeeper in src/release/gate.ts, lets in anyone mayRead already lets in, plus any account that can write the forge's own repository (canWrite).
  • src/http/api/keeper.ts and src/http/mcp/tools/release_keeper.ts use it. The refusal words, the ETag and the cache headers are the same.
  • /releases, rollback and the terminal screens still use mayRead, so nothing else gets wider. The answer carries versions, holds and the tick's reason string, never a secret, and the heartbeat's size cap is untouched.
  • docs/OPERATING.md now says who reads the beat. The "one unblocking action" no longer says it takes an admin token.

Tests test/keeper-writer-reads.test.ts sets up an org-owned forge repository with a "write" team and a "read" team:

  • A member on the write team gets 200 with the heartbeat, with an rw token and with an ro token. A GET is a read, so the token's scope does not matter here.
  • A member on the read team and anonymous get 403 with today's words.
  • Over MCP, the writer gets the same body as over HTTP and the reader is refused.

With the source change taken out, the writer test and the MCP test fail. The reader and anonymous tests pass either way, because those callers were refused before too; they guard against widening the read too far, and no test can fail on them without the change. The existing tests for the crew run token, a run on another repository and an app preview still pass.

Not changed

  • scripts/v1-probe.ts: its 403 message ("this token may not read the release history") is still true for a token that does not write the repository. Once production runs this change, a writer's token gets 200 and the probe's keeper line prints PASS or FAIL from the beat.
  • A member who only reads the repository is still refused, as the issue asks.
  • I didn't keep a plan on the issue or record an estimate: the keep_plan and estimate tools were not available in this run.

Checks bun scripts/gate.ts --fix rewrapped one comment, which is committed. bun x tsc --noEmit is clean. scripts/fast.ts named 3,325 test files (about 280 minutes), too broad to run here, so I ran the covering ones myself: 63 files covering the keeper, MCP and release_keeper, releases, OPERATING and the v1 probe, all passing.

Try it With a token for a non-admin member on a team that writes the forge repository, run curl -H 'authorization: Bearer <token>' $FORGE/api/v1/keeper: it answers 200 with heartbeat. A read-only member's token answers 403.

🤖 Generated with Claude Code

Closes #15515

2 earlier comments · 1 event
commented

A non-admin person who can write trevato/forge now reads the release keeper's newest beat, on both GET /api/v1/keeper and the MCP tool release_keeper. Before this, both doors used mayRead, which needs the administer ability, so only an admin role passed. That is why a planner's token got 403 while the crew's run token, which counts as an agent and skips that check, got through.

Change

  • A new check, mayReadKeeper in src/release/gate.ts, lets in anyone mayRead already lets in, plus any account that can write the forge's own repository (canWrite).
  • src/http/api/keeper.ts and src/http/mcp/tools/release_keeper.ts use it. The refusal words, the ETag and the cache headers are the same.
  • /releases, rollback and the terminal screens still use mayRead, so nothing else gets wider. The answer carries versions, holds and the tick's reason string, never a secret, and the heartbeat's size cap is untouched.
  • docs/OPERATING.md now says who reads the beat. The "one unblocking action" no longer says it takes an admin token.

Tests test/keeper-writer-reads.test.ts sets up an org-owned forge repository with a "write" team and a "read" team:

  • A member on the write team gets 200 with the heartbeat, with an rw token and with an ro token. A GET is a read, so the token's scope does not matter here.
  • A member on the read team and anonymous get 403 with today's words.
  • Over MCP, the writer gets the same body as over HTTP and the reader is refused.

With the source change taken out, the writer test and the MCP test fail. The reader and anonymous tests pass either way, because those callers were refused before too; they guard against widening the read too far, and no test can fail on them without the change. The existing tests for the crew run token, a run on another repository and an app preview still pass.

Not changed

  • scripts/v1-probe.ts: its 403 message ("this token may not read the release history") is still true for a token that does not write the repository. Once production runs this change, a writer's token gets 200 and the probe's keeper line prints PASS or FAIL from the beat.
  • A member who only reads the repository is still refused, as the issue asks.
  • I didn't keep a plan on the issue or record an estimate: the keep_plan and estimate tools were not available in this run.

Checks bun scripts/gate.ts --fix rewrapped one comment, which is committed. bun x tsc --noEmit is clean. scripts/fast.ts named 3,325 test files (about 280 minutes), too broad to run here, so I ran the covering ones myself: 63 files covering the keeper, MCP and release_keeper, releases, OPERATING and the v1 probe, all passing.

Try it With a token for a non-admin member on a team that writes the forge repository, run curl -H 'authorization: Bearer <token>' $FORGE/api/v1/keeper: it answers 200 with heartbeat. A read-only member's token answers 403.

🤖 Generated with Claude Code

commented

A non-admin member's token that can write the forge's own repository (trevato/forge in production) now reads the release keeper's newest beat. That holds in all three places: GET /api/v1/keeper, the MCP tool release_keeper, and the terminal's Release keeper screen. Before, all three needed the administer ability, which only the admin role has, so a planner's token got 403. A member who only reads the repository, and anonymous, still get the same refusal.

  • What changed: mayReadKeeper in src/release/gate.ts lets in everyone mayRead lets in, plus anyone who can write the forge repository.
    • It is used by src/http/api/keeper.ts, src/http/mcp/tools/release_keeper.ts, and the terminal (the palette entry in src/tui/forge.ts and readKeeper in src/tui/screens/keeper.ts).
    • /releases and the terminal's Releases screen keep mayRead.
    • Holding releases, lifting a hold and asking for a release now still need mayRollBack.
    • The answer carries versions, holds and the tick's reason, never a secret, and the reason's size cap is unchanged.
  • Tests: test/keeper-writer-reads.test.ts sets up a forge repository owned by an org, with a team that writes it and a team that only reads it.
    • Writer: gets 200 and the beat with both an rw and an ro token, the same body over MCP, the palette entry, and the beat in readKeeper.
    • Reader-only member and anonymous: get 403 with today's words, and no palette entry or readKeeper answer.
    • With the source change removed, the writer, MCP and terminal tests fail. The reader and anonymous tests pass either way, because those callers were already refused; they guard against the read getting wider.
  • Docs: docs/OPERATING.md now says who may read the beat.
  • Not changed: scripts/v1-probe.ts. Its 403 message ("this token may not read the release history") is still true for a token that cannot write the repository. Once production runs this change, a writer's token gets 200 and the probe's keeper line prints PASS or FAIL.

The first push failed the gate's "both doors" rule because the terminal still used the old check; the second commit fixes that. That commit also drops the test's own user-making helper, which the gate had flagged as identical to one in test/tui-board-panel-remove.test.ts; it now uses promote from test/helpers/members.ts. bun scripts/gate.ts and bun x tsc --noEmit pass. scripts/fast.ts named 3,325 test files, too many to run here, so I ran the 44 files covering the keeper, releases and the terminal: 284 tests pass. The forge's full check runs on this push.

To try it: with a token for a non-admin member on a team that writes the forge repository, run curl -H 'authorization: Bearer <token>' /api/v1/keeper and get 200 with heartbeat, or open Release keeper from the terminal's command palette. A read-only member's token gets 403 and no palette entry.

🤖 Generated with Claude Code

Approved

Does what the issue asks: mayReadKeeper widens only the keeper read (HTTP, MCP, terminal) to writers of the forge repo; /releases and acting stay on mayRead/mayRollBack. Tests cover writer rw/ro, reader, anonymous, MCP and terminal. Non-blocking: the 403 text still says "administrators and its repository readers", which is now stale for writers; the box 3 gap is real (probe unchanged, needs production to run this).

commented

Left #15515 open: 1 unticked item remain (the probe's keeper line prints PASS or FAIL from that read in the crew's own shell).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs