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

The lane-stopped card carries a Merge action for each green pull waiting on a person #18348

opened this

Merged 2h 31m ago, live in production

The lane-stopped alarm now lists its green pulls one by one. Each pull that merges gets a Merge #N button that posts to the existing POST / / /pulls/ /merge; there is no new merge path. A green pull that no longer merges into main is listed separately, with its conflicting files and no button.

Notes

opened this

The lane-stopped alarm now lists its green pulls one by one. Each pull that merges gets a Merge #N button that posts to the existing POST /<owner>/<name>/pulls/<N>/merge; there is no new merge path. A green pull that no longer merges into main is listed separately, with its conflicting files and no button.

What changed

  • src/flow/alarm_lane.ts: LaneAlarm.waiting lists each green pull with its page and conflicting files. The Sentinel evidence links each pull as #N, and conflicting pulls get their own line in the evidence and the alarm sentence. onPeople and the queue counts are unchanged.
  • src/web/studio/alarm_lines.ts, boards-view.ts: on /boards, each green pull is a row under the alarm. The Merge form appears only when mayMergeOwn is true: the viewer can write the forge's repository and is not an agent. The route still checks permission, and mergePull checks the merge afresh. Anyone else sees the rows with no button.
  • Conflicts: the alarm stays a synchronous read of the database. It reads the forge's last merge reading of each pull through lastConflicts in src/core/pulls.ts, which pullStatus now records, so viewing a pull page also feeds it. Before /boards is drawn, src/flow/lane_conflicts.ts runs the existing pullMergeStates on the green pulls (cached, bounded, 300 ms budget). This is needed because the picture can be read in a worker, which never sees the main thread's memory.
  • Terminal: src/tui/screens/flow.ts prints one waitingLine per pull under the alarm: #N is green: merge it at <origin>/…/pulls/N, or #N conflicts with main in <files>.
  • docs/features/lane-stopped.md describes the action.

What to look at

  • A pull still being read when the 300 ms budget runs out shows a Merge button until the next draw. If someone presses it and the pull conflicts, the merge route refuses and says so. Nothing bad can land.
  • The Sentinel's hourly hunt is synchronous and runs no git. It only sees conflicts the forge has already read, from a pull page or a /boards draw.

Not done: no Merge from inside the terminal flow screen; it links to the pull, whose screen already merges. The terminal dashboard still shows only the alarm sentence, not the per-pull lines. The public flow view (publicOnly) does not get the list.

Tests: test/flow-alarm-lane.test.ts covers green (rows, form actions, no buttons without permission, the terminal line, nothing for public readers), conflicting (listed apart with the file named, no form) and cleared (the next merge ends the alarm and its list). The two existing assertions on the evidence wording were updated because the evidence now links each pull; the tests were not wrong. test/flow-lane-conflicts.test.ts builds a real repository where a branch clashes with main, runs readLaneConflicts, and checks that the alarm names door.ts. It also checks that a pull page's reading is what the alarm reads next.

Checks run: scripts/fast.ts reached 4,075 files, too many to run, so I ran 71 chosen files: the alarm, sentinel, boards, merge-reading and terminal-flow suites, plus the unused-exports, duplicate-import, module-state, hollow and door rules. 623 pass. The gate rules (0 fail), tsc --noEmit and design lint are clean. A commit carries No door: because the new module is a read behind the /boards alarm, not a page; its terminal side and how-to are the changed flow.ts and lane-stopped.md.

[
 {"go":"/boards","look":"the lane-stopped alarm line and the rows under it","expect":"one row per green pull linking to /trevato/forge/pulls/N, each with a Merge #N button","ask":"Does pressing Merge #N land the pull and come back to its page with 'Pull request merged.'?"},
 {"go":"/boards","look":"a green pull that conflicts with main","expect":"a row saying 'conflicts with main in <file>: it merges once brought up to date', with no button"},
 {"go":"/boards","look":"the alarm after a merge","expect":"the lane-stopped line and its rows are gone"}
]

🤖 Generated with Claude Code

