Repository navigation
Description
Design and tracking, in the shape of #366, #397 and #410. Nothing here starts a build.
What
#367 measured behold's read cost and fixed half of it. The half it fixed was duplicate work: a shared FIFO budget across every chant read, in-flight sharing by read identity, cancellation per subscriber, and the removal of the browser's unconditional 3/8/15s follow-ups. That landed as cbede01.
The half it did not fix is the number itself, and it said so:
An 11-member Kubernetes estate took 153s to observe, then 147s on a repeated read with the source cache warmed. A single member made 217 API requests in 28s.
This addresses duplicate work and resource spikes; it does not remove Chant's per-read Kubernetes discovery cost. No production latency improvement is claimed yet.
Nothing tracks that. Two and a half minutes of blank screen for one picture of a real estate, on a warm cache, is the largest known defect in behold and it has no issue.
Why this is not a performance chore
behold's discipline is refusing to show an answer it does not have. _unobserved carries the reason it could not look. A card goes neutral rather than green when the plan did not mention it. The behaviour overlay splits a refusal from an absence so a missing engine can never read as an estate that costs nothing. Every one of those is the same move: name the gap rather than paper over it.
There is no equivalent for time. A member that has not reported yet is not missing and not unobserved — it is pending, and behold has no word for it. That absence is why the estate read is all-or-nothing: mapWithConcurrency and Promise.all await every member before /api/graph or /api/overlay returns anything (src/estate.ts:52-70, src/server.ts:1913), and SSE carries change notifications rather than graph content (src/server.ts:1356), so there is no partial picture to fall back to. Giving time the same vocabulary the other gaps already have is what turns 147 seconds of nothing into a picture that fills in.
behold cannot currently say where the time goes
- There is no
/api/doctor.src/doctor.tsis a CLI report (diagnose,formatReport) and nothing serves it. memberIrCacheStats()returns hits, misses and entries, and its own comment calls it "cheap enough to expose for a future/api/doctorline". Nothing but its own test has ever called it.- There is no timing instrumentation on the read path at all. Every
Date.now()insrc/is domain logic in operator, frames or gh-run.
So the 147 seconds is a single opaque number. Which member, which phase, how much was chant evaluating TypeScript and how much was the cluster answering — none of it is observable from inside behold, which is why the first milestone is measurement and not a fix.
The measurement has an obvious home. ReadScheduler (src/read-scheduler.ts, #367) is the chokepoint every chant read already passes through, and each job already carries an identity key built from the project, the resolved chant, the source stamp and generation, the argv and the effective environment. Timing keyed by that costs almost nothing and needs no new plumbing.
The rules
A completed live result is never cached. #367 settled that and this epic does not reopen it: live means live, and a cached live read is the same lie as a faked figure. Rendering a member before its neighbours is not caching — it is showing what has arrived and saying plainly that the rest has not.
Freshness is never implied. A member drawn from an earlier moment says which moment, the way component-status.ts already labels tier-3 evidence rather than colouring from it.
The invariant is untouched. Nothing here writes to a cloud or to source.
What stays chant's
The per-read Kubernetes discovery cost is chant's, and src/estate.ts's own comment already names the other half: each member read is "a whole Node process doing a full TypeScript evaluation of that member's source — seconds of CPU each, before the live half even talks to a cluster." Neither is worked around here. M1 exists partly so the upstream issue can be filed with a breakdown instead of one aggregate number.
Milestones
- M1 the read path says what it cost (read cost M1: the read path says what it cost — per-read timing through ReadScheduler, and the source-versus-live split #420)
- M2 where the time went, somewhere a person can see it (read cost M2: where the time went — serve the doctor report, and one panel line for the person waiting #421)
- M3 the picture arrives in pieces, and says what has not arrived (read cost M3: the picture arrives in pieces — a pending member is not an unobserved one #422)
- M4 the line held: a duration assertion in the workbench e2e (read cost M4: the line held — a duration assertion in the workbench e2e, beside the aspect ratio #423)
- M5 the upstream half, with numbers (read cost M5: the upstream half, with numbers #424)
Activity
lex00 commentedon Sep 16, 2026
Ordering and current state.
M1 and M2 are implemented on
feat/420-read-cost-instrumentationand awaiting review as PR #425; both close when it merges.M3 is the milestone worth pulling forward. It carries one decision the issue deliberately leaves open — SSE carrying per-member IR as it lands, versus a polled partial payload — and it is the only one of the five that changes what a person sees. Everything else in the lane is measurement, a test ceiling, or a filing.
test(e2e): assert the line held — a duration ceiling per entry, and #422
lex00 commentedon Sep 17, 2026
All five milestones are done and there is no behold work left in this epic.
ReadScheduler, with the source/live split. Landed in PR feat: what a picture costs — the read ledger, and the doctor report over HTTP (#420, #421) #425, after review found and fixed three defects:/api/doctorwas running the fulldiagnose()on every graph load (untimed docker/gh/helm/k3d probes), the panel line claimed a "slowest member" the ledger cannot see choudoufu members in, and the in-flight count M2 asked for did not exist.GET /api/doctor, plus?reads=1as the cheap half the SPA actually asks for,reads.inFlightandreads.unmeasured.?progressive=1, opt-in so the blocking answer stays the contract agents andbehold exportdepend on.The number this epic opened on, with the share that is chant's isolated.
chant --help— argv parse, exit, no graph work — costs 799 ms. An 8-node graph read costs 1048 ms, so 76% of it is startup. behold shells the project's own chant per member because members pin different versions, so the 11-member estate behind the 147s is ~8.8 s of CLI startup before any graph work or any substrate call.That is the half behold could fix by not asking twice, and it has: the #367 budget and in-flight sharing, #307's source cache, the removed browser follow-ups. What is left per invocation is upstream, which is what #2481 asks about.
Closing. The remaining latency work is chant's, tracked there.
test: pin the version floor and the cache key (#449)