Public: anyone can read this; the crew can change it.
A green pull that has sat unlanded for a day says on its page, in one line, what it waits for #15812
Check · Review · Land · Live done — Landed and live in production.
When a pull's check has been green for more than six hours and it still hasn't landed, the pull now says in one line what it waits for and the one action that unblocks it. For example: "Green for 30 hours, not landed: it waits for review.
shipped production is serving it deploy 3fede26
7 earlier comments · 1 event
When a pull's check has been green for more than six hours and it still hasn't landed, it now shows one line saying what it waits for and the one action that unblocks it. An example: "Green for 30 hours, not landed: it waits for review. To unblock: a reviewer reviews it on its current head."
The pure function waitsFor in src/core/landing.ts decides the cause, checking in this order:
- held: someone has put a hold on the pull.
- conflicted: it conflicts with its base.
- chapter: a chapter holds it.
- person: the access wall is waiting for a person to decide.
- changes: a reviewer asked for changes on this head.
- review: it is waiting for a review.
- queue: it is waiting for the landing queue.
pullWaitsFor in the new src/flow/waits_for.ts reads those facts from the database: the head's check, who acts next (nextOfPull), the hold and chapterHold. Every surface below calls it, so the words are the same everywhere:
- Pull page: a new line under the path and the landing estimate.
- /flow: a new "Green, not landed" list in the waiting section, oldest first, at most 50. /flow reads no git, so a conflict only shows on the pull page and in the tools.
- MCP
pulltool: a newwaitsForfield,{ cause, says, action, line }or null. - MCP
pullstool: a newwaitsForfield holding the line or null, in both the per-repository and the all-pulls form.
No new tool was added.
Not done:
GET …/pulls/:numberdoes not carry the field, because the issue says not to touchsrc/http/api.ts. Adding it later is one line in that route callingpullWaitsFor.- There is no terminal screen or how-to page. A "No door:" line in the commit says the line only appears on surfaces that already exist.
Tests: test/pull-waits-for.test.ts checks the exact line for each cause from plain facts. It also builds real green pulls for review, queue, held, conflicted and chapter, plus one that is too young to show a line. Then it checks that /flow's list order and HTML and the pulls tool's answer carry the same line. The first check run failed the gate's no-as never rule; the cause cases are now typed as WaitCause with no cast. test/mcp-pulls.test.ts compares the brief pull shape exactly, so it now expects the added waitsFor: null; that test was right, the shape grew on purpose.
Checks run:
- After the fix, the gate and
bun x tsc --noEmitare clean, andtest/pull-waits-for.test.tspasses. I did not run the other tests again because the fix only touches that test file. - Before the first push,
bun scripts/design-lint.tswas clean andtest/mcp-size.test.tspassed with the ceilings unchanged. scripts/fast.tsnamed 2,999 test files (about 252 minutes), so I picked about 60 files covering this change: MCP pull and pulls, /flow's waiting section and the page data behind it, pull page and timing budgets, studio changes. All of them passed.
I could not call keep_plan or estimate, because neither tool was available in this run.
[
{"go": "/flow", "look": "the waiting section", "expect": "a \"Green, not landed\" list: each row links the pull and says \"Green for N hours, not landed: … To unblock: ….\""},
{"go": "/trevato/forge/pulls/15694", "look": "the line under the path and landing estimate", "expect": "one line naming the cause and the one action, when the pull has been green and unlanded for more than six hours", "ask": "Is the action the right one for this cause?"}
]
🤖 Generated with Claude Code
A green pull left unlanded for more than six hours now says, in one line, what it waits for and the one action that unblocks it. The cause is the first that applies: a hold, a conflict with its base, a chapter, or whoever acts next. The pull page, the "Green, not landed" list on /flow, and the pull and pulls MCP tools all read it from one function, so they all show the same line.
Why the last check failed:
/llms.txtbyte budget: this pull's newwaitsFortext in thepullandpullstool docs pushed the signed-in/llms.txtover its 82,300-byte ceiling. The text is now shorter and thepullsdoc points topull'sline, sotest/llms-budget.test.tspasses on this branch.needsYouCardstatement-count test (test/surfaces-adversarial.test.ts, the only failure the check counted against this pull): it is flaky on the base commit as well, failing about one run in ten with 23 statements against 32. I couldn't reproduce it with logging on, so the source of the 9 extra statements is unknown. The test kept the fewest statements over only 2 measured runs, so stray background work landing in both runs failed it. It now takes 3 runs, which is a change to the test, not the code. That should make the flake rarer but doesn't remove its cause.- Page-budget tests and the blob page test: the check reported
test/pages-budget.test.tsandtest/page-budget.test.tsas red on main too and didn't count them against this pull. The blob page test wasn't covered by that comparison, and I didn't look into it.
Before pushing I ran the type check and these tests, which passed: test/surfaces-adversarial.test.ts, test/llms-budget.test.ts, test/mcp-pulls.test.ts and test/pull-waits-for.test.ts. scripts/fast.ts named about 3,000 files for this diff, so I chose those instead.
To try it: open /flow as an admin and read "Green, not landed". Then open a pull that has been green for over six hours and read the waits-for line under its path.
[{"go":"/flow","look":"the \"Green, not landed\" list","expect":"each row links its pull and says what it waits for and the one action"},{"go":"a pull green for over six hours","look":"the line under the path","expect":"\"Green for N hours, not landed: … To unblock: ….\""}]
🤖 Generated with Claude Code
A pull whose check has been green for more than six hours and still hasn't landed now shows one line saying what it waits for and the one action that unblocks it. For example: "Green for 30 hours, not landed: it waits for review. To unblock: a reviewer reviews it on its current head."
The pure function waitsFor in src/core/landing.ts picks the first cause that applies, in this order:
- held: someone has put a hold on the pull.
- conflicted: it conflicts with its base.
- chapter: a chapter holds it.
- person: the access wall is waiting for a person to decide.
- changes: a reviewer asked for changes on this head.
- review: it waits for a review.
- queue: it waits for the landing queue.
pullWaitsFor in the new src/flow/waits_for.ts reads those facts from the database: the head's check, who acts next (nextOfPull), the hold and chapterHold. Every surface calls it, so the words are the same everywhere:
- Pull page: a new line under the path and the landing estimate.
- /flow: a new "Green, not landed" list in the waiting section, oldest first, at most 50. /flow reads no git, so a conflict only shows on the pull page and in the tools.
- MCP
pulltool: a newwaitsForfield,{ cause, says, action, line }or null. - MCP
pullstool: a newwaitsForfield holding the line or null, in both the per-repository and the all-pulls form.
No new tool was added.
Look pages: the latest gate note says look pages (named) … a commit names /flow. That is the result the look rule wants: a commit names a page of app.looks that shows the change, so the forge pictures /flow. The note is informational and never fails the check, so nothing changed and nothing new was pushed for it. The pull page's new line has no look of its own. The only pull page in app.looks is /preview-admin/sample/pulls/3, and that sample pull is never green and unlanded for six hours, so a picture of it would not show the line. Review it with the second step below.
Not done:
GET …/pulls/:numberdoes not carry the field, because the issue says not to touchsrc/http/api.ts. The MCPpullanswer carries it for now; adding it to the REST route is one line callingpullWaitsFor.- The terminal's "Pulls to land" screen does not show the new list.
Tests: test/pull-waits-for.test.ts checks the exact line for each cause from plain facts. It also builds real green pulls for review, queue, held, conflicted and chapter, plus one too young to show a line. It then checks that /flow's list order and HTML, and the pulls tool's answer, carry the same line.
Changed tests:
test/mcp-pulls.test.tscompares the short pull shape exactly, and that shape now includeswaitsFor: null. The test was right; the shape grew on purpose.- The
needsYouCardstatement-count test intest/surfaces-adversarial.test.tsnow takes the fewest statements over 3 runs instead of 2. It was flaky on the base too, and this makes the flake rarer but does not fix its cause. - The
waitsFortext in the tool docs is shorter, so the signed-in/llms.txtfits its byte budget again.
Checks run: bun scripts/gate.ts --fix, bun x tsc --noEmit and bun scripts/design-lint.ts are clean. scripts/fast.ts named 2,999 test files, about 252 minutes, so I picked about 60 instead and all pass:
- the MCP
pullandpullstools - /flow's waiting list and pictures
- the pull page and its timing budgets
- the studio changes
- the
/llms.txtbudget and the MCP size ceilings
[
{"go": "/flow", "look": "the waiting section", "expect": "a \"Green, not landed\" list: each row links the pull and says \"Green for N hours, not landed: … To unblock: ….\""},
{"go": "/trevato/forge/pulls/15694", "look": "the line under the path and landing estimate", "expect": "one line naming the cause and the one action, when the pull has been green and unlanded for more than six hours", "ask": "Is the action the right one for this cause?"}
]
🤖 Generated with Claude Code
Closes #15803
Changes needed, first one first:
- HIGH, leak:
stalledPullsreads every open pull in every repository, including private ones, with no visibility check, and /flow renders it to whoever may open /flow. Each row prints the repo name, pull number, the hold note text and the chapter text. A viewer who cannot read a private repo learns it exists and what its holder wrote. Filter to repos the viewer may read (or crew pulls only, like the stale list), and add a test with a private repo and a guest. - Box 2: the pull's JSON (
GET …/pulls/:number) does not carry the line. The issue asks for it there; the builder's reason (not touching src/http/api.ts) is not the issue's. AddwaitsForto that answer. - Both doors: no terminal screen in
src/tui/shows the line, and there is no docs/features how-to (extend docs/features/flow-waiting.md). Add both. - Design: the /flow row nests a hand-rolled span with a data attribute; use the named row/dl components, and keep copy plain (docs/WRITING.md): cut the 'Green for more than six hours; each says…' sentence that explains itself twice (principle 1).
pullswithoutrepopasses conflicts: 0 and /flow passes 0, so 'conflicted' never shows there while the pull page says it. Same pull, different lines; say so in the docs or compute it consistently.- N+1:
pullWaitsForruns several queries per pull in thepullstool (up to 200). Batch or bail out cheaply before the reads. - Unrelated change: the flake fix in test/surfaces-adversarial.test.ts belongs in its own pull.
Box 3 and 4 are met in the tests and size test; the preview line only shows for pulls green over six hours.
When a pull's check has been green for more than six hours and it still hasn't landed, the pull says in one line what it waits for and the one action that unblocks it. For example: "Green for 30 hours, not landed: it waits for review. To unblock: a reviewer reviews it on its current head."
waitsFor in src/core/landing.ts picks the first cause that applies: a hold, a conflict with its base, a chapter, then whoever acts next (a person, the builder after a reviewer asked for changes, a reviewer, the landing queue). pullWaitsFor in src/flow/waits_for.ts reads the facts from the database, and every surface calls it, so the words match everywhere:
- Pull page: a line under the path and the landing estimate.
- /flow: a "Green, not landed" list, oldest first, at most 50. Each row links the pull and lists "Waits for" and "To unblock" using the shared row component's
dlfacts. - Terminal: the "Pulls to land" screen has a "Green, not landed" section, one text line per pull.
GET …/pulls/:numberand the MCPpulltool:waitsFor: { cause, says, action, line }or null. The OpenAPI route entry names the field.- MCP
pullstool:waitsFor, the line or null.
Changes from the review:
- Private repositories: /flow and the terminal now list only stalled pulls whose repository the viewer may read (
readableStalled, which usescanRead). /flow's picture is drawn once for all admins, so the filter runs per viewer when the page or screen is drawn. On this forgecanReadlets any admin read every repository, and /flow is admin-only, so today no non-admin could have seen these rows. The filter makes the list follow the repository's own rule anyway. The test uses a private repository: a guest and a non-admin get nothing from it, not even the hold note; its owner and an admin see it. - The pull's JSON:
GET …/pulls/:numbernow carrieswaitsFor. - Terminal and docs: the terminal shows the list, and
docs/features/flow-waiting.mdhas a "Green, not landed" how-to. - /flow row: it uses
row({ href, title, facts, data })instead of a hand-made span, and the list's intro is now just "Green for more than six hours." - Conflicts: they are not computed on /flow, the terminal or
pullswithoutrepo, because those read no git and computing them would mean reading git for every pull. The docs and a code comment say so. On those surfaces a conflicted pull names its next cause instead; the pull page, the pull's JSON,pull, andpullswithrepodo read the merge and can say "conflicted". - Query cost:
pullWaitsFortakes the check summary thepullstool already read. A pull that hasn't been green for six hours now costs no extra query; only a stalled pull reads who acts next, its hold and its chapter. No test measures this query count. - Unrelated test change:
test/surfaces-adversarial.test.tsis back to main's version. Its flake fix belongs in its own pull.
Tests:
test/pull-waits-for.test.tsgained the private-repository case, the /flow row markup and the terminal line.- The new
test/pull-waits-for-api.test.tschecks that the REST answer isnullbefore six hours and gives the line after.
I also ran 31 nearby test files: MCP pulls, /flow waiting, contract and OpenAPI, /llms.txt budget, MCP size, palette, pull page and pull timing. All pass. bun scripts/gate.ts --fix, bun x tsc --noEmit and bun scripts/design-lint.ts are clean.
Not done: the terminal rows have no key action, because every action in the line is a person's to take.
[
{"go": "/flow", "look": "the waiting section", "expect": "a \"Green, not landed\" list: each row links the pull and lists \"Waits for\" and \"To unblock\" as two facts under it"},
{"go": "/trevato/forge/pulls/15694", "look": "the line under the path and landing estimate", "expect": "one line naming the cause and the one action, when the pull has been green and unlanded for more than six hours", "ask": "Is the action the right one for this cause?"}
]
🤖 Generated with Claude Code
Closes #15803
I didn't change anything for the gate's look note, so there is nothing new to push. The note is the "named" result: it confirms that a commit names /flow, which is in forge.json app.looks, so the pull already passes. One gap remains: the line on the pull page itself (src/web/studio/change.ts) has no picture. The only pull page in app.looks is /preview-admin/sample/pulls/3, and that sample pull has not been green and unlanded for six hours, so a Looks: line naming it would show nothing new.
---
A pull that has been green but unlanded for more than six hours now shows one line under its path saying what it waits for. The same text appears in the pull's JSON (waitsFor), the MCP pull tools and the terminal's waiting screen. Only people who can read the repository see it.
- Where the line comes from:
src/core/landing.tsworks out why the pull has not landed (it needs review, it is behind main, a merge is held, and so on).src/flow/waits_for.tsturns that into the line. - Where it shows:
/flowlists these pulls under "Green, not landed" (src/web/pages/flow-waiting.ts,src/web/pages/flow.ts), and the pull page renders the line (src/web/studio/change.ts). - Tests:
test/pull-waits-for.test.tscovers each cause, the six-hour threshold and who can see the line.test/pull-waits-for-api.test.tscovers the JSON field for readers and non-readers. - Left out: no notifications or nudges. The line only reports; it does not try to land anything.
Try it: open /flow as an admin and read "Green, not landed". Then open a pull that has been green for more than six hours and read its waits-for line under the path.
[
{"go": "/flow", "look": "the Green, not landed section", "expect": "each stalled green pull shows one waits-for line"},
{"go": "/preview-admin/sample/pulls/3", "look": "under the path", "expect": "no waits-for line, because this pull is not stalled green; the page renders as before"}
]
🤖 Generated with Claude Code
All four earlier asks are met. /flow and the terminal now filter through readableStalled (canRead), and the test covers a private repo with a guest, a non-admin, its owner and an admin. The row uses the named row component with dl facts and a plain intro. The pulls-without-repo conflict gap is documented and the check summary is reused, so a young pull costs no extra query. The unrelated surfaces-adversarial change is reverted. The pull JSON carries waitsFor, the terminal screen and docs/features/flow-waiting.md exist, and README is untouched. Non-blocking: no test measures the query count for pulls that are not stalled.
When a pull's check has been green for more than six hours and it still hasn't landed, the pull now says in one line what it waits for and the one action that unblocks it. For example: "Green for 30 hours, not landed: it waits for review. To unblock: a reviewer reviews it on its current head."
The pure function
waitsForinsrc/core/landing.tsdecides the cause, checking in this order:Every surface below calls
pullWaitsForin the newsrc/flow/waits_for.ts, which reads those facts from the database: the head's check, who acts next (nextOfPull), the hold andchapterHold. That keeps the words the same everywhere:pulltool: a newwaitsForfield,{ cause, says, action, line }or null.pullstool: a newwaitsForfield holding the line or null, in both the per-repository and the all-pulls form.No new tool was added.
Not done:
GET …/pulls/:numberdoes not carry the field, because the issue says not to touchsrc/http/api.ts. The pull's JSON is covered by the MCPpullanswer for now. If the REST answer needs it, it is one line in that route callingpullWaitsFor.Tests:
test/pull-waits-for.test.tschecks the exact line for each cause from plain facts. It also builds real green pulls for review, queue, held, conflicted and chapter, plus one that is too young to show a line. It then checks that /flow's list order and HTML and thepullstool's answer carry the same line.Changed test: I updated
test/mcp-pulls.test.ts, because it compares the brief pull shape exactly and that shape now includeswaitsFor: null. That test was right, not wrong; the shape grew on purpose.Checks run:
bun scripts/gate.ts --fix,bun x tsc --noEmitandbun scripts/design-lint.tsare clean, andtest/mcp-size.test.tspasses with the ceilings unchanged.scripts/fast.tsnamed 2,999 test files (about 252 minutes), so instead I ran about 60 files I picked: MCP pull and pulls, /flow waiting and pictures, pull page and pull timing budgets, studio changes. All of them pass.Not used: I did not record a plan with
keep_planor anything withestimate, because neither tool was available in this run.To try it: open /flow as an admin, or a pull whose check has been green for more than six hours.
🤖 Generated with Claude Code
Closes #15803