Repository navigation
Publish run_uk_cut.py builds through the emitter and refuse new direct Hugging Face imports - #1743
Merged
Merged
Conversation
The UK national build tool still assembles, publishes and promotes as the tagged publisher did: it needs a "tag" in the assembler's summary, which the assembler has not printed since the UK switch, then calls microcosm.data.publish_cli, which refuses microcosm-uk-2024-25-national. These tests describe the build-folder path instead: the assembler's "build", the publication and its pre-flight through microcosm.build.release_publication without --make-current, a printed --promote command, a rerun that publishes nothing once releases.json lists the build, and Hub checks that list no release-staging branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…orts tools/run_uk_cut.py takes the build the assembler prints, runs its publication pre-flight and publication through microcosm.build.release_publication (microcosm-publish-release-build) without --make-current, skips publication once releases.json lists the build, prints a --promote command, and no longer lists the repository's refs for a release-staging branch or a tag. Its docs say the policyengine.py certification tool still reads tagged builds only. Ruff's TID251 bans huggingface_hub imports except in the modules pyproject.toml lists, grouped by the exception that covers each. The comment above MINIMUM_EMITTER_VERSION keeps only the current minimum's reason and the cost of refusing an emitter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The agent guide, the release contract and the UK guide's opening no longer describe run_uk_cut.py's tagged publication or promise a policyengine.py certification its tool cannot yet make. The exemption for conftest.py covers only the root one, the datasets group names the pointer-file refusal and run_uk_cut.py's input fetch, and the comment above MINIMUM_EMITTER_VERSION keeps the Orrery graph publication a refused emitter costs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the conflict in the comment above MINIMUM_EMITTER_VERSION: this branch's shorter comment, with #1748's wording that a refused emitter costs the Orrery inputs in a build's staged bundle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--publish-orrery and --no-publish-orrery have changed nothing since builds stopped uploading their graph (#1590); #1748 kept them for this cleanup. These tests ask the UK full build to refuse both as unknown options and to carry no publish_orrery setting, and run_uk_cut.py to pass neither. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The UK full build no longer defines --publish-orrery or --no-publish-orrery or prints the warning the first one gave; argparse refuses both as unrecognized. tools/run_uk_cut.py stops passing --no-publish-orrery, and docs/orrery-publication.md and docs/uk-cut-anyone.md say the options are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_the_national_build_passes_no_orrery_upload_flag looked for "orrery" in every argument, paths included, so a temporary directory named after the test could fail it. It now looks only at arguments that start with "--" (review round 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the conflict in the comment above MINIMUM_EMITTER_VERSION: this branch's shorter comment, now saying, as #1744 does, that every BE build has parent_build_manifest.json and reform_validation.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Interface 0.18.0 (PolicyEngine/microcosm-emitter#100) adds typed calls for the emitter's version, status and telemetry-token commands. microcosm-build requires it; uv.lock moves only that package, APPROVED_UV_LOCK_SHA256 follows the lock, and the installed-emitter job tests emitter 0.18.0 beside the minimum, 0.17.0, which does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The adapter runs `microcosm-emitter version` and parses its JSON itself. These tests stand in for the interface's emitter_version (0.18.0) and ask the adapter to take the installed release from its answer, to turn each CommandFailure reason into the existing refusal (version_timeout, or version_failed with what happened), and to refuse an answer without protocol versions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_version_description calls microcosm-emitter-interface's emitter_version instead of running `microcosm-emitter version` with subprocess and parsing its JSON. Each CommandFailure maps onto the kinds the refusals already use: timed_out to version_timeout, unusable output to "printed no JSON object", an exit code to "exited N", and a command that could not run or was not found to "could not be run (...)". _protocol_refusal reads the answer's protocol_versions, which the interface reports as None unless version printed a list of integers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main moved uv.lock (policyengine-uk 2.180.0 and the US base's lock check) and APPROVED_UV_LOCK_SHA256 with it; this branch moved the lock to microcosm-emitter-interface 0.18.0. uv.lock merged without conflict, `uv lock --check` accepts it, and APPROVED_UV_LOCK_SHA256 is the merged lock's SHA-256. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plan module uses only the standard library and requests the telemetry token under the Modal client's own interpreter, and the runner's version and status calls run on the image's interpreter; neither has microcosm-emitter-interface, so they keep running the commands (Anthony's decision, 2026-11-26). Comments only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd 3) The release now reads `version` through the interface, which decodes its output with replacement characters, so the Route A check must accept a valid answer with undecodable bytes on standard error and report undecodable standard output as no JSON object, as the release does. A time limit the interface refuses (invalid_arguments) must be named as the cause, not reported as a command that could not run. The adapter test for undecodable standard error passes already; it records the interface's behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/route_a/check_emitter.py reads `version` with errors="replace", as
microcosm-emitter-interface does, so it accepts what the release accepts.
The adapter reports a CommandFailure("invalid_arguments") as the time limit
the interface refused, without advice to check the command. The Emitter
dependency section of docs/orrery-publication.md and docs/release-contract.md
name the >=0.18.0 floor, and the Modal runner's docstrings say what the
image's interpreter and the Modal client are known to have (review round 3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
marked this pull request as ready for review
November 27, 2026 13:11
anth-volk
added a commit
that referenced
this pull request
Nov 27, 2026
Merges main after #1743, which moved tools/run_uk_cut.py onto build-folder publication. The one conflict was run_uk_cut.py's closing message: it keeps #1743's build variable and promote command, and replaces #1743's "cannot certify this build yet" with the certification command for the build, --national-build <build>. #1743's matching caveats in docs/uk-cut-anyone.md ("Certifying into policyengine.py") and in docs/release-contract.md's list of leftovers merged without a conflict and are removed, since this branch certifies build folders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks done
anth-volk
added a commit
that referenced
this pull request
Nov 27, 2026
main's root pyproject.toml (from #1743) exempts the removed module from ruff's TID251 rule; the merge lets this branch remove that entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
added a commit
that referenced
this pull request
Nov 27, 2026
Review round 1: main's root pyproject.toml, merged in from #1743, still exempts the removed module from ruff's TID251 rule, and the scan did not read it. The scan now also reads the root and package pyproject.toml files, the root conftest.py and the CI workflows, and a second test checks that every scanned directory and file exists, so a wrong path cannot make the scan pass without reading anything. The scan fails on pyproject.toml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
added a commit
that referenced
this pull request
Nov 27, 2026
Bug (medium): remove the root pyproject.toml's TID251 exemption for the removed module, which #1743 added on main, and reword its comment so it names only the tagged publisher. Also from the review's quality points: - the refusal test checks that the refusal names neither the `copy` nor the `switch` step; - the loader again has a test that it certifies a moved build's manifest carrying migrated_from, from a tag or an untagged folder; the only such test was in a deleted module; - docs/release-contract.md says the switch tool was a fourth reader of pointer files, and that the fixture generator sets `default` only in the C5 golden records. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
juaristi22
added a commit
that referenced
this pull request
Nov 27, 2026
…mitter, the Chronicle rebuild image's roots and US base changes (#931) Main took six pull requests since 5589fae: #1743 (UK cuts publish their build into its own folder through the emitter, and the retired Orrery upload flag goes), #1747, #1737, #1770 and #1773 (the US base build's hash inputs, final export carry, memory profile and system-only JCT reform) and #1769 (the UK Chronicle rebuild's image distrusts the eMudhra roots). The emitter interface moves to 0.18.0; no feed or engine pin moves. Two files conflicted. - tools/run_uk_cut.py: main replaced the staging-branch constant with the emitter publisher; this branch's spine inputs, build-inputs repository and disk and memory floors for dense-spine stay beside it. - docs/agent-guide.md: main's account of publishing through the emitter, with this branch's dense-spine command and the national step's refusal until the atomic-area basis exclusion applies on the national line. The sentence on the tagged publisher's arguments goes, since the cut no longer builds them. The gate contract pins, the stage table, the coverage manifest, the US F0 report and the US pins are current on the merged tree. Checks: with policyengine-uk hidden, as in CI's engine-free job, the tests main's six pull requests change, the cut and full-build CLI tests, the spec-engine loader and the UK graph's binding rules (1,556 pass); the US coverage report and pins, the gate pins, the stage table and the coverage manifest (--check); CI's test plan verify. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 27, 2026
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.
Part of #1742 (tracker task 5a · 4 of "1. Collector/Emitter": Microcosm reaches Hugging Face and the collector only through the emitter, apart from the agreed exceptions). Draft: the merge waits for the items under "What the merge waits for".
What changes
tools/run_uk_cut.pypublishes through the emitterSince the UK switch (#1537), the UK assembler (
tools/assemble_uk_release_dir.py) printsreleaseandbuildand no tag, and the tagged publisher (microcosm.data.publish_cli) refusesmicrocosm-uk-2024-25-nationalinprepare_release.run_uk_cut.pystill expected both, so reading the code, a full run stops at step 9 with "assembly printed no cut tag", and its publication steps call a publisher that refuses the release. Its tests passed because their fake assembler printed acut_tag. Nothing here was run against real data.Now:
buildthe assembler prints (assemble_doneand the receipt recordbuild).python -m microcosm.build.release_publication <release dir> --repo-id policyengine/populace-uk-private --artifact-root <national run dir>(themicrocosm-publish-release-buildcommand, which hands the build to the emitter), with--preflight-onlyfor the pre-flight and never--make-current. The artifact root is the candidate's folder, where the assembler leaves the dataset and its calibration.releases.jsonlists the build (build_published, a read of release metadata).... release_publication <release dir> --repo-id ... --promote.release-staging/...branch, which only the tagged publisher used.docs/uk-cut-anyone.md, the agent guide anddocs/release-contract.mddescribe this. The UK guide's policyengine.py section now says thattools/certify_uk_cut_in_policyengine_py.pystill reads a national build by its tag, so it cannot yet certify a build published into its own folder. That tool is not changed here (see "Found, not changed").Ruff refuses new direct Hugging Face imports
pyproject.tomlselectsTID251and banshuggingface_hub.per-file-ignoreslists every module that may still import it, grouped by the exception that covers it:microcosm-dataloader,release_publication.py(repository listing, recertification parent and annual base checks),uk_runtime/cut_reference.py,tools/run_uk_cut.py,tools/certify_uk_cut_in_policyengine_py.py,tools/build_us_compatibility_recertification.py,examples/quickstart_us.ipynbus_runtime/asec_sources.py,us_runtime/sipp_financial_assets.py,tools/modal_us_stage.py,tools/modal_rebuild_uk_chronicle_artifact.py,tools/build_uk_efrs_parity_reference.py,tools/build_uk_release_input_coverage_manifest.py,experiments/**tools/provision_uk_staging_repository.py,tools/fetch_uk_staged_dataset.py,staging_storage.pybuild_folder_switch.py,microcosm-data/release.pypackages/*/tests/**,test_support/**,conftest.pyruff check --select TID251 .found 59 imports in 39 modules before the list and none after; a scratch module importinghuggingface_hubundermicrocosm/build/is refused, and so is aconftest.pyoutside the repository root (./conftest.pyexempts only the root one). The rule sees imports only: the SIPP donor readers that fetchhuggingface.coURLs withurllib(build inputs) are outside it.The retired Orrery upload flags are gone
--publish-orreryand--no-publish-orreryhave changed nothing since builds stopped uploading their graph (#1590). 5a · 1 (#1748) kept them for this task. The UK full build (uk_runtime/full_build_cli.py) no longer defines them or prints the first one's warning, so argparse refuses either as an unrecognized argument (exit 2).tools/run_uk_cut.pystops passing--no-publish-orrery.docs/orrery-publication.mdsays the options are gone, anddocs/uk-cut-anyone.mddrops its sentence about the runner passing one (bf2b42dd6's message says both docs describe the removal; only the first does). Nothing else in the repository passes them; a launcher outside it that still does now stops at argument parsing. The changelog fragments and an evidence README that record earlier runs keep their text.The emitter version check goes through the interface
microcosm-buildrequiresmicrocosm-emitter-interface>=0.18.0(5a · 3, PolicyEngine/microcosm-emitter#100),uv.lockmoves only that package, andAPPROVED_UV_LOCK_SHA256follows the lock. The installed-emitter job tests emitter 0.18.0 beside the minimum, 0.17.0, which does not change (tools/installed-emitter/requirements.txt).telemetry_emitter._version_descriptioncalls the interface'semitter_versioninstead of runningmicrocosm-emitter versionwithsubprocessand parsing its JSON. EachCommandFailuremaps onto the kinds the refusals already use (timed_outtoversion_timeout; unusable output to "printed no JSON object"; an exit code to "exited N"; a command that could not run or was not found to "could not be run (...)"), so the warning and every refusal read as before._protocol_refusalreads the answer'sprotocol_versions, which the interface reports as None unlessversionprinted a list of integers.Smaller
MINIMUM_EMITTER_VERSIONkeeps only the current minimum's reason and the cost of refusing an emitter; the emitter's changelog has the history of earlier releases.Tests
Failing commit
9cfa2354a, passing commit7a136a99e, review fixes63eabebd7. For the Orrery flags: failing commit5bc88ff45, passing commitbf2b42dd6. For the version check: dependency0232d7367, failing commite9a2ac482, passing commit9c48f40d8. For review round 3's bugs: failing commitc871907de, passing commit30e9e8fc1. Inpackages/microcosm-build/tests/engine_free/uk/test_run_uk_cut.py, on the failing commit:test_the_hub_checks_ask_the_builds_emittertest_a_complete_run_executes_each_step_once_and_resumes_to_nothing,test_the_assembled_build_publishes_once_through_the_emitter,test_without_publish_only_the_publication_preflight_runsCutError: assembly printed no cut tag, the bug itself, once the fake assembler prints what the real one printstest_publication_hands_the_build_to_the_emitter_without_making_it_current(2),test_the_printed_promotion_makes_the_published_build_currentTypeError: the old functions need a tagtest_a_build_is_published_once_releases_json_lists_it(4)AttributeError:build_publisheddid not existFor the Orrery flags, on
5bc88ff45, all on their assertions:test_uk_orrery_inputs.py::test_the_retired_orrery_upload_flags_are_refused(2,DID NOT RAISE SystemExit),test_uk_orrery_inputs.py::test_a_build_request_has_no_orrery_upload_setting, andtest_run_uk_cut.py::test_the_national_build_passes_no_orrery_upload_flag(2, the argv held--no-publish-orrery). They replacetest_publish_orrery_only_warns_that_the_build_uploads_no_graphandtest_the_national_build_never_publishes_to_the_orrery.For the version check, on
e9a2ac482, all on their assertions:test_emitter_adapter.py::test_the_version_check_asks_the_interface_for_the_installed_release,::test_a_required_build_s_error_for_each_failure_the_interface_reports(6:timed_out,could_not_run,command_not_found,usage_error,exited,unusable_output) and::test_a_required_build_refuses_a_version_answer_without_protocol_versions. The existing stand-in-command tests of the version check are unchanged and now run through the interface.For review round 3, on
c871907de, all on their assertions:test_route_a_driver.py::test_undecodable_standard_error_does_not_fail_the_check_as_in_the_release(2),::test_an_undecodable_version_answer_is_no_json_object_as_in_the_release(2; they replacetest_undecodable_version_output_is_a_failed_run_as_in_the_release) andtest_emitter_adapter.py::test_a_time_limit_the_interface_refuses_is_named_instead_of_the_command.test_emitter_adapter.py::test_bytes_that_are_not_utf_8_on_standard_error_do_not_stop_a_valid_answerpassed already; it records the interface's decoding.Changed without a new failure:
test_the_receipt_names_the_cut_signer,test_the_receipt_records_the_referenceandtest_a_reference_withdrawn_after_certification_stops_the_cutpass a build instead of a tag. Only these node IDs ran locally, once, before the change; CI runs the rest.Not in this PR yet
main): its own PR removed the upload interval option andforce_upload, and the staging version 1 writer moves to version 2 in 5a · 5 (microcosm#1135).tools/modal_us_stage.pyrunsversionandstatuson the image's own interpreter, which has neither the build's environment nor the interface, andtools/modal_us_stage_plan.py, standard-library only by design, runstelemetry-tokenunder the Modal client's interpreter on the operator's machine. Their docstrings say so (3f76b25a3,30e9e8fc1).tools/route_a/check_emitter.pyruns under a standalonepython3 -Ibefore the build's environment exists, so it keeps its ownversioncall; it now decodes the output as the interface does.Found, not changed
tools/certify_uk_cut_in_policyengine_py.pyreadsreleases/<release>/release_manifest.jsonat a tag (--national-tag), so it cannot certify a UK build published into its own folder. Changing it is outside this task.tools/modal_uk_cut.py) installs nomicrocosm-emitterin its image, so, reading the code, a Modal run fails the pre-flight's write-access check through the emitter and could not publish through it either. This predates the PR.Review
7a136a99e):microcosm-1743-review-round1-2026-11-26.mdin the review handoffs folder. No bugs. Code-quality points fixed in63eabebd7: stale text in the agent guide,docs/release-contract.mdand the UK guide's opening; theconftest.pyexemption now covers only the root one; the exemption comments name the pointer-file refusal and the tool's input fetch; the comment aboveMINIMUM_EMITTER_VERSIONkeeps the Orrery graph publication a refused emitter costs; one test message. Not changed: the fake assembler is written by hand (the real one needs full build inputs); a Hub error inbuild_publishedendsmainwith a traceback, as the old tag check did; a withdrawn build is logged as published without saying it is withdrawn.bf2b42dd6, covering the review fixes, the merge ofmainand the Orrery flags):microcosm-1743-review-round2-2026-11-26.md. No bugs. It recomputed the merge and found it differs from the automatic result only in the resolved comment, ran the five new tests at5bc88ff45(each fails as stated) andbf2b42dd6(all pass), and found nothing else that passes, reads or documents the flags. Fixed in7b784c889:test_the_national_build_passes_no_orrery_upload_flagchecks only arguments that start with--, so a path containing "orrery" cannot fail it. This description now says what each doc does.3f76b25a3, covering both merges ofmain, the interface 0.18.0 requirement, the version check and the Modal docstrings):microcosm-1743-review-round3-2026-11-26.md. Two low-priority bugs, both fixed test-first (failingc871907de, passing30e9e8fc1): (1)tools/route_a/check_emitter.pydecodedversion's output strictly, so it refused an answer with undecodable bytes on standard error that the release, through the interface, accepts; it now decodes with replacement characters and reports undecodable standard output as no JSON object, as the release does. (2) A startup time limit the interface refuses (invalid_arguments) was reported as a command that could not run, with advice to check the command; it now names the time limit. No caller passes such a limit. Also fixed: the interface floor indocs/orrery-publication.mdanddocs/release-contract.md, and two docstring statements about the Modal interpreters. Left: the "exited -9" refusal for a killedversionkeeps the existing advice about releases before 0.4.0, as before this PR. That was the last round.Deployment
No workflow, image or deployment change. The changed tool reads
HF_TOKENandMICROCOSM_UK_TERMINAL_GATE_SIGNING_KEYfrom the operator's shell, as before.What the merge waits for
done: both are merged, and interface 0.18.0 is on PyPI.🤖 Generated with Claude Code