Repository navigation
docs: Show the Timeline pane in the README animation - #1889
Conversation
The README animation now ends in agentop's Timeline pane, not in the spend breakdown and usage charts. One session's main agent starts five subagents. Their bars grow as the replay advances, they hand back one by one, and each row shows its tok/s. Then the events pane of another session shows each tool call as its own row, and Enter on the Bash row opens the call and its output. The live session is the shape of a real Claude Code session, scrubbed by testdata/scrub.py: every message is a hash, and the labels, commands and hosts are invented. A beat's new `at` and `frames` fields replay it into the store while agentop is attached, so the pane updates over the live stream. Other changes: - svg.go draws block elements (█ and ▁…▇) in agentop rows as exact rects. Font glyphs left steps and seams in the Timeline bars. - svg.go draws each distinct row once in <defs>, and merges touching cells of one colour. The asset is 459 KB, under its 500 KB budget. - With a replay, the clock stops at each beat's moment, so two runs give the same bytes. The events/sec footer is masked for the same reason. - The installer lines show v0.9.5. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Hai Huang <huang195@gmail.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 8 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
clawgenti
left a comment
There was a problem hiding this comment.
Summary
The new act does what the PR says. I rendered the committed SVG in headless Chromium at t=29s, 31s, 34s, 37s, 44s and 48s. The Timeline shows the main agent and five subagents, the bars grow across frames, the subagents hand back, tok/s is filled in, the dark-mode session lists Read/Grep/Edit/Bash as their own rows, and the Bash call's PASS … ✓ toggles dark mode output is on screen. Locally, GOWORK=off go test -count=1 ./... in scripts/readme-demo passes at 15beb24 (including the byte-for-byte staleness check and the 500 KB budget; the asset is 460 KB), and go vet and gofmt -l are clean. I also checked the gzipped fixture for leaks: every message, tool result and completion is a bare 8-hex hash plus the kept markers; the only hosts are api.anthropic.com, api.github.com and github.com; and tool arguments are only the invented commands and labels. No blocking issues.
One suggestion lets you drop the second known limit (42:24 everywhere). Two nits are inline.
One small thing in the asset itself: at 120 columns, the Timeline legend's last item is cut to ▁…█ re (the full text is "requests in flight"). The cut is agentop's legend wrapping at that width, not the generator, but it is now visible in the README.
Author: huang195 (MEMBER — maintainer)
Areas reviewed: Go (readme-demo generator, SVG emitter, capturer, tests), Python (testdata/scrub.py), Docs (README, readme-demo docs), committed fixture and asset
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: README demo, core, CodeQL, DCO and the lint jobs pass. Go CI (Windows build, archive and ledger) failed in go test ./bootstrap/... ./session/archive/... ./cost/ledger/.... This PR doesn't touch core/, and the branch base (676557d) predates #1887, which skips a Windows-flaky archive test. The same job passes on main, so a rebase should clear it. Several jobs were still pending when I reviewed.
| view = isoTimestamp.ReplaceAllString(view, canonicalISO) | ||
| view = agePattern.ReplaceAllStringFunc(view, fixAge) | ||
| view = eventRate.ReplaceAllString(view, canonicalRate) | ||
| for _, re := range clockPatterns { |
There was a problem hiding this comment.
suggestion: With a replay, the clock is already frozen at demoAnchor + shift, so the clock masking here isn't needed for determinism in this act any more. It's what produces the 42:24 known limit (the Timeline axis reads 42:24:24 five times, and every TIME cell in the events pane is 42:24:24.24). I tried skipping it when frozen:
if !c.frozen.Load() {
for _, re := range clockPatterns {
view = re.ReplaceAllStringFunc(view, fixClock)
}
}Two full runs of go run . gave identical bytes, and a third run with TZ=America/New_York matched them too (466 KB, still under budget). In that render the axis reads 12:00:05 12:02:13 12:04:21 12:06:29 12:08:37, the header reads 09-15 12:00 → 09-15 12:09, and the tool rows show 11:58:42.90 … 11:59:42.90, so the 20 s spacing from turnTime is visible. That would let you drop the second known limit.
| // SolidBlocks draws each █, and each lower block ▁…▇, as a filled cell rather than a glyph. A terminal's | ||
| // cells touch, so block art such as setup's logo reads as solid there; here the | ||
| // line height is taller than the glyph, and drawn as text it reads as stripes. | ||
| // Not for agentop's screens, whose block-drawn bars sit on adjacent rows and |
There was a problem hiding this comment.
nit: This sentence is now the opposite of what the code does. screenRows sets SolidBlocks: true on every agentop row, and the rect merging plus seamOverlap is there so adjacent rows merge on purpose. Consider rewording it to say agentop rows use this too (and why: font glyphs left seams in the Timeline bars), and rewrapping the first line, which now runs past 100 columns.
|
|
||
|
|
||
| def H(s, n=8): | ||
| return hashlib.sha256(s.encode()).hexdigest()[:n] |
There was a problem hiding this comment.
nit (privacy hardening, non-blocking): H is an unsalted, 32-bit SHA-256 prefix of the plaintext. For long messages that's fine. For short ones (one-word user replies, common tool outputs like ok, short Bash results) anyone with a candidate list can confirm a guess by hashing it. The hash only needs to be stable within one scrub (so a retry still reads as a retry), so salting with a per-run random key keeps that property and closes the guessing route:
SALT = os.urandom(16)
def H(s, n=8):
return hashlib.sha256(SALT + s.encode()).hexdigest()[:n]The one catch is that sub_id/tool_id would change between scrubs too. That's harmless, since the fixture is regenerated whole.
Summary
The README animation now shows agentop's Timeline pane, not the spend breakdown and usage charts.
tok/s. The pane updates over the live stream, about every 0.5 s.┣⚒ Read,Grep,Edit,Bash). Enter on the Bash row opens the request that carries its output, and the view scrolls down to that output.v0.9.5, the latest release.The animation is 50 s. It was 58 s.
How the live session is made
The live session is the shape of a real Claude Code session, scrubbed by
scripts/readme-demo/testdata/scrub.py:api.anthropic.com.testdata/README.mdsays how to make the fixture again.In
demo.yaml, a beat now has two new fields:at:is how far into the replay the beat is captured.frames: Nsplits the beat into N captures.Generator changes
svg.godraws█and▁…▇in agentop rows as exact rects. Font glyphs left steps and seams in the Timeline bars.<defs>, and touching cells of one colour merge. The asset is 459 KB, under its 500 KB budget. Without these two changes it was about 1 MB.LAST 1HaboveTHIS MONTH.toolCalls,historyToolCalls,toolResults), so the tool rows and the call detail have content.Known limits
42:24on the Timeline axis and in the TIME column.Test plan
GOWORK=off go test ./...inscripts/readme-demo(includes the staleness check and the size budget)go vetandgofmt -l .cleanAssisted-By: Claude (Anthropic AI) noreply@anthropic.com