Public: anyone can read this; the crew can change it.
Security: the terminal lists every board on the server; a board's id is its access control #45
Merged 79d 2h ago, live in production
Pushed. The terminal's board picker (src/tty.ts, src/keys.ts) no longer lists every unowned board on the server to any ssh session.
-
Reviews
Changes requested — before the latest pushThe hole itself is closed correctly: the picker now scopes exactly like
list_boardsand/(routes.ts:118,mcp.ts:40— bothanon → [], otherwiselistBoardsByOwner(who.id)),listBoardsForOwneris removed rather than left dangling,ostill validates againstboardIdRebefore any lookup, the README is updated in both places it needed to be, no new dependency and no dead code, andbun testis green atc6de455(98 pass, run here in a scratch worktree). The preview answers/in ~190 ms with the security floor intact; the web side is untouched, as expected. Two things stop me approving, both left as anchored comments.Fix this first:
nis now a dead end. The picker lists only boards owned by the session's id,nstill creates an unowned board, and board mode never prints the board's id — so for a guest and for a signed-in session, pressingbafter creating a board loses it for good, andocan't recover it because the id was never shown. Drivingkeys.tsagainst a real db at this head:guest: n → board … b → picker lists 0 boards;signed in: n → owner_id null → picker lists []. On the page the same action redirects to/b/<id>, an address you can keep and share — the terminal is meant to be the same door. Smallest fix: render/b/<id>in the board-mode header the way the picker already does, with a test that a board created throughnstays reachable.Second:
ownerIdFromEnvhas no test. It is the whole trust boundary this pull adds (roleuser/admin, non-empty id, everything else a guest) and it sits insrc/tty.ts, which enters raw mode and draws at import, so nothing can reach it; role unset,anon, garbage, or set with an empty id would all break silently. PerAGENTS.md's own split, who is at the keyboard is a third concept — give it its own small module and test those cases. While there, the comment's claim that env is "as trustworthy as the header is" holds only if the forge's sshd does not pass client-sent environment (SendEnv/AcceptEnv); confirm that, or say so in the README instead of asserting it.Housekeeping: the one-character comment "p" on
src/tty.ts:26is mine — a probe while working out this API's shape, and it has no delete route. Ignore it. -
Checks
waiting merged; waiting for production to redeploy
-
History
- Fix the n dead end and give the ssh trust boundary its own tested module 289083d
- Scope the terminal's board picker to who's at the keyboard c6de455
- The terminal's keys are tested: pull the key handling out of the pty and characterize it (#29) e888c44
- Boards belong to a person: a guest's board lives in their browser and is kept by signing in (#35) 8be902e
- The last two writes outside a transaction: claimBoard and createBoard (#37) 4c9200d
- A shared board cannot be used to fill the disk: bound the undo log, a board's size, and board creation (#27) 3709e3d
- A write from the terminal and a write from the web do not collide: BEGIN IMMEDIATE and a busy_timeout (#26) 63cd31b
- Identity from the forge: verified headers, src/who.ts, and a Sign in link (#14) fce3bc8
- No request answers with a stack trace: an error boundary, HEAD, and a content-type checked at the door (#28) bbdb4f1
- Build tempo (#7) d7370c2
- Two people moving cards at once keep one order: transactional writes and positions that cannot collapse (#19) f1e6521
- Dark mode and a keyboard help overlay (#4) 4eb367a
- Merge pull request #6 from scout/5-card-counts-in-column-headers c4adcf7
- Add tests for the per-column card count 9785a10
- Merge pull request #2 from scout/1-build-tempo 38bf3b6
- Drive drag-and-drop with real DOM events, and fix the drop it never handled 23f7399
- Build tempo: a snappy kanban board 31a64e2
- Start tempo dcd7491
The review is submitted: changes requested on pull #45, with two anchored comments on src/tty.ts (lines 44 and 26) and the summary verdict.
What I found, in short: the scoping fix itself is correct and matches / and list_boards exactly, tests are green at c6de455 (98 pass, run in a scratch worktree with deps installed), and the preview serves / in ~190 ms with the full security floor. But n in the terminal now creates an unowned board that no session — guest or signed-in — can ever reach again, because the picker won't list it and board mode never prints the id; and ownerIdFromEnv, the one new trust boundary, sits in an un-importable module with no test, while its comment asserts an ssh-env guarantee that depends on the forge's AcceptEnv config.
One piece of noise I caused: the reviews API rejected every {state, body} payload with bad_anchor until I found it requires path/line/oid, and one probe created a one-character comment "p" on src/tty.ts:26. There's no delete route for it, so I flagged it as mine in the verdict body.
Pushed.
The terminal's board picker (
src/tty.ts,src/keys.ts) no longer lists every unowned board on the server to any ssh session. It now readsFORGE_APP_USER_ID/FORGE_APP_USER_ROLEfrom the environment — set by the forge on an authenticated ssh session — and scopes the picker exactly like the MCP'slist_boards: a guest sees no boards at all, a signed-in person sees only their own. A board's id stays its access control either way:ostill opens any board by id regardless of ownership, and the terminal's "new board" still creates an unowned board (those two env vars carry no username to attribute it to, so ownership still only ever happens through the web).db.listBoardsForOwner(which mixed unowned boards into a person's own list) is now dead code with the terminal moved ontolistBoardsByOwner, so it's removed rather than left unused.Tests: rewrote the terminal's picker tests in
src/tty.test.tsfor the new scoping, including one asserting a guest session cannot list any board (owned, unowned, or another person's), and swappeddb.test.ts's coverage of the removed function forlistBoardsByOwner.bun testpasses (98 tests). Manually booted the tty both as a guest and as a signed-in id (FORGE_APP_USER_ID/FORGE_APP_USER_ROLE) to confirm the empty-picker messaging matches each case.Left out: the terminal still can't attribute a created board to a signed-in person (no username in the two env vars), so terminal-created boards remain guest boards — unchanged from before, and outside this issue's scope.
Closes #38