Documentation
¶
Overview ¶
Package trajectory defines the normalized event schema every agent adapter maps its native stream onto. The drift engine and trigger measurement read only this schema, so adding an agent never touches scoring code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct {
Seq int `json:"seq"`
TS time.Time `json:"ts"`
Type EventType `json:"type"`
Name string `json:"name,omitempty"`
ArgsDigest string `json:"args_digest,omitempty"`
Paths []string `json:"paths,omitempty"`
// ExitCode is a pointer so that a real exit code of 0 is distinguishable
// from "no exit code was reported". With a plain int and omitempty, every
// successful command would serialize as if it had never run.
ExitCode *int `json:"exit_code,omitempty"`
TextDigest string `json:"text_digest,omitempty"`
}
Event is one normalized step in an agent's trajectory. Arguments and message text are digested rather than stored: trajectories are retained for scoring, and the raw text can contain workspace contents and credentials.
func Contractable ¶
Contractable filters a trajectory down to the events a contract may be scored against, preserving order.
func (Event) Contractable ¶
Contractable reports whether the event may be evaluated against a contract.
type EventType ¶
type EventType string
EventType is the normalized event vocabulary.
const ( TypeMessage EventType = "message" TypeToolCall EventType = "tool_call" TypeToolResult EventType = "tool_result" TypeShell EventType = "shell" TypeFileRead EventType = "file_read" TypeFileWrite EventType = "file_write" TypeSkillRead EventType = "skill_read" TypeAskUser EventType = "ask_user" // TypeOpaque is what a parser emits for a native event it does not // recognise. Opaque events are recorded but never scored: they are excluded // from contract denominators so that an unmapped event — a new tool, a // changed CLI format — cannot be counted as a contract violation. TypeOpaque EventType = "opaque" )