Expand description
Dependency-light, versioned observations for provider-session monitoring.
Observations carry bounded, allowlisted workflow facts. They never carry prompts, transcript text, raw tool input/output, credentials, or provider configuration. Consumers must still treat the evidence source as part of the fact: terminal hints cannot authoritatively claim semantic workflow completion.
Structs§
Enums§
- Block
Authority V1 - WHO or WHAT blocked an action – see
ObservationKindV1::ActionBlocked. A strictly wider vocabulary thanHostDecisionAuthorityV1: the harness itself only ever producesHarnessGate/HarnessPolicy/HarnessDeadline/Operator(see that type’s own variants, which this one mirrors one-for-one for the harness’s own four), but a block can also come from the PROVIDER side of the wire – a classifier, a permission rule, a sandbox, a plain refusal, a hook, or the user declining inside the provider’s own UI – none of whichHostDecisionAuthorityV1has any vocabulary for at all.Unknownis the evidence-gated fallback: seeObservationV1::validate’s pty-hint rule, the only evidence class this crate lets claim it. - Host
Decision Authority V1 - WHO decided a host request the agent sent to the ACP host – see
ObservationKindV1::HostRequestObserved. Mirrorsgate4agent’s ownHostDecisionAuthorityone-for-one; this crate is dependency-light and keeps its own copy rather than depending ongate4agent, the same convention every other*V1wire type here follows. - Host
Request Decision V1 - A typed answer to “what happened to this host request” – see
ObservationKindV1::HostRequestObserved. Mirrorsgate4agent’s ownHostRequestDecisionone-for-one; seeHostDecisionAuthorityV1’s doc comment for why this crate keeps its own copy. - Host
Request Outcome V1 - Whether a
Grantedhost request’s underlying operation actually ran without an I/O or execution problem – see [ObservationKindV1:: HostRequestObserved]. Mirrorsgate4agent’s ownHostRequestOutcomeone-for-one; seeHostDecisionAuthorityV1’s doc comment for why this crate keeps its own copy rather than importing it. - Observation
Evidence V1 - Observation
Interaction Outcome V1 - Observation
Kind V1 - Observation
Source Family V1 - Observation
Todo State V1 - Observation
Validation Error
Constants§
- OBSERVATION_
ACTION_ BLOCKED_ HELP_ MAX_ BYTES - Max bytes for
ObservationKindV1::ActionBlocked::help– the guidance tail a CLI attaches after naming the block (e.g. “add a Bash permission rule”). Larger thanreasonbecause guidance text runs longer than a one-line refusal. - OBSERVATION_
ACTION_ BLOCKED_ REASON_ MAX_ BYTES - Max bytes for
ObservationKindV1::ActionBlocked::reason– the authority’s own refusal sentence (e.g. “blocked by dangerous-command gate: rule=…, argument=…”, or a provider’s “Reason: Blocked by classifier.”). Verbatim and bounded, never summarised – seetruncate_observation_textfor the producer-side cut this bound backs. - OBSERVATION_
COLLECTION_ MAX - OBSERVATION_
DETAIL_ MAX_ BYTES - OBSERVATION_
EVENT_ MAX_ BYTES - OBSERVATION_
LABEL_ MAX_ BYTES - OBSERVATION_
PATH_ MAX_ BYTES - OBSERVATION_
TODO_ ITEMS_ MAX - OBSERVATION_
TODO_ TEXT_ MAX_ BYTES
Functions§
- truncate_
observation_ text - Cuts
valueto at mostmax_bytes, backing off to the nearest UTF-8 character boundary at or before that limit – never inside a multi-byte sequence. Returns(text, true)when a cut was made,(text, false)whenvaluealready fit. This is the one honest way to boundActionBlocked::reason/helpwithout rewriting them: the byte limit is enforced here, at the producer, BEFOREObservationV1::validateever sees the text – that validator rejects an oversize value outright (seevalidate_required_text), it does not truncate. A caller that cuts text with this function is responsible for setting the siblingObservationV1::truncatedfrom the returned bool; this function only makes the cut safe, it does not know how to report having made it.