The one launch-nonce reader for a module process: launch_nonce() reads
the inherited Unix descriptor, the Windows named pipe, or, when neither is
named, the SUBC_LAUNCH_NONCE environment copy once and caches it. The SDK’s
HELLO and route opens go through it too; a module’s own readers must as well.
Read before spawning children so they cannot inherit an unread Unix pipe
containing the module’s credential.
The launch nonce: the secret the daemon gives each module it spawns, which
the module presents to be admitted as itself.
One process owner for registration and claim minting. No synchronous mutex is
held over I/O. The async pool lock serializes consumer creation, not minting
or the registration reader, so a HELLO/claim reply can always make progress.
One channel-0 subscription response on the request’s correlation id, with
RESPONSE and MORE set, like activity.subscribe. There is no separate ACK:
the first push carries the current generation, then advances may coalesce.
Build facts a module DECLARES about its own binary at HELLO. The daemon
overlays process-identity evidence it alone can attest; the two halves are
served together via supervisor.provenance and never merged.
A cooperative stop signal that can be created before connecting to the daemon.
Clones share the same, irreversible stop request. Await the serving future
after calling stop; dropping it does not perform teardown.
Daemon-attested target facts. Spawn-only keys are ignored for all other kinds,
which are always unmarked. Incomplete targets decode as absent in the reply.
The scope a route is opened under, re-exported so a caller of
SubcConsumer::open_route_scoped can name the type from this crate.
The scope a route.open asks to be admitted under.
How a registered module’s daemon connection ended. After the handshake, EOF
and socket disconnects are orderly ends on every platform: serving calls
on_connection_end and returns Ok(()). Handshake, handler, protocol and
other transport failures return errors.
Sentinel strings that build tooling emits where it means “no value”: shell
fallbacks and Makefile defaults produce unknown, wire vocabulary uses
unavailable, and git describe failures surface as none. Publishing
any of them as a fact is the well-formed-lie shape the provenance contract
warns against — a present, well-formed field stops the reader asking — so
the helper maps them all to field omission. Matched case-insensitively
because UNKNOWN/Unknown are equally common from shell fallbacks.
The version of THIS crate (subc-protocol) as compiled into the linking
binary — the fleet’s shared wire-vocabulary version, and the value
ManifestProvenance.wire_crate_version declares. Not the version of a
module’s own envelope or payload crates: those are different numbering
spaces, and declaring one here produces a confident wrong answer at any
version gate (insula shipped exactly that before the referent was written
down). env! makes it a property of the compiled binary, not of whatever
source tree sits beside it at run time.
Read the reader-side environment and return the first usable connection file.
Unlike writer-side subc_daemon::bootstrap::connection_file_path(), this searches
every location where an already-running daemon may have written its file.
The paths a reader consults, most specific first. explicit is the
caller’s own override (a --subc flag); env_named is the value of
SUBC_CONNECTION_FILE read by the caller. Either, when present, is the
ONLY candidate.
The one launch-nonce reader for a module process: launch_nonce() reads
the inherited Unix descriptor, the Windows named pipe, or, when neither is
named, the SUBC_LAUNCH_NONCE environment copy once and caches it. The SDK’s
HELLO and route opens go through it too; a module’s own readers must as well.
Read before spawning children so they cannot inherit an unread Unix pipe
containing the module’s credential.
This process’s launch nonce and where it came from.
The cached launch-nonce source (fd, pipe or env), or None when no
nonce is available. The SDK records this in the registration message’s
manifest.provenance.launch_nonce_source; the daemon stores that declaration
for ck provenance to display. A module constructing that record can use:
.with_launch_nonce_source(subc_client_rs::launch_nonce_source()).
Run a module to completion. Reads --subc <connection-file> from args, uses
SUBC_MODULE_ID when set by the process that launched the module, connects,
authenticates, sends HELLO, waits for HELLO_ACK, then serves frames until
GOODBYE, clean EOF or a socket disconnect. How it ended is passed to
ModuleHandler::on_connection_end.
A validated inherited registration channel replaces TCP when available.
It is never reconnected; its end exits the process after the lifecycle hook
and teardown, so the supervisor can restart the module with a new channel.
Run a module with an explicit connection-file path. The manifest is sent as
provided; callers that need a nonstandard module id should set it before calling.