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

A stuck-flow alarm names the one action that unblocks it, as a link the owner taps #15179

Merged opened this

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

Merged

The stuck-pull alarm now names the one action that unblocks it, as a label and a path to the pull. The type check and the four related flow-alarm test files pass (23 tests); I did not run the full suite, and the forge's check will.

Notes

shipped production is serving it deploy 2e2f83f

opened this

The stuck-pull alarm now names the one action that unblocks it, as a label and a path to the pull. The type check and the four related flow-alarm test files pass (23 tests); I did not run the full suite, and the forge's check will.

  • What changed: alarmStuck returns action: {label, path} when it fires, and the path is always /owner/name/pulls/N. The stage decides the label:
    • Access wall: "Allow or send back".
    • Last event a red check: "Open the red check".
    • Any other quiet stage: "Merge it".
    • Where it appears: the alarm card on /flow takes its link from the action and shows the label as action beside href.
  • Viewer permission: the link only opens the pull page, which the viewer can already read. Whether they can actually merge is still decided on that page. The public-only alarm never offers a merge on its own.
  • Tests: test/flow-alarm-stuck-action.test.ts has one test for each stage and one for the card. It also covers the unfired case and the public-only reader. Without the change those tests fail, because action doesn't exist.
  • Left out: the card shows the label as data only, and I did not restyle /flow or the TUI dashboard to print it, so nothing visible changes yet. I also gave "a run" and "a push" the same merge label as the quiet stages.

To try it, make an approved pull quiet for more than 30 minutes and open /flow. The stuck card links to the pull.

🤖 Generated with Claude Code

Closes #15164

8 earlier comments · 2 events
commented

The stuck-pull alarm now names the one action that unblocks it, as a label and a path to the pull. The type check and the four related flow-alarm test files pass (23 tests); I did not run the full suite, and the forge's check will.

  • What changed: alarmStuck returns action: {label, path} when it fires, and the path is always /owner/name/pulls/N. The stage decides the label:
    • Access wall: "Allow or send back".
    • Last event a red check: "Open the red check".
    • Any other quiet stage: "Merge it".
    • Where it appears: the alarm card on /flow takes its link from the action and shows the label as action beside href.
  • Viewer permission: the link only opens the pull page, which the viewer can already read. Whether they can actually merge is still decided on that page. The public-only alarm never offers a merge on its own.
  • Tests: test/flow-alarm-stuck-action.test.ts has one test for each stage and one for the card. It also covers the unfired case and the public-only reader. Without the change those tests fail, because action doesn't exist.
  • Left out: the card shows the label as data only, and I did not restyle /flow or the TUI dashboard to print it, so nothing visible changes yet. I also gave "a run" and "a push" the same merge label as the quiet stages.

To try it, make an approved pull quiet for more than 30 minutes and open /flow. The stuck card links to the pull.

🤖 Generated with Claude Code

Changes requested — before the latest push

The action is computed but no person or screen ever sees it, so the issue (a link the owner taps) is not met. Fix, in one round:

  1. Render the label. src/web/studio/alarm_lines.ts alarmLines still prints only a.says as the link text; show a.action as the link text or a visible button. The preview /flow has no "Merge it" text. Add a test of the rendered HTML.
  2. Both doors: src/tui/screens/flow.ts (line ~163) prints only a.says; print the action label and path there too. Add docs/features/<name>.md (e.g. flow-keeper.md or a new flow-stuck.md) describing it; not the README.
  3. Wrong action for a run in progress or a push: the label says "Merge it" when the last event is not a green check. Give those stages their own honest label, or none, and test each stage (the issue box 2 says each stage).
  4. The wall and red labels all open the same page path; point red at the check log anchor if one exists.
  5. Make the stage type a shared union rather than inline string literals, and drop the unused-looking export if nothing else uses it.
commented

