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

crewNow shows nothing sealed, private or hidden to someone who may not see it #14920

Merged opened this

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

Merged

The crew line on a forge link's page (/claim, /welcome) and the terminal's crew-now screen are shown to anyone. They no longer list runs that a signed-out reader may not see. Before this change the only filter in BYSTATE (src/core/crewnow.ts) was repo.visibility = 'public'.

Notes

shipped production is serving it deploy 9504585

opened this

The crew line on a forge link's page (/claim, /welcome) and the terminal's crew-now screen are shown to anyone. They no longer list runs that a signed-out reader may not see. Before this change the only filter in BY_STATE (src/core/crew_now.ts) was repo.visibility = 'public'. Each of the five per-state reads now also leaves out:

  • Sealed reports: runs on a sealed issue (i.id IS NULL OR i.sealed = 0), so a security report's title, summary and reason never show.
  • Private apps: runs of a private app, even when its repository is public (NOT EXISTS … app.access = 'private'). This matches mayReadRuns.
  • Held owners: repositories whose owner is suspended or removed, using the shared OWNER_STANDING clause from core/visibility.ts. The repository's table alias went from p to repo so that clause fits as written.

The issue says "unless the viewer may see them", but this function has no viewer: the page and the terminal screen show the same list to everyone, so these rows are always left out. Signed-in readers who may see them still get them through the per-viewer route (actions/crew_now.ts), which this change does not touch. The read is still one statement.

Tests: test/crew-now-hidden.test.ts has one test per exclusion, and each of the three fails without the fix. A fourth test confirms the read is still one statement. These pass along with link-crew-now, claim-page-words and tui-crew, and bun x tsc --noEmit is clean. scripts/fast.ts said the change reaches 2,392 test files, far over its budget, so I picked the tests above by hand and the forge's check runs the rest. I didn't call keep_plan or estimate because neither tool is available in this session. The finding in #14766 still needs ticking by someone who can edit that issue.

To try it: bun test test/crew-now-hidden.test.ts.

🤖 Generated with Claude Code

Closes #14906

commented

The crew line on a forge link's page (/claim, /welcome) and the terminal's crew-now screen are shown to anyone. They no longer list runs that a signed-out reader may not see. Before this change the only filter in BY_STATE (src/core/crew_now.ts) was repo.visibility = 'public'. Each of the five per-state reads now also leaves out:

  • Sealed reports: runs on a sealed issue (i.id IS NULL OR i.sealed = 0), so a security report's title, summary and reason never show.
  • Private apps: runs of a private app, even when its repository is public (NOT EXISTS … app.access = 'private'). This matches mayReadRuns.
  • Held owners: repositories whose owner is suspended or removed, using the shared OWNER_STANDING clause from core/visibility.ts. The repository's table alias went from p to repo so that clause fits as written.

The issue says "unless the viewer may see them", but this function has no viewer: the page and the terminal screen show the same list to everyone, so these rows are always left out. Signed-in readers who may see them still get them through the per-viewer route (actions/crew_now.ts), which this change does not touch. The read is still one statement.

Tests: test/crew-now-hidden.test.ts has one test per exclusion, and each of the three fails without the fix. A fourth test confirms the read is still one statement. These pass along with link-crew-now, claim-page-words and tui-crew, and bun x tsc --noEmit is clean. scripts/fast.ts said the change reaches 2,392 test files, far over its budget, so I picked the tests above by hand and the forge's check runs the rest. I didn't call keep_plan or estimate because neither tool is available in this session. The finding in #14766 still needs ticking by someone who can edit that issue.

To try it: bun test test/crew-now-hidden.test.ts.

🤖 Generated with Claude Code

Approved

BY_STATE now drops sealed-issue runs, private-app runs and suspended/removed owners (OWNER_STANDING, alias renamed to repo so it fits). Still one statement, and the web page and TUI screen share the same read, so both doors stay consistent. Tests cover each exclusion plus the one-statement budget. Next: (1) confirm the per-viewer route in actions/crew_now.ts gets the same three filters for viewers who may see them; (2) add a one-line note to docs/features/crew-now.md that the public line omits sealed, private-app and held-owner runs.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs