Repository navigation
Project Orrery artifacts without the content store, and write the execution overlay as its own file - #1295
Merged
Conversation
A collector worker is to project Orrery artifacts from a saved compiler schema and execution overlay, without the build machine's content store. Importing microcosm.graph.orrery pulled in the whole build runtime for two reasons: orrery_evidence took one protocol string and a hash helper from evidence, which imports the store, kernels and manifests; and the package init eagerly imported the executor, store, kernels, codecs and evidence, so any microcosm.graph module brought numpy, pandas and microcosm-frame with it. The package init now keeps declarations, the schema, serialization and weight-update receipts eager and loads the runtime exports on first access (PEP 562); __all__ and every public name are unchanged. The overlay protocol moves to a new standard-library-only execution_overlay module and sha256 to canonical; evidence imports both, so its names stay importable. The tests run the projection and the command in an interpreter that refuses those imports and require the in-process bytes. Declared dependencies are unchanged. Refs #1294 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The execution overlay is the projection's only input besides the schema, but it existed only in memory and, once projected, embedded at metadata.execution of the Orrery artifact. A collector worker that projects later needs it as a file it can read without the store. execution_overlay_bytes serializes an overlay as canonical JSON, and load_execution_overlay reads it back as an equal object, so projecting the file gives byte-identical Orrery JSON. The file keeps the overlay's existing protocol, microcosm.graph.execution-evidence.v1, rather than adding a wrapper protocol. The reader is standard-library only. It refuses non-regular files and files over the schema's 32 MiB serialized limit (which collection and projection already apply to the overlay) before parsing. It also refuses duplicate keys, non-finite numbers, other protocols and values outside the schema's JSON bounds. Graph binding and record checks stay in the projection. The restricted-import test now reads the overlay through this reader. Refs #1294 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UK finalize collected the execution overlay and projected it straight into graph.orrery.json, so the overlay itself never reached disk. The collector is to project builds from the schema and the overlay, so finalize now also writes the overlay as graph.execution.json, using execution_overlay_bytes, and registers it as a build output like the other graph files: in the dataset manifest's outputs, in the evidence manifest of a refused build, and in the failure bundle. It is deliberately left out of the Orrery publication set (the preserved orrery-publication/ directory and orrery.upload.json). The emitter's file roles and the runs service's contract do not admit it yet. Apart from the new manifest entry, every existing file stays byte-identical. The overlay's content is already embedded in graph.orrery.json, which is registered and staged the same way, so the new file discloses nothing new. Refs #1294 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pull_request trigger was filtered to branches: [main]. A stacked pull request targets another pull request's branch, so GitHub started no Tests run for it at all. The filter is removed. Pushes still run the workflow only for main. Nothing else in the workflow depends on the base branch. The concurrency group is keyed on the pull request number, and country selection reads the pull request's own changed files from the API. Pull requests from this repository's branches get the same token permissions and secrets whatever their base. New tests read the workflow's triggers. Pull requests into main, into another pull request's branch and into a nested branch name must all run it, and pushes must run it only for main. The agent guide and a changelog fragment say so. Fixes #1321 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tore Stack this branch on ci-pull-requests-into-any-base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
changed the base branch from
main
to
ci-pull-requests-into-any-base
October 19, 2026 21:09
anth-volk
added this pull request to stack #1323
October 19, 2026 21:09
This was referenced Oct 19, 2026
The previous test checked three literal branch names against the trigger's branches and branches-ignore lists. GitHub matches those entries as glob patterns, so a membership check proves nothing about other bases: a filter listing exactly those three names passed it, although pull requests into any other base would get no run, and a filter of '**', which runs for every base, failed it. The intended design is no base-branch filter at all, so the test now asserts that the pull_request trigger has neither a branches nor a branches-ignore key. _workflow_triggers is typed as dict[str, Any]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every push to a pull request's branch now runs the full Tests workflow on the organization's shared runners, whatever the base, so merging one change up a stack of N pull requests starts N full runs. The agent guide says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tore Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
removed this pull request from stack #1323
October 20, 2026 18:01
anth-volk
changed the base branch from
ci-pull-requests-into-any-base
to
main
October 20, 2026 18:01
This branch carried #1322 through three merges of its branch (`ci-pull-requests-into-any-base`). #1322 removed the `branches: [main]` filter from the Tests workflow so stacked pull requests would get CI. That is not wanted: CI runs only for pull requests into `main` on purpose, to limit the number of simultaneous runs on the organization's shared runners. #1322 is being closed. This restores the four files #1322 changed to their versions on `main` (`a90eec3cb`), which is also this branch's merge base with `main`: - `.github/workflows/test.yml`: the `pull_request` trigger filters on `main` again; - `docs/agent-guide.md`: the CI paragraph no longer says any base runs; - `packages/microcosm-build/tests/engine_free/shared/test_ci_integration_job.py`: #1322's two trigger tests are removed; - `changelog.d/1321-ci-pull-requests-into-any-base.changed.md`: deleted. The branch's own commits are not rewritten, so `8d159a8`, which microcosm-collector#9 records as its source, stays in the history. 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.
Fixes #1294
Stack
main← #1295 ← #1297 ← #1296 ← #1298 (GitHub stack #1328, linked on 2026-10-20 withgh stack link).#1322 taken out of the stack (2026-10-20): CI runs only for pull requests into
mainon purpose, to limit the number of simultaneous runs on the organization's shared runners. #1322, which removed that filter, is closed, and the old stack #1323 was removed.4ced66de0on #1295 restores the four files #1322 changed to their versions onmain, and each branch above merges the one below it: #129794a5bff93, #1296b0406fd76, #12987cb857716. None of those merges had conflicts, andtest_ci_integration_job.pypasses on every branch (9 passed). No commit was rewritten. From now on only the bottom pull request, which targetsmain, gets CI; each one above gets CI once it becomes the bottom.mainsince 2026-10-20. Until then it wasci-pull-requests-into-any-base(Run the Tests workflow for pull requests into any base branch #1322's branch).4ced66de0is a revert of an unwanted change rather than a bug fix, so it has no red step.4ced66de0, the restore commit on top of6b6887ef6. Before it, since8d159a8c5, the branch gained three merge commits from its old base, all without conflicts and none rewriting a commit:a645a3de8: Run the Tests workflow for pull requests into any base branch #1322's first commit andmainat 41209b3;e8c164966: Run the Tests workflow for pull requests into any base branch #1322's two review fixes (a test and the agent guide);6b6887ef6:mainata90eec3cb(Prepare the d1386 Route A rerun: CT-ladder base plan, fresh lineage evidence, launch-day sequence #1289, Place UK private rent and BRMA at the assigned area; bind Scotland's rents at BRMA grain (#1262, #1090) #1305), through Run the Tests workflow for pull requests into any base branch #1322.8d159a8c5, the commit it copied the projection from, is in this branch's history, and the nine copied modules inpackages/microcosm-graph/src/microcosm/graph/still have the blob IDs itsprovenance.pyrecords. So no re-copy is needed.test_uk_orrery_publication.py,test_graph_orrery_projection_without_store.py) gave 33 passed.Why
mainwas merged in (2026-10-20): GitHub builds each stacked pull request's test merge on top of the test merge of the pull request below it, starting frommain:refs/pull/1322/mergehasmainas its first parent, and each later one has the previous one's. Oncemaingained #1305, #1296's change torowwise_staging.pyconflicted with it, so GitHub could not build #1296's test merge. It reported #1296 as conflicting although its branch contained its base, and started no CI for #1296 or #1298.main(a90eec3cb) was merged into #1322's branch, and each branch into the one above, with merge commits; #1296 is now mergeable.Merge order: #1295, #1297, #1296, #1298, each after the one below it, with merge commits (or
gh stack merge). Every branch above #1295 has its parent merged in rather than rebased, so no commit was rewritten. Squash-merging a lower pull request would leave its original commits in the branches above, which would then need rebasing.Summary
The Orrery artifact is built in two halves. The build machine keeps evidence capture and verification against the content store. Projection needs only the compiler schema and the execution overlay, which makes it the half a collector worker can take over later. This PR makes that possible without changing what builds publish:
The projection imports without the build runtime.
microcosm.graph.orrerynow imports and projects a schema plus overlay in a process where numpy, pandas, microcosm-frame andmicrocosm.graph.storecannot be imported. Two things pulled them in before:orrery_evidenceimportedevidencefor one protocol string and a hash helper;microcosm.graphnow loads those runtime exports on first access (PEP 562).__all__and every public name are unchanged, and the declared dependencies are untouched (that's O2).The execution overlay has its own file format.
microcosm.graph.execution_overlay.execution_overlay_bytesandload_execution_overlaywrite and read the overlay as canonical JSON, keeping its existing protocol,microcosm.graph.execution-evidence.v1.UK finalize writes
graph.execution.jsonbesidegraph.orrery.jsonand registers it as a build output: in the dataset manifest, a refused build's evidence manifest, and a failed build'sorrery-failure/bundle. It is not added to the Orrery publication set (orrery-publication/,orrery.upload.json); that waits for O5.Overlay file format
graph.execution.jsonin the build output directory, next tograph.schema.jsonandgraph.orrery.json.microcosm.graph.execution-evidence.v1, the overlay's ownprotocolfield. No wrapper protocol was added.integer_literalandfloat_literalare added by the projection only.To project from the files:
Commits
Local checks were limited to the test files this branch adds or modifies, at the user's request; the rest of the suite is left to CI. Commit 1 ran the complete engine-free category before that change arrived. Commit 2's full-category run was stopped at about 40%. Every commit also passed
tools/ci_test_plan.py verify,tools/graph_acceptance_burndown.py --verify,ruff check .,ruff format --checkon the changed files, and a byte-identity harness. The harness runs a deterministic local-onlyfinalize_graph, with and without a dataset manifest, over a fixed two-phase toy state, and compares every file's digest withorigin/main.dd71e0e71)numpy, imported frommicrocosm/graph/__init__.pythroughkernel.py. One guard test passed (all public exports still resolve).test_us_release_head_to_head_scorer.py::test_spawned_workers_score_identically_to_sequential_cli, is environmental: the scorer refuses--worker-max-sliceson the local Python 3.14.6, which its own version table lists as unsupported. It is unrelated to this change.632c266cb)AttributeError:execution_overlay_bytesandload_execution_overlaydidn't exist yet). The 2 commit-1 tests passed.8d159a8c5)FileNotFoundError), or absent from the manifest, the evidence manifest or the failure bundle (KeyError). One guard passed (no overlay without recorded execution).graph.orrery.json,graph.schema.json, the evidence files,orrery.upload.json, the receipt, and everything inorrery-publication/. The only differences are the newgraph.execution.jsonand exactly one new output entry in each manifest (orrery/graph.execution.jsonin the dataset manifest,graph.execution.jsonin the evidence manifest).The new UK round-trip test runs a synthetic full build. Projecting
graph.schema.jsonwith the overlay read back fromgraph.execution.jsonmust give bytes identical to thegraph.orrery.jsonthat finalize wrote, and the loaded overlay must equalcollect_execution_evidencere-run against the store.Findings and risks
graph.execution.jsonis 121,145 bytes, beside a 348,283-bytegraph.orrery.json(about 35%).collect_execution_evidenceapplies the schema's serialized bound.graph.orrery.json).collect_execution_evidencefails on that 32 MiB bound, so those builds produce neither an Orrery artifact nor an overlay file, before and after this PR. The collector-side size policy (O4) will need to decide what the overlay carries at that scale.graph.orrery.json, which is registered and staged the same way. The new file therefore adds no new disclosure, and it stays out of the public publication set.import microcosm.graphno longer imports the runtime modules. Any code that reached a submodule as an attribute (microcosm.graph.store.X) without importing it would now fail; I found no such use in the workspace.from microcosm.graph import storeandfrom microcosm.graph import ContentStoreboth still work, and a guard test checks every__all__name. Errors from a broken runtime module now surface on first use instead of at package import.orrery.py, and changes only two import lines inorrery_evidence.py. If Reconstruct declaration-only Orrery publications for UK builds before #1144 #1291 adds package exports, each one needs to go either in the eager imports (standard-library-only modules) or in_RUNTIME_MODULE_EXPORTSinmicrocosm/graph/__init__.py.python -m microcosm.graph.orreryhas no--execution PATHoption; O3 can add one if the worker wants a command rather than the API.🤖 Generated with Claude Code