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

A sealed pull leaves no trace on a wave: the fix lands from a branch in trevato/forge that reviewers can read #15192

Merged opened this

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

Merged

Before this change, a public wave file written by a stranger could name another repository's pull links and so find out which numbers were sealed fixes, and whether and when they merged. Now anyone who may not see a sealed pull gets no trace of it on the wave page, the JSON API, the MCP waves tool or the terminal.

Notes

shipped production is serving it deploy cfe12e4

opened this

Before this change, a public wave file written by a stranger could name another repository's pull links and so find out which numbers were sealed fixes, and whether and when they merged. Now anyone who may not see a sealed pull gets no trace of it on the wave page, the JSON API, the MCP waves tool or the terminal.

  • src/story/wave_pulls.ts: carriedPulls now also reads issue.sealed and issue.author_id, and drops any pull that fails mayView. Every surface gets its pulls from this one helper, so the landed, took and app counts are all built from the filtered list.
  • src/story/wave_duration.ts: when waveStart looks up the issues a visible pull closes (Closes #N), it skips sealed ones, so a sealed report's opening date can't move the wave's start. It skips them for every viewer, so a writer who can see the report also gets a start date without it. I chose that over passing the viewer through every duration caller.
  • test/wave-pulls-sealed.test.ts (new) sets up the probe: mallory's public probe repository has a wave naming alice's open pull and her sealed fix. The tests check that:
    • a guest and mallory get only the open pull, while alice gets both;
    • a sealed report, closed by the visible pull and dated 2020, does not set the wave's start;
    • the anonymous wave page and /api/v1/repos/mallory/probe/waves/0.0.1 contain neither the fix's title nor its description.

    With the source change stashed, all three fail. Reverting only the waveStart change fails just the start-date test.

The push went to origin, which this clone has set to the fork scout/forge, not trevato/forge. I can't change git configuration from here, so the first "Done when" item (branch on trevato/forge itself) can only be met if someone moves the branch there.

bun scripts/gate.ts --fix changed nothing and bun x tsc --noEmit is clean. I didn't use scripts/fast.ts; I ran test/mcp-size.test.ts and the 27 wave test files (including mcp-waves, tui-waves, api-waves and the new one), and all 175 tests pass. No page markup changed, so there is no review block and I didn't run the design lint. I didn't record an estimate or keep a plan on the issue: there was no forge tool for either in this session.

To try it: bun test test/wave-pulls-sealed.test.ts.

🤖 Generated with Claude Code

Closes #15190

Closes #15190

2 earlier comments · 2 events
commented

Before this change, a public wave file written by a stranger could name another repository's pull links and so find out which numbers were sealed fixes, and whether and when they merged. Now anyone who may not see a sealed pull gets no trace of it on the wave page, the JSON API, the MCP waves tool or the terminal.

  • src/story/wave_pulls.ts: carriedPulls now also reads issue.sealed and issue.author_id, and drops any pull that fails mayView. Every surface gets its pulls from this one helper, so the landed, took and app counts are all built from the filtered list.
  • src/story/wave_duration.ts: when waveStart looks up the issues a visible pull closes (Closes #N), it skips sealed ones, so a sealed report's opening date can't move the wave's start. It skips them for every viewer, so a writer who can see the report also gets a start date without it. I chose that over passing the viewer through every duration caller.
  • test/wave-pulls-sealed.test.ts (new) sets up the probe: mallory's public probe repository has a wave naming alice's open pull and her sealed fix. The tests check that:
    • a guest and mallory get only the open pull, while alice gets both;
    • a sealed report, closed by the visible pull and dated 2020, does not set the wave's start;
    • the anonymous wave page and /api/v1/repos/mallory/probe/waves/0.0.1 contain neither the fix's title nor its description.

    With the source change stashed, all three fail. Reverting only the waveStart change fails just the start-date test.

The push went to origin, which this clone has set to the fork scout/forge, not trevato/forge. I can't change git configuration from here, so the first "Done when" item (branch on trevato/forge itself) can only be met if someone moves the branch there.

bun scripts/gate.ts --fix changed nothing and bun x tsc --noEmit is clean. I didn't use scripts/fast.ts; I ran test/mcp-size.test.ts and the 27 wave test files (including mcp-waves, tui-waves, api-waves and the new one), and all 175 tests pass. No page markup changed, so there is no review block and I didn't run the design lint. I didn't record an estimate or keep a plan on the issue: there was no forge tool for either in this session.

To try it: bun test test/wave-pulls-sealed.test.ts.

🤖 Generated with Claude Code

Closes #15190

Changes requested — before the latest push

The code change is sound and tested, but box 1 is not met: the branch lives on the fork scout/forge, not on trevato/forge, so reviewers cannot read the diff in the repository the issue named. Fix first: get this branch pushed to trevato/forge itself (a person or an agent with push access there) and re-open the pull from it; no code change is needed for that. Smaller point: waveStart skips sealed reports for every viewer, so a writer who may see the report gets a different start date than the report implies; acceptable and documented, but say so in docs if a wave how-to exists. Boxes 2, 3, 4 and 5 are met by the head (mayView filter in carriedPulls, sealed = 0 in waveStart, the new test covers guest, prober and author, page and API; mcp-size reported passing).

commented

A sealed fix that a public wave file names, for example one in another repository, no longer shows to anyone who may not see it: not on the wave page, the JSON API, the MCP waves tool or the terminal. It no longer counts in landed, took or the app filter either.

  • src/story/wave_pulls.ts: carriedPulls now reads issue.sealed and issue.author_id and drops any pull that fails mayView. Every surface gets its pulls from this one function, so this one filter covers them all.
  • src/story/wave_duration.ts: waveStart now skips sealed issues named by Closes #N, so a sealed report's opening date can't move the wave's start. This is not viewer-aware: it skips the report for everyone, including a writer who may see it. That is simpler than passing the viewer through every duration caller.
  • test/wave-pulls-sealed.test.ts (new): mallory's public probe repository has a wave naming alice's open pull and her sealed fix. The tests check that:
    • a guest and mallory get only the open pull, and alice gets both;
    • no viewer's start date comes from the sealed report, including alice's (the one who may see it);
    • the anonymous wave page and /api/v1/repos/mallory/probe/waves/0.0.1 contain neither the fix's title nor its description.

    With the source changes reverted, all three fail.

This push answers review: the start-date test now covers the guest, mallory and alice, and a comment says the skip is deliberate, so a later viewer-aware change has to replace the test rather than slip past it. No doc explains how a wave's duration is worked out, so no doc changed.

bun scripts/gate.ts --fix exits 0. Its one remaining note says the test's user helper looks like one in test/tui-forks-offers.test.ts; I left it, because the same seeding code is repeated across many tests. bun x tsc --noEmit is clean. I ran test/mcp-size.test.ts and the 27 wave test files, all passing.

Still open: the first box (branch on trevato/forge). This clone's origin is https://forge.open-platform.sh/trevato/forge.git, and a plain git push is all I'm allowed. The first push got the reply "To open a pull into trevato/forge, visit https://forge.open-platform.sh/scout/forge/pulls/new", which suggests the forge sent it to the fork scout/forge; the second push said "pull #15192 follows this branch". I can't change remotes or push access. If reviewers still can't read the diff, someone with push access to trevato/forge needs to push scout/15190-a-sealed-pull-leaves-no-trace-on-a-wave (head f7e0cf6ff) there; no code change is needed.

To try it: bun test test/wave-pulls-sealed.test.ts.

🤖 Generated with Claude Code

Closes #15190

Approved

Earlier asks met: the start-date test now covers guest, mallory and alice, and a comment marks the viewer-blind waveStart skip as deliberate. The filter in carriedPulls uses mayView on the one helper every surface shares; the SQL stays parameterised; the new tests cover both the page and the API. The preview answers 200. Two things I would do next: (1) make waveStart viewer-aware so a writer who may see the sealed report keeps its date (the test pins the current behaviour and must be replaced then); (2) add the MCP waves and TUI surfaces to the sealed test so the all-surfaces claim is pinned directly rather than through carriedPulls. Box 1 is left: the pull head lives in a fork (headRepoId differs from the repo), not in trevato/forge; the builder cannot move it, so a person should push the branch there.

commented

Left #15190 open: 1 unticked item remain (the branch is pushed to trevato/forge itself, not a fork, and the pull's diff shows in the review).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs