Repository navigation
refactor(agent-status): one worktree rollup and one clock (PR 3) - #19788
brennanb2025 wants to merge 2 commits into
Conversation
a34c37f to
c76845d
Compare
6c8c44a to
f8d0d3f
Compare
c76845d to
bebdf84
Compare
f8d0d3f to
4772ad3
Compare
Live Electron validation of the whole stack — 7/7 PASSFirst live run over any of these five steps, against the top of stack (
The two that mattered mostQ5 is a new capability, not a preservation. The dashboard popout has never shown structured sessions — it's a separate React root that never mounted the renderer's status bridge. Removing the IPC filter is what gives it rows for the first time. Q7 is an intended behavior change, and the CLI output verifies it rather than a screenshot: Provenance is correct on both row typesQ3 and Q6 confirm the two paths stayed distinct through the refactor: the PTY row carries Working → settled, and CLI/sidebar parityTwo findings that are NOT stack defects
Gaps, stated rather than impliedDev-mode instance under electron-vite (no packaged build). Claude structured route only — the Codex structured route was not exercised. Local folder workspace only: no SSH/remote host, no mobile client. A late turn hit an account-level 429 after all evidence was captured; the row still settled correctly. |
bebdf84 to
910d2aa
Compare
4772ad3 to
417235e
Compare
910d2aa to
f159550
Compare
417235e to
9f8560d
Compare
f159550 to
8d0acb5
Compare
9f8560d to
bf7fb55
Compare
Names the three derivations and their line counts, records that mobile hand-copies the staleness constant, and says why sharing the rollup only makes sense after the inputs agree.
…s decay into src/shared The worktree card status was derived three times: the renderer's worktree-status.ts, main's runtime-worktree-status-projection.ts, and mobile's agent-row-display.ts, which hand-copied the 30-minute constant. Two modules now own it, beside agent-status-freshness.ts: agent-status-row-display.ts holds the staleness decay and where a stale row lands (idle / unverifiable); worktree-status-rollup.ts holds the priority ladder. The renderer's hand-ordered if-chain became a fold over that ladder and main's private priority table was deleted; the wire subset keeps its order, so worktree ps rolls up exactly as before. Mobile is not a pure refactor. Two corrections, both to the behavior the desktop has always had: a structuredHostOwned row no longer decays to idle on the phone, and a restoredUnconfirmed row never reads as active (a contract change - today's host drops those rows before the wire). The evidence clock does not reach mobile: RuntimeWorktreeAgentRow carries no evidence stamps, so the shared rule falls back to updatedAt, mobile's existing clock. Forwarding them would trade a reconnect error for a clock-skew one, so the wire is unchanged and absence degrades to the ordinary window. Also: mobile was never walled off from src/shared (metro already watches it and ~20 modules value-import from it), and main's mergeWorktreeStatus was dead. Nothing pinned the worktree ps rollup order, so a reordered ladder passed the whole runtime aggregator; runtime-worktree-status-projection.test.ts now pins it.
bf7fb55 to
d6b0839
Compare
|
Closing as superseded, for the same reason as #19786 and #19787 — the lane was rebuilt and this stage is now written against a contract that postdates this branch. What changed underneath it. The shared rollup and clock work now sits after the canonical store (#20717) and its producers, and depends on host-owned child work keyed by a host-minted Salvage. The shared selectors and rollup intent are carried into the reader-cutover stage, where all four readers move onto one set of host-fed selectors and the two parallel child-freshness rules become one shared decay rule. Branch |






What this step does
Collapses the worktree card rollup and the 30-minute decay from three implementations into one in
src/shared.The three copies
renderer/src/lib/worktree-status.tsmain/runtime/runtime-worktree-status-projection.tsmobile/src/worktree/agent-row-display.tsworktree psrowsThe mobile copy hand-copies the 30-minute constant rather than importing
AGENT_STATUS_STALE_AFTER_MS, so the three can drift by edit as well as by logic.isFreshNonDoneAgentStatusinshared/agent-status-freshness.tsis already shared and is the model — the rollup should sit beside it.Why this is last
Only after PR 2b do all three read equivalent rows. Sharing the rollup before that unifies the arithmetic over inputs that still disagree, which hides the disagreement rather than removing it.
Watch item
Mobile currently ignores
structuredHostOwned, so an owned structured row decays to idle there while the desktop keeps it. Pre-existing, not a regression from PR 1a — and this is the step where it stops being true, since the shared rule already handles the owned case.Dependency
Stacked on #19787 (PR 2b).