Skip to content

Leave progress reports out of the Candidate tab's Stage timeline - #321

Merged
anth-volk merged 6 commits into
mainfrom
claude/stage-timeline-leave-out-progress-reports
Nov 25, 2026
Merged

anth-volk merged 6 commits into
mainfrom
claude/stage-timeline-leave-out-progress-reports

Conversation

@anth-volk

@anth-volk anth-volk commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #320. Tracker task 4a · 41 of "1. Collector/Emitter". It depends only on 4a · 32 (#315), which is done, so its merge waits for nothing else.

Why

Since #315, an unfinished run's Stage timeline on the Candidate tab comes from the collector's record (read API v2). #315 left heartbeats out of the record's events but kept progress reports. A run's own events file holds neither. Only the newest events that fit 1,500,000 characters of JSON are returned, so a long record loses its stages.

The record of the US run populace-us-2024-b5db384-8b0c1950b65f-20261023T153127Z has about 4,300 events. After heartbeats are left out, the newest 2,089 kept are all post_export_scoring progress reports. In production its Stage timeline shows none of the stages that the copy's 42 rows listed. Anthony's decision (2026-11-25): leave the progress reports out too.

What changes

recordInternals (frontend/lib/microcosm/staging-run-state.ts) builds the Stage timeline from the record's stage changes and calibration events, in the record's order. It leaves out heartbeats and progress reports, which the run's own events file never holds.

  • A progress report is an event, not a calibration event, whose details hold both done and total, whatever its status. Anthony chose this rule, option A of three, on 2026-11-25. The emitter and the collector read a progress report's counts by the same two keys. The record's status can't tell a progress report from a stage change: the collector's documents, and the dashboard's conversion of read API v2 answers (collector-run-documents.ts), turn every event type but calibration into stage and keep only the status.
    • The US builder's work counters (progress(): engine batches in target compilation, scoring batches after export) arrive with status progress.
    • UK graph-node reports (emit(event_type="progress", status="completed") in the UK builders) arrive with status completed. They make up 26 of the 33 events of UK run uk-local-candidate-f100-s42-20261123T075147Z-7081d968 after heartbeats.
    • A scan of Microcosm's non-test code (keyword arguments and literal details) finds done and total passed only by these progress-report calls.
  • Stage rows the build sends with a status of its own stay. The US events file holds a retained and a PASS row in every run read. The emitter doesn't recognise those statuses, so they reach the record as progress, with the build's own details.
  • Heartbeats are recognised as before, and also when the collector removed a heartbeat's machine reading because it didn't match the collector's model (it names the reading in dropped_emitter_details; only a heartbeat's details hold a reading). Before, such a heartbeat counted as a stage change, which could fill the size limit; it was there since Read the release and staging calibration views from the collector's store #315, and review round 2 found it.
  • Size limit. Within the limit, the newest stage changes are kept first, and the newest calibration events fill what is left. So neither progress reports nor 1,500 calibration epochs crowd out a run's stages. The calibration progress keeps its newest events within a limit of its own of the same size, as before.

The route comment and docs/calibration-tree-artifacts.md say the same.

What pages show differently

On the Candidate tab, an unfinished run whose Stage timeline comes from the collector's record:

  • no longer lists progress reports: the US builder's engine and scoring batches or the UK builders' per-node rows (uk.full.*, unit graph_nodes);
  • for a long record, lists its stages again, with its calibration events.

Unchanged:

Tests

Red-green:

  • e6fdcf3 adds three failing tests to frontend/app/api/microcosm/staging/run/route.test.ts. Run by name, all three failed on assertions against main's code.
  • 940dc17 makes them pass.
  • 98710bd changes only comments and docs wording.
  • 6660196 applies review round 1's code-quality points: the first test now also checks the record's order with calibration events among stage changes, and that a stage row whose details hold done without total stays; comment and docs wording.
  • 893f3b0 adds a failing test for heartbeats whose reading the collector dropped (failed locally on its assertion, by name) and, from review round 2, more cases in the first and third tests, which pass. 0c50d6c makes the new test pass and changes comment and docs wording.

The four tests cover:

  • leaving out heartbeats, US scoring-batch reports (status progress, with an outer counter) and UK graph-node reports (status completed), while keeping stage changes, a retained-style stage row with status progress, a stage update with a message, an emitter-made stage end and calibration events (one with done and total in its details), in the record's order; stage rows with only done or only total stay;
  • a record shaped like the US run above: 42 stage changes, 1,500 calibration epochs, 3,000 scoring-batch reports and 400 heartbeats, which keeps every stage and every calibration event;
  • 10,000 large calibration events around 30 stage changes, which keeps every stage, keeps the newest calibration events, and fills the limit without going over it;
  • heartbeats whose reading the collector dropped, with and without a sleep, which are left out, while a stage end whose span the collector dropped stays.

Locally, only these four tests were run, by name; all pass. tsc --noEmit passes. CI's runs at e6fdcf3 and 940dc17 were cancelled by the next push, so the failing run of e6fdcf3's tests is recorded only locally and by review round 1; CI run 45670875848 at 98710bd passed.

How the change is checked

This PR's Preview deployment reads Preview's collector, which has no record of the production runs this fixes, so Preview can't show the change on them. Instead:

  • The tests use the event shapes read from production's records on 2026-11-24 and 2026-11-25: the UK run's graph-node reports, and the US run's scoring-batch reports and stage rows.
  • After the production deployment, the US run's Stage timeline can be compared read-only with the stage list the Build progress tab derives from the same record. That list has 46 stages.

Review

  • Round 1 (calibration-diagnostics-321-review-round1-2026-11-25.md, at 98710bd): no bugs (0 high, 0 medium, 0 low). It verified each claim above against Microcosm, the emitter and the collector, including the **details spreads of the build's stage calls, and ran the three tests red at e6fdcf3 and green at 98710bd. Its code-quality points are applied in 6660196.
  • Round 2 (calibration-diagnostics-321-review-round2-2026-11-25.md, at 6660196, at Anthony's request): 0 high, 0 medium, 1 low. Low: a heartbeat whose reading the collector dropped stayed in the Stage timeline (since Read the release and staging calibration views from the collector's store #315); fixed test-first in 893f3b0 and 0c50d6c. It found the Candidate tab's other sections, the Build progress tab, the Candidate list and the cached record documents unaffected, and the size accounting exact. Its test and wording points are applied in the same commits.
  • Left, by decision: the rule reads details keys, not read API v2's original event_type, which only one of the dashboard's two read paths has (option B, not chosen). A future build stage row whose details hold both done and total would be left out of the Stage timeline.
  • Left, unchanged from before this PR: the run detail's other documents from the copy (run manifest, progress, calibration summary) have no size limit, and the limits count characters, not bytes, so a response can still pass the platform's 4.5 MB limit in rare cases, as before.

Environment variables

None read or declared by this change.

🤖 Generated with Claude Code

While an unfinished run's Stage timeline comes from the collector's
record, it must leave out progress reports as well as heartbeats, as the
run's own events file does. A progress report is an event, not a
calibration event, whose details hold both `done` and `total`, whatever
its status: US scoring batches arrive with status `progress`, UK graph
nodes with status `completed`. Stage rows the build sent with a status
the emitter doesn't know arrive as `progress` and stay. Within the size
limit, stage changes are kept before calibration events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
calibration-diagnostics Ready Ready Preview Nov 25, 2026 6:50pm UTC

Request Review

anth-volk and others added 2 commits November 25, 2026 22:01
While an unfinished run's Stage timeline comes from the collector's
record, it now lists what the run's own events file holds: its stage
changes and calibration events. Heartbeats stay out as before, and
progress reports are left out too: events, not calibration events,
whose details hold both `done` and `total`, whatever their status. The
emitter and the collector read a progress report's counts by the same
two keys. Within the size limit, the newest stage changes are kept
first and the newest calibration events fill what is left, so a long
record no longer loses the run's stages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…events file

The record's stage changes include the stage ends the emitter adds, which
a US run's events file doesn't hold; say instead that heartbeats and
progress reports, which no events file holds, are left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test that the Stage timeline keeps the record's order with calibration
events among stage changes, and that a stage row whose details hold
`done` without `total` stays. Name the US builder's target compilation
counter among the progress reports, say in the docs that the emitter's
stage ends and calibration events stay, and rewrap the route comment and
the docs paragraph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk and others added 2 commits November 25, 2026 22:49
The collector removes a heartbeat's machine reading that doesn't match
its model and names it in `dropped_emitter_details`; such a heartbeat
must stay out of the Stage timeline. Also pin, as review round 2 asked,
that rows with only `total`, the emitter's stage ends and calibration
events with counts stay, and that calibration events fill what the
stage changes leave of the size limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The collector removes a heartbeat's machine reading that doesn't match
its model and names it in `dropped_emitter_details`. Only a heartbeat's
details hold a reading, so such an event is a heartbeat and stays out of
the Stage timeline; before, it counted as a stage change and could fill
the size limit. Review round 2 also asked for wording: the size limit's
comment now says the Stage timeline and the calibration progress each
have a limit of their own, and the docs paragraph is rewrapped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@anth-volk
anth-volk marked this pull request as ready for review November 25, 2026 19:00
@anth-volk
anth-volk merged commit b6ed41d into main Nov 25, 2026
5 checks passed
@anth-volk
anth-volk deleted the claude/stage-timeline-leave-out-progress-reports branch November 25, 2026 19:00

This branch was successfully deployed

1 active deployment
Preview — 0c50d6cf Deployed Nov 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Candidate tab: leave progress reports out of an unfinished run's Stage timeline

1 participant