Skip to main content

Module node_projection

Module node_projection 

Source
Expand description

Projection of a gate4agent node’s own event stream onto the observation vocabulary.

The node publishes NodeEvent::Control (session lifecycle and provider events) and the agent stream; it names no observation type. This module is the harness side of that boundary: it derives ObservationV1 telemetry from those events, deterministically, so the same node cursor observed twice – directly and through C2, or replayed on resync – projects to equal observations.

Three inputs feed it:

  • a control event (control_event_observations) – lifecycle, turns, tools, usage, plans, subagents, interactions, host-request audit;
  • an agent-stream Blocked chunk (blocked_chunk_observation) – the blocked-action fact, computed once by the node and only mapped here;
  • a record history summary (history_summary_observations) – the counts the node publishes when a client previews a session record.

Functions§

blocked_chunk_observation
The ActionBlocked observation for one agent-stream Blocked chunk, or None for every other chunk.
control_event_observations
The observations one node control event projects to, in the order they were minted. Deterministic: the same event always yields the same observations (observed_at_unix_ms is left unset – the receive time lives on the ingress envelope), so the same node cursor observed twice compares canonically equal.
history_summary_observations
The observations one session record history summary projects to: the declaration that this record reports a history summary, and the aggregate snapshot itself. Both are HistoryProjection evidence and deterministic; source_sequence is the record modification time (1 when the history has none), so a newer history orders after an older one.