tickmarkr 1.87.0 → 1.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/catalog.d.ts +18 -1
- package/dist/adapters/catalog.js +44 -1
- package/dist/adapters/fake.d.ts +2 -1
- package/dist/adapters/fake.js +7 -0
- package/dist/adapters/grok.js +11 -0
- package/dist/adapters/kimi.d.ts +2 -1
- package/dist/adapters/kimi.js +36 -0
- package/dist/adapters/opencode.js +17 -0
- package/dist/adapters/pi.js +11 -0
- package/dist/adapters/prompt.js +8 -1
- package/dist/adapters/registry.js +76 -57
- package/dist/adapters/types.d.ts +34 -3
- package/dist/adapters/types.js +99 -1
- package/dist/cli/commands/approve.d.ts +2 -0
- package/dist/cli/commands/approve.js +104 -84
- package/dist/cli/commands/compile.d.ts +1 -1
- package/dist/cli/commands/compile.js +29 -12
- package/dist/cli/commands/init.js +1 -1
- package/dist/cli/commands/plan.d.ts +1 -1
- package/dist/cli/commands/plan.js +10 -1
- package/dist/cli/commands/report.js +49 -0
- package/dist/cli/commands/status.js +298 -96
- package/dist/cli/harness.d.ts +13 -0
- package/dist/cli/harness.js +50 -0
- package/dist/compile/collateral.js +4 -4
- package/dist/compile/index.d.ts +14 -3
- package/dist/compile/index.js +36 -10
- package/dist/compile/native.js +101 -25
- package/dist/drivers/subprocess.d.ts +6 -1
- package/dist/drivers/subprocess.js +9 -4
- package/dist/gates/acceptance.d.ts +21 -1
- package/dist/gates/acceptance.js +67 -22
- package/dist/gates/artifact-manifest.d.ts +119 -0
- package/dist/gates/artifact-manifest.js +357 -0
- package/dist/gates/baseline.d.ts +6 -0
- package/dist/gates/baseline.js +52 -7
- package/dist/gates/llm.js +37 -26
- package/dist/gates/review.d.ts +16 -11
- package/dist/gates/review.js +44 -150
- package/dist/gates/run-gates.js +124 -7
- package/dist/graph/schema.d.ts +3 -1
- package/dist/graph/schema.js +4 -1
- package/dist/run/daemon.d.ts +42 -0
- package/dist/run/daemon.js +2321 -1967
- package/dist/run/git.d.ts +50 -0
- package/dist/run/git.js +113 -2
- package/dist/run/interactive-seed.d.ts +6 -2
- package/dist/run/interactive-seed.js +72 -5
- package/dist/run/journal.d.ts +9 -1
- package/dist/run/journal.js +99 -9
- package/dist/run/lock.d.ts +11 -0
- package/dist/run/lock.js +97 -6
- package/dist/run/outcome.d.ts +50 -0
- package/dist/run/outcome.js +152 -0
- package/dist/run/protocol.d.ts +460 -0
- package/dist/run/protocol.js +433 -0
- package/dist/run/supervision.d.ts +29 -0
- package/dist/run/supervision.js +189 -0
- package/fixtures/wrapped-acceptance.native.md +29 -0
- package/package.json +1 -1
- package/schema/rungraph.schema.json +21 -2
- package/skills/tickmarkr-overseer/SKILL.md +257 -5
- package/skills/tickmarkr-overseer/scripts/watch-artifacts.sh +79 -8
- package/skills/tickmarkr-overseer/scripts/watch-contamination.sh +77 -0
- package/skills/tickmarkr-overseer/scripts/watch-context.sh +86 -0
- package/skills/tickmarkr-overseer/scripts/watch-parks.sh +96 -0
- package/skills/tickmarkr-overseer/scripts/watch-pending-input.sh +183 -0
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type GateName } from "../graph/schema.js";
|
|
3
|
+
import { type GateOutcome } from "./outcome.js";
|
|
4
|
+
/** The T31 outcome vocabulary, made executable and strict at the persistence boundary. */
|
|
5
|
+
export declare const GateOutcomeSchema: z.ZodType<GateOutcome>;
|
|
6
|
+
export declare const ROLE_INVOCATION_ROLES: readonly ["worker", "judge", "review", "consult"];
|
|
7
|
+
export type RoleInvocationRole = (typeof ROLE_INVOCATION_ROLES)[number];
|
|
8
|
+
export declare const ROLE_INVOCATION_OUTCOMES: readonly ["completed", "failed", "unavailable"];
|
|
9
|
+
export type RoleInvocationOutcome = (typeof ROLE_INVOCATION_OUTCOMES)[number];
|
|
10
|
+
export declare const RUN_TERMINAL_OUTCOMES: readonly ["completed", "failed", "incomplete"];
|
|
11
|
+
export type RunTerminalOutcome = (typeof RUN_TERMINAL_OUTCOMES)[number];
|
|
12
|
+
export declare const GatePhaseStartEventSchema: z.ZodObject<{
|
|
13
|
+
ts: z.ZodString;
|
|
14
|
+
event: z.ZodLiteral<"gate-phase-start">;
|
|
15
|
+
taskId: z.ZodString;
|
|
16
|
+
data: z.ZodObject<{
|
|
17
|
+
attempt: z.ZodNumber;
|
|
18
|
+
gate: z.ZodEnum<{
|
|
19
|
+
build: "build";
|
|
20
|
+
test: "test";
|
|
21
|
+
lint: "lint";
|
|
22
|
+
evidence: "evidence";
|
|
23
|
+
scope: "scope";
|
|
24
|
+
acceptance: "acceptance";
|
|
25
|
+
review: "review";
|
|
26
|
+
}>;
|
|
27
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
export declare const GateTerminalEventSchema: z.ZodObject<{
|
|
31
|
+
ts: z.ZodString;
|
|
32
|
+
event: z.ZodLiteral<"gate-result">;
|
|
33
|
+
taskId: z.ZodString;
|
|
34
|
+
data: z.ZodObject<{
|
|
35
|
+
attempt: z.ZodNumber;
|
|
36
|
+
gate: z.ZodEnum<{
|
|
37
|
+
build: "build";
|
|
38
|
+
test: "test";
|
|
39
|
+
lint: "lint";
|
|
40
|
+
evidence: "evidence";
|
|
41
|
+
scope: "scope";
|
|
42
|
+
acceptance: "acceptance";
|
|
43
|
+
review: "review";
|
|
44
|
+
}>;
|
|
45
|
+
outcome: z.ZodType<GateOutcome, unknown, z.core.$ZodTypeInternals<GateOutcome, unknown>>;
|
|
46
|
+
details: z.ZodOptional<z.ZodString>;
|
|
47
|
+
load: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
48
|
+
oneMinute: z.ZodNumber;
|
|
49
|
+
fiveMinute: z.ZodNumber;
|
|
50
|
+
cores: z.ZodNumber;
|
|
51
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
52
|
+
unavailableReason: z.ZodString;
|
|
53
|
+
}, z.core.$strict>]>>;
|
|
54
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
}, z.core.$strict>;
|
|
57
|
+
export declare const RoleInvocationStartEventSchema: z.ZodObject<{
|
|
58
|
+
ts: z.ZodString;
|
|
59
|
+
event: z.ZodLiteral<"role-invocation-start">;
|
|
60
|
+
taskId: z.ZodString;
|
|
61
|
+
data: z.ZodObject<{
|
|
62
|
+
attempt: z.ZodNumber;
|
|
63
|
+
role: z.ZodEnum<{
|
|
64
|
+
review: "review";
|
|
65
|
+
judge: "judge";
|
|
66
|
+
consult: "consult";
|
|
67
|
+
worker: "worker";
|
|
68
|
+
}>;
|
|
69
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
70
|
+
model: z.ZodOptional<z.ZodString>;
|
|
71
|
+
vendor: z.ZodOptional<z.ZodString>;
|
|
72
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
}, z.core.$strict>;
|
|
75
|
+
export declare const RoleInvocationTerminalEventSchema: z.ZodObject<{
|
|
76
|
+
ts: z.ZodString;
|
|
77
|
+
event: z.ZodLiteral<"role-invocation-terminal">;
|
|
78
|
+
taskId: z.ZodString;
|
|
79
|
+
data: z.ZodObject<{
|
|
80
|
+
attempt: z.ZodNumber;
|
|
81
|
+
role: z.ZodEnum<{
|
|
82
|
+
review: "review";
|
|
83
|
+
judge: "judge";
|
|
84
|
+
consult: "consult";
|
|
85
|
+
worker: "worker";
|
|
86
|
+
}>;
|
|
87
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
88
|
+
model: z.ZodOptional<z.ZodString>;
|
|
89
|
+
vendor: z.ZodOptional<z.ZodString>;
|
|
90
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
91
|
+
outcome: z.ZodEnum<{
|
|
92
|
+
failed: "failed";
|
|
93
|
+
unavailable: "unavailable";
|
|
94
|
+
completed: "completed";
|
|
95
|
+
}>;
|
|
96
|
+
reason: z.ZodString;
|
|
97
|
+
tokens: z.ZodOptional<z.ZodObject<{
|
|
98
|
+
input: z.ZodNumber;
|
|
99
|
+
output: z.ZodNumber;
|
|
100
|
+
cacheRead: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
cacheWrite: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
reasoning: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
unmeteredReason: z.ZodOptional<z.ZodString>;
|
|
105
|
+
}, z.core.$strict>;
|
|
106
|
+
}, z.core.$strict>;
|
|
107
|
+
export declare const RunTerminalEventSchema: z.ZodObject<{
|
|
108
|
+
ts: z.ZodString;
|
|
109
|
+
event: z.ZodLiteral<"run-end">;
|
|
110
|
+
data: z.ZodObject<{
|
|
111
|
+
outcome: z.ZodEnum<{
|
|
112
|
+
failed: "failed";
|
|
113
|
+
completed: "completed";
|
|
114
|
+
incomplete: "incomplete";
|
|
115
|
+
}>;
|
|
116
|
+
reason: z.ZodString;
|
|
117
|
+
runId: z.ZodString;
|
|
118
|
+
branch: z.ZodString;
|
|
119
|
+
done: z.ZodArray<z.ZodString>;
|
|
120
|
+
failed: z.ZodArray<z.ZodString>;
|
|
121
|
+
human: z.ZodArray<z.ZodString>;
|
|
122
|
+
blocked: z.ZodArray<z.ZodString>;
|
|
123
|
+
pending: z.ZodArray<z.ZodString>;
|
|
124
|
+
tipVerify: z.ZodOptional<z.ZodEnum<{
|
|
125
|
+
failed: "failed";
|
|
126
|
+
passed: "passed";
|
|
127
|
+
}>>;
|
|
128
|
+
lastMergedTask: z.ZodOptional<z.ZodString>;
|
|
129
|
+
approvalDisposition: z.ZodOptional<z.ZodEnum<{
|
|
130
|
+
complete: "complete";
|
|
131
|
+
outstanding: "outstanding";
|
|
132
|
+
}>>;
|
|
133
|
+
outstandingApprovals: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
134
|
+
phase: z.ZodOptional<z.ZodString>;
|
|
135
|
+
fatal: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
+
error: z.ZodOptional<z.ZodString>;
|
|
137
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
}, z.core.$strict>;
|
|
140
|
+
/**
|
|
141
|
+
* The complete decision-event vocabulary. There is no catch-all object arm: an event claiming one of
|
|
142
|
+
* these names either validates as exactly one member or becomes a protocol issue on read.
|
|
143
|
+
*/
|
|
144
|
+
export declare const DecisionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
145
|
+
ts: z.ZodString;
|
|
146
|
+
event: z.ZodLiteral<"gate-phase-start">;
|
|
147
|
+
taskId: z.ZodString;
|
|
148
|
+
data: z.ZodObject<{
|
|
149
|
+
attempt: z.ZodNumber;
|
|
150
|
+
gate: z.ZodEnum<{
|
|
151
|
+
build: "build";
|
|
152
|
+
test: "test";
|
|
153
|
+
lint: "lint";
|
|
154
|
+
evidence: "evidence";
|
|
155
|
+
scope: "scope";
|
|
156
|
+
acceptance: "acceptance";
|
|
157
|
+
review: "review";
|
|
158
|
+
}>;
|
|
159
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
160
|
+
}, z.core.$strict>;
|
|
161
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
162
|
+
ts: z.ZodString;
|
|
163
|
+
event: z.ZodLiteral<"gate-result">;
|
|
164
|
+
taskId: z.ZodString;
|
|
165
|
+
data: z.ZodObject<{
|
|
166
|
+
attempt: z.ZodNumber;
|
|
167
|
+
gate: z.ZodEnum<{
|
|
168
|
+
build: "build";
|
|
169
|
+
test: "test";
|
|
170
|
+
lint: "lint";
|
|
171
|
+
evidence: "evidence";
|
|
172
|
+
scope: "scope";
|
|
173
|
+
acceptance: "acceptance";
|
|
174
|
+
review: "review";
|
|
175
|
+
}>;
|
|
176
|
+
outcome: z.ZodType<GateOutcome, unknown, z.core.$ZodTypeInternals<GateOutcome, unknown>>;
|
|
177
|
+
details: z.ZodOptional<z.ZodString>;
|
|
178
|
+
load: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
179
|
+
oneMinute: z.ZodNumber;
|
|
180
|
+
fiveMinute: z.ZodNumber;
|
|
181
|
+
cores: z.ZodNumber;
|
|
182
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
183
|
+
unavailableReason: z.ZodString;
|
|
184
|
+
}, z.core.$strict>]>>;
|
|
185
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
186
|
+
}, z.core.$strict>;
|
|
187
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
188
|
+
ts: z.ZodString;
|
|
189
|
+
event: z.ZodLiteral<"role-invocation-start">;
|
|
190
|
+
taskId: z.ZodString;
|
|
191
|
+
data: z.ZodObject<{
|
|
192
|
+
attempt: z.ZodNumber;
|
|
193
|
+
role: z.ZodEnum<{
|
|
194
|
+
review: "review";
|
|
195
|
+
judge: "judge";
|
|
196
|
+
consult: "consult";
|
|
197
|
+
worker: "worker";
|
|
198
|
+
}>;
|
|
199
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
200
|
+
model: z.ZodOptional<z.ZodString>;
|
|
201
|
+
vendor: z.ZodOptional<z.ZodString>;
|
|
202
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
203
|
+
}, z.core.$strict>;
|
|
204
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
205
|
+
ts: z.ZodString;
|
|
206
|
+
event: z.ZodLiteral<"role-invocation-terminal">;
|
|
207
|
+
taskId: z.ZodString;
|
|
208
|
+
data: z.ZodObject<{
|
|
209
|
+
attempt: z.ZodNumber;
|
|
210
|
+
role: z.ZodEnum<{
|
|
211
|
+
review: "review";
|
|
212
|
+
judge: "judge";
|
|
213
|
+
consult: "consult";
|
|
214
|
+
worker: "worker";
|
|
215
|
+
}>;
|
|
216
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
217
|
+
model: z.ZodOptional<z.ZodString>;
|
|
218
|
+
vendor: z.ZodOptional<z.ZodString>;
|
|
219
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
220
|
+
outcome: z.ZodEnum<{
|
|
221
|
+
failed: "failed";
|
|
222
|
+
unavailable: "unavailable";
|
|
223
|
+
completed: "completed";
|
|
224
|
+
}>;
|
|
225
|
+
reason: z.ZodString;
|
|
226
|
+
tokens: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
input: z.ZodNumber;
|
|
228
|
+
output: z.ZodNumber;
|
|
229
|
+
cacheRead: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
cacheWrite: z.ZodOptional<z.ZodNumber>;
|
|
231
|
+
reasoning: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
}, z.core.$strict>>;
|
|
233
|
+
unmeteredReason: z.ZodOptional<z.ZodString>;
|
|
234
|
+
}, z.core.$strict>;
|
|
235
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
236
|
+
ts: z.ZodString;
|
|
237
|
+
event: z.ZodLiteral<"run-end">;
|
|
238
|
+
data: z.ZodObject<{
|
|
239
|
+
outcome: z.ZodEnum<{
|
|
240
|
+
failed: "failed";
|
|
241
|
+
completed: "completed";
|
|
242
|
+
incomplete: "incomplete";
|
|
243
|
+
}>;
|
|
244
|
+
reason: z.ZodString;
|
|
245
|
+
runId: z.ZodString;
|
|
246
|
+
branch: z.ZodString;
|
|
247
|
+
done: z.ZodArray<z.ZodString>;
|
|
248
|
+
failed: z.ZodArray<z.ZodString>;
|
|
249
|
+
human: z.ZodArray<z.ZodString>;
|
|
250
|
+
blocked: z.ZodArray<z.ZodString>;
|
|
251
|
+
pending: z.ZodArray<z.ZodString>;
|
|
252
|
+
tipVerify: z.ZodOptional<z.ZodEnum<{
|
|
253
|
+
failed: "failed";
|
|
254
|
+
passed: "passed";
|
|
255
|
+
}>>;
|
|
256
|
+
lastMergedTask: z.ZodOptional<z.ZodString>;
|
|
257
|
+
approvalDisposition: z.ZodOptional<z.ZodEnum<{
|
|
258
|
+
complete: "complete";
|
|
259
|
+
outstanding: "outstanding";
|
|
260
|
+
}>>;
|
|
261
|
+
outstandingApprovals: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
262
|
+
phase: z.ZodOptional<z.ZodString>;
|
|
263
|
+
fatal: z.ZodOptional<z.ZodBoolean>;
|
|
264
|
+
error: z.ZodOptional<z.ZodString>;
|
|
265
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
266
|
+
}, z.core.$strict>;
|
|
267
|
+
}, z.core.$strict>], "event">;
|
|
268
|
+
export type DecisionEvent = z.infer<typeof DecisionEventSchema>;
|
|
269
|
+
export declare const DecisionEventWriteSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
270
|
+
data: z.ZodObject<{
|
|
271
|
+
attempt: z.ZodNumber;
|
|
272
|
+
gate: z.ZodEnum<{
|
|
273
|
+
build: "build";
|
|
274
|
+
test: "test";
|
|
275
|
+
lint: "lint";
|
|
276
|
+
evidence: "evidence";
|
|
277
|
+
scope: "scope";
|
|
278
|
+
acceptance: "acceptance";
|
|
279
|
+
review: "review";
|
|
280
|
+
}>;
|
|
281
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
282
|
+
}, z.core.$strict>;
|
|
283
|
+
taskId: z.ZodString;
|
|
284
|
+
event: z.ZodLiteral<"gate-phase-start">;
|
|
285
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
286
|
+
data: z.ZodObject<{
|
|
287
|
+
attempt: z.ZodNumber;
|
|
288
|
+
gate: z.ZodEnum<{
|
|
289
|
+
build: "build";
|
|
290
|
+
test: "test";
|
|
291
|
+
lint: "lint";
|
|
292
|
+
evidence: "evidence";
|
|
293
|
+
scope: "scope";
|
|
294
|
+
acceptance: "acceptance";
|
|
295
|
+
review: "review";
|
|
296
|
+
}>;
|
|
297
|
+
outcome: z.ZodType<GateOutcome, unknown, z.core.$ZodTypeInternals<GateOutcome, unknown>>;
|
|
298
|
+
details: z.ZodOptional<z.ZodString>;
|
|
299
|
+
load: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
300
|
+
oneMinute: z.ZodNumber;
|
|
301
|
+
fiveMinute: z.ZodNumber;
|
|
302
|
+
cores: z.ZodNumber;
|
|
303
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
304
|
+
unavailableReason: z.ZodString;
|
|
305
|
+
}, z.core.$strict>]>>;
|
|
306
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
307
|
+
}, z.core.$strict>;
|
|
308
|
+
taskId: z.ZodString;
|
|
309
|
+
event: z.ZodLiteral<"gate-result">;
|
|
310
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
311
|
+
data: z.ZodObject<{
|
|
312
|
+
attempt: z.ZodNumber;
|
|
313
|
+
role: z.ZodEnum<{
|
|
314
|
+
review: "review";
|
|
315
|
+
judge: "judge";
|
|
316
|
+
consult: "consult";
|
|
317
|
+
worker: "worker";
|
|
318
|
+
}>;
|
|
319
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
320
|
+
model: z.ZodOptional<z.ZodString>;
|
|
321
|
+
vendor: z.ZodOptional<z.ZodString>;
|
|
322
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
323
|
+
}, z.core.$strict>;
|
|
324
|
+
taskId: z.ZodString;
|
|
325
|
+
event: z.ZodLiteral<"role-invocation-start">;
|
|
326
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
327
|
+
data: z.ZodObject<{
|
|
328
|
+
attempt: z.ZodNumber;
|
|
329
|
+
role: z.ZodEnum<{
|
|
330
|
+
review: "review";
|
|
331
|
+
judge: "judge";
|
|
332
|
+
consult: "consult";
|
|
333
|
+
worker: "worker";
|
|
334
|
+
}>;
|
|
335
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
336
|
+
model: z.ZodOptional<z.ZodString>;
|
|
337
|
+
vendor: z.ZodOptional<z.ZodString>;
|
|
338
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
339
|
+
outcome: z.ZodEnum<{
|
|
340
|
+
failed: "failed";
|
|
341
|
+
unavailable: "unavailable";
|
|
342
|
+
completed: "completed";
|
|
343
|
+
}>;
|
|
344
|
+
reason: z.ZodString;
|
|
345
|
+
tokens: z.ZodOptional<z.ZodObject<{
|
|
346
|
+
input: z.ZodNumber;
|
|
347
|
+
output: z.ZodNumber;
|
|
348
|
+
cacheRead: z.ZodOptional<z.ZodNumber>;
|
|
349
|
+
cacheWrite: z.ZodOptional<z.ZodNumber>;
|
|
350
|
+
reasoning: z.ZodOptional<z.ZodNumber>;
|
|
351
|
+
}, z.core.$strict>>;
|
|
352
|
+
unmeteredReason: z.ZodOptional<z.ZodString>;
|
|
353
|
+
}, z.core.$strict>;
|
|
354
|
+
taskId: z.ZodString;
|
|
355
|
+
event: z.ZodLiteral<"role-invocation-terminal">;
|
|
356
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
357
|
+
data: z.ZodObject<{
|
|
358
|
+
outcome: z.ZodEnum<{
|
|
359
|
+
failed: "failed";
|
|
360
|
+
completed: "completed";
|
|
361
|
+
incomplete: "incomplete";
|
|
362
|
+
}>;
|
|
363
|
+
reason: z.ZodString;
|
|
364
|
+
runId: z.ZodString;
|
|
365
|
+
branch: z.ZodString;
|
|
366
|
+
done: z.ZodArray<z.ZodString>;
|
|
367
|
+
failed: z.ZodArray<z.ZodString>;
|
|
368
|
+
human: z.ZodArray<z.ZodString>;
|
|
369
|
+
blocked: z.ZodArray<z.ZodString>;
|
|
370
|
+
pending: z.ZodArray<z.ZodString>;
|
|
371
|
+
tipVerify: z.ZodOptional<z.ZodEnum<{
|
|
372
|
+
failed: "failed";
|
|
373
|
+
passed: "passed";
|
|
374
|
+
}>>;
|
|
375
|
+
lastMergedTask: z.ZodOptional<z.ZodString>;
|
|
376
|
+
approvalDisposition: z.ZodOptional<z.ZodEnum<{
|
|
377
|
+
complete: "complete";
|
|
378
|
+
outstanding: "outstanding";
|
|
379
|
+
}>>;
|
|
380
|
+
outstandingApprovals: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
381
|
+
phase: z.ZodOptional<z.ZodString>;
|
|
382
|
+
fatal: z.ZodOptional<z.ZodBoolean>;
|
|
383
|
+
error: z.ZodOptional<z.ZodString>;
|
|
384
|
+
evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
385
|
+
}, z.core.$strict>;
|
|
386
|
+
event: z.ZodLiteral<"run-end">;
|
|
387
|
+
}, z.core.$strict>], "event">;
|
|
388
|
+
export type DecisionEventWrite = z.infer<typeof DecisionEventWriteSchema>;
|
|
389
|
+
export declare const DECISION_EVENT_NAMES: readonly ["gate-phase-start", "gate-result", "role-invocation-start", "role-invocation-terminal", "run-end"];
|
|
390
|
+
type AssertNever<T extends never> = T;
|
|
391
|
+
export type UntabledDecisionEventName = AssertNever<Exclude<DecisionEvent["event"], (typeof DECISION_EVENT_NAMES)[number]>>;
|
|
392
|
+
export interface JournalSourceRow {
|
|
393
|
+
/** Zero-based physical JSONL line index. Blank and torn lines retain their place in this index. */
|
|
394
|
+
sourceIndex: number;
|
|
395
|
+
raw: unknown;
|
|
396
|
+
}
|
|
397
|
+
export interface InterpretedDecisionEvent {
|
|
398
|
+
kind: "decision";
|
|
399
|
+
runId: string;
|
|
400
|
+
sourceIndex: number;
|
|
401
|
+
event: DecisionEvent;
|
|
402
|
+
/** Original parsed JSON, retained even when a legacy row was normalized for interpretation. */
|
|
403
|
+
raw: unknown;
|
|
404
|
+
rawData: unknown;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Compatibility is deliberately opaque for event names outside the decision vocabulary. Arbitrary
|
|
408
|
+
* historical payloads survive byte-for-byte through `raw`; no unknown type can be mistaken for a
|
|
409
|
+
* successful decision merely because it happened to contain pass-like fields.
|
|
410
|
+
*/
|
|
411
|
+
export interface HistoricalUnknownEvent {
|
|
412
|
+
kind: "historical-unknown";
|
|
413
|
+
runId: string;
|
|
414
|
+
sourceIndex: number;
|
|
415
|
+
eventType?: string;
|
|
416
|
+
raw: unknown;
|
|
417
|
+
rawData: unknown;
|
|
418
|
+
}
|
|
419
|
+
export interface ProtocolIssue {
|
|
420
|
+
kind: "protocol-issue";
|
|
421
|
+
runId: string;
|
|
422
|
+
sourceIndex: number;
|
|
423
|
+
eventType: DecisionEvent["event"];
|
|
424
|
+
issues: string[];
|
|
425
|
+
raw: unknown;
|
|
426
|
+
rawData: unknown;
|
|
427
|
+
}
|
|
428
|
+
/** Closed tracked-reader result: decision, opaque historical unknown, or visible protocol failure. */
|
|
429
|
+
export type TrackedJournalRow = InterpretedDecisionEvent | HistoricalUnknownEvent | ProtocolIssue;
|
|
430
|
+
/** Interpret every parseable JSONL row without dropping unknown or malformed-known events. */
|
|
431
|
+
export declare function trackJournalRows(runId: string, sourceRows: readonly JournalSourceRow[]): TrackedJournalRow[];
|
|
432
|
+
export type PairRole = RoleInvocationRole | `gate:${GateName}`;
|
|
433
|
+
export interface PairIdentity {
|
|
434
|
+
runId: string;
|
|
435
|
+
taskId: string;
|
|
436
|
+
attempt: number;
|
|
437
|
+
role: PairRole;
|
|
438
|
+
}
|
|
439
|
+
export interface PairIntegrityRecord {
|
|
440
|
+
identity: PairIdentity;
|
|
441
|
+
state: "closed" | "open" | "invalid";
|
|
442
|
+
startSourceIndexes: number[];
|
|
443
|
+
terminalSourceIndexes: number[];
|
|
444
|
+
}
|
|
445
|
+
export interface PairIntegrityIssue {
|
|
446
|
+
kind: "duplicate-start" | "duplicate-terminal" | "terminal-without-start" | "malformed-decision";
|
|
447
|
+
identity?: PairIdentity;
|
|
448
|
+
sourceIndexes: number[];
|
|
449
|
+
reason: string;
|
|
450
|
+
}
|
|
451
|
+
export interface PairIntegrityFold {
|
|
452
|
+
pairs: PairIntegrityRecord[];
|
|
453
|
+
issues: PairIntegrityIssue[];
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Structural pair fold only. It does not reduce task or run state. An open start remains observable as
|
|
457
|
+
* open; duplicate starts/terminals and orphan terminals are invalid and never count as a closed pair.
|
|
458
|
+
*/
|
|
459
|
+
export declare function foldPairIntegrity(rows: readonly TrackedJournalRow[]): PairIntegrityFold;
|
|
460
|
+
export {};
|