Repository navigation
Compare UK local-area Staging candidates with the local-area release - #239
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
anth-volk
force-pushed
the
uk-staging-comparison-baseline
branch
from
October 20, 2026 12:44
53fa9d3 to
966523b
Compare
anth-volk
force-pushed
the
uk-staging-comparison-baseline
branch
from
October 20, 2026 12:52
966523b to
6fb5ee6
Compare
anth-volk
force-pushed
the
uk-staging-comparison-baseline
branch
from
October 20, 2026 13:15
753fb5c to
3ca39f3
Compare
anth-volk
force-pushed
the
uk-staging-comparison-baseline
branch
from
October 20, 2026 14:13
3ca39f3 to
ee84664
Compare
anth-volk
force-pushed
the
uk-staging-comparison-baseline
branch
from
October 20, 2026 14:54
ee84664 to
5f9d817
Compare
The Staging page compared every candidate with the country's latest release. For the UK that is the national build, so a local-area candidate (21,523 targets in September) was set against the national release (1,168 targets): 634 targets matched, 20,889 counted as added and 534 as removed. A candidate whose run manifest records a pipeline the country registers as local-area (the UK's uk-local-candidate) is now compared with the local-area release. That release has no pointer file and is never promoted, so its most recently published build, as the dashboard manifest records it, is used; release roles come from each release manifest's dataset_role, as in the release picker. No staged receipt or run manifest records a dataset role, and the local dataset file was microcosm_uk_2025_local.h5 in September and microcosm_uk_2024_25_local.h5 in October, so the contract-validated pipeline id is the stable signal. With no published local-area release, the current release is used and the page says so. National candidates, US and Belgium are unchanged: their comparison still resolves to the current release, and the response gains a comparison_release field only for local-area candidates. The page names the release in the comparison column, the map tab and a note, and the comparison map starts from that release's build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… comparison arrives The Staging calibration map stored its "From" build in state and only replaced it when the stored value was not a published build. The build manifest usually responds before /microcosm/staging/compare, so the panel first stored the manifest's latest (national) build and kept it when the comparison then named the local-area release. Because the target-change query prefers a build over a release, the "Change from local-area release" tab showed the national comparison. The panel now stores only the builds the user picks. comparisonMapBuilds works out both selectors on every render from those picks and the current responses, so the defaults follow the comparison until the user picks a build. A pick of the live candidate as "To" also holds now, instead of being replaced on the next manifest refetch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For a UK local-area candidate, the "Change from local-area release" tab still said "Current release calibration target" above a target from the compared build, and its mode help said removed targets subtract their "current-release contribution". The target detail both maps open also labelled its estimate, error, chart series and summaries "current release". The release label the Staging page already derives for the candidate (stagingComparisonBaseline, whose columnLabel is now releaseLabel because the maps use it too) is passed to StagingTargetChangeMap and to the candidate-fit map's target detail. targetChangeModeHelp and stagingTargetDetailPresentation name that release, and the detail's eyebrow now comes from the presentation. National, US and Belgian candidates keep "Current release"; the removed-target help now reads "subtract their contribution in the current release". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
newestPublishedLocalAreaRelease sorted builds with its own buildPublishedInstant, which computes the same order as the dashboard's calibrationBuildsNewestFirst: createdAt, else updatedAt, an undated build last, and ties by build ID. The package cannot import from the dashboard, so calibrationBuildsNewestFirst and its two tests move into the package's calibration-tree-manifest module, and both callers use it. No ordering changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route's loadComparison dependency returned Promise<object>, which accepts any object. It now returns StagingComparison, the type loadStagingComparison returns, exported from the package. The route test's stub, which carries only the field the page reads, says so with an explicit cast. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README's API table said only that staging/compare diffs a candidate against a published release. It now says that release=latest resolves to the newest published local-area build for a run whose pipeline is registered as local-area, documents the comparison_release field, and documents the staging registration's local_area_pipelines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
force-pushed
the
uk-staging-comparison-baseline
branch
from
October 20, 2026 16:21
5f9d817 to
a869fc9
Compare
…lished stagingComparisonBaseline's fallback note said "No local-area release has been published" whenever the dashboard's build manifest lists no build of a local-area release. That also happens when the release is published on Hugging Face but the dashboard has not built its calibration tree yet, for example while tree publishing is paused. The new test expects the note to state the condition the code checks: the dashboard has no published calibration build of a local-area release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a local-area candidate falls back to the current release, the Staging page's note said "No local-area release has been published". The fallback is decided from the dashboard's build manifest alone, so it also applies to a local-area release that is published on Hugging Face but whose calibration tree the dashboard has not built yet, for example the dense release while tree publishing is paused. The note now says the dashboard has no published calibration build of a local-area release, and the README describes the same condition in terms of the tree manifest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
added a commit
that referenced
this pull request
Oct 20, 2026
#239 merged into main as dec6ed1 with its last fixes (e5367a0, b51b5c5), and #243 merged after it. This branch had taken #239 before those fixes, so the merge conflicted in seven files. The result is main's tree plus this branch's own changes, the diff from #239's head it last merged (ee84664) to this branch's head (2e43079): #239's files take main's final code, and this branch's changes apply without conflicts. git diff origin/main HEAD now shows only this branch's own changes: the same 22 files and changed lines as ee84664..2e43079. 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 #238
Summary
Stacked on #237 (which is stacked on #220 and #223), in GitHub stack #230. Base:
uk-calibration-views. After review fixes to #220 and #237,gh stack rebase --no-trunkreplayed commit 1 without conflicts; five review fixes follow it (commits 2 to 6 below).The Staging page now compares like with like:
latest-national.jsonnames through the dashboard manifest's latest release.How a candidate's kind is decided
The kind is decided from a field the run records, without parsing names:
microcosm_uk_2025_local.h5in September andmicrocosm_uk_2024_25_local.h5in October.pipeline.id. The staging contract validates it and checks that it matchesprogress.json. It isuk-local-candidatefor local-area candidates anduk-frs-calibrationfor national attempts.The UK's staging registration in
countries.tsnow listslocal_area_pipelines: ["uk-local-candidate"]. A run whose recorded pipeline id is in that list is a local-area candidate. No other country lists any, so for them the run manifest is never read.Which local-area build is used
The local-area (dense) release has no pointer file and is never promoted, so there is no "current" build. The comparison uses its most recently published build, chosen as follows:
dataset_role: "non_default_local_area"), read the same way as for the release picker, for folder releases and for tagged builds at their commits.createdAt, elseupdatedAt).If the dashboard's build manifest lists no local-area release build, the candidate is compared with the current release, and the page says that this release calibrates a different set of targets. That includes a local-area release published on Hugging Face whose calibration tree the dashboard has not built yet (commit 8).
What the page shows
For a local-area candidate:
If the user picks a different "From" build, the labels still name the compared release. That was already so for "Current release", and this PR doesn't change it.
/api/microcosm/staging/compareadds acomparison_releasefield (release_id,basis,local_area_candidate) only for local-area candidates. Responses for US, Belgian and UK national candidates are unchanged. The README documents the field, howrelease=latestresolves, andlocal_area_pipelines(commit 6).Effect on published tree bytes
None, including after commits 2 to 6.
Commits
6fb5ee6; earlier53fa9d3, then966523b)stagingLocalAreaPipelines,createStagingCompareHandler,defaultComparisonBuildArtifactId). 0 tests passed.staging-comparison-release.test.ts(7): the registration, the newest local-area build from a UK-shaped manifest, the US and Belgian path (which never reads the run's pipeline), UK national, UK local-area, the fallback when none is published, and reading the pipeline id from a run manifest;calibration-selection.test.ts(5 existing and 2 new): the map's default build, and the page labels and notes;staging/compare/route.test.ts(3): the US response unchanged, the UK local-area response, and an explicitly requested release.countries.test.ts,staging-artifact.test.tsand the package boundary test.bun run lint(dashboard and package typecheck) clean.810bda1, from review)/microcosm/staging/compare, so the panel stored the manifest's latest (national) build first and kept it when the comparison then named the local-area release.microcosmStagingTargetChangeSourceParametersprefersbuild, so the "Change from local-area release" tab showed the national comparison.fromandto, null until picked).comparisonMapBuilds, inlib/microcosm/calibration-selection.ts, replacesdefaultComparisonBuildArtifactId. It works out both selectors on every render from the picks, the build manifest and the comparison, and no effect writes defaults into state.microcosmStagingTargetChangeSourceParameterssendsbuild=<local-area build>;calibration-selection.test.tsfailed to load becausecomparisonMapBuildsdidn't exist; 0 passed. The old logic lived inside the component's effect, which no test could call, so this red is a load failure rather than a wrong value. The first test's third step encodes the reported failure: it expects the local-area build where the panel kept the national one.bun run lintclean.965c8e0, from review)stagingComparisonBaseline'scolumnLabelis nowreleaseLabel, because the maps use it too;StagingTargetChangeMaptakescomparisonReleaseLabel;stagingTargetDetailPresentationtakes it as an optional fourth argument and returns the eyebrow;targetChangeModeHelp(label), inlib/microcosm/target-change-visualization.ts, replaces theMODE_HELPconstant.staging-target-detail-presentation.test.tsand 1 incalibration-selection.test.ts.target-change-visualization.test.tsfailed to load becausetargetChangeModeHelpdidn't exist. 10 passed.bun run lintclean.2e0dc12, from review; a refactor, so no red step)buildPublishedInstantandcalibrationBuildsNewestFirstgave the same order:createdAt, elseupdatedAt; an undated or unparseable timestamp last; ties by build ID.calibrationBuildsNewestFirstand its 2 tests move into the package'scalibration-tree-manifestmodule.newestPublishedLocalAreaReleaseand the map panel both use it.staging-comparison-release.test.ts,calibration-tree-manifest.test.tsandcalibration-selection.test.ts; the 2 moved tests count in both runs. The boundary test passes;bun run lintclean.1814155, from review)loadComparisonreturnedPromise<object>. It now returnsStagingComparison, which the package exports as the typeloadStagingComparisonreturns. The route test's stub carries onlyavailable,run_idanda.release_id, and says so with an explicit cast.bun run lintreported 1 error: the route test's stub didn't matchStagingComparison.bun run lintclean;route.test.tsandstaging-comparison-release.test.ts, 10 of 10.local_area_pipelines(753fb5c, from review; documentation only, so no red step)release=latestresolves for each candidate;pipeline.idis instaging.local_area_pipelines) is compared with the newest published local-area build;comparison_releasefields;release=<id>adds no field.local_area_pipelines.Re-review fix (2026-10-20)
A re-review of
a869fc9found the five earlier review findings fixed. It also found that the fallback note misstated its condition. The note said "No local-area release has been published" whenever the dashboard's build manifest lists no local-area release build. That also happens when the dense release is published on Hugging Face but the dashboard has not built its calibration tree yet. Tree publishing is paused until this PR deploys, so this is the state straight after the deploy.e5367a0, test only)calibration-selection.test.ts, 9 passed and 1 failed. The new test expected "The dashboard has no published calibration build of a local-area release, so …" and received "No local-area release has been published, so …".b51b5c5)stagingComparisonBaseline's fallback note now states the condition the code checks. The README's description ofrelease=latestand ofbasissays the same, in terms of the tree manifest.calibration-selection.test.ts, 10 of 10.bun run lintclean.Not changed by this fix:
Tests run
Locally: only the new and changed test files listed above, plus the golden suites and lint.
At the head after the restack (
753fb5c): 107 passed and 0 failed across 12 files:countries,staging-artifact,use-microcosmand the boundary test;bun run lintwas clean.Not run locally: the full suites and
next build, because the machine is shared. CI runs them.Real-data checks still to do
The production dashboard runs
main, and the local Hugging Face login can't read the UK release repository. After #223's rollout publishes the dense release, check the following:microcosm-uk-2024-25-dense-20261019T000432Z-ee5c2dbe;Environment variables
This PR changes no workflow, deploy script or configuration, and reads no new variables.
🤖 Generated with Claude Code