Probe to Gateway Event Contract v0
Scope
Defines the minimum append-only event contract that Probe uses to report lifecycle, lease, channel, recovery, and capability signals back to Gateway. The contract is metadata-centered and aligned with forward-only, no-transcript persistence rules.Terminology
- Event: immutable metadata record emitted by Probe.
- Monotonic sequence: Probe-local increasing event sequence used for ordering and deduplication.
- Causation: upstream command or event that caused the current event.
Normative Spec
Event Principles
Probe-to-Gateway events MUST follow these rules in v0:- Events are append-only.
- Delivery semantics are at-least-once.
- Gateway MUST support idempotent ingestion.
- Events MUST rely on metadata, not transcript persistence.
Common Event Envelope
All events MUST include:event_idevent_typesession_idresource_idlease_epochmonotonic_seqtimestampcorrelation_idcausation_idpayload
Field Rules
event_idMUST be unique per event emission.lease_epochMUST allow Gateway to discard stale events.monotonic_seqMUST increase monotonically per Probe event stream.correlation_idMUST support trace continuity across command, session, and channel flows.causation_idSHOULD point to the originatingcommand_idor prior event when applicable.
v0 Event Set
Probe MUST support these v0 event types:PhaseChangedLeaseHeartbeatChannelStatusChangedRecoveryAttemptedRecoverySucceededRecoveryFailedSnapshotReadyResourcePressureAdapterFaultCapabilityReported
Event Payload Requirements
PhaseChangedMUST report phase transitions and reason.LeaseHeartbeatMUST report current health and latest heartbeat time.ChannelStatusChangedMUST report channel type, target when relevant, current status, and reason.- Recovery events MUST report at least
actionandretry_count, withreasonorerror_codewhere appropriate. CapabilityReportedSHOULD reference the active capability schema version.
Multi-target Dialog Rule
For dialog-backed targets such ascodex, claude_code, opencode, wechat, and telegram, Probe MUST use the same event schema and MUST NOT introduce target-specific persistence exceptions.
Examples
Error & Recovery
- Stale
lease_epoch: Gateway MUST ignore or reject the event for state mutation purposes. - Duplicate
event_idor replayedmonotonic_seq: Gateway MUST ingest idempotently. - Missing required envelope fields: Gateway MUST reject as invalid event.
- Probe recovery attempts MUST be surfaced through typed recovery events rather than silent local retries.
Security & Audit
- Event ingestion is the canonical source for runtime audit breadcrumbs.
- Events MUST remain metadata-only and MUST NOT carry persisted transcript bodies as payload substitutions.
correlation_idandcausation_idMUST preserve cross-layer traceability.
Status
Current status:draft
Source discussions:
docs/maintainers/conversation-records/agent-platform/2026-03-24-probe-to-gateway-event-contract-v0-draft.mddocs/maintainers/conversation-records/agent-platform/2026-03-24-p0-freeze-result-accepted.md
Changelog
- 2026-03-24: Initial formal v0 event contract created from frozen discussion draft.