Skip to content

Write only the collector's Orrery inputs and delete Microcosm's projection - #1748

Merged
anth-volk merged 11 commits into
mainfrom
claude/orrery-inputs-only
Nov 26, 2026
Merged

anth-volk merged 11 commits into
mainfrom
claude/orrery-inputs-only

Conversation

@anth-volk

@anth-volk anth-volk commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1745.

What this changes

Since #1590, UK builds hand the collector their Orrery inputs in the staged bundle, and the collector builds the Orrery graph files with its own copy of the projection. The nine modules in that copy (telemetry_collector/orrery/projection/) have the same git blob IDs as the ones on Microcosm main, so this PR deletes Microcosm's copy and everything that only existed for it:

  • Graph package: microcosm.graph.orrery (with python -m microcosm.graph.orrery) and microcosm.graph.orrery_evidence are deleted, and microcosm.graph no longer exports orrery_document or orrery_json. execution_overlay.py, evidence.py, presentation.py, schema.py and reconstruction.py stay; only their docstrings change, plus the reconstruction marker's scope text, which no longer claims the reconstructing code projected the document.
  • UK builds: the graph step moves from uk_runtime/orrery_publication.py (deleted) to uk_runtime/orrery_inputs.py. It writes graph.execution.json beside graph.schema.json and registers under orrery/: the schema, execution.evidence.json with each run's native evidence files, the overlay, and each upstream-<sha256>.json file the schema's extensions or the overlay link (found from their url fields, which is where the projection used to find them, and digest checked). It no longer writes graph.orrery.json, orrery.upload.json, orrery.publication.json, the manifest's orrery_publication field or orrery-publication/ under the attempt evidence. Summaries carrying a target row's figures or a check's failure lines still leave the bundle with no Orrery input, and the build now says so on standard error; any other graph-step failure registers nothing and prints the error's type.
  • Emitter adapter: the emitter a build starts has only its telemetry and Hugging Face modules. publication_inventory, publish_graph and the short-lived Orrery-only emitter are gone; nothing in Microcosm used the graph publication module except to measure the inventory. Removing the module from the emitter itself is separate emitter work.
  • New command: python -m microcosm.build.uk_runtime.orrery_inputs --schema <build>/graph.schema.json [--evidence <build>/execution.evidence.json --store <content store>] --output <new directory> writes the collector's inputs into a new directory: the schema's bytes unchanged, the overlay the build would have written (with the build's summary check), and the linked upstream files checked against their names. It uploads nothing. It replaces the deleted command for builds whose files exist only on one machine.
  • Reconstruction tool (Reconstruct declaration-only Orrery publications for UK builds before #1144 #1297), split: python -m microcosm.build.uk_runtime.orrery_reconstruction keeps its reads, digest checks, revision resolution and marker, and now writes only the marked graph.schema.json and orrery.reconstruction.json (report protocol v2: no publication_id or published_files; files lists what it wrote). The function is now reconstruct_uk_schema. A build that records Orrery evidence is pointed to the new command.
  • CI and tools: tools/orrery-contract/ (Node scripts running Orrery's parser on Microcosm's documents) is deleted, with the engine-free job's actions/setup-node step and the npm ci line in tools/run_engine_free_tests.sh. tools/ci_test_plan.py verify-workflow passes on the edited workflow.
  • Kept on purpose: --publish-orrery and --no-publish-orrery still change nothing and keep their warning; the cleanup task removes them with tools/run_uk_cut.py's use.
  • Docs and changelog: docs/orrery-publication.md, docs/orrery-adapter.md, the README, the graph package README, the agent guide and the other docs that described the projection; three fragments under changelog.d/1745-*.

Decisions

Made with Anthony on 2026-11-25 and 2026-11-26:

  1. Split the reconstruction tool, rather than move it to microcosm-collector. Pre-Add country-neutral Orrery execution evidence and UK contracts #1144 build directories exist only on the machines that ran them (staged bundles never carried graph.json), and the marker records the Microcosm revision that compiled the schema.
  2. How a reconstructed schema reaches the collector: later work outside this repository. Today's emitter and collector both require an execution overlay in an orrery-inputs submission, and a declaration-only reconstruction has none. A new collector task accepts a schema carrying a valid reconstruction marker without an overlay and records its document as reconstructed; the planned microcosm-emitter backfill-orrery <dir> command submits it.
  3. No local projection for offline viewing: graphs are viewed through the run viewer from the collector. A build staged only locally, or interrupted, has no Orrery document until its inputs are submitted.
  4. Keep the two flags for the cleanup task.
  5. Replace the deleted command with the inputs command above.

What its merge waits for

Nothing in another repository has to land first: the collector already projects from the staged inputs, and the emitter already starts without its graph module when a build does not ask for it (as start_bundle_emitter does today).

Outside this repository

  • microcosm-runs' local development reader (MICROCOSM_RUNS_LOCAL_DIR) and the emitter's microcosm-emitter-publish-graph --directory read orrery.upload.json, which new builds no longer write. Both belong to the direct-upload path that the emitter and microcosm-runs tasks remove.
  • The collector's tools/generate-orrery-projection-fixtures.py runs Microcosm's projection from a Microcosm checkout, so after this merges it works only on an earlier commit. Its tests use saved fixtures and blob IDs, so nothing breaks.

Tests

Red-green, with only the added and changed tests run locally, by node ID:

  • Red (af1752c59, stand-ins orrery_inputs.py and reconstruct_uk_schema so every failure is an assertion): 19 failed, none at import or collection, in 3 min 22 s.
  • Green (a8bb42be8): the change. Tests that used the projection only to inspect a schema, an overlay, a presentation contract or a marker now assert on those directly; tests of the projection's own output, the Node parser checks, the inventory and the receipt are deleted. test_graph_orrery_projection_without_store.py is now test_graph_execution_overlay_file.py, and the three schema checks worth keeping from test_graph_orrery.py moved to test_graph_schema.py.
  • Red (4da3455f2) and green (06e09b6ad): only the deleted projection validated a schema's presentation contract, so the graph step and the inputs command now run validate_presentation before handing a schema over; red: 2 failed.
  • Docs (1371ddad9).
  • Review fixes are listed under Review below.
  • Locally only ruff check, ruff format --check, pytest --collect-only of the changed test files and tools/ci_test_plan.py verify-workflow ran after each change; the reviewers ran individual changed tests by node ID to settle their findings. CI runs the tests.

One check is gone with the projection: it was the only code that refused an execution overlay whose graph_sha256 does not match the schema's (test_execution_overlay_graph_binding_is_checked is deleted). Microcosm only writes overlays it collects from that same schema, and the collector's copy of the projection still refuses a mismatch.

Review

Three rounds of adversarial review, each in a fresh clone; every bug found was fixed, test-first where the bug was in code.

Round Bugs (priority) Fixes
1 High: two inputs-command tests passed the synthetic build's unset args.graph_store, so the command refused "Evidence store None". Low: a graph step that registered nothing left an earlier attempt's orrery.evidence-manifest.json in a reused output directory, where staging would take it for this attempt's. 7fbc57b38 (tests; red for the low bug: 1 failed; plus refusal tests for a duplicate JSON key, a symbolic link and a missing upstream file), 9da8e1a66 (the stale record is removed; the dead rowwise_staging.active_telemetry_emitter goes), 4bf54fb8b (_run_with_graph_publication is now _run_with_graph_inputs)
2 High: test_transport_evidence_kernels still listed nine graph modules the transport bindings reached only through the deleted projection, so its module count failed. cac3af4dc (the list is now the twelve modules reached; red test for an upstream file behind a link: 1 failed), 9534827c0 (the command reads each upstream file once, never through a link, within the collector's 64 MiB bound)
3 High: test_cli_prints_the_resolved_output_path_it_wrote, unchanged by the PR, still expected the reconstruction summary's old first sentence. 0f5c669f4 (the test expects the new sentence; the build's graph step uses the same single upstream read)

Left open, all rated as code quality rather than bugs:

  • The inputs command and the reconstruction tool each keep their own copy of the bounded JSON read and the new-directory writer.
  • Untested refusals of the inputs command: a schema over 32 MiB, a named pipe or device, a non-finite number, a schema validate_graph_schema rejects, and an upstream file over 64 MiB or not a regular file.
  • Nothing in Microcosm now checks the UK declarations against the collector's node and edge limits; a declaration past them would show up as a rejected orrery-inputs submission.
  • The test-support fake emitter client still lists an orrery module and keeps its Orrery methods, which mirror the interface (the emitter work removes them there).
  • Two rewritten assertions in test_uk_graph restate values the schema compiler always sets.

Reviews: microcosm-1748-review-round{1,2,3}-2026-11-26.md in the review hand-off folder.

Environment variables and secrets

The workflow change only removes a step. No variable or secret is added or removed.

Variable or secret Read by Provider Wiring Status
(none) the engine-free job and tools/run_engine_free_tests.sh — The removed actions/setup-node step and npm ci line read no variable or secret, and the job declares no env: or secrets: Confirmed from the workflow
MICROCOSM_TELEMETRY_REQUIRED microcosm.build.telemetry_emitter, unchanged Whoever starts the build: the Modal stage runner, or the operator's shell Read in the build process when it starts its emitter Unchanged by this PR
MICROCOSM_EMITTER_COMMAND, XDG_CACHE_HOME microcosm-emitter-interface, in the build The operator's shell; the Modal image sets the command path Read in the build process Unchanged by this PR
HF_TOKEN / HUGGINGFACE_TOKEN The emitter's Hugging Face module, inherited from the build The operator's environment or hf auth login Inherited by the emitter child process Unchanged; the build emitter no longer starts a graph module, which used none of these

🤖 Generated with Claude Code

anth-volk and others added 11 commits November 26, 2026 00:48
Failing tests for #1745. The graph package must have no projection module
or export; a build must start no graph publication module in its emitter;
UK builds, refused builds and failure bundles must register the schema,
overlay and upstream files but no Orrery document, inventory or receipt;
unpublishable summaries must leave no inputs and say so; a new command must
write the collector's inputs from a saved schema and optional recorded
evidence, refusing an existing output, evidence without its store, a
changed upstream file and unpublishable summaries; and the pre-#1144
reconstruction must write only its marked schema and a version 2 report,
pointing builds with recorded evidence to the new command.

orrery_inputs.py and reconstruct_uk_schema are stand-ins so that every test
fails on its assertions: 19 failed, none at import or collection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ction

The collector builds every Orrery graph file with its own copy of the
projection, whose modules have the same contents as Microcosm's. So:

- Delete microcosm.graph.orrery (with python -m microcosm.graph.orrery),
  microcosm.graph.orrery_evidence and the orrery_document and orrery_json
  exports.
- Move the UK graph step from orrery_publication.py to orrery_inputs.py.
  It writes the execution overlay and registers the schema, the evidence
  index and run evidence, the overlay and the linked upstream files, found
  from the schema's extensions and the overlay's links. It writes no
  graph.orrery.json, publication inventory, receipt or orrery-publication/
  copy, and says on standard error when it hands over no inputs.
- Add python -m microcosm.build.uk_runtime.orrery_inputs, which writes those
  inputs into a new directory from a saved schema and, optionally, the
  build's evidence index and content store.
- Start build emitters without the graph publication module, and remove
  publication_inventory, publish_graph and the Orrery-only emitter.
- Split the #1297 reconstruction tool: reconstruct_uk_schema writes only the
  marked graph.schema.json and a version 2 report.
- Delete tools/orrery-contract/ and the engine-free job's Node setup.
- Adapt the tests that used the projection to inspect schemas, overlays,
  presentation contracts and markers, and delete those of the projection's
  own output, the Node parser checks, the inventory and the receipt.

The --publish-orrery and --no-publish-orrery flags stay as no-ops for the
cleanup task. Closes #1745.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only the deleted projection checked a schema's presentation contract, which
the collector's projection refuses when it is invalid. The graph step must
then register no Orrery input and say so, and the inputs command must refuse
the schema. Both tests fail on their assertions: 2 failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The graph step and the inputs command now run validate_presentation on the
schema, which only the deleted projection did; the collector's projection
refuses an invalid contract, so the build registers no Orrery input and the
command refuses the schema. Docstrings that still described a local Orrery
export now describe the overlay and the collector.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/orrery-publication.md ("UK graph inputs") and docs/orrery-adapter.md
("Orrery inputs") now describe the files a build registers and hands over,
the inputs command and the split reconstruction tool, and point to the
collector for the Orrery document format. The README, the graph package
README, the agent guide and the docs that linked to the projection, the
inventory or the receipt follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… records

Review round 1 of #1748:

- High: the two inputs-command tests with evidence passed args.graph_store,
  which the synthetic build leaves unset (it sets the store only on its
  staged copy of the arguments), so the command refused "Evidence store
  None". They now pass the build directory's .graph-store.
- Low: a graph step that registers nothing for a build without a dataset
  manifest left an earlier attempt's orrery.evidence-manifest.json in a
  reused output directory, where staging would take it for this attempt's.
  The new test fails on its assertion: 1 failed.

Also cover the command's refusal of a duplicate JSON key, a symbolic link
and a missing upstream file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 1 of #1748 (low): a build without a dataset manifest whose
graph step registered nothing left an earlier attempt's
orrery.evidence-manifest.json in a reused output directory, and staging
would have taken it for this attempt's. The old step always wrote a record,
so each attempt replaced the last; now it removes the stale one from the
build directory and the published output.

Also remove rowwise_staging.active_telemetry_emitter, which only the deleted
graph step called, and the tracker task code from the docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
full_build_cli._run_with_graph_publication becomes _run_with_graph_inputs,
and the adapter test about the graph hand-over before shutdown is renamed;
nothing is published any more (review round 1 of #1748, code quality).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 2 of #1748:

- High: test_transport_evidence_kernels still listed nine graph modules
  (evidence, store, manifest, presentation and their imports) that the
  transport bindings reached only through the deleted projection, so its
  module count failed (238 against 247). LEAF_ADDED_MODULES now lists the
  twelve the leaf reaches.
- The inputs command checked an upstream file's digest by path and then
  read it again, following links. A new test expects an upstream file
  behind a symbolic link to be refused; it fails: 1 failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 2 of #1748 (code quality): the inputs command checked an
upstream file's digest by path and then read it again, following links and
with no size bound, so bytes changed in between were copied unchecked. It
now reads each upstream file once, refusing links, devices and files over
the collector's 64 MiB bound, and checks those bytes; the schema read
shares the same reader.

Also document that a graph step that registers nothing writes no evidence
record and removes an earlier attempt's (finalize_graph's docstring and the
UK graph inputs doc), and say in the changelog that the reconstruction
report's files field names the schema.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 3 of #1748:

- High: test_cli_prints_the_resolved_output_path_it_wrote, which the PR had
  not changed, still expected "Wrote a reconstructed Orrery publication
  (declaration only)", which summary_text no longer prints. It now expects
  the graph schema sentence, as its neighbouring test does. CI had not
  reached the UK tests yet because an earlier failure stopped the job.
- The build's graph step now checks upstream files with the same single
  read as the inputs command (no links, the collector's 64 MiB bound), and
  _checked_upstream_file is gone.
- The Orrery inputs doc lists the command's upstream-file refusals, and the
  reconstruction tests' docstring no longer speaks of publications.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@anth-volk
anth-volk marked this pull request as ready for review November 26, 2026 12:51
@anth-volk
anth-volk merged commit 60a3697 into main Nov 26, 2026
12 checks passed
@anth-volk
anth-volk deleted the claude/orrery-inputs-only branch November 26, 2026 12:52
anth-volk added a commit that referenced this pull request Nov 26, 2026
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>
anth-volk added a commit that referenced this pull request Nov 26, 2026
--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>
juaristi22 added a commit that referenced this pull request Nov 26, 2026
…no Orrery projection, untagged build folders (#931)

Main took three pull requests since 51d952c: #1746 (each UK kernel builds
its Frame from one copy of its input tables, through
microcosm.frame.table_copies and Frame.adopt), #1748 (the graph package
keeps the Orrery inputs and drops its projection, orrery_document among it)
and #1740 (the build-folder switch tool reads untagged folders). No feed or
engine pin moves.

Three files conflicted.
- uk_runtime/graph_kernels.py, _minimal_frame: both sides cut the stage
  kernel's Frame to one copy. This branch passed the frozen tables to the
  Frame constructor, whose own copy still stacked each dtype's columns;
  #1746 copies each column once with copy_table and stores the copies with
  Frame.adopt, and the strata with copy_series. The merge takes #1746's copy
  and keeps this branch's mass_log and metadata parameters, through which
  the spine gate kernel builds this one Frame, and both imports.
- uk_runtime/graph_population.py: the import of the copy helpers beside
  Frame. This branch had removed the code that used Weights, so the merged
  import leaves Weights out; context_frame is #1746's.
- tests/engine_free/uk/test_uk_graph.py: the imports. #1748 replaced the
  Orrery document check with a schema check (validate_graph_schema); the
  merge keeps this branch's binding-rule imports and drops the two that only
  the old check used.

The derived binding rule then asked every UK kernel that builds its frame
through _minimal_frame or context_frame to hash the new
microcosm.frame.table_copies, and the merge adds it where each computes
through it: every stage kernel (_implementation_hash), the spine gates, the
calibration kernels' shared hash, the measures, problem and holdout, the
three national kernels, the export preparations and the terminal phase's
own code. It also brings the size search and refit to #1735's rules, which
the merge at c18c0ae missed: they compute through target_weights and
national_doctrine, so they hash calibrate.target_loss_rules too.

Checks: CI's test plan and workflow verify; the tests the merge touches,
main's changed tests among them (1,498 pass, then the UK graph test's
binding rules, 65, after the hash additions); the parity pins, the
graph evidence, the kernel frame copies, the FRS spine, the calibration
graph, the transport binding identity and the battery pins (808); H2
parity and the UK graph on the engine (3); and the staging smoke (2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete Microcosm's Orrery projection; builds and tools write only the collector's inputs

1 participant