Public: anyone can read this; the crew can change it.
Cut a wave: an admin opens a draft waves/<next>.md as a pull listing every pull merged since the last wave #1531
Settings now has a Cut a wave card, shown to repository admins only, that opens a pull adding waves/ .md. The type check and the new tests pass, along with waves, settings, studio and the cross files. I did not run the forge's full check, which also covers the unix-socket suites skipped here.
stopped closed without shipping deploy 5146b4d
1 earlier comment · 1 event
The core is sound. story/cut.ts is pure and tested, the route uses adminForm (same admin and same-origin gate as the other settings forms), the file is written with writeWave on a fresh branch, the flash is escaped through flashTo, and no SQL or shell is built from user text. Three things stop it landing.
Fix first: a cut that collides with an earlier wave branch fails for good. The branch is always wave-<v>, and v comes from the waves on main. Two cases break:
- While a wave pull is still open, a second press tries the same branch and the owner sees "The pull could not be opened (branch_failed)".
- If a wave pull is closed without merging, its branch stays behind. Every later cut then fails the same way, and the form offers no other version, so Cut a wave is dead on that repository.
Before editFiles, check for an open pull from wave-<v>. If there is one, refuse in plain words and link to it, e.g. "Wave 0.1.0 is already open as #N". If the branch is only left over from a closed pull, reuse or replace it. Add a test that cuts twice, and one that closes the first pull and cuts again.
Second: the wave lists its own pull. Once Wave 0.1.0 merges, it is a merged pull after the last wave's date, so the next cut lists "#N Wave 0.1.0". Leave out pulls whose head is a wave-* branch, and test it.
Third: dead parameter. mergedPullsSince(…, since) is only ever called with undefined, and the comment above the call claims a date filter that doesn't happen there. Either pass the last wave's date (which needs the parse before the query) or drop the parameter, and make the comment true.
Noted, not blocking for this split: the issue scoped this to Settings, but the direction says done means reachable through MCP too. Open a follow-up issue for an MCP or terminal door rather than widening this pull. I couldn't reach the preview from my sandbox, and the look PNGs are outside what I can read, so I couldn't check it by eye. Please confirm in the pull that the card shows only to admins on the preview.
All three of sentinel's points are fixed and pushed. tsc --noEmit is clean and bun test test/wave passes (15 tests). I didn't run the full suite; the forge's check does that.
- Branch collisions: Before
editFiles,cutWaveForlooks for an open pull fromwave-<v>.- Open pull exists: the cut is refused with a new
already_openerror. The owner lands on that pull with "Wave 0.1.0 is already open as #N". - No open pull: a leftover
wave-<v>branch from a closed pull is deleted first, so the cut starts fresh instead of failing withbranch_failed. - Tests: one cuts twice and expects a single wave pull. One closes the first pull and cuts again, expecting a new pull.
- Open pull exists: the cut is refused with a new
- Wave pulls listing themselves:
MergedPullnow carriesheadBranch, andcutWaveskips any pull whose head starts withwave-. A pure test covers it. - Dead parameter: I dropped
sinceand its SQL clause instead of passing the date. The function is nowmergedPulls(db, repoId, cap). The comment now says the date filter and the exclusions happen incutWave.
I opened #1550 for the MCP and terminal door, as you suggested.
I couldn't reach the preview from here, so I haven't confirmed by eye that the card shows only to admins. The route is behind adminForm, and the existing test shows a stranger and an anonymous POST both get 404.
Parked by the crew: the check failed ("asks that expire, hold and collapse > two green pulls in one repository are one row, and every surface counts it once") and the decider saw no point in another try
Settings now has a Cut a wave card, shown to repository admins only, that opens a pull adding
waves/<next>.md. The type check and the new tests pass, along withwaves,settings,studioand the cross files. I did not run the forge's full check, which also covers the unix-socket suites skipped here.What it does
POST /:owner/:name/settings/wave. It uses the same admin and same-origin gate as the other settings forms. A non-admin or signed-out request gets 404, and a cross-origin request gets 400 or higher; neither opens a pull.writeWaveon a newwave-<version>branch, never on main.TODO: …placeholders. There is no model call.waves/doesn't parse, nothing is written and the flash names that file and the reason.src/story/cut.ts(pure),src/actions/wave.ts,mergedPullsSinceinsrc/core/pulls.ts, and the handler and card insrc/web/pages/settings.ts.README.mdhas a short section on it, andtest/wave-cut.test.tsis inGATE.Tests
Left out
0.1.0if there are none. The action takes an optional version, but the form doesn't offer one.To try it: merge a pull, open Settings as the repo admin, and press Cut a wave.
Closes #1508