Closes #18339

Show 2 earlier items

7 earlier comments
commented

When a person needs to merge pulls, the lane-stopped alarm on /boards now has a Merge #N button for each green pull. Pulls that conflict with main are listed separately with no button, because they need a rebase first. The waiting pulls are drawn as rows through rowList, like the other lists on that page.

The changed rendering is in src/web/studio/alarm_lines.ts and src/web/pages/boards-view.ts. The lane logic is in src/flow/alarm_lane.ts, and its tests are test/flow-alarm-lane.test.ts and test/flow-lane-conflicts.test.ts.

The latest commit adds a commit line Looks: /boards?help. The gate couldn't work out which page these files render on, and /boards?help is the pictured page closest to /boards. The gate now shows the note as "named". The alarm only appears while the lane is stopped, so a screenshot of /boards?help may not show it; the review steps below do.

Not done: there is no merge-all button. Each pull is merged on its own, and a conflicting pull is never offered a Merge.

To try it: stop the lane while a green pull is open, open /boards, and press Merge #N under the alarm.

[{"go":"/boards","look":"the lane-stopped alarm","expect":"one Merge #N button per green pull waiting on a person; conflicting pulls listed apart without a button","ask":"Does pressing Merge #N merge that pull and drop it from the list?"}]

🤖 Generated with Claude Code

commented

<!-- look-pages b940403838f5 --> Look pages for b940403, from the gate:

  • look pages (named): this pull changes src/web/pages/boards-view.ts, src/web/studio/alarm_lines.ts; a commit names /boards?help
commented

When a person needs to merge pulls, the lane-stopped alarm on /boards now has a Merge #N button for each green pull. Pulls that conflict with main are listed separately with no button, because they need a rebase first. The terminal's flow screen shows the same thing, and docs/features/lane-stopped.md explains it.

How conflicts are found: each time the forge checks whether an open pull merges cleanly, it now keeps what it found. The alarm reads that saved result (lastConflicts in src/core/pulls.ts) and never runs git while a page loads. The sentinel's lane finding uses the same result.

What to look at:

  • The rendering is in src/web/studio/alarm_lines.ts and src/web/pages/boards-view.ts.
  • The lane logic is in src/flow/alarm_lane.ts and src/flow/lane_conflicts.ts, tested by test/flow-alarm-lane.test.ts and test/flow-lane-conflicts.test.ts.
  • A commit line Looks: /boards?help names the page, since the gate couldn't trace the route. The alarm only appears while the lane is stopped, so a screenshot may not show it; the review steps below do.

The last check's failure: two tests in test/apps-rollout.test.ts failed on one runner: startingCount() read 0 right after boot. This pull doesn't touch app boot (src/apps/), and the test passes four times out of four here with main merged in. That was only in port mode, because this sandbox can't bind the unix sockets the check uses. I've merged main and pushed so the check runs again on a fresh base. If it fails the same way again, the cause is in the rollout path and needs its own look.

The gate, bun x tsc --noEmit and the two lane test files pass.

Not done: there is no merge-all button. Each pull is merged on its own, and a conflicting pull is never offered a Merge.

To try it: stop the lane while a green pull is open, open /boards, and press Merge #N under the alarm.

[{"go":"/boards","look":"the lane-stopped alarm","expect":"one Merge #N button per green pull waiting on a person; conflicting pulls listed apart without a button","ask":"Does pressing Merge #N merge that pull and drop it from the list?"}]

🤖 Generated with Claude Code

commented

<!-- look-pages a0e9661da92b --> Look pages for a0e9661, from the gate:

  • look pages (named): this pull changes src/web/pages/boards-view.ts, src/web/studio/alarm_lines.ts; a commit names /boards?help
commented

The lane-stopped alarm now lists each green pull waiting on a person. A pull that merges cleanly into main gets a Merge #N button, which posts to the existing POST /<owner>/<name>/pulls/<N>/merge; there is no new merge path. A green pull that no longer merges into main is listed separately, with its conflicting files and no button.

What changed

  • src/flow/alarm_lane.ts: LaneAlarm.waiting lists each green pull with its page and its conflicting files. The Sentinel evidence links each pull as #N, and conflicting pulls get their own line in the evidence and in the alarm sentence. onPeople and the queue counts are unchanged.
  • src/web/studio/alarm_lines.ts and boards-view.ts: on /boards, each green pull is a row under the alarm. The Merge form only appears when mayMergeOwn holds, meaning the viewer can write the forge's repository and is not an agent. The route still checks permission itself, and mergePull checks the merge again when pressed. Everyone else sees the rows without buttons.
  • Conflicts: the alarm stays a synchronous database read. It reads the forge's last merge reading of each pull through lastConflicts in src/core/pulls.ts. pullStatus now records that reading, so opening a pull page also updates it. Before /boards is drawn, src/flow/lane_conflicts.ts runs the existing pullMergeStates on the green pulls (cached, bounded, 300 ms budget). This step is needed because the page can be built in a worker, which never sees the main thread's memory.
  • Terminal: src/tui/screens/flow.ts prints one line per pull under the alarm: #N is green: merge it at <origin>/…/pulls/N, or #N conflicts with main in <files>.
  • docs/features/lane-stopped.md describes the action.

What to look at

  • If a pull is still being read when the 300 ms budget runs out, it shows a Merge button until the next draw. If someone presses it and the pull conflicts, the merge route refuses and says why, so nothing bad can land.
  • The Sentinel's hourly check is synchronous and runs no git. It only sees conflicts the forge has already read, from a pull page or a /boards draw.

Not done: there is no Merge inside the terminal flow screen; it links to the pull, whose own screen can merge. The terminal dashboard still shows only the alarm sentence, not the per-pull lines. The public flow view (publicOnly) does not get the list.

Tests: test/flow-alarm-lane.test.ts covers three cases:

  • Green: the rows and form actions, no buttons without permission, the terminal line, and nothing for public readers.
  • Conflicting: the pull is listed separately with the file named and no form.
  • Cleared: the next merge ends the alarm and its list.

Two existing assertions on the evidence wording were updated because the evidence now links each pull; those tests were not wrong. test/flow-lane-conflicts.test.ts builds a real repository where a branch clashes with main, runs readLaneConflicts, and checks that the alarm names door.ts. It also checks that the alarm next reads what a pull page recorded.

Checks run on a0e9661:

  • bun scripts/gate.ts --explain: 0 of 39 rules fail, including both doors, dead code and duplicate import.
  • bun x tsc --noEmit and bun scripts/design-lint.ts: clean.
  • Tests: the first-view budget (test/attention.test.ts), page-budget, pages-budget, the alarm and lane-conflict suites, boards-page, boards-doors, tui-boards, unused-exports, dup-imports, doorless and feature-doors all pass.

The look-pages note for a0e9661 only lists the pages review will open (/boards, /boards?help) and asks for no change, so this round adds no commit. A commit carries No door: because the new module is a read behind the /boards alarm, not a page; its terminal side and how-to are the changed flow.ts and lane-stopped.md.

[
 {"go":"/boards","look":"the lane-stopped alarm line and the rows under it","expect":"one row per green pull linking to /trevato/forge/pulls/N, each with a Merge #N button","ask":"Does pressing Merge #N land the pull and come back to its page with 'Pull request merged.'?"},
 {"go":"/boards","look":"a green pull that conflicts with main","expect":"listed apart, naming its conflicting files, with no Merge button"},
 {"go":"/boards?help","look":"the help text for the lane-stopped alarm","expect":"it names /boards as the page the alarm shows on"}
]

🤖 Generated with Claude Code

commented

The lane-stopped alarm now lists each green pull waiting on a person. Under the alarm on /boards, every pull that merges cleanly into main has a Merge #N button that posts to the existing POST /<owner>/<name>/pulls/<N>/merge; there is no new merge path. Green pulls that no longer merge into main come after those, in a second list labelled "Green pulls that need bringing up to date". Each one names its conflicting files and has no button.

What changed

  • src/flow/alarm_lane.ts: the alarm's waiting field lists each green pull with its number, title, page and conflicting files. The Sentinel evidence links each pull, and puts conflicting pulls on their own line, both in the evidence and in the alarm sentence.
  • src/web/studio/alarm_lines.ts: draws two lists, so a conflicting pull always comes after every Merge form. Each row's title is the pull's own title, escaped by row, with #N in the meta. The Merge form only appears when mayMergeOwn holds: the viewer can write the forge's repository and is not an agent. The route still checks who may merge, and mergePull checks the merge again.
  • Conflicts: the alarm stays a synchronous read of the database. It reads the forge's last merge reading of each pull through lastConflicts (src/core/pulls.ts). Opening a pull page records that reading. Before /boards is drawn, src/flow/lane_conflicts.ts also runs pullMergeStates on the green pulls (cached, bounded, 300 ms budget).
  • Terminal: src/tui/screens/flow.ts (waitingLines) prints the pulls in the same order as the page. The ones that merge come first, as #N <title>: green, merge it at <origin>/…/pulls/N. Then comes the same label, followed by #N <title>: conflicts with main in <files>. Control bytes are removed from titles before they reach the terminal.
  • docs/features/lane-stopped.md: describes the action, the second list, and that the terminal flow screen links to the pull instead of merging, because the pull's own terminal screen does the merge.

What to look at

  • If a pull is still being read when the 300 ms budget runs out, it shows a Merge button until the next draw. If someone presses it and the pull conflicts, the merge route refuses and says why.
  • The Sentinel's hourly check runs no git. It only sees conflicts the forge has already read, from a pull page or a /boards draw.

Not done: there is no Merge inside the terminal flow screen, and the terminal dashboard shows only the alarm sentence. The public flow view (publicOnly) does not get the list.

Tests:

  • test/flow-alarm-lane.test.ts:
    • Green case: checks the rows, that each row shows the pull's title escaped plus its #N, the form actions, no buttons for a viewer without permission, the terminal lines, and nothing for public readers.
    • Conflicting case: the conflicting pull is the older one. The test checks that the output has two lists with their own labels, that the conflicting row comes after the last Merge form, and that the terminal lists them apart the same way.
  • The "cleared" test is now in test/flow-lane-conflicts.test.ts, because that file has a real repository to merge in. It merges through mergePull, checks that lastMerge equals the merged_at the merge wrote, and that the alarm is gone a minute later. It also checks that 91 minutes later the alarm fires again with since and last merge at set to that merge's time. I deleted the old version that faked the merge with two UPDATE statements.
  • Two older assertions on the evidence wording were updated because the evidence now links each pull; those tests were not wrong.

Checks run: bun scripts/gate.ts --explain found 0 failures in 39 rules. bun x tsc --noEmit and bun scripts/design-lint.ts are clean. 125 tests passed, covering the alarm and lane-conflict suites, the first-view budget (attention), page-budget, dead code, duplicate imports, both doors, the boards suites and the terminal boards and flow suites. I did not open /boards on the preview: it sends my token to the sign-in page, so the rows and buttons are judged from the source and the tests.

