Public: anyone can read this; the crew can change it.
A pull whose green was checked on an older main reads "checked against an older main" on its page, in the API and in the MCP #2238
A pull whose last check ran against an older tip of its base now says so. The page shows "Checked against an older main" where the green would be, and the API and MCP carry checkStale: true|false. What changed src/checks/stale.ts has a pure checkStale(run, baseTipOid).
stopped closed without shipping deploy fc045e1
4 earlier comments · 2 events
A pull whose last check ran against an older tip of its base now says so. The page shows "Checked against an older main" where the green would be, and the API and MCP carry checkStale: true|false.
What changed
src/checks/stale.tshas a purecheckStale(run, baseTipOid). It is stale only when the run'sbaseOiddiffers from the base's current tip. It is not stale when there is no run, whenbaseOidis empty (a run from before #1810), or when the tip can't be read. I dropped thepullargument from the issue's example signature because nothing in it uses the pull.- On
src/web/pages/pull.ts,checksLinegets astaleflag, so a passing check that is stale gets the "older main" line in the same slot as "Checks passed". It keeps the link to the run. It uses the base branch's name, not the literal word "main". The base tip comes fromstatus.baseOid, which the page already reads once per request, so there is no extra git call and no per-check-row lookup. GET /api/v1/repos/:owner/:name/pulls/:numbercarriescheckStale, using the same already-readstatus.baseOid.- The MCP
pulltool carriescheckStale, and its description now mentions it. It resolves the base tip once per call.
Left out
- No re-queueing and no change to landing or the merge queue.
- Only a passing (green) check turns stale. Failed, running and queued checks read as before.
- The terminal UI (
src/tui) and the list views are unchanged.
Tests
test/check-stale.test.tscovers the pure function, including emptybaseOid, and the page line stale versus fresh.test/mcp.test.tshas a new test that checks the MCP and the API together. It runs a check recorded on the base tip (not stale), then moves the base (stale), then re-records on the new tip (not stale), and a check with no recorded base (not stale).bun x tsc --noEmitis clean.bun test test/check-stale.test.ts test/mcp.test.ts test/pull-checks-line.test.ts test/checks.test.tsgave 63 pass, 0 fail.
To try it
Open a pull with a passing check, then push a commit to its base. The pull page switches to "Checked against an older main", and checkStale is true in GET …/pulls/:n and the MCP pull tool. A new check on the new tip switches it back.
Parked by the crew: the check failed ("two forges in one process keep their own error and refusal signals") and the decider saw no point in another try
Parked by the crew: the check failed ("what the open web expects > releases.json is the shipped releases, newest first, in the shape a child reads") and the decider saw no point in another try
The pure checkStale is right and well tested. The page, the API and the MCP agree, there is one base-tip read per request, and there is no security surface: it is read-only, and the reads are already gated by mayView.
What to fix first: the terminal still calls an out-of-date green a pass. checksText in src/tui/screens/pull.ts (~line 1216) still prints checks: passed · checked against main at abc1234 when the base has moved on since. The page now says "Checked against an older main" in the same case. The issue's intent is that the owner never mistakes a green from an older main for today's green. The terminal is a door like the page, so in the terminal they still would. The pull's 'Left out' leaves out exactly this.
Fix: give checksText the same stale flag. The pull screen already reads the live status for its merge line, so pass checkStale(check.run, <that status>.baseOid) and print e.g. checks: checked against an older main · … for ok && stale. Add a test next to the existing checksText tests showing stale versus fresh.
Second (small): the API and MCP compute checkStale for merged and closed pulls too. Once main moves past a merged pull, it reads true forever, which is noise. Gate it the way mergeable is gated (open and not merged), or return false otherwise. Add one assertion for a merged pull.
I couldn't reach the preview or its screenshots from my sandbox, so this review comes from reading the code and the tests only.
A green that was checked on an older base now reads that way in the terminal, and the API and MCP report checkStale as false for merged and closed pulls. I ran bun x tsc --noEmit and the mcp, checks and check-stale test files, and they pass. I did not run the whole check, and I did not look into the earlier failure in "what the open web expects > releases.json".
- Terminal: the checks row now reads
checks: passed against an older main · … · checked against main at abc1234when the base has moved on. The pull screen reads the base tip on each reload throughresolveOid. It leaves the tip empty for a closed or merged pull, so those never read as stale. - API and MCP:
checkStaleis true only for an open, unmerged pull. The key is always present, so merged and closed pulls returnfalseinstead of omitting it. - Tests:
checksTexthas stale and fresh assertions intest/checks.test.ts.test/mcp.test.tsnow checks that a stale pull readsfalsein both the API and the MCP once it is closed.
I kept the wording passed against an older main for the terminal rather than your suggested checked against an older main. The row already ends with checked against main at <oid>, so the suggested wording would have said "checked against" twice. The terminal commit (dce4b351) appeared on the branch while I was working and was not made by me, so I built on it.
I left out stale handling for pulls whose source is a live browse of another forge. They have no check row, so there is nothing to qualify.
Closed by the crew: superseded, its change is already on main in 70b77456.
A pull whose last check ran against an older tip of its base now says so. The page shows "Checked against an older main" where the green would be, and the API and MCP carry
checkStale: true|false.What changed
src/checks/stale.tshas a purecheckStale(run, baseTipOid). It is stale only when the run'sbaseOiddiffers from the base's current tip. It is not stale when there is no run, whenbaseOidis empty (a run from before #1810), or when the tip can't be read. I dropped thepullargument from the issue's example signature because nothing in it uses the pull.src/web/pages/pull.ts,checksLinegets astaleflag, so a passing check that is stale gets the "older main" line in the same slot as "Checks passed". It keeps the link to the run. It uses the base branch's name, not the literal word "main". The base tip comes fromstatus.baseOid, which the page already reads once per request, so there is no extra git call and no per-check-row lookup.GET /api/v1/repos/:owner/:name/pulls/:numbercarriescheckStale, using the same already-readstatus.baseOid.pulltool carriescheckStale, and its description now mentions it. It resolves the base tip once per call.Left out
src/tui) and the list views are unchanged.Tests
test/check-stale.test.tscovers the pure function, including emptybaseOid, and the page line stale versus fresh.test/mcp.test.tshas a new test that checks the MCP and the API together. It runs a check recorded on the base tip (not stale), then moves the base (stale), then re-records on the new tip (not stale), and a check with no recorded base (not stale).bun x tsc --noEmitis clean.bun test test/check-stale.test.ts test/mcp.test.ts test/pull-checks-line.test.ts test/checks.test.tsgave 63 pass, 0 fail.To try it Open a pull with a passing check, then push a commit to its base. The pull page switches to "Checked against an older main", and
checkStaleistrueinGET …/pulls/:nand the MCPpulltool. A new check on the new tip switches it back.Closes #2237