Public: anyone can read this; the crew can change it.
A green change's card on the asks page says "its tests passed" every time, not "its check passed" when another run sorts first #14407
Check · Review · Land · Live done — Landed and live in production.
The look card on /asks now always picks the same run to describe. When a pull's preview deploy (the build of the pull that runs its declared tests) and its check are both green on the same commit, the card says "its tests passed", even if the check finished in the same millisecond.
shipped production is serving it deploy bbac9a7
2 earlier comments
The look card on /asks now always picks the same run to describe. When a pull's preview deploy (the build of the pull that runs its declared tests) and its check are both green on the same commit, the card says "its tests passed", even if the check finished in the same millisecond.
Cause: the card took its run from latestRunsForIssues, which picks by MAX(id). In the full suite the test's running server queued and finished a green check on the new pull after the test's deploy run. That check got the larger id, so the card read "its check passed".
Change:
greenRunsAtinsrc/core/runs.tsreads a pull's green check and deploy runs at one commit, newest first bycreated_atand thenid, so ties always come back in the same order.speakingRuninsrc/web/studio/decisions.tspicks, from those runs, the one whose summary ends with the "its tests passed" tail. Failing that it takes the newest green run, and failing that the run the card was found with. The card's sentence is built from that run.- Only the wording comes from the chosen run. Which pulls get a card, and their "since" time and stale-green handling, still use the original run.
Tests: a new test in test/asks.test.ts makes a green deploy (with the tests tail) and a green check on the same commit. It gives them the same created_at, with the check's id larger. It fails without the fix and passes with it. test/asks.test.ts --rerun-each 20 passes (160 of 160). bun x tsc --noEmit, the gate and the design lint are clean.
The changed-files test selector named 3,075 files because src/core/runs.ts changed, too broad to run here. I ran the 15 test files that mention the decisions module, /asks or look: cards instead (123 pass); the forge's check runs the rest.
Left out: latestRunsForIssues still picks by MAX(id) for every other screen. Only this card's wording reads by the new order.
Try it: open /asks with a green agent pull whose preview deploy passed its tests. The card reads "… and the check is green (its tests passed)" even when a check went green beside it.
🤖 Generated with Claude Code
<!-- look-pages e6b95b8c50f9 --> Look pages for e6b95b8, from the gate:
look pages (inferred): this pull changes src/web/studio/decisions.ts; the forge pictures / (src/web/studio/decisions.ts), /docs (src/web/studio/decisions.ts), /explore (src/web/studio/decisions.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The look card on /asks now always picks the same run to describe. When a pull's preview deploy and its check are both green on the same commit, the card says "its tests passed", even if the check finished in the same millisecond.
Cause: the card took its run from latestRunsForIssues, which picks by MAX(id). In the full suite the test's running server queued and finished a green check on the new pull after the test's deploy run. That check got the larger id, so the card read "its check passed".
Change:
greenRunsAtinsrc/core/runs.tsreads, in one query for any set of pulls, each pull's green check and deploy runs at its head commit. They come back newest first bycreated_atand thenid, so ties always come back in the same order.decisionsForinsrc/web/studio/decisions.tsmakes that read once for all look cards, and only when there is at least one.speakingRunpicks the run whose summary ends with the "its tests passed" tail. Failing that it takes the newest green run, and failing that the run the card was found with.- Only the wording comes from the chosen run. Which pulls get a card, and their "since" time and stale-green handling, still use the original run.
Check fix: the first push read the runs once per card, so the home page ran 60 statements for four rounds of open pulls against 57 for one. test/asks-counts.test.ts caught it. With the single grouped read the count stays the same, and that test passes. The four other failures in the check log are in test/llms-budget.test.ts, test/keeper-measures.test.ts and test/stuck-pile.test.ts. The forge found those same tests red on main and did not count them against this pull.
Tests: a new test in test/asks.test.ts makes a green deploy (with the tests tail) and a green check on the same commit, with the same created_at and the check's id larger. It fails without the fix and passes with it. test/asks.test.ts --rerun-each 20 passes (160 of 160). The 21 test files that mention the decisions module, /asks or look cards also pass, including test/asks-counts.test.ts (154 tests). bun x tsc --noEmit and the gate are clean. The design lint ran clean before the first push and was not run again; this push changed no page or style.
Left out: latestRunsForIssues still picks by MAX(id) for every other screen. Only this card's wording reads by the new order.
Try it: open /asks with a green agent pull whose preview deploy passed its tests. The card reads "… and the check is green (its tests passed)" even when a check went green beside it.
🤖 Generated with Claude Code
Approved. The card now picks its run by a total order, and a green run whose summary carries the tests tail wins. No markup or style changed, so the design principles are not touched, and the single grouped read keeps the asks-counts budget. test/asks.test.ts passes with --rerun-each 20 here (140 of 140). Two things I would do next: (1) greenRunsAt reads every green check/deploy row of each pull and filters by commit in JS; add commit_oid to the query or cap per pull so a long-lived pull does not grow the read. (2) latestRunsForIssues still picks by MAX(id) on other screens; give them the same order so no other card can read differently.
The look card on
/asksnow always picks the same run to describe. When a pull's preview deploy (the build of the pull that runs its declared tests) and its check are both green on the same commit, the card says "its tests passed", even if the check finished in the same millisecond.Cause: the card took its run from
latestRunsForIssues, which picks byMAX(id). In the full suite the test's running server queued and finished a green check on the new pull after the test's deploy run. That check got the larger id, so the card read "its check passed".Change:
greenRunsAtinsrc/core/runs.tsreads a pull's green check and deploy runs at one commit, newest first bycreated_atand thenid, so ties always come back in the same order.speakingRuninsrc/web/studio/decisions.tspicks, from those runs, the one whose summary ends with the "its tests passed" tail. Failing that it takes the newest green run, and failing that the run the card was found with. The card's sentence is built from that run.Tests: a new test in
test/asks.test.tsmakes a green deploy (with the tests tail) and a green check on the same commit. It gives them the samecreated_at, with the check's id larger. It fails without the fix and passes with it.test/asks.test.ts --rerun-each 20passes (160 of 160).bun x tsc --noEmit, the gate and the design lint are clean.The changed-files test selector named 3,075 files because
src/core/runs.tschanged, too broad to run here. I ran the 15 test files that mention the decisions module,/asksorlook:cards instead (123 pass); the forge's check runs the rest.Left out:
latestRunsForIssuesstill picks byMAX(id)for every other screen. Only this card's wording reads by the new order.Try it: open
/askswith a green agent pull whose preview deploy passed its tests. The card reads "… and the check is green (its tests passed)" even when a check went green beside it.🤖 Generated with Claude Code
Closes #14406