nemo_gym.token_id_capture.staging.capture
nemo_gym.token_id_capture.staging.capture
Worker-owned, engine-neutral capture with stage-before-response ordering.
Module Contents
Classes
Functions
Data
API
One admitted call, the policy version present at admission, and its resolved prefix.
prefix_token_ids is the exact token prefix the engine prompt must begin
with. begin_call resolves it from the admission’s inline prefix or from
the caller-supplied ids fetched for a staging_chain. Empty for a text root.
Bases: Exception
A caller violated the worker capture lifecycle.
Minimal serving-layer seam used by install_capture.
Build, stage, and acknowledge exact per-call token deltas.
Admit a typed gate contract and stamp its generation weight version.
prefix_token_ids is the resolved parent prefix for a token_in call.
It is required when the admission stores its prefix as a staging_chain:
the caller fetches and concatenates those staged deltas and passes the ids here,
the same list it hands to CaptureAdapter.enter_prefix.
When the admission carries the prefix inline the argument may be omitted;
if given it must match. A text root accepts no prefix.
Violations are caller bugs and raise CaptureError; they never poison the call.
weight_version is supplied when engine-finished metadata owns the
authoritative per-call epoch. Other worker capture paths leave it unset
and read the serving worker’s current version provider instead.
Stage a normalized delta before returning lightweight coordinates.
attachments are opaque framework payloads staged in the same sink
write as the record; they are forwarded untouched and never digested.
Extract engine-native material and stage it as one atomic lifecycle step.
Poison one admitted call that failed before durable staging.
Bases: CaptureError
Worker-owned staging currently accepts only complete responses.
Wire worker-owned staging into one inference serving layer.