Repository navigation
Conversation
Three failing tests for removing microcosm.build.build_folder_switch: the module cannot be found; no package source or test, shared test support, tool, doc or README names it; and the refusal for a repository with pointer files and no releases.json names no tool or step to run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The US, UK and BE release repositories have all moved to build folders and releases.json and had their old layout deleted, so the one-time tool has nothing left to move. Remove microcosm.build.build_folder_switch (copy, switch and delete-old-layout), its three test modules and their in-memory Hub helper. The refusal for a repository with pointer files and no releases.json no longer names the tool or its steps. The fixture generator's docstring, the README, docs/release-contract.md and three microcosm-data mentions of delete-old-layout describe the move in the past tense. What moved builds' manifests carry (migrated_from, unpublished_artifacts) stays documented and accepted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
- The root pyproject.toml's comment on microcosm.data.release's TID251 exemption names everything there that imports huggingface_hub: the tagged publisher, the pointer-file readers and the Hub error checks the loader imports. - The removal test module is now test_switch_tool_removal.py, so a doc or command that names it by path does not contain the name it scans for. - The loader test of a moved build's manifest keeps only the case a loaded repository has: migrated_from naming a tag. - The README and the test module's docstring say the US and UK builds moved from tags and BE's from untagged folders, and that the tool copied the builds it moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in #1797, which removed the tagged publisher. Conflicts resolved: - pyproject.toml: main moved microcosm.data.release's TID251 exemption into its datasets group and kept one for the switch module; both entries in the conflicted block go, since the module is removed. - release_publication.py's docstring: this branch's removal of "the switch reads them" with main's sentence that the tagged publisher is gone. - docs/release-contract.md: this branch's past-tense lines on the switch tool with main's rewritten pointer-files bullet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been 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 #1792
What this changes
Microcosm no longer has the one-time build-folder switch tool,
microcosm.build.build_folder_switch, with itscopy,switchanddelete-old-layoutsteps. The tool moved a dataset repository's builds into build folders listed inreleases.json: the US and UK builds from tags, and BE's from untagged folders onmain. It deleted each repository'slatest*.jsonpointer files, and later deleted the old layout's files frommain. All three repositories have moved and had their old layout deleted, BE's last on 2026-11-27. AM and NZ have no Hugging Face repository yet. The tool was kept only until BE had moved, as a temporary exception for operator tools that use the operator's own Hugging Face token (tracker 4a · 21).Removed
packages/microcosm-build/src/microcosm/build/build_folder_switch.py. Nopyproject.tomldeclared an entry point for it; it ran only aspython -m.tests/engine_free/uk/test_build_folder_switch.py,tests/engine_free/us/test_us_build_folder_switch.pyandtests/engine_free/shared/test_untagged_build_folder_switch.py.test_support/microcosm_build/build_folder_switch.py, which nothing else used.pyproject.toml's exemption of the module from ruff's rule against importinghuggingface_hub(TID251), which Publish run_uk_cut.py builds through the emitter and refuse new direct Hugging Face imports #1743 added onmain. Remove the tagged publisher, microcosm-publish-release #1797 has since movedmicrocosm.data.release's exemption into the datasets group, so this PR leaves that one asmainhas it.Reworded
release_publication.py. For a repository that has pointer files and noreleases.json,microcosm-publish-release-buildstill refuses before any emitter starts and still says to keep the files in place. It no longer tells the operator to run the tool'scopyandswitchsteps. The rest of the wording is unchanged; the separate task that removes pointer-file support decides whether this refusal stays. The module and function docstrings no longer say the switch reads the pointer files.tools/generate_release_contract_fixtures.py. Its docstring named the tool's_switch_recordas the step that setsdefault. It now says the tool took that step once. The generator imported nothing from the tool, and its fixtures are unchanged.d3b7f4b4a, and what moved builds' manifests carry.docs/release-contract.md. Its C1 and C5 passages describe the tool in the past tense, and say it was a fourth reader of pointer files. The gap entry onreleases.json'sdefaultnow says that nothing in Microcosm sets it in a live record, including for a new repository such as AM's or NZ's. The tool was its only writer; the fixture generator sets it only in the C5 golden records, and no loader reads it.delete-old-layoutstep are now past tense: inpackages/microcosm-data/README.md, theregistry.pydocstring and thetest_examples_read_build_folders.pydocstring.changelog.d/1792-remove-build-folder-switch.removed.md.Kept
microcosm.data.build_folder_manifests(rewrite_release_dir,referenced_build,publication_commands,require_offered_build). The builders use it, and the tool never imported it; the tool had private functions with two of the same names.migrated_fromfield:annual_projections.pyaccepts it andtools/assemble_us_annual_release_dir.pydrops it. The manifests of moved builds on Hugging Face carry it, as BE's two moved builds carryunpublished_artifacts. The docs still describe both fields.check_change,check_repository) belong to the separately released interface package, and the test-support emitter stand-in calls them too.changelog.d/,PROGRESS.mdand mentions of "the switch" as a past event ("the builds the switch moved"). In the gate-shadow code, "the switch" means a setting, not this tool.Not in this PR
registry.py'spointer_path, and whether_refuse_pointer_filesstays (tracker 5b · 12).microcosm-publish-releaseand its docs: Remove the tagged publisher, microcosm-publish-release #1797 (tracker 5b · 10) removed them, and that change is merged into this branch.What its merge waits for
Tracker task 5b · 11 of "1. Collector/Emitter". Its merge waits for:
microcosm-publish-release, to bedone. Remove the tagged publisher, microcosm-publish-release #1797 merged on 2026-11-27 as8ea088de0; the tracker marks itdoneonce its post-merge CI onmainis confirmed;It builds on
main, which has been merged in twice with merge commits:b1bb463f6, frommainat35ec6c7d2, with no Git conflict. Publish run_uk_cut.py builds through the emitter and refuse new direct Hugging Face imports #1743 had added the lint exemption for the removed module onmain, and only a merge let this branch remove it.baf7caeee, frommainat8ea088de0, which includes Remove the tagged publisher, microcosm-publish-release #1797 (5b · 10). It resolves three conflicts:pyproject.toml:mainhad movedmicrocosm.data.release's exemption into its datasets group and kept the switch module's. Both entries in the conflicted block go.release_publication.pymodule docstring: this branch's removal of "the switch reads them" is combined withmain's sentence that the tagged publisher is gone.docs/release-contract.md: this branch's past-tense lines on the switch tool are combined withmain's rewritten pointer-files bullet.Nothing that
mainadded names the removed module or its test helper.5b · 12, removing
latest.jsonpointer support, follows this task.Tests
Red-green, run locally by node ID only.
4dbe19f2d: 4 cases fail on assertions.packages/microcosm-build/tests/engine_free/shared/test_switch_tool_removal.py(namedtest_build_folder_switch_removal.pyuntil1994900b9) has two tests.test_the_build_folder_switch_module_is_removedchecks thatimportlib.util.find_specfinds no such module, astest_candidate_restoration_module_is_removeddoes for a removed UK module. The scan test reads every file of nine text suffixes in the package sources and tests,test_support/,tools/anddocs/, plus the READMEs, and asserts that none namesbuild_folder_switch. Before the change, it listed nine files.test_the_command_refuses_a_repository_that_has_not_switched_without_advising_removal, in both of its cases (publish,promote). It used to assert that the refusal names the module. It now asserts that the refusal names nopython -mcommand, nomicrocosm.build.module, neither thecopynor theswitchstep, and no--write, and that it still says to keep the files in place.c71f0093d: the removal and the rewording.16f853187: the scan also reads the root and packagepyproject.tomlfiles, the rootconftest.pyand.github/workflows. It failed on the rootpyproject.tomlalone. A new test,test_the_scan_reads_directories_and_files_that_exist, checks that every directory and file the scan reads exists, so a wrong path cannot make the scan pass without reading anything.765819cd4: the exemption is removed.765819cd4): a new testtest_download_certified_reads_a_moved_builds_manifestinpackages/microcosm-data/tests/engine_free/shared/test_loader.py. The only test that the loader certifies a moved build's manifest carryingmigrated_fromwas in a deleted module.1994900b9): wording, the test module's new name, and one case dropped from the loader test.main(baf7caeee): no test changed. Ruff check and format are clean on the resolvedrelease_publication.py, andtools/ci_test_plan.py verifypasses.Tests were not re-run locally after the fixes; PR CI runs them. Round 2's reviewer ran this PR's added and changed tests by node ID at
765819cd4, and all seven cases passed. Ruff check and format are clean on every changed Python file, andtools/ci_test_plan.py verifypasses.Review
Two rounds of adversarial review, each in a fresh subagent with its own clone.
c71f0093d: one medium bug, no high or low bugs.mainafter this branch's base and exempted the removed module in the rootpyproject.toml. Git reported no conflict, and the scan did not read that file. Fixed test-first in16f853187and765819cd4, after mergingmainin.765819cd4: the scan now checks that what it reads exists; the refusal test checks the step names; a loader test of a moved build's manifest; twodocs/release-contract.mdsentences made precise (the tool as a fourth reader of pointer files, and the fixture generator'sdefault).765819cd4: no bugs. Its quality points, applied in1994900b9:TID251comment's accuracy;Review stopped after round 2, since it found no bugs. No known bugs remain.
🤖 Generated with Claude Code