Repository navigation
Expand file tree
/
Copy pathtracker_activity_entry_gen.go
More file actions
157 lines (144 loc) · 5.96 KB
/
Copy pathtracker_activity_entry_gen.go
File metadata and controls
157 lines (144 loc) · 5.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// Code generated by scripts/gen/activitylog; DO NOT EDIT.
// Edit scripts/gen/activitylog/schema.go and run `make gen-activity-schema`.
package tracker
import (
"time"
"github.com/2389-research/tracker/pipeline"
)
// ActivityEntry is a parsed line from activity.jsonl. Populate via
// ParseActivityLine — ActivityEntry is not itself a JSON-wire type because
// tracker has historically used two timestamp formats and time.Time's
// default unmarshal handles only RFC3339Nano.
//
// Marshal/unmarshal contract: do not json.Marshal/json.Unmarshal
// ActivityEntry directly. Use ParseActivityLine and LoadActivityLog for
// decoding and map to your own wire type when encoding.
//
// Field contract: the reader is lossless — every field the runtime writes to
// activity.jsonl is decoded here, and each field's Go name is the same as the
// matching StreamEvent field (tracker_events.go), so replaying a finished run
// from the audit log and following it live over NDJSON read the same names.
// Every field except Timestamp is optional: a line carries only the fields
// its event type emits, so a zero value means "this line does not carry it".
//
// Generated from scripts/gen/activitylog/schema.go, the single field
// authority shared with activityRawLine and the toEntry copier.
type ActivityEntry struct {
// Core identity and payload — present on most lines.
// Timestamp is always set — a line whose ts does not parse is rejected
// outright.
Timestamp time.Time
// Source is the emitting subsystem: "pipeline" (engine), "agent" (LLM
// session), "llm" (raw provider events), or "cli" (CLI-level audit).
Source string
Type string
RunID string
NodeID string
Message string
Error string
// Identity of the emitting LLM call / tool, and its payload text
// (tool output or response preview). Set on agent and llm lines.
Provider string
Model string
ToolName string
Content string
// BundleIdentity is the content-addressed identity of the .dipx bundle
// the run executed against ("sha256:<hex>"); empty for a plain .dip run.
BundleIdentity string
// Decision fields — populated for decision_edge / decision_condition /
// decision_outcome / decision_restart / conditional_fallthrough entries.
// ConditionMatch and RestartCount are pointers precisely so a consumer can
// tell false/0 from absent.
EdgeFrom string
EdgeTo string
EdgeCondition string
EdgePriority string
ConditionMatch *bool
OutcomeStatus string
ContextSnapshot map[string]string
ContextUpdates map[string]string
RestartCount *int
ClearedNodes []string
ConditionsTried []pipeline.ConditionEval
// TokenInput / TokenOutput are the node's session token counts on a
// decision entry — never run-cumulative (that is TotalTokens). Per-turn
// cache-token counts and cost ride on the capture group below.
TokenInput int
TokenOutput int
// Cost snapshot fields — populated for cost_updated and budget_exceeded
// entries. Run-cumulative, not per-node. Estimated is true when any
// contributing session was heuristic-derived.
TotalTokens int
TotalCostUSD float64
ProviderTotals map[string]pipeline.ProviderUsage
WallElapsedMs int64
Estimated bool
// Truncation fields — populated for tool_output_truncated entries (#208).
TruncStream string
TruncLimit int
TruncCaptured int
TruncDropped int
TruncTotal int
// Marker fields — populated for tool_marker_missing entries (#210).
MarkerPattern string
MarkerTail string
MarkerError string
// RouteTail is populated for tool_route_missing entries (#212).
RouteTail string
// Auto-status fields — populated for auto_status_missing entries (#346).
AutoStatusTail string
AutoStatusFailClosed bool
// Override fields — populated for "validation_overridden" entries. Mirror
// the wire-format fields written by the runtime's jsonlLogEntry: the gate
// that produced the override, the label that selected the override edge, who
// acted, and the subgraph_path when propagated up from a child run.
OverrideGate string
OverrideLabel string
OverrideActor pipeline.Actor
OverrideSubgraphPath []string
// Gate lifecycle fields — populated for gate_opened / gate_resolved entries
// (#509). GateID correlates the pair; NodeID identifies the gate node on
// both. Open-time: GateMode, GateLabel, GatePrompt, GateChoices,
// GateQuestions. Resolve-time: GateResponse, GateOutcome, GateActor,
// GateTimedOut (plus Error when the gate failed to collect an answer).
GateID string
GateMode string
GateLabel string
GatePrompt string
GateChoices []string
GateQuestions []pipeline.GateQuestion
GateResponse string
GateOutcome string
GateActor pipeline.Actor
GateTimedOut bool
// Run-reconstruction / capture fields (#519). Mirror the same-named keys on
// pipeline's jsonlLogEntry so the supported reader is lossless (E2).
// SessionID/TurnNo/CallID identify the emitting session/turn/LLM call;
// NodeKind and AttemptNo come from engine state; ToolInput is the
// untruncated tool arguments; the token/cost/duration fields carry per-turn
// economics; FinishReason classifies a turn's end; TerminalStatus is the
// run's authoritative outcome, set on exactly one entry per run.
SessionID string
ParentSessionID string
TurnNo int
AttemptNo int
NodeKind string
ToolInput string
ToolDurationMs int64
CacheReadTokens int
CacheWriteTokens int
ReasoningTokens int
EstimatedCost float64
ContextUtilization float64
ToolCacheHits int
ToolCacheMisses int
TurnDurationMs int64
CallID string
FinishReason string
TerminalStatus string
// ResumeAfter is the provider's rate/usage reset time (RFC3339 string), set
// only on a billing_paused line whose pause carried it (#591). Kept as the
// on-disk string — like TerminalStatus — rather than a typed time.Time so
// the reader stays a pure decode with no reparse.
ResumeAfter string
}