Skip to main content

Microcosm emitter interface

microcosm-emitter-interface is the small, dependency-free package a Microcosm build imports to hand work to the separately installed microcosm-emitter. Microcosm decides what to hand over; the emitter decides where it goes.

Install the emitter on its own, outside the build's environment:

uv tool install microcosm-emitter

The build then depends on this package with a version range and starts the emitter through it:

from microcosm_emitter_interface import EmitterClient, TelemetryRun, TelemetrySettings

client = EmitterClient.start(
    telemetry=TelemetrySettings(run=TelemetryRun("run-id", "UK", "uk-build")),
)
client.telemetry.transition_stage("calibrating")
client.telemetry.complete()
client.close()

EmitterClient.start runs the microcosm-emitter command as the build's own child process. The command comes from the command argument, then the MICROCOSM_EMITTER_COMMAND environment variable, then PATH. The child inherits the build's environment variables and user, so it finds the same Hugging Face credential: HF_TOKEN, then HUGGINGFACE_TOKEN, then the token saved by hf auth login.

No call raises into the build: not because the emitter is missing, slow or refusing a request, and not because an argument cannot be converted to JSON (for example a multi-element NumPy array or a self-referencing mapping). Each call converts its arguments inside its error handling and reports whether the emitter accepted it; after a refusal, client.last_failure says why (emitter_unavailable, invalid_arguments or not_accepted). Startup settings that cannot be converted start an unavailable client (invalid_configuration). The build continues in every case. Constructing a request object (for example StageRunFiles(...)) that breaks the shared path and identifier rules raises ValueError in the build's own code, before any call.

Calls

Hand-over Call Emitter module
Telemetry event client.telemetry.stage(...), transition_stage, progress, calibration_progress, fail, refuse, complete, emit (each one emit_telemetry) telemetry
Staging run files under runs/<run_id>/ stage_run_files(StageRunFiles(...)), run_files_receipt, read_back_run_files huggingface
Staged dataset bundle, each file with its role stage_dataset_bundle(StageDatasetBundle(...)), dataset_bundle_receipt, check_write_access huggingface
Release publication: release, build, whether current, files with roles publish_release(PublishRelease(...)), promote_build, withdraw_build, release_receipt huggingface
Orrery inputs orrery_inventory, hand_over_orrery_inputs, orrery_receipt, retry_orrery_inputs orrery

microcosm_emitter_interface.releases holds the shape of releases.json and the checks every release write must pass, so Microcosm, the emitter and a scheduled repository check run the same code.

Compatibility

Both packages are released together with one version number, and microcosm-emitter==X requires microcosm-emitter-interface==X. A build, though, may run with a different emitter from the interface it depends on: it keeps the emitter it started with, and the next build uses whichever emitter is installed then. So the socket protocol carries its own version:

  • PROTOCOL_VERSION names the shape of every message this package sends. The emitter lists the versions it accepts in its hello answer, and the client refuses an emitter that does not list its version (unsupported_protocol_version); the build continues without it.
  • Every emitter release must accept every protocol version that interface releases still in use send. Adding a module or a message kind keeps the version; changing the shape of an existing message needs a new version, which emitters then accept alongside the old one.
  • fixtures/protocol-v<N>/ holds one JSON file per message of protocol version N, including how the command is started (host-launch.json: its arguments and the configuration object on standard input) and each socket request's whole envelope (host-ping.json, host-message-envelope.json, host-query-envelope.json, host-close.json, and host-hello.json). This package's tests check that each typed call, the launcher and the socket transport send exactly their fixture, and the emitter's contract tests check that it accepts every fixture of every version it supports, so a change to the command's arguments or the envelope cannot pass by changing both sides at once. An emitter's hello answer must contain the recorded keys and may add more. A released fixture is never edited or removed: the emitter's tests pin each one's SHA-256.
  • An emitter that lacks a module this package asks for starts without it (--skip-unavailable-modules); calls for that module report that they were not accepted.

Metadata

Release files for microcosm-emitter-interface 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for microcosm-emitter-interface 0.7.0
File Size Uploaded Provenance
microcosm_emitter_interface-0.7.0.tar.gz 34.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for microcosm-emitter-interface 0.7.0
File Interpreter ABI Platform
microcosm_emitter_interface-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 90.2 kB

Release files / microcosm_emitter_interface-0.7.0.tar.gz

Download URL microcosm_emitter_interface-0.7.0.tar.gz
Size 34.4 kB
Tags Source
SHA-256 checksum
How to use checksums
16c285331f28c926ce4775f9bb622c4d6cd05c867d419d3339a939cf8de2fa5a
BLAKE2b-256 checksum
How to use checksums
6935afaf9a249d5c09aa9ebcbbc3c58ca0f7d28a184d1f9d28d8cb807dacdb28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / microcosm_emitter_interface-0.7.0-py3-none-any.whl

Download URL microcosm_emitter_interface-0.7.0-py3-none-any.whl
Size 55.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df6b382bf77b7e63bf737b530d89549c14aba9b4c7625b64ec8c144c8cb8d81a
BLAKE2b-256 checksum
How to use checksums
74938ff4fbfe3dfb53451e672a424edb6d28f400e5ec4808ecf98762dedd6567
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for microcosm-emitter-interface 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for microcosm_emitter_interface-0.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page