Conversation
The Dashboard gets an "Agent reads, this week vs last" section: every markdown doc in scope with its agent reads over the last 7 days against the 7 before, and a ▲/▼/new change. Built from heat?days=7 and heat?days=14 — no server change. CLAUDE.md / AGENTS.md / GEMINI.md are pinned as "auto-loaded - not counted", with a visible caveat, since their real use never passes through the read hook. Also fixes a clock-dependent staleNote unit test that pinned "now" to 2026-08-18 while staleNote measures from the real clock. Co-Authored-By: Claude Opus 5.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.
TL;DR
heat?days=7andheat?days=14subtracted. No new endpoint, no server change.Closes BEA-244.
How it's built
Two windows plus the tree go into one pure helper:
lib/heat.ts:weeklyAgentReads+weekChange, unit-tested inheat.test.ts(clamp on a B<A race, auto-loaded basenames at any depth and case-sensitive,.mdxincluded,.txtout, sort tie-breaks, 0/0 for unread docs).Insights.tsx:useAgentWeeksmakes two queries keyed under["heat", apiBase, "days", N]. The existing refresh-on-open prefix-matches them, and they never collide withuseHeat's 30-day key. It returnsnullunless both requests succeed, so a failed or older hub hides the section and nothing else.AgentWeekTablerenders below Hot path: top 20, then a "show all N" toggle.Browser.tsx: it's gated oninsightsOpen(the Dashboard or the project home), so no other page fires the new requests./heatshares.visibility(r).days=7covers today plus 7 prior UTC days, so "this week" carries one extra, partial day. The UI just says "the last 7 days, today included".Screenshots
What was run
go test ./...: all packages ok (internal/webapp419s).npm test: 149/149.npm run e2e: 283 passed, 2 failed, both unrelated to this PR:edit-url.spec.ts"a failing read leaves the editor…" fails on main too. I checked by running it against main's committedstatic/.layout.spec.ts"the gutter belongs to the scroll container" is a flake that passes when re-run alone.dashboard.spec.tscover: the caveat is visible, index.md shows 30/0new, deploy.md shows 0/5▼ 5, human reads are excluded, folder scope shows onlynotes/, and the section hides whenheat?days=7|14returns 500.check-dist.sh: fresh.Deviations from the plan (small)
deploy.md, 5 agent reads, ten days back. No other spec counts that file.in-wk-*classes instead of the plan's reuse ofin-hp-*. Existing specs count.in-hp-rowby filename, and reusing the class doubled those counts.staleNoteinheat.test.tspinned "now" to 2026-08-18 whilestaleNotereads the real clock, so it has failed on main since the calendar passed it. It now usesDate.now().guides/what-agents-read.mdgets the new view and the auto-load caveat. No architecture diagram change, since no new component file or seam was added.Open question
Once this is in use, is 7 vs 7 days the right grain? A multi-week sparkline or a window picker was scoped out of v1.
Build session
(only works on the machine that ran the build)
🤖 Generated with Claude Code