[
 {"go":"/boards","look":"the lane-stopped alarm line and the first list under it","expect":"one row per mergeable green pull, titled with the pull's title and its #N, linking to /trevato/forge/pulls/N, each with a Merge #N button","ask":"Does pressing Merge #N land the pull and come back to its page with 'Pull request merged.'?"},
 {"go":"/boards","look":"below the mergeable pulls","expect":"a small label 'Green pulls that need bringing up to date' and a second list naming each conflicting pull's files, with no Merge button"},
 {"go":"/boards?help","look":"the help text for the lane-stopped alarm","expect":"it names /boards as the page the alarm shows on"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 1886b496797a --> Look pages for 1886b49, from the gate:

  • look pages (named): this pull changes src/web/pages/boards-view.ts, src/web/studio/alarm_lines.ts; a commit names /boards?help
commented

The lane-stopped alarm now lists its green pulls one by one. Each pull that can merge gets a Merge #N button that posts to the existing POST /<owner>/<name>/pulls/<N>/merge; there is no new merge path. A green pull that no longer merges into main is listed separately, with its conflicting files and no button.

What changed

  • src/flow/alarm_lane.ts: LaneAlarm.waiting lists each green pull with its page and conflicting files. The Sentinel evidence links each pull as #N. Conflicting pulls get their own line in the evidence and in the alarm sentence. onPeople and the queue counts are unchanged.
  • src/web/studio/alarm_lines.ts, boards-view.ts: on /boards, each green pull is a row under the alarm. The Merge form appears only when mayMergeOwn is true, which means the viewer can write the forge's repository and is not an agent. The route still checks permission, and mergePull checks the merge again. Anyone else sees the rows without a button.
  • Conflicts: the alarm is still a synchronous read of the database. It reads the forge's last merge reading of each pull through lastConflicts in src/core/pulls.ts. pullStatus now records that reading, so viewing a pull page also feeds the alarm. Before /boards is drawn, src/flow/lane_conflicts.ts runs the existing pullMergeStates on the green pulls (cached, bounded, 300 ms budget). This step is needed because the page can be built in a worker, which never sees the main thread's memory.
  • Terminal: src/tui/screens/flow.ts prints one waitingLine per pull under the alarm: #N is green: merge it at <origin>/…/pulls/N, or #N conflicts with main in <files>.
  • docs/features/lane-stopped.md describes the action.

What to look at

  • If the 300 ms budget runs out while a pull is still being read, that pull shows a Merge button until the next draw. If someone presses it and the pull conflicts, the merge route refuses and says so, so nothing bad can land.
  • The Sentinel's hourly hunt is synchronous and runs no git. It only sees conflicts the forge has already read, from a pull page or a /boards draw.
  • The gate's look-pages note is met by the existing commit line Looks: /boards?help. That page is in app.looks and looksAsOwner, and it shows the alarm rows. No code change was needed for the note, so this round adds no commit.

Not done: there is no Merge inside the terminal flow screen; it links to the pull, whose screen already merges. The terminal dashboard still shows only the alarm sentence, not the per-pull lines. The public flow view (publicOnly) does not get the list.

Tests: test/flow-alarm-lane.test.ts covers three cases:

  • green: the rows, the form actions, no buttons without permission, the terminal line, and nothing for public readers
  • conflicting: listed apart with the file named, and no form
  • cleared: the next merge ends the alarm and its list

Two existing assertions on the evidence wording were updated because the evidence now links each pull; those tests were not wrong. test/flow-lane-conflicts.test.ts builds a real repository where a branch clashes with main, runs readLaneConflicts, and checks that the alarm names door.ts. It also checks that what a pull page reads is what the alarm reads next.

Checks run on 1886b49:

  • The gate: 39 rules, 0 failing. That includes dead code, duplicate-import, both doors and the look rule.
  • tsc --noEmit and design lint: clean.
  • scripts/fast.ts reached 4,077 files, too many to run, so I ran the alarm, lane-conflict, attention (first-view budget), unused-exports, dup-imports, doorless and feature-doors suites. All 52 tests pass. /boards uses exactly its first-view budget (345/345 at both widths).
  • One commit carries No door: because the new module is a read behind the /boards alarm, not a page. Its terminal side and how-to are the changed flow.ts and lane-stopped.md.
[
 {"go":"/boards","look":"the lane-stopped alarm line and the rows under it","expect":"one row per green pull linking to /trevato/forge/pulls/N, each with a Merge #N button","ask":"Does pressing Merge #N land the pull and come back to its page with 'Pull request merged.'?"},
 {"go":"/boards","look":"a green pull that conflicts with main","expect":"a row saying 'conflicts with main in <file>: it merges once brought up to date', with no button"},
 {"go":"/boards","look":"the alarm after a merge","expect":"the lane-stopped line and its rows are gone"}
]

🤖 Generated with Claude Code

Closes #18339

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs