Frames to envelopes
An EventDecoder consumes transport frames such as output bytes, stderr, structured messages, or process exit. It produces provider-neutral events. The supervisor adds sequence, timestamp, session, run, provider, and fidelity metadata in an EventEnvelope.
The event taxonomy covers lifecycle, native session identity, turns, visible messages and thoughts, tools, permission requests and resolutions, usage, limits, errors, diagnostics, and namespaced extensions.
Fidelity labels
| Label | Appropriate evidence |
|---|---|
| Native | A documented structured provider message. |
| Inferred | Terminal matching or another semantic heuristic. |
| Synthetic | A supervisor-generated event. |
ThoughtChunk only contains reasoning that the provider chose to display. The contract never claims access to hidden reasoning.
Fidelity travels with visible transcript entries during handoff. A label is not upgraded merely because data passes through the supervisor.
Malformed data should not end a run
Malformed records become protocol violations or diagnostics. Decoders continue with later records and must not panic. Record-level framing failures resynchronize at the next boundary instead of dropping the entire run.
An unrecoverable transport I/O failure or decoder panic is a different condition and can abort the run. The runtime distinguishes these from a bad record.
Limits and completion
Usage-quota interpretation belongs to provider semantics in the decoder. A native terminal adapter that has no decoder of its own gets a general one from the supervisor: the limit wording in terminal output becomes an inferred LimitReached(UsageQuota) event. Events feed RunOutcome rather than directly triggering arbitrary failover. The orchestrator watches the events of the active run for that limit signal.