Skip to content

Orrery export fails on full UK local builds: execution evidence exceeds the graph metadata bound #1290

Open

Description

@juaristi22

A full-scale UK local build ran with --publish-orrery, but its graph was neither exported nor published. The dataset, staging and telemetry were unaffected.

Run: the K=15 local candidate at 95,000 households on main 121fd4dd6 (tools/build_uk_full.py --release-role dense --dataset-households 95000 --inspection-export --publish-orrery), staging run uk-local-candidate-f100-s42-20261015T082730Z-68448178.

What happened

  • orrery.publication.json reads {"status": "failed", "error_code": "graph_export_or_enqueue_failed", "publication_id": null}.
  • The bundle has no graph.orrery.json, and nothing reached the emitter's publication queue.
  • The build log says nothing about it; the receipt is the only signal.

Reproduction

From the run directory and its graph store:

python -m microcosm.graph.orrery --schema graph.schema.json \
  --evidence execution.evidence.json --store <graph-store> --output graph.orrery.json

After about 12 minutes and 8 GB of memory it exits 2 with Graph schema exceeds the metadata size limit. Without --evidence, the same command writes the graph (6.9 MB) in 3 seconds.

Cause

The execution evidence goes through the schema's _plain_json bound (_MAX_BYTES = 32 MiB in microcosm/graph/schema.py), via collect_execution_evidence (evidence.py) and orrery_evidence.py. The schema itself is 1.8 MB.

This run captured evidence for all four graph phases. Three phase summaries are about 47.5 MB each and each phase manifest about 228 MB, so any one of them exceeds the bound.

The K=25 100,000-household build of 2026-10-11 exported because its preflight, numerical, export and final captures were skipped under the native evidence byte limit, leaving only the spine checkpoint's small evidence. Now that full-phase capture succeeds at this scale, the Orrery export cannot carry it.

To do

  1. Decide what execution evidence Orrery embeds for large builds, and bound that rather than the full summaries. One option is per-node status, timings and artifact digests, with summaries referenced by digest rather than inlined. Whatever it embeds must pass disclosure control; a disclosure-control note on the current summaries went to the build owner separately.
  2. Fail fast with a named cause in the receipt (for example execution_evidence_over_bound) instead of walking the whole evidence first.
  3. Print a warning in the build log when --publish-orrery was requested and nothing was published.
  4. Add a regression test with an oversized synthetic evidence payload.

Workaround: the schema-only export (the command above without --evidence) gives the graph without the execution overlay.

Related: #1149, #1150, #1170.

Activity

  1. vahid-ahmadi commented on Nov 6, 2026

    @vahid-ahmadi
    Contributor

    Plan review at main f44512d. I read the issue, #1295 (merged 20 October, which says #1290 still applies) and the export path in orrery_publication.py, evidence.py, schema.py and execution_overlay.py. I didn't run a build.

    The cause still holds at main: the overlay goes through _plain_json with _MAX_BYTES = 32 MiB (packages/microcosm-graph/src/microcosm/graph/schema.py:43, raised at :91), while run evidence is read up to 1 GiB (evidence.py:65, :111-113). Two things the plan doesn't cover yet:

    1. should: the build has no schema-only fallback, so the graph is lost as well as the overlay.

    • In finalize_graph the evidence is collected inside the same try that writes the graph (packages/microcosm-build/src/microcosm/build/uk_runtime/orrery_publication.py:131-152). When collect_execution_evidence raises at :134, control goes to the except Exception at :214, so graph.orrery.json is never written, although the schema alone projects in 3 seconds (your workaround).
    • Fix: add a step to the to-do list: on the over-bound cause only, project with execution=None, write and publish the schema-only graph, and set recorded_execution: false with the named code from to-do 2. Keep other failures (for example unpublishable_summary, :137-139) as hard failures, so the fallback never sidesteps the disclosure check.

    2. should: since #1295 the bound has a second consumer, graph.execution.json.

    • execution_overlay.py:20 takes the same _MAX_BYTES from schema.py, and finalize writes the overlay file from the same execution object (orrery_publication.py:158-164).
    • So to-do 1's reduced overlay has to be what both the embed and the overlay file carry, or a large build will still fail on the file once the embed fits. The regression test in to-do 4 should cover both outputs.

    Checked and fine

    The plan is right otherwise; the two points above fill in what the fix has to touch.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions