Repository navigation
feat(heartbeat): every command that works before it prints says so - #90
Merged
Merged
Conversation
The one line that says work is still going was shaped for a review run and nothing else: it held the count itself, and that count was tools and subagents. A sweep counts pull requests, and a command reading two guards counts nothing, so neither could reach for it. The count moves out to whoever is counting. What stays is what only this module can know: when the work started, how to rewrite one line in place, and what to do where there is no screen to measure. It is a Heartbeat in CONTEXT.md rather than a Turn, because a turn is already one turn of an agent session here and one word cannot be both. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A sweep is the longest wait in a normal day and it said nothing while it ran. `dw-mc status` sat on a blank screen for five seconds against two repositories, and `dw-mc` and `dw-mc sweep` sat on the same silence, because all three start with the same pass. The pass now reports how far it has got and the three commands turn one heartbeat over it. The two stages are told apart: how many pull requests there are to read is what the searches answer, so nothing counts towards that total until they come back. The heartbeat paints the moment the wording changes rather than at the next frame, which a sweep is fast enough to make visible: a pull request that lands in less than a frame would otherwise show a count already out of date. Nothing goes out as an aside, so a piped `dw-mc status` prints what it always printed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Six commands read their guards live before they can print a word, and every one of them spent that read on a blank screen. Reading live is the point - a guard off the last sweep is a stale verdict on a write no reflog undoes - so the reads stay and the silence goes. There is nothing worth counting here. Two or three calls, and a number counting to three says less than the words do, so the line is what is being read and how long it has taken. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The longest silence in the tool is the one nobody measures, because it happens once: a clone is made the first time and fetched on every run after that, and a first clone of a large repository is minutes of nothing on the screen. Cutting the worktree is its own wait, because it checks out a whole tree. The stages are named apart. A `cloning` that sits there for two minutes is a large repository arriving once, not a tool that has hung, and the line is the only thing that can say which. Cutting a worktree now talks to the screen, so it asks for one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Taking the inventory is a walk over every clone and every worktree, weighing each one. The whole reason to run the command is that those directories have grown large, so the blank screen got blanker the more there was to take back. The line is gone before the blocks it was waiting for, so the prompt is never asked beside it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dw-mc statusspends five seconds reaching GitHub before its first row, and shows a blank screen for every one of them. So does the picker, so does a sweep on its own, and so does every command that reads a pull request's guards live. A first clone of a large repository is minutes of the same nothing. A terminal that says nothing for five seconds is one I stop trusting, so each of these says what it is doing and how far it has got, on one line it wipes when the work is done.What changes
src/adapters/heartbeat.ts— the line, the clock and the single-line rewrite. What it counts is the caller's: a review counts tools, a sweep counts pull requests, a command reading two guards counts nothing. It paints the moment the wording changes rather than at the next frame, because a sweep gets further than once per frame.src/cli/sweep.ts— the pass reports how far it has got, andstatus, the picker andsweepturn one line over it. The two stages are told apart: nothing counts towards a total the searches have not answered yet.src/cli/pr.ts—readingputs the live guard reads ofmerge,rebase,rerun,resolve,commentsandfixunder that line.src/adapters/git.ts— a clone says whether it is arriving for the first time or being fetched, and a worktree says it is being cut. Cutting a worktree now talks to the screen, so it asks for aTerminal.src/cli/cleanup.ts— the walk that weighs the disk says so, which matters most exactly when there is most to take back.Test plan
pnpm check— pass, onmainatfbf8721after a clean rebase over feat(terms): the layer the glossary lives in #89src/adapters/heartbeat.test.ts— five cases, including work that counts nothing and work with no aside, which is what keeps a pipe byte-identical.src/adapters/git.test.ts— a first clone sayscloning, a warm one says onlyfetching.dw-mc statusanddw-mc comments AirHelp/ahplus-rails#7783under a sized pty — the line counted0 of 2 repositoriesthrough7 of 7 pull requests, then wiped. Piped, both printed zero heartbeat bytes and zero escape sequences.Risk
Nothing on disk and nothing on GitHub: this only draws. If the line is wrong it is wrong on a screen that wipes it a moment later, and where there is no width to draw in nothing is drawn at all.
Closes #78
Closes #79
Closes #80
Closes #81
Closes #82
🤖 Generated with Claude Code