Conversation
The two surfaces write two event streams (logs/router.log verdicts, stats.jsonl carve records); until now the only live view was raw tail. whittle watch merges both into one feed with the same visual vocabulary as whittle stats: ▸ verdicts colored by served tier family with the reason, family move (opus→haiku / kept), ctx tokens, latency, non-200 statuses, and the full signals trace; 🪓 carves with tool, in→out tokens, percent, strategy; startup lines pass through dim; MCP retrievals render as their own event. Implementation is stdlib-only: a poll-based follower per file (300ms) that tolerates missing files (waits for creation), buffers partial lines, and recovers from rotation by size regression; -n backlog is merged across files by timestamp before following; -plain and NO_COLOR disable ANSI. Watch reads the background service's log; foreground `whittle route` prints to the terminal directly (documented). Docs: README router bullet, ROUTER.md §8, and POLICY.md's authoring loop now reference watch. Tests pin all renderers, follower edge cases, backlog order. Co-Authored-By: Claude Opus 4.8 (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.
Implements the
whittle watchsubcommand: one live terminal feed merging both event streams — the router's per-request verdicts (/.whittle/logs/router.log) and the compression hook's per-carve records (/.whittle/stats.jsonl) — rendered as chips in the house visual vocabulary (▸ verdicts colored by served tier, 🪓 carves with token deltas, non-200s in red, signals inline).Poll-based dual-file follower, stdlib only: waits for files that don't exist yet, buffers partial lines, recovers from rotation/truncation.
-nbacklog merged across both files by timestamp,-plain/NO_COLOR support. Tests cover renderers (route, no-op, startup passthrough, non-200, carve, retrieve, junk), the follower's edge cases, backlog merge order, and number formatting.Verified live against real files: session carves and a mid-watch routing verdict rendered together.
This also makes the retired hero-GIF concept honest:
whittle watchnow actually exists, so a future demo can type a real command.🤖 Generated with Claude Code