Repository navigation
Distrust emSign ECC Root CA - G3 in the UK Chronicle rebuild's Modal image - #1769
Merged
Merged
Conversation
The rebuild's Modal image must drop the compromised eMudhra (emSign) certificate authorities before it downloads anything, as the US Modal image does: ca-certificates in apt_install, the hash-pinned pip 26.2.2 in place of the base's pip 25.3, then uv 0.13.4 and certifi 2026.10.19 or later beside huggingface_hub. The test compares those steps with tools/modal_us_stage_plan.py's values. It fails on an assertion now. Refs #1768 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As the US Modal image does, the rebuild's image now drops the compromised eMudhra (emSign) certificate authorities before it downloads anything else: apt_install names ca-certificates, a hash-pinned pip 26.2.2 replaces the cached base's pip 25.3, and uv 0.13.4 (was 0.11.7) and certifi 2026.10.19 or later are installed beside huggingface_hub. The upload's Hub client, which carries HF_TOKEN, checks the Hub's certificate against that certifi. The app keeps its own constants; the test compares them with tools/modal_us_stage_plan.py's. Closes #1768 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 1 of #1769: the test compared only each image step's positional arguments, so an index URL or a trusted-host option on pip_install would have passed it. It now requires that no step before the environment passes options, and its docstring names emSign ECC Root CA - G3, the root the image stops trusting. Refs #1768 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 1 of #1769: uv 0.13.4, pip 26.2.2's certifi and certifi 2026.10.19 drop only emSign ECC Root CA - G3, the root certifi and Debian removed after the 2026-10-20 disclosure, so the comments, docstring, guide paragraph and changelog fragment now name it rather than "the eMudhra roots". The guide and the fragment also give the Python release uv 0.13.4 installs (3.14.8; uv 0.11.7 installed 3.14.4). Refs #1768 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 2 of #1769: certifi 2026.10.18 already left out every emSign root, and 2026.10.19 restored the three certifi judged unaffected, so 2026.10.19 is not the first release without emSign ECC Root CA - G3, and that removal did not follow a 2026-10-20 disclosure. The comments, docstrings, guide paragraph and changelog fragment no longer order the events by date; the certifi comment says what each release holds. The floor stays 2026.10.19, as in the US image. Refs #1768 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
marked this pull request as ready for review
November 27, 2026 13:31
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 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 #1768. Tracked as task 5d · 3 of the "1. Collector/Emitter" project.
What changes
tools/modal_rebuild_uk_chronicle_artifact.pyrebuilds the pinned Chronicle UK consumer artifact in a Modal container. Its image still trusted emSign ECC Root CA - G3, the eMudhra root that certifi and Debian distrust over eMudhra's disclosed intermediate private keys (changelog.d/emudhra-ca-trust.fixed.md). That matters because a run that opts into uploading carriesHF_TOKEN, which can write to the private UK build-inputs repository:huggingface_hubwere installed without hash pins through the cacheddebian_slimbase's pip 25.3, whose bundled certifi still contains it.ca-certificateswas never upgraded; git's clone of Chronicle and the standard library'ssslmodule read that CA store.huggingface_hubchecks the Hub's certificate against certifi.The image now does what the US Modal image (
_image()intools/modal_us_stage.py) does, before it downloads anything else:apt_installgit,curl,timeca-certificates, which upgrades the base's CA store to Debian's current releaserun_commandspip_bootstrap_command(): pip 26.2.2 from a requirements file with--require-hashesand the wheel's published sha256, so the one download made with the old pip is checked by hash, not by the connectionpip_installuv==0.11.7,huggingface_hub==1.18.0(old pip)uv==0.13.4,huggingface_hub==1.18.0,certifi>=2026.10.19, through pip 26.2.2run_commandsuv python install 3.14(uv 0.11.7)envCHRONICLE_PIN,UV_LINK_MODE,PYTHONDONTWRITEBYTECODEAnthony decided two points on 2026-11-26:
tools/modal_uk_cut.py. Modal imports the app module in the container from/rootwith no checkout, so readingmodal_us_stage_plan.pythere would need a copy in the image. The test compares the steps with that module's values (IMAGE_UV_VERSION,image_pip_bootstrap_command(),RUNNER_CERTIFI_MINIMUM_VERSION), loaded by path, so the two images can't drift apart unnoticed.uv python install 3.14stays, rather thanUV_PYTHON_DOWNLOADS=neverand the image's own Python, so the environment that has to reproduce the pinned digests changes as little as possible. uv 0.13.4 downloads Python over its updated CA list and rejects a file whose sha256 differs from the one it carries for that release (extract_readerreturnsHashMismatch). It installs Python 3.14.8, where uv 0.11.7 installed 3.14.4; the receipt'senvironment.pythonrecords the one used.Docs: the module docstring, the "Rebuilding the Chronicle artifact" section of
docs/uk-cut-anyone.md, andchangelog.d/1768-uk-chronicle-rebuild-emudhra.fixed.md.Tests
A new file,
packages/microcosm-build/tests/engine_free/uk/test_modal_rebuild_uk_chronicle_artifact.py, checks the image definition against the stand-inmodalmodule that the app's existing tests use.test_modal_uk_cut.py, which #1758 also changes, is left untouched.test_the_rebuild_image_trusts_no_compromised_certificate_authoritypip_install, where the pip bootstrap belongs, and the chain has one step fewerRed commit
67daae06c; change822341cec. Review round 1:d616d4adcmakes the test also require that none of the four steps betweendebian_slimandenvpasses options (such as another index or a trusted host), andfad867845corrects the wording. Review round 2:8b84e55ffcorrects the wording again. The round 1 reviewer ran the test at67daae06c(fails on the assertion above) and at822341cec(passes); the round 2 reviewer ran it atfad867845(passes). CI runs it on the later commits. Ruff check and format pass on both changed Python files. Nothing ran on Modal: the test checks the image definition, not a built image.Known gaps, not changed
uv python installunder uv 0.13.4 are checked only in the definition. The US image runs the same first three steps on the samedebian_slimPython 3.14 base. Whether uv 0.13.4'suv sync --lockedaccepts Chronicle's lock unchanged is unverified.uv sync --lockedinstalls Chronicle's locked packages by hash. Butodfpy1.4.1 has only a source archive and Chronicle installs as an editablehatchlingproject, sosetuptools,hatchlingand their dependencies are fetched at sync time without hashes, over uv 0.13.4's CA list. They run as the same user as the function that holdsHF_TOKEN.chronicle.source_packagefetches the two DESNZ workbooks withhttpx, which checks certificates against the certifi in Chronicle's lock; at the pinned commit that is certifi 2026.10.19. The workbooks are also checked against pinned sha256 values, and those processes get noHF_TOKENin their environment.Checked, not changed
ca-certificatesupgrade comes from bookworm-security. Debian's security tracker lists bookworm-security's20250419~deb12u2as the fixed release for DLA-4845-1, and according to that advisory it removes emSign ECC Root CA - G3 and the Comodo AAA Services root. git's clone of Chronicle, the Hub's Xet upload path (hf_xet, which reads the operating system's store) and pip 26.2.2 (throughtruststore, beside its vendored certifi) all check certificates against that store, so every unhashed package the upload runs withHF_TOKEN, all installed by pip 26.2.2, depends on this step as well as on the newer pip.Found, not changed
Deployment
This changes a Modal image definition. Every environment variable and secret the app reads or declares; this PR adds none and changes none:
HF_TOKENmodal run, sent as an ephemeral secret (modal.Secret.from_dictin_secrets()) only whenMICROCOSM_UK_CHRONICLE_MODAL_UPLOAD=1; no named Modal secretrebuildfunction's environment →_upload()→huggingface_hub.HfApi(token=…).rebuild()removes it from the environment it passes touv sync, thechroniclecommands andpython --version(env.pop). The threegitcalls (clone, checkout,rev-parse) are started withoutenv=, so they inherit it; git sends it nowhere. Unchanged; on Modal with the new image, unverified (never run)MICROCOSM_UK_CHRONICLE_MODAL_UPLOAD_secrets()andmain(); not sent to Modal. UnchangedCHRONICLE_PIN.env), frompackages/microcosm-build/src/microcosm/build/uk/chronicle_feed.jsonin the launching checkout; not a credentialUV_LINK_MODE,PYTHONDONTWRITEBYTECODELEDGER_SOURCE_ARTIFACT_FETCH,UV_PYTHON,UV_PROJECT_ENVIRONMENTrebuild()in the subprocess environment; fixed valuesrebuild()→uv syncand thechroniclecommands. UnchangedPIP_BOOTSTRAP_REQUIREMENTS(/tmp/pip-bootstrap.txt) is a file path used inside one image build step, not an environment variable.Review
Round 1 (head
822341cec): three bugs, all fixed in wording; no code behaviour changed.fad867845); the other roots are under "Found, not changed".HF_TOKEN, but the git calls inherit it. The table now says so.uv sync --lockedinstalls every package by hash, which is untrue for build tools. "Unhashed build tools" now says what is fetched without hashes.From its code-quality points: the test now checks step options (
d616d4adc); the guide, the fragment and this description name Python 3.14.8 and 3.14.4; and the workbook gap now says Chronicle's lock already pins certifi 2026.10.19. The reviewer confirmed the step order, the values' equality with the US module, the test's red and green results,huggingface_hub1.18.0's use of certifi throughhttpx, and uv's hash check of Python downloads.Round 2 (head
fad867845): two low-priority bugs, both in wording, fixed.8b84e55ffdrops the date ordering and says what each certifi release holds. The same sentence is in the US plan module andchangelog.d/emudhra-ca-trust.fixed.md, which this PR doesn't change.The reviewer confirmed the round 1 fixes, the Python releases, and that the new option check would fail on a keyword option such as
extra_index_url=. It doesn't coverdebian_slim(python_version=…), which is not a download setting.Round 3 (head
8b84e55ff): one low-priority bug, fixed. The PR title said "the eMudhra roots"; it now names emSign ECC Root CA - G3, so the merge commit onmainis accurate. Two description points are also corrected (which steps the option check covers; the upload's packages come from pip only). The reviewer confirmed the round 2 fix against certifi's tagged bundles, ran the test at8b84e55ff(pass) and ran ruff check and format (pass).Left, so as not to restart CI for a comment: the test's comment says no step "before the environment" passes options, but the check skips
debian_slim(python_version=…), which sets the Python version, not a download source.What the merge waits for
Nothing in the tracker. Anthony marks it ready and merges it. It doesn't build on #1758 (5d · 2), which applies the same measures to
tools/modal_uk_cut.py. This PR leavestest_modal_uk_cut.pyalone, and itsdocs/uk-cut-anyone.mdhunk is in a different section from those of #1758, #1743 and #1538, so no text conflict is expected. If Anthony merges 5d's tasks in tracker order, this one follows #1758.🤖 Generated with Claude Code