Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ change:
```bash
uv tool install microcosm-emitter # once per machine
uv tool upgrade microcosm-emitter # to take a new release
microcosm-emitter version # the installed release; builds need 0.14.0 or later
microcosm-emitter version # the installed release; builds need 0.15.0 or later
```

The build finds the `microcosm-emitter` command through
Expand All @@ -76,7 +76,12 @@ no remote staging, and queues no Orrery graph publication; a UK build given
its dataset bundle remotely, as it is by default, is refused before it
starts, since the emitter uploads the bundle. Before it starts the emitter,
the build reads its version from `microcosm-emitter version` and does not
start one older than 0.14.0. That release adds the build machine's
start one older than 0.15.0. That release adds the setting that switches
the Hugging Face module's collector submissions on, which every emitter a
build starts sets, so staged bundles and release publications that name
their build reach the collector; collector provenance on a release
publication; and a `skipped` collector receipt when the emitter refuses its
collector settings. 0.14.0 added the build machine's
readings: each heartbeat carries the machine's memory, CPU and disk use and
the build's processes, a heartbeat after the machine wakes carries the sleep,
the run's first event describes the machine, each stage's end says how long
Expand All @@ -90,12 +95,12 @@ which builds read as package data and the Modal image's install step reads
from the launching checkout. Releases before 0.10.0 send telemetry to the
collector's Cloud Run address, which changes when the collector moves to
another Google Cloud project; from 0.10.0 on, releases send to the
collector's hostname, which stays the same. 0.13.0 and 0.14.0 were each
the newest release when practically no machine ran the emitter yet, so
collector's hostname, which stays the same. 0.13.0, 0.14.0 and 0.15.0 were
each the newest release when practically no machine ran the emitter yet, so
requiring them cost nothing (see
[graph publication](docs/orrery-publication.md#emitter-dependency)). The
build prints the installed and required versions, what it loses and the
upgrade command, `uv tool install --upgrade 'microcosm-emitter>=0.14.0'`,
upgrade command, `uv tool install --upgrade 'microcosm-emitter>=0.15.0'`,
and continues as it does without the command. `uv tool upgrade` keeps any
version constraint given at install time, such as `==0.7.0`; that
`uv tool install --upgrade` command replaces it. Microcosm supplies build
Expand All @@ -118,7 +123,7 @@ if the emitter cannot be prepared or is missing, its
`microcosm-emitter version` times out or fails, it is older than the
minimum, it lists no protocol version 1, its `hello` fails, it exits or
times out before it is ready, or it starts without its telemetry module.
Every emitter a build starts (0.14.0 and later, the minimum) reads a given
Every emitter a build starts (0.15.0 and later, the minimum) reads a given
collector token, and exits at that point when the collector-token
variables it inherits (`MICROCOSM_COLLECTOR_TOKEN`,
`MICROCOSM_COLLECTOR_TOKEN_EXPIRES_AT`, `MICROCOSM_COLLECTOR_ORIGIN`) are set
Expand Down Expand Up @@ -531,7 +536,20 @@ three hours for a publication to land or be refused, which covers the
emitter's one-hour expiry of a pending change and the upload of a US ACS
local-area build of about 10 GB, and five minutes for a promotion.
`--preflight-only` checks the build and lists what would be published,
offline, and starts no emitter. The calibration diagnostics dashboard posts
offline, and starts no emitter. A publication names its build for the
collector: country `UK` with licensed data for the UK releases, `US`
without for the US releases, and the release and build of its folder. The
emitter submits the build's calibration diagnostics, with its build and
release manifests, to the collector after the release commit, so once the
publication has landed the command waits up to ten minutes for the collector
to accept them before it closes the emitter. The printed outcome's
`collector_submission` gives the collector receipt's `status` and
`error_code`. A collector that receives nothing (`skipped`, for example
`COLLECTOR_SETTINGS_REFUSED`) or refuses the submissions at intake, and
submissions not yet accepted when the wait ends, are warnings and never fail
the command. Once the collector has accepted them, its own processing decides
whether it builds a tree from them or rejects them (for example
`provenance_mismatch`); the command doesn't wait for that. The calibration diagnostics dashboard posts
these releases' Slack alerts from changes to `releases.json`. The UK
assemblers, the US national builder and the US ACS package stage print the
exact commands; the UK
Expand Down
1 change: 1 addition & 0 deletions changelog.d/1599-collector-submissions-on.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Builds now send their calibration diagnostics to the collector at staging and at release (microcosm#1599). Builds and the Modal image require microcosm-emitter 0.15.0 instead of 0.14.0, and microcosm-build's `microcosm-emitter-interface` pin rises to `>=0.15.0,<1` (the lock and `APPROVED_UV_LOCK_SHA256` follow, as does the installed-emitter job's pin). Every emitter Microcosm starts with its Hugging Face module has its collector submissions on. `microcosm-publish-release-build` names each build for the collector (UK builds as licensed, US builds as not), so the emitter submits its calibration diagnostics after the release commit. Once a staged bundle or publication has landed, the build or command waits up to ten minutes for the collector to accept them, and warns without failing when the collector receives nothing (`skipped`), refuses them at intake or has not accepted them yet; the publication command prints the collector's status as `collector_submission`.
3 changes: 3 additions & 0 deletions docs/agent-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ start the installed command with `start_bundle_emitter()`, as the UK re-stage
command does (the Hugging Face module only), and send its Hugging Face Hub
requests through `HF_ENDPOINT` to a loopback stand-in server
(`test_support/microcosm_build/stand_in_hub.py`), so the job needs no secret.
Builds switch the emitter's collector submissions on, so the tests' fixture
sends them to a closed loopback port: nothing reaches a collector, and a
build's wait for the collector ends at the first failed attempt.
With Xet turned off, the stand-in takes the dataset through the LFS upload a
real Hub requires for it, with the single-part `basic` transfer. It does not
model Xet, which machines with `hf_xet` use, or the multipart transfer a real
Expand Down
48 changes: 28 additions & 20 deletions docs/orrery-publication.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ retain a second delivery implementation or a compatibility wrapper.
## Emitter dependency

`packages/microcosm-build` depends on `microcosm-emitter-interface`
(`>=0.14.0,<1`), the dependency-free package of typed calls, which `uv.lock`
(`>=0.15.0,<1`), the dependency-free package of typed calls, which `uv.lock`
records with its hashes. The emitter itself, `microcosm-emitter`, is not a
workspace dependency: each machine installs it on its own with
`uv tool install microcosm-emitter`, and the Modal image installs the newest
Expand All @@ -162,9 +162,9 @@ versions interfaces still send, and an emitter that lacks a module the build
asks for starts without it.

A build does not start an emitter older than `MINIMUM_EMITTER_VERSION` in
`microcosm.build.telemetry_emitter`, now 0.14.0, and the Modal image installs
`microcosm.build.telemetry_emitter`, now 0.15.0, and the Modal image installs
at least the same release (`image_emitter_requirement()` in
`tools/modal_us_stage_plan.py`, `microcosm-emitter>=0.14.0`). The release is
`tools/modal_us_stage_plan.py`, `microcosm-emitter>=0.15.0`). The release is
written once, in microcosm-build's package data,
`packages/microcosm-build/src/microcosm/build/minimum_emitter_version.json`:
the adapter reads it as package data, and the runner, which imports nothing
Expand All @@ -179,20 +179,28 @@ changes when the collector moves to another Google Cloud project. From 0.10.0
on, the emitter's default collector address is the collector's hostname,
which stays the same. Microcosm passes the emitter no collector address: the
adapter's `development_collector_url` parameter, which no build command sets,
accepts only a loopback address.

The minimum is 0.14.0, the newest release on 2026-11-09. 0.14.0 adds the
build machine's readings to each heartbeat, the sleeps the machine took, a
description of the machine in the run's first event, each stage's awake and
asleep time at its end, and a counter one level above a stage's progress,
which the US fiscal refresh's post-export scoring sends as the reform pass
each scoring batch belongs to (the interface's `OuterProgress`, from 0.14.0).
The minimum before it, 0.13.0, added `microcosm-emitter status`, which the
US Modal stage runner runs after each stage to record how many telemetry
events the stage's emitter left undelivered; builds require the same release
as the Modal image so that it is written once. Practically no machine ran
the separately installed emitter on either date, so refusing 0.11.9 to
0.13.0 cost nothing; the minimum before those, 0.11.9, came from the
accepts only a loopback address, and reaches telemetry, Orrery graph
publication and the Hugging Face module's collector submissions alike.

The minimum is 0.15.0, the newest release on 2026-11-13. 0.15.0 adds the
Hugging Face module's setting that switches collector submissions on, which
every emitter a build starts sets (`telemetry_emitter.COLLECTOR_SUBMISSIONS`),
collector provenance on a release publication, which it submits after the
release commit, and a `skipped` collector receipt with an error code when it
refuses its collector settings. An older emitter accepts the setting but
drops a publication's provenance, so it would submit no release. The
minimum before it, 0.14.0, added the build machine's readings to each
heartbeat, the sleeps the machine took, a description of the machine in the
run's first event, each stage's awake and asleep time at its end, and a
counter one level above a stage's progress, which the US fiscal refresh's
post-export scoring sends as the reform pass each scoring batch belongs to
(the interface's `OuterProgress`, from 0.14.0). 0.13.0 added
`microcosm-emitter status`, which the US Modal stage runner runs after each
stage to record how many telemetry events the stage's emitter left
undelivered; builds require the same release as the Modal image so that it
is written once. Practically no machine ran the separately installed
emitter on any of these dates, so refusing 0.11.9 to 0.14.0 cost nothing;
the minimum before those, 0.11.9, came from the
collector's hostname, for which 0.10.0 would have been enough. A refused
emitter does cost the build:

Expand All @@ -219,7 +227,7 @@ the new lockfile digest and rerun the tests and wheel checks.

## Migrating an existing workstation

Install the emitter once with `uv tool install microcosm-emitter` (0.13.0 or
Install the emitter once with `uv tool install microcosm-emitter` (0.15.0 or
later; a build does not start an older emitter, says how to upgrade it and
continues without it). It keeps using the existing spool database,
`$XDG_CACHE_HOME/microcosm/telemetry/events.sqlite3`, at the same Alembic
Expand All @@ -232,7 +240,7 @@ modification. The emitter's README describes the repair for a machine that
ran an earlier, unreleased build of the hand-over queue. No new credential,
hosted service or infrastructure is required by this migration.

To upgrade a machine whose emitter is older than 0.13.0, run
`uv tool install --upgrade 'microcosm-emitter>=0.13.0'`; it also replaces a
To upgrade a machine whose emitter is older than 0.15.0, run
`uv tool install --upgrade 'microcosm-emitter>=0.15.0'`; it also replaces a
version constraint given at install time, which `uv tool upgrade` keeps.
`microcosm-emitter version` prints the installed release.
5 changes: 3 additions & 2 deletions docs/uk-dense-release-assembly-runbook-762.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ the gates stood on. See [Optional diagnostics](#optional-diagnostics-microcosm13
bytes), which the publication command's release-contract check also reads.
- For publication: `HF_TOKEN` (or `HUGGINGFACE_TOKEN`, or a token saved by
`hf auth login`) with write access to `policyengine/populace-uk-private`,
and the separately installed `microcosm-emitter` 0.14.0 or later, which the
and the separately installed `microcosm-emitter` 0.15.0 or later, which the
publication command starts as its child process and which uses the token it
inherits. These come from your shell: the command does not read
inherits, for the release commit and for submitting the build's calibration
diagnostics to the collector. These come from your shell: the command does not read
`tools/release.env`, so if you keep the values there, `source
tools/release.env` first.
- The Ledger consumer artifact, the spine H5 with its sidecar, the OA ladder.
Expand Down
6 changes: 4 additions & 2 deletions docs/uk-national-release-assembly-runbook-806.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ Before starting, export:
copied certification.
- `HF_TOKEN` (or `HUGGINGFACE_TOKEN`, or a token saved by `hf auth login`),
with write access to `policyengine/populace-uk-private`. The publication
command starts the separately installed `microcosm-emitter` (0.14.0 or
later) as its child process, and the emitter uses the token it inherits.
command starts the separately installed `microcosm-emitter` (0.15.0 or
later) as its child process, and the emitter uses the token it inherits,
for the release commit and for submitting the build's calibration
diagnostics to the collector.

These come from your shell: the publication command does not read
`tools/release.env`, so if you keep the values there, `source
Expand Down
45 changes: 36 additions & 9 deletions docs/uk-staging-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,42 @@ The hand-over also names the build for the collector, with the interface's
With that, the emitter submits the bundle's calibration diagnostics (with the
build manifest as `build_manifest`) to the collector once the Hugging Face
commit lands, as a `calibration-diagnostics` submission whose folder is
`staged/<run_id>`, but only while its collector submissions are on. No
emitter release up to 0.14.0 (the newest released, which the installed-emitter
tests pin) can switch them on, so for now the emitter ignores the provenance
and the bundle goes to Hugging Face alone. Microcosm sets only a minimum
emitter version, so an emitter release that switches submissions on by
default would start these submissions with no change here. A different `collector` block gives the bundle a
different hand-over ID, so a bundle handed over before this change is not
the same hand-over as one handed over after it; the re-stage command resumes
a recorded hand-over by its recorded ID either way.
`staged/<run_id>`, with the build's Hugging Face credential. Every emitter a
build or the re-stage command starts has its collector submissions switched
on (`telemetry_emitter.COLLECTOR_SUBMISSIONS`, through the setting emitter
0.15.0 added; the emitter's own default leaves them off, so switching them
off again is a Microcosm change). Once the bundle has landed, the build waits
up to ten minutes for the collector to accept the submissions
(`collector_submissions.follow_collector_submissions`), because an emitter that is
closing starts no new submission; an attempt after the commit that fails
ends the wait sooner. A bundle that has not landed is asked about once and
not waited for. The build carries on in every case, with a warning when:

- the collector receives nothing (`skipped`): the emitter refused its
collector settings or the collector-token variables it inherits
(`COLLECTOR_SETTINGS_REFUSED`; an emitter given a collector token uses it
instead of the Hugging Face credential, and it only sends telemetry, so
unset those variables), the bundle's Hugging Face upload failed or was
refused (`NOT_STAGED_ON_HUGGING_FACE`), or its folder is longer than the
collector accepts (`COLLECTOR_FOLDER_TOO_LONG`);
- the collector refused the submissions at intake (`rejected` or `failed`),
with the code the receipt gives. Once it has accepted them, its own
processing decides whether it builds a tree or rejects them, and the build
doesn't wait for that; a re-stage that resumes an older hand-over can show
that later result, or `timed_out`;
- the emitter had no credential for them (`CREDENTIAL_MISSING`): it was given
a collector token, which only sends telemetry, or found no Hugging Face
credential;
- they were still queued when the wait ended: an emitter running on this
machine later sends them, and files the emitter did not copy at hand-over
must stay unchanged until the hand-over settles.

The staged dataset record (`staged_dataset`) describes the Hugging Face
upload alone and does not change. A different `collector` block gives the
bundle a different hand-over ID, so a bundle handed over before the
provenance was added is not the same hand-over as one handed over after it;
the re-stage command resumes a recorded hand-over by its recorded ID either
way, and follows its collector receipt as the build does.

Modes follow the staging switch. The default uploads telemetry and the bundle;
`--staging-local-only` keeps both on disk (the sidecars are still written);
Expand Down
9 changes: 5 additions & 4 deletions docs/us-modal-stage-runbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ that release's current build.
and asserts `HEAD` equals the commit. It then runs
`uv sync --all-packages --extra us --frozen` against that tree's own
`uv.lock` into `/opt/venv`, installs the newest `microcosm-emitter`
release (0.14.0 or later, the oldest a build starts) on its own with
release (0.15.0 or later, the oldest a build starts) on its own with
`uv tool install` into `/usr/local/bin`, checks that
`microcosm-emitter version` runs, and asserts `git status --porcelain` is
empty. Emitter releases from 0.10.0 on send telemetry to the collector's
Expand All @@ -108,7 +108,7 @@ that release's current build.
(`/root/minimum_emitter_version.json`), and the copy reads that one: the
check, which runs there, reports the install step the image was built
with. The install step and its
`>=0.14.0` floor come from the checkout that launches the app
`>=0.15.0` floor come from the checkout that launches the app
(`image_build_commands`, `image_emitter_requirement`), while the minimum
the build enforces comes from the commit the plan pins, so a launch can
combine an older checkout's floor with a newer commit's minimum, or the
Expand Down Expand Up @@ -357,8 +357,9 @@ that release's current build.
the newest emitter release when Modal builds its install step, and
Modal reuses that step for a commit while the step's command is the
same. Since #1455 (merged 2026-11-03), the command asks for at least
0.11.9, since #1522 for `microcosm-emitter>=0.13.0`, and since #1556 for
`microcosm-emitter>=0.14.0`, so every image this runner builds has an
0.11.9, since #1522 for `microcosm-emitter>=0.13.0`, since #1556 for
`microcosm-emitter>=0.14.0`, and since #1599 for
`microcosm-emitter>=0.15.0`, so every image this runner builds has an
emitter that reports a collector origin and has `status`. An image whose install step an
older checkout built (with `>=0.7.0`, possibly before 0.11.0) is not
reused: the changed command rebuilds that step, for each commit, at its
Expand Down
2 changes: 1 addition & 1 deletion packages/microcosm-build/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
# microcosm-emitter`) and started as the build's child process, so an
# emitter release needs no change here. The socket protocol carries its
# own version, and every emitter release accepts the versions in use.
"microcosm-emitter-interface>=0.14.0,<1",
"microcosm-emitter-interface>=0.15.0,<1",
]

[project.optional-dependencies]
Expand Down
Loading
Loading