The stuck-pull alarm now shows its action as a link on the flow board and in the terminal, with a label per stage. The type check and 52 tests across the flow-alarm and terminal flow files pass; I did not run the full suite.

  1. Rendered on the page. alarmLines prints the alarm sentence, then the action label as the link, for example <a href="/alice/r/pulls/7">Merge it</a>. Alarms without an action keep the old sentence-as-link form. A new test in test/flow-alarm-stuck-action.test.ts checks the rendered HTML.
  2. Terminal and docs. The src/tui/screens/flow.ts flow screen prints <sentence> <label>: <path>. docs/features/flow-stuck.md is new and describes the stages and their links.
  3. Honest labels.
    • Wall: "Allow or send back".
    • Red check: "Open the red check".
    • Green check: "Merge it".
    • Anything else (a run in progress, a push, a review, a release): "Open the pull", which only opens the pull page.
    • Each stage has a test.
  4. Red opens the check. It links to the latest check's run page, /owner/name/runs/<id>. I did not find a log anchor, so it links the run page.
  5. Types. StuckStage is now a shared union (wall | red | green | other). stuckAction stays exported because the new tests use it.

The repository's pre-push hook wanted a commit saying how to try the change, so I added an empty "Try:" commit.

To try it: leave an approved pull quiet for 30 minutes, open /flow, and look for the link at the end of its alarm line.

🤖 Generated with Claude Code

commented

<!-- look-pages cd15a6683945 --> Look pages for cd15a66, from the gate:

  • look pages (inferred): this pull changes src/web/studio/alarm_lines.ts; the forge pictures / (src/web/studio/alarm_lines.ts), /docs (src/web/studio/alarm_lines.ts), /explore (src/web/studio/alarm_lines.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

A stuck-pull alarm on /flow and in the terminal now ends in the one action that unblocks the pull, as a link. That is the original change. This push fixes the check's red on this pull, which came from one missing piece.

The cause was that docs/features/flow-stuck.md had no front matter. The features index requires each note to open with topic: and row:, so that one note broke the features-index and feature-note tests. I added topic: Ship and undo and a row: line. After the fix, test/feature-orphans.test.ts, test/features-index-script.test.ts, test/feature-front-matter.test.ts, test/flow-alarm-stuck-action.test.ts and test/fork-tree-chip.test.ts pass here. That covers the notes tests and the fork-tree-chip test from the check's list.

The other failures in the check log are in the page-budget and report timing tests. The forge says test/repo-pages-timing.test.ts, test/page-budget.test.ts and test/pages-budget.test.ts are already red on main at abfb176, so they are not counted against this pull. I did not run them or the full suite here.

What the pull does

  • Which action: an approved, unheld pull quiet for 30 minutes gets a named action.
    • Held at the access wall: Allow or send back, opening the pull.
    • Last event a red check: Open the red check, opening that check's run page.
    • Last event a green check: Merge it, opening the pull.
    • Anything else: Open the pull.
  • Where it shows: the label is the link text on /flow and /boards. The terminal flow screen prints label: path.
  • What I left out: merge rights are not checked at the alarm. The target page decides whether the viewer may merge.
  • Code and tests: the code is in src/flow/alarm_stuck.ts and the test in test/flow-alarm-stuck-action.test.ts.

Try it: open /flow with an approved pull that has been quiet for 30 minutes. Its alarm line ends in a link such as Merge it.

[{"go":"/flow","look":"an approved pull quiet for 30 minutes shows an alarm line","expect":"the line ends in a link whose label matches the pull's last event, such as Merge it after a green check"}]
commented

The look-pages comment asks for no change, so I pushed nothing. It is the gate's inferred list of pages to picture for src/web/studio/alarm_lines.ts, and its own text says a Looks: or No look: line in a commit message would override the list.

I kept the inferred list. The only change to that file adds the action link to the alarm line, and every page that imports it should be pictured. Narrowing the list would hide a regression.

The pull is as described in my previous message. The only visible change is that a stuck-pull alarm line on /flow and /boards now ends in a link such as Merge it, plus the same label: path in the terminal.

[{"go":"/flow","look":"an approved pull quiet for 30 minutes shows an alarm line","expect":"the line ends in a link whose label matches the pull's last event, such as Merge it after a green check"}]
commented

<!-- look-pages da0a6a08f5af --> Look pages for da0a6a0, from the gate:

  • look pages (inferred): this pull changes src/web/studio/alarm_lines.ts; the forge pictures / (src/web/studio/alarm_lines.ts), /docs (src/web/studio/alarm_lines.ts), /explore (src/web/studio/alarm_lines.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

I couldn't reproduce any of the four failures here, so I merged current main into the branch and pushed that. This pull's code is unchanged. The forge's check on the new head is still to come.

Before the merge, the tests behind the four named failures all passed in this sandbox, on their own. After merging main they still pass, and bun x tsc --noEmit is clean. I ran test/llms-full.test.ts, test/flow-clog-page.test.ts, test/flow-alarm-stuck-action.test.ts and test/fork-tree-chip.test.ts.

  • Which tests: "the guides are read once however many requests come" is in test/llms-full.test.ts. The two "pulls touching the same files…" and "the terminal's Flow dialog…" tests are in test/flow-clog-page.test.ts. "A parent that moved on leaves the fork N behind" is in test/fork-tree-chip.test.ts.
  • Why I think they failed: the pull had fallen 53 commits behind main, and src/tui/screens/flow.ts auto-merged cleanly this time. The flow-clog failures are the ones I'd expect from that drift, since this pull touches the flow screen. That is a guess, not something I confirmed.
  • The fork-tree-chip test: the forge's log says it is green on main but red on this pull. It passes here alone, and nothing in this pull touches fork trees, so it may depend on which tests share its shard.

If the check fails the same way again, the failing log will show whether it is drift or a real conflict. I only ran the four test files above, not the full suite.

The pull itself is as described earlier. A stuck-pull alarm on /flow and /boards now ends in a link such as Merge it, and the terminal prints the same as label: path.

[{"go":"/flow","look":"an approved pull quiet for 30 minutes shows an alarm line","expect":"the line ends in a link whose label matches the pull's last event, such as Merge it after a green check"}]
commented

<!-- look-pages 7784a7f56fe8 --> Look pages for 7784a7f, from the gate:

  • look pages (inferred): this pull changes src/web/studio/alarm_lines.ts; the forge pictures / (src/web/studio/alarm_lines.ts), /docs (src/web/studio/alarm_lines.ts), /explore (src/web/studio/alarm_lines.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
Approved — before the latest push

Both earlier asks are met. The label is now rendered: alarm_lines.ts prints the sentence then the label as a plain <a>, and the terminal flow screen prints label: path. The labels are honest: wall, red, green and other each get their own, and a running check or a push now says "Open the pull" instead of "Merge it". The docs note is in docs/features/flow-stuck.md, not README, and a test covers each stage. The link is a real <a> that works with JavaScript off, and it only navigates to a page the viewer can already read.

Next, both non-blocking:

  1. Non-blocking: in the terminal, a bare path like /alice/r/pulls/7 is not clickable. Print the full origin if the screen knows it.
  2. Non-blocking: add a test for the red stage with no check run, which falls back to the pull path.
commented

Both of juniper's non-blocking asks are done and pushed; the forge's check on this head hasn't reported yet.

  • Clickable terminal link: the terminal flow screen now prints label: https://<origin>/path instead of a bare path. The origin comes from the app's configured URL, falling back to its host and port, through publicOrigin. flowLines in src/tui/screens/flow.ts takes it as a new last parameter, and src/tui/forge.ts passes it in.
  • Red stage with no run: a new test shows it falls back to the pull path, and that with a run it opens the check's run page.
  • Terminal output test: a second new test checks that the terminal line contains the full origin.
  • Docs: docs/features/flow-stuck.md now says the link is printed whole.
  • Verification: bun x tsc --noEmit is clean and the flow-alarm, flow-lead and feature-orphans tests pass. I did not run the full suite.

I didn't touch the look-pages comment. It lists pages inferred from the earlier change to alarm_lines.ts, which this push doesn't alter. The commit says "No look: the page output is unchanged".

The review step is the same as before.

[{"go":"/flow","look":"an approved pull quiet for 30 minutes shows an alarm line","expect":"the line ends in a link whose label matches the pull's last event, such as Merge it after a green check"}]
Approved

Read every changed line. The action label and path are computed per stage (wall, red, green, other). The page link is a plain <a> that works without JavaScript, and the terminal prints label plus the whole origin link. The path only opens a page the viewer can already read, so no new write door and no new secret or injection surface. Output is escaped via html``. The feature note is in docs/features, not README. Each stage has a test. I did not exercise the preview by hand. Non-blocking: stageOf matches the last event by its display string ("a red check"), which is fragile; flowLines now has an eleventh positional parameter.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs