Repository navigation
Show the collector's run state on the Staging page's Candidate tab - #264
Merged
Merged
Conversation
Add failing tests for the Staging page's Candidate tab taking each run's state from the telemetry collector when the collector has a record of it: - the two US runs whose Hugging Face uploads stopped mid-calibration (one failed at its release acceptance checks, one is in reform validation); - a collector that fails or is not configured, which leaves the Hugging Face states in place with a note; - runs the collector does not know, which keep their Hugging Face state; - UK runs, both one the collector knows and a local-area candidate it does not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Staging page's Candidate tab read run state only from the Hugging Face staging repository. When a build's Hugging Face uploads stop (the US writer switches them off after Hugging Face refuses commits over its hourly limit), the tab kept showing the last uploaded state. Two US runs showed as calibrating although one had failed at its release acceptance checks and the other was in reform validation. The staging/runs and staging/run routes now ask the collector for the runs they list. For each run the collector has a record of, among the country's 60 most recent collector runs as on the Build progress tab, the response carries the collector's status, stage, start, end, heartbeat and failure, derived with the Build progress tab's own collector loader and buildTimeline. The Hugging Face values stay as hugging_face_status, hugging_face_stage and hugging_face_updated_at, and state_source names where the state came from. Runs the collector does not know keep their Hugging Face state, derived with the now exported runState, which applies the same 6-hour rule the view applied. A collector that is not configured, or that fails, leaves the Hugging Face states in place and adds collector_note. Runs only the collector knows are not listed: they have no candidate files in the staging repository. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add failing render tests for the Candidate tab's overview card: the failed and running US runs show the collector's state and stage, where that state came from, and what their out-of-date Hugging Face copies still say; a collector failure shows the Hugging Face state with the collector note; a refused UK run shows the stage that refused it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The run picker and the Candidate overview now show the state the server derives: the collector's when it has a record of the run, else the Hugging Face copy's. The view's own 6-hour rule for silent runs is removed; the server applies the Build progress tab's rule instead. The overview card, now the exported CandidateOverview, adds: - "Status from": the telemetry collector or the Hugging Face staging repository; - "Last heartbeat", when the run sends heartbeats; - the stage a failed or refused run stopped at, and its failure message; - "Hugging Face copy": what the copy last recorded and when, shown only when it disagrees with the collector or is more than 15 minutes behind; - the collector note, when the collector is not configured or failed. The run picker names each state's source in a tooltip and a footnote. Run internals, which read the Hugging Face copy, say so when the copy has fallen behind, and mark the last event of a run that is no longer running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The overview fell back to the run list's collector note when the selected run's response had none. The collector can answer for the selected run after the list's request failed, so that fallback could show a failure note next to a state the collector did provide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ging Face state A collector record that stopped before the run ended (running, or stalled once its heartbeats stop) must not replace a Hugging Face copy that recorded the run's end afterwards. Two guards keep the rule narrow: a final collector state stays when the copy recorded the end later, and a final Hugging Face state written before the collector's latest update gives way to the collector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Candidate tab replaced every Hugging Face state with the collector's, so a run whose collector record stopped before the end (for example, when the build could not deliver its last events) showed as running or stalled even though its Hugging Face copy had recorded it passing, failing or being refused afterwards. Before this branch the tab showed that end. The overlay now keeps the Hugging Face state when the collector's state is not final, the Hugging Face state is final, and the copy was updated after the collector's latest update. A final collector state still wins, so a schema 2 refusal the collector infers from its acceptance check events stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comment said a healthy UK run uploads its copy every 5 minutes. The writer uploads only when the build records something, at most every 5 minutes, so a healthy run in a long stage can also trail the collector by more than 15 minutes (production showed one 40 minutes behind). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One run seen through the Candidate tab's overlay, Build progress's merged list and its run view, in three cases: a collector record that stopped before a later Hugging Face end, a final collector state with a later Hugging Face end, and a collector record newer than a Hugging Face end. Build progress lets any collector record replace the Hugging Face copy, so the first case fails on that tab. The merged list's function, `mergeHostedDocuments`, does not exist yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build progress let any collector record replace the run's Hugging Face copy, in its merged list and in its run view. So a run whose collector record stopped before an end the copy recorded later showed as running or stalled there, while the Candidate tab showed the end. The rule now lives in one shared function, `collectorMissedTheEnd` in build-monitor.ts. The Candidate tab's overlay uses it. Build progress's list merge, now `mergeHostedDocuments`, uses it to keep the Hugging Face copy for such a run. `refreshHostedRun` uses it to keep that copy when it re-reads the collector. A final collector state, or a collector record newer than the Hugging Face end, still wins on both tabs. The README and docs/build-monitor.md describe the rule for both tabs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Fixes #263
Summary
The Staging page's Candidate tab now takes each run's status, stage and times from the hosted telemetry collector whenever the collector has a record of the run, as the Build progress tab already does. The Hugging Face values stay in the response, and the page says which source each state came from and what the Hugging Face copy still records when it has fallen behind.
What the two US runs now show
Checked against the production data from 2026-10-22, reproduced in the tests:
…20261019T222143Z…20261021T160022ZHow it works
GET /api/microcosm/staging/runsandGET /api/microcosm/staging/runcall the newloadCollectorTimelinesinbuild-runs.ts.loadCollectorDocuments.buildTimeline, so the two tabs agree on every run the collector knows, including the 5-minute heartbeat rule.lib/microcosm/staging-run-state.tslays the collector's state over the Hugging Face summary:status,stage(for a failed or refused run, the stage it stopped at),started_at,updated_at,ended_at,heartbeat_atandfailure;state_source(collectororhugging_face);hugging_face_status,hugging_face_stageandhugging_face_updated_at;hugging_face_differs, which is true when the copy shows another state or is more than 15 minutes behind the collector. A healthy UK copy uploads every 5 minutes.state, next to the unchanged Hugging Face documents.runState, which is now exported frombuild-monitor.ts. It applies the same 6-hour rule for silent runs that the view applied, so the view's own copy of that rule is removed.collector_note, which the overview shows. One run whose record fails to load keeps its Hugging Face state, and the note names it. An invalid collector setting is caught the same way, so it can't hide the Hugging Face runs.CandidateOverview, adds "Status from", "Last heartbeat", "Failure", and "Hugging Face copy" (shown only when the copy differs).stagingcapability never reaches the collector.Runs only the collector knows: not listed
The Candidate tab doesn't add runs that exist only in the collector (55 UK runs today).
UK
uk-frs-calibration-attempt-…anduk-local-candidate-…-20261018/19…) already agree, so they show the same state as before. Only "Status from: Telemetry collector" is added, with no Hugging Face copy row.…20261007T120029Z,…20261006T094003Z,…20260919T154920Z,…20260919T013428Z,…20260918T185154Z) show "Completed" on the Candidate tab and "Blocked" on Build progress.completed. Build progress infers "Blocked" from blocking failures in their acceptance check events, which only the Build progress tab reads.completed, instead of "Completed".blockedthemselves, so no new run is affected.Environment variables
This adds no new variables. The Candidate tab's routes use the same three the Build progress routes use. They are in the same Next.js deployment, and Vercel applies a deployment's variables to every function in it.
MICROCOSM_TELEMETRY_COLLECTOR_URLProductionenvironment variabledeploy.ymlpassesvars.MICROCOSM_TELEMETRY_COLLECTOR_URLtodeploy-dashboard.sh, which checks it's set and passes it tovercel deploy --env.Productionenvironment, and the wiring is in the repository.MICROCOSM_TELEMETRY_READ_SECRET_VERSIONsecret-manager.ts).MICROCOSM_TELEMETRY_GOOGLE_IDENTITY_PROVIDERVERCEL=1, which Vercel sets.Both routes set
runtime = "nodejs", which Secret Manager access needs. The list route also setsmaxDuration = 120to allow for the collector requests' 30-second time limits.Tests
The tests were committed failing first, then the implementation (two pairs: server, then view).
loadCollectorTimelines, both routes and the card.loadCollectorTimelinesasks for one list page of 60 runs and fetches documents only for the requested runs it knows.Local results:
bun testpassed (800 tests),bun run lint(type checks) passed, andbun run buildpassed. I haven't viewed the page in a browser, because the private staging repository and the collector need credentials this machine doesn't have.Overlaps
docs/build-monitor.md. This PR adds one sentence to the "Historical Hugging Face telemetry" bullet, outside Remove telemetry-service/ now that the collector deploys from its own repo #234's changes.staging-artifact.ts, anduse-microcosm.ts.staging-artifact.ts.use-microcosm.tsit changes only the staging run response types and one import.Known, separate issues (not changed here)
Review round 2026-10-26
Fixed
4fc3acc, fix7f7dbbb(also updates the README anddocs/build-monitor.md).collectorMissedTheEnd(build-monitor.ts). The Candidate overlay, Build progress's merged list (mergeHostedDocuments) and its run view (refreshHostedRun) all use it. Failing test3cc2ee0(one run seen through both tabs, plus the run view case), fix7988977, which also updates the README anddocs/build-monitor.md.HUGGING_FACE_LAG_MS(low). Staging writers upload only when the build records something (at most every 5 minutes for the UK), not every 5 minutes. So a healthy run in a long stage can also show the "Hugging Face copy" row; production had one 40 minutes behind today.8f058eb.Not changed, for follow-up
Checked: the three settings exist in the Vercel project's Production settings, and the collector address is also a GitHub
Productionvariable thatdeploy.ymlpasses tovercel deploy --env. Production Build progress read collector records today. #234 and #241 merge cleanly with this branch. Local:bun test(807 pass),bun run lintandbun run buildpass.🤖 Generated with Claude Code