nemo_gym.trajectory.trajectory_record
nemo_gym.trajectory.trajectory_record
Shared contracts for rollout observations and trajectories.
Module Contents
Classes
Functions
Data
NG_AGENT_SANDBOX_OBSERVATION_KEY
API
An Agent response and the observations available at its execution boundary.
Bases: ObservationModel
One agent activation or subagent invocation observed by a harness.
A harness’s saved session may span several invocations; harness_session_id
retains that context while invocation_id owns each activation’s evidence.
Harness adapters should report an iteration-limit event through an
on_iteration_limit_reached(*, invocation_id: str) -> None observer hook.
The hook records stop_reason="max_iterations" once on that invocation,
leaving parent invocations, budgets, and summary generation alone. Harnesses
with native stop events can call it directly; compatibility shims may call it
at the point where the harness detects its limit.
Bases: ObservationModel
Normalized observations returned by one Agent Server for one rollout.
Require unique invocation IDs and reject cycles in the observed parent graph.
Bases: ObservationModel
An explicit context-compaction event reported by the Agent harness.
Bases: ObservationModel
A source-reviewed grading calculation actually executed inside a verifier invocation.
llm_judge grades from judge calls made through call_judge; its dependencies are those calls’ model and
response ids, and it completes only when the reviewed call site marked an explicitly parsed verdict.
Bases: ObservationModel
Stable identifiers an Agent integration can observe for one model call.
Bases: ObservationModel
A fact that the selected integration could not observe or join exactly.
A supplied owner constrains the span; missing ownership never selects between matches.
Bases: BaseModel
Bases: ObservationModel
A model call the server sent again with its output budget lowered, because the budget it requested exceeded the engine’s whole context window.
Bases: ObservationModel
Outcome and lifetime resource usage reported by a sandbox-owning harness.
Bases: ObservationModel
Raw tool evidence; span and parent IDs are local to its producer until imported.
Bases: ObservationModel
Bases: ObservationModel
The attempt-qualified episode identity (called rollout_id in v1).
Bases: ObservationModel
Bases: ToolCallObservation
Canonical tool attempt with qualified span IDs and model-visible output.
Unlike raw ToolCallObservation inputs, these IDs have already crossed the import boundary and must remain unchanged on replay.
Bases: ObservationModel
Bases: ObservationModel
The grade a verifier returned without asking any model, recorded by the shared verify path.
It names the verifier (its resources server), the score and the verifier’s verdict on it (masked when the
verifier marked the score as no valid measurement), and binds the graded response and score like a grading
operation. A verify execution that sent a model request records none: its grading is observed only through
its captured calls.
Bases: ObservationModel
One verify() execution, its outcome, and all model attempts made while grading.
Captured calls establish ownership. The shared verify boundary records the execution outcome, including for programmatic verifiers with no model calls.
Exclude explicitly verifier-owned attempts from agent and step joins.
Keep the existing typed observation slots across an unsuccessful HTTP reply.
Error strings are not searched recursively: only producer-owned top-level fields are accepted, and malformed observations remain unavailable.
Bind the actual graded response and numeric reward/components, without exporting their payload.
Join captured calls to agent invocations and their compactions without guessing ownership.
Join persisted messages to HTTP attempts using session, message and model-server IDs.
Run after invocation ownership resolution. Summary attempts belong to compactions; calls without a saved message (for example title generation) stay invocation-owned. Producers declare source_message_id(s), source_model_ref and invocation IDs. Source labels are not dispatch keys. No content or timing fallback is used.
Return only cycle members in the same-instance tool-parent relation.