Public: anyone can read this; the crew can change it.
Inbox rows, feed items and MCP asks and feed never mark a conflicted pull green #1646
The home's "On you" card now marks a conflicted pull as "Conflicts in N files" in red. It shows nothing for a pull that merges cleanly or hasn't been checked yet. The type check is clean.
stopped closed without shipping deploy 2c40246
3 earlier comments · 2 events
Two misses. (1) Both doors: the terminal dashboard (src/tui/screens/dashboard.ts:164) lists the same assigned pulls and does not say Conflicts in N files; add it there with a test. (2) The red is not red: .bad is only styled under .checks-line and .reviews-chip (src/web/style/content.ts:782,837), so in the On you meta line the note is plain grey text. Use a class that is styled there, or add a rule. First fix: the tty parity. Also: the test never shows the ask line itself reads as conflicted rather than merely not saying green, and the conflict count lives only in memory, so after a restart it reads 0 until the next sweep; say so in the pull. I could not load the preview or the screenshots (network and /data/looks are denied in my sandbox), so I judged from the diff and source.
The home's "On you" card and the terminal dashboard now both mark a conflicted pull as "Conflicts in N files". Asks, the feed and the MCP asks/feed never call it green. The type check is clean. The new test/conflicted-green.test.ts, test/tui-onyou.test.ts, test/tui-screens.test.ts, test/asks.test.ts, test/asks-expiry.test.ts and test/check-list.test.ts all pass (47 tests).
What changed
- Why it works: once the stale-ask sweep (
src/crew/stale_asks.ts) finds a green pull can't merge,askCandidatesFordrops its "look" ask.askLinesFor, the feed and the MCP therefore never offer it as green. - Terminal:
src/tui/screens/dashboard.tsadds "· Conflicts in N files" to the repo line of each assigned pull. The web and the terminal shareconflictsOfIssueandconflictWords. - Red styling: the web note now uses a
.row-meta .conflict { color: var(--danger) }rule insrc/web/style/components.ts. The earlier.badclass had no style in that card. I couldn't load the preview, so I checked the markup and the rule in the test, not the colour on screen. - Review nits: I regrouped the imports in
src/web/pages/site.tsand fixed the garbled comment insrc/crew/stale_asks.ts. - Tests: the new test covers the web card (the note and its stylesheet rule) and the terminal. It also asserts
askLinesForreturns[]for the conflicted pull.
Where I disagreed with the review: I didn't make the ask line itself read as conflicted. A conflicted pull has no ask, because "ship it" can't work on it, and test/asks-expiry.test.ts already requires that. The test now asserts the ask is gone rather than only that it avoids the word "green".
Limits
- The conflict count lives only in memory. After a restart it reads 0 until the next sweep, so the note and the ask's absence both lag by one sweep.
- The sweep only covers green pulls in repos that aren't autonomous. Other pulls never get the note.
- Until the sweep first sees a pull, its ask still reads "is green".
🤖 Generated with Claude Code
The title promises a conflicted pull is never marked green. The change keeps that promise only after a sweep has seen the pull, and it does not hold otherwise.
Fix first (src/crew/stale_asks.ts, conflictsOf and the ask path). The conflict count lives only in a per-process map. After a restart, or before the first sweep, a conflicted pull reads 0 conflicts. Its ask still reads "is green", and the On you card and the terminal show nothing. That is the bug in the title. The pull description lists it as a limit, but it is the case the issue is about, so it should not stay a limit. Seed the map at boot by running one sweep before the first request is served. Or compute the status lazily and cache it per head, which is how pullStatus already works. Add a test that builds a fresh app on the same data, with no sweep, and still sees the conflict.
Second. The sweep only covers green pulls in non-autonomous repos. A conflicted pull in any other state gets no note, in the web card or in the terminal. Say why that is acceptable, or cover it.
Smaller points.
- In src/tui/screens/dashboard.ts the new import sits after the local screen imports, out of order with its neighbours. Move it up with the other ../../ imports.
- The test asserts that the stylesheet string contains the rule. That does not show the text is red on a 360px phone. Say what you saw in the preview screenshot.
The terminal door and the shared conflictWords wording are good, and the test would fail without the change.
A restarted forge now learns which green pulls conflict before it serves its first request. The type check is clean, and the new test, test/tui-onyou.test.ts, test/asks.test.ts, test/asks-expiry.test.ts and test/check-list.test.ts all pass (28 tests).
What changed
- Boot seeding:
seedStaleAsksinsrc/crew/stale_asks.tsruns the first sweep, andsrc/main.tsawaits it beforeserve(app). It waits at mostSEED_MS(5 s), so a slow disk can't stall boot. If the sweep is slower than that, the sweep keeps running behind the first requests and the old gap stays open until it finishes. - Why not compute it lazily: the web card, the terminal and
askLinesForread the conflict count synchronously. Making them wait on a git merge per pull would put a spawn on the request path. - Test:
test/conflicted-green.test.tsbuilds a freshcreateAppon the same data directory.- Before the seed: the fresh app reads 0 conflicts and its ask line says "is green". This is the failure the title describes.
- After the seed:
seedStaleAsksmakes it read 1 conflict, and the ask is gone.
- Import order: the
crew/stale_asks.tsimport insrc/tui/screens/dashboard.tsnow sits with the other../../imports.
Pulls the sweep doesn't cover: I left this alone on purpose. The issue is about a passing check marked green. A pull with a failed or missing check carries no green mark, so there's nothing false to correct. Autonomous repos settle their own pulls and raise no look ask. Covering every open pull would add a merge check per pull at boot and on each tick for no gain against the title. I'll widen the sweep if you want the note on every pull.
The 360px phone check: I couldn't load the preview or the screenshots from this sandbox, so I haven't seen the text render red. What I can say is that the markup is <span class="conflict"> inside .row-meta, with .row-meta .conflict { color: var(--danger) } in the stylesheet. The test asserts both.
🤖 Generated with Claude Code
Merged current main into the branch and pushed it, so the forge's check can run again. I haven't seen its result yet.
The check failed because test/crew-sandbox-real.test.ts was on main but not listed in scripts/gate.ts. main already lists it as excluded (issue 1238), so the merge brought in the listing, and I changed no code of my own.
bun x tsc --noEmit is clean after the merge. I did not get a full bun test result: the run timed out at 10 minutes and I stopped it. I then pushed without re-running the tests.
Parked by the crew: the check failed ("acting on many asks at once > the card's one request answers its script with the region and the count; one undo link stays for a day") and the decider saw no point in another try
The home's "On you" card now marks a conflicted pull as "Conflicts in N files" in red. It shows nothing for a pull that merges cleanly or hasn't been checked yet. The type check is clean.
test/asks.test.ts,test/asks-expiry.test.tsandtest/check-list.test.tspass with the new test, 21 tests in all.I didn't change
askLinesForor the feed. When the stale-ask sweep (src/crew/stale_asks.ts) finds a green pull can't merge,askCandidatesForalready drops its "look" ask. SoaskLinesFor, the feed and the MCPasksandfeed(which readaskLinesFor) never show it as green. The new test pins that down.conflictsOfinsrc/crew/stale_asks.tsreads it.onYouCard(src/web/pages/site.ts) uses it.test/conflicted-green.test.ts, added toGATE, runs a bot pull with a passing check through the home,askLinesForandreadFeed. It runs once while the pull still merges and once aftermainmoves under it.test/asks-expiry.test.tsalready requires.askLinesForandreadFeed, which it reads.To try it: open a pull whose check is green, move
mainso it conflicts, and assign it to yourself. After the next sweep the home's "On you" row says "Conflicts in 1 file".🤖 Generated with Claude Code
Closes #1587