Repository navigation
Evaluation harness: resolve BE's build from releases.json as well as latest.json - #323
Merged
Merged
Conversation
The evaluation harness's Microcosm release resolver reads only latest.json, which BE's release repo deletes when it moves to releases.json and releases/<release>/<build>/ folders. These tests describe the resolver reading both layouts, as the telemetry collector and Microcosm's loader read the US and UK release repos: releases.json decides when present, only its absence selects latest.json, the current build of the default release is resolved as <release>/<build>, and its release manifest must name that release and build. Refs #322. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The resolver now reads releases.json first, as the telemetry collector and Microcosm's loader read the US and UK release repos. When the record exists it decides: the current build of its default release is resolved from releases/<release>/<build>/, its release_id is <release>/<build>, and its release manifest must name that release and build. The record is checked with a copy of the collector's parse_releases_record rules, since the harness cannot import it. Only an absent releases.json (no local file, or Hugging Face's 404 EntryNotFound) selects latest.json, which resolves the same build with the same outputs as before. Every other read failure is raised, so a refused token or a server error never resolves an old pointer's build in a repo that has moved. Refs #322. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A local releases.json that is a directory, a broken link or a link loop must be refused, not read as an absent file that selects latest.json. Each malformed-record case now matches the message of its own rule, and new cases cover a leading byte order mark, invalid UTF-8, deep nesting, a releases.json linked to a file elsewhere, and the latest.json layout's refusal of a release manifest build that is not an object. Refs #322. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The local release-directory reader reported every path that is not a regular file as absent, so a releases.json that is a directory, a broken link (a Hugging Face cache snapshot copied away from its blobs) or a link loop selected latest.json. It now treats only a path with nothing at it as absent and refuses the rest. The release manifest check no longer reads names bound in another branch, and the copied record rules name the collector commit they match. Refs #322. 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.
Closes #322. Tracker: "1. Collector/Emitter", task 4a · 40.
Merge order: after tracker task 4a · 39 is
done(a manual deletion of a GitHub variable; this code does not depend on it, only the tracker order does), and before 5b · 5, which deletes BE'slatest.json.Why
evaluation_harness/microcosm_release.pyresolves the Belgium build thatscripts/run_full_chronicle_evaluation.py --jurisdictions BEevaluates, by readinglatest.jsonfrompolicyengine/populace-be-privatewith the operator's own Hugging Face token. Tracker substage 5b moves that repo to the layout the US and UK release repos use,releases.jsonplusreleases/<release>/<build>/folders, and 5b · 5 deleteslatest.json. Without this change the BE run stops at its first read.What changes
The module reads both layouts, following the readers of the US and UK release repos: the telemetry collector's release run (
telemetry_collector/calibration_tree_reconciliation.py,releases_record.py) and Microcosm's dataset loader (microcosm.data.loader). Decided with Anthony on 2026-11-25.releases.json, it decides, andlatest.jsonis not read. Only an absentreleases.jsonselectslatest.json: nothing at that path in a local release directory, or Hugging Face's 404 withX-Error-Code: EntryNotFound. A localreleases.jsonthat is a directory, a broken link or a link loop is refused. Every other failure is raised (401, 403, 404RevisionNotFoundorRepoNotFound, 5xx, network errors), so a refused token or a server error never resolves the build an oldlatest.jsonnames in a repo that has moved. This is Microcosm's loader's rule. The injectableartifact_readersignals an absent file withFileNotFoundError, as the local reader already did; the local reader now raises it only when nothing is at the path.releases.jsonis checked with a copy of the collector'sparse_releases_record, which refuses exactly what@policyengine/calibration-tree's parser refuses. The harness depends only on numpy, pyarrow and pyyaml, so it cannot import either parser.release_manifest.jsonmust name the selected release and build: the collector's whole check, and the identity part of Microcosm's loader's (the loader also checks the manifest'sschema_versionand that itsdataset_rolematches the release's role, which concern loading a dataset, not this evaluation).build_manifest.jsonis read but not checked, so a moved build whose build manifest keeps its oldbuild_idis accepted.microcosm_be_release, whose hash feeds the run ID). In the new layout:release_idis<release>/<build>, the build's folder underreleases/and the collector's build ID;artifact_pathsnames the three files in that folder;artifact_sha256hashes those three files only, so the run ID does not change when an unrelated build is published to or withdrawn from the repo.The keys are the same as today's, except that there is no
latesthash.latest.jsonlayout is unchanged. It resolves the same build and gives the samerelease_id, paths and hashes,latestincluded, so a rerun before BE's move gives the same summary and run ID. What changes on that path, none of it in the outputs: each run first requestsreleases.json; a file missing on Hugging Face raisesFileNotFoundErrorinstead ofHTTPError(no caller catches either); a local artifact that exists but is not a regular file raisesValueErrorinstead ofFileNotFoundError; and a release manifest whosebuildis not an object is refused with the existing mismatch error instead of anAttributeError.ResolvedMicrocosmRelease.latestisNonewhenreleases.jsonselected the build, and a newreleases_recordfield holds the record. Nothing in the repository reads either field.What this does not change
--microcosm-release-dir,--microcosm-release-repository,--microcosm-release-revision). A revision from before BE's move has noreleases.json, so it is still resolved through that commit'slatest.json.calibration_diagnostics.jsonis copied unchanged: the switch tool copies a tagged build's declared files byte for byte and checks their SHA-256, and moving BE's untagged builds is tracker task 5b · 2, not yet written.Tests
CI does not run the root
tests/folder (docs/chronicle-update-workflow.md: the harness tests are run by hand), so these were run locally by node ID.tests/test_microcosm_release.py:releases.jsonlayout from a reader and from a local directory, withlatest.jsonand the old folder still present; the read failures that must not fall back; a record with no default release or no current build; release manifests that name another build or release, or none; 24 records that break the record's rules, each matched to its own rule's message (invalid UTF-8 and deep nesting included); a record with a leading byte order mark; a localreleases.jsonthat is a directory, a broken link or a link loop, and one that links to a file elsewhere; the Hugging Face reader's absent-file answer and the failures it must raise unchanged; every output of thelatest.jsonlayout, and its refusal of a release manifestbuildthat is not an object.FileNotFoundErrorfor an absent file, and the request list starts withreleases.json.tests/test_be_full_run.py: new, a BE run on the new layout and the summary block it records.First change: red
824ab14(40 of the 48 selected test cases fail; the 8 that pass check behaviour that must not change), green2932f45(all 48 pass).Review round 1 fixes: red
6f9d2a1(the 3 localreleases.jsoncases fail; the other new and stricter cases pass), green07f2f27(all 56 pass).Review
One round of adversarial review, in a fresh subagent, on
2932f45. It found no high- or medium-priority bugs, so review stopped there.07f2f27: areleases.jsonin a local release directory that is a directory, a broken link or a link loop counted as absent and selectedlatest.json.releases.jsonprefix and would still pass with their own rule deleted; each case now matches its own message, with new cases for a byte order mark, invalid UTF-8, deep nesting and thelatest.jsonlayout's non-objectbuild. The release-manifest check no longer reads names bound in another branch. The copied record rules name the collector commit they match (370c91b). This description no longer overstates the loader's check or the changes on thelatest.jsonpath.resolve_microcosm_releaseinto one helper per layout. The function keeps both layouts' steps in order in one place, and the change would touch thelatest.jsonpath that must stay as it is.calibration_diagnostics.jsonis copied unchanged depends on 5b · 2 and is unverified.Environment variables and secrets
No deployment code changes. The module reads
HF_TOKENorHUGGINGFACE_TOKENfrom the operator's environment, as before; it is an operator tool, one of the exceptions agreed in 4a · 21.🤖 Generated with Claude Code