@reticlehq/core 3.2.0 → 3.4.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.
Files changed (91) hide show
  1. package/README.md +1 -1
  2. package/dist/artifacts/flow-composition.d.ts +3 -2
  3. package/dist/artifacts/flow-constants.d.ts +68 -2
  4. package/dist/artifacts/flow-constants.js +84 -2
  5. package/dist/artifacts/flow-expect-flat.d.ts +260 -0
  6. package/dist/artifacts/flow-expect-flat.js +284 -0
  7. package/dist/artifacts/flow-mutation-target.d.ts +0 -1
  8. package/dist/artifacts/flow-mutation-target.js +30 -2
  9. package/dist/artifacts/flow-step-tool.d.ts +2 -0
  10. package/dist/artifacts/flow-types.d.ts +1285 -1343
  11. package/dist/artifacts/flow-types.js +111 -140
  12. package/dist/artifacts/impact.d.ts +48 -20
  13. package/dist/artifacts/impact.js +11 -0
  14. package/dist/artifacts/journal.d.ts +34 -6
  15. package/dist/artifacts/journal.js +13 -0
  16. package/dist/hooks/hook-events.d.ts +18 -18
  17. package/dist/hud-entry.d.ts +9 -0
  18. package/dist/hud-entry.js +9 -0
  19. package/dist/identity/source-constants.d.ts +11 -0
  20. package/dist/identity/source-constants.js +11 -0
  21. package/dist/index.d.ts +9 -0
  22. package/dist/index.js +25 -1
  23. package/dist/onboarding.d.ts +2 -2
  24. package/dist/realm/registry.d.ts +0 -8
  25. package/dist/realm/registry.js +1 -11
  26. package/dist/registry/daemon-registry.d.ts +14 -4
  27. package/dist/registry/daemon-registry.js +20 -4
  28. package/dist/schema/event-message.json +3 -1
  29. package/dist/schema/event-payloads.json +72 -0
  30. package/dist/schema/event-type.json +3 -1
  31. package/dist/schema/reticle-event.json +3 -1
  32. package/dist/schema/reticle-message.json +3 -1
  33. package/dist/source-constants.cjs +1 -0
  34. package/dist/source-constants.d.cts +1 -0
  35. package/dist/telemetry-feedback.d.ts +6 -6
  36. package/dist/telemetry-refusal.d.ts +5 -4
  37. package/dist/telemetry-session.d.ts +25 -2
  38. package/dist/telemetry-session.js +13 -0
  39. package/dist/telemetry.d.ts +130 -102
  40. package/dist/verdict/compare-source.d.ts +80 -0
  41. package/dist/verdict/compare-source.js +93 -0
  42. package/dist/verdict/consequence.d.ts +12 -0
  43. package/dist/verdict/consequence.js +15 -0
  44. package/dist/verdict/instrumentation-gap.js +1 -1
  45. package/dist/verdict/intent.d.ts +24 -0
  46. package/dist/verdict/intent.js +66 -10
  47. package/dist/verdict/predicate-tree.d.ts +82 -0
  48. package/dist/verdict/predicate-tree.js +186 -0
  49. package/dist/verdict/predicate.d.ts +138 -0
  50. package/dist/verdict/predicate.js +430 -0
  51. package/dist/verdict/property-assertion.d.ts +191 -0
  52. package/dist/verdict/property-assertion.js +42 -0
  53. package/dist/verdict/security.js +16 -4
  54. package/dist/verdict/verdict-attribution.d.ts +52 -0
  55. package/dist/verdict/verdict-attribution.js +87 -0
  56. package/dist/verdict/verification-run.d.ts +330 -83
  57. package/dist/verdict/verification-run.js +44 -1
  58. package/dist/verdict/verified-constants.d.ts +9 -0
  59. package/dist/verdict/verified-constants.js +9 -0
  60. package/dist/wire/channel.d.ts +10 -0
  61. package/dist/wire/channel.js +25 -0
  62. package/dist/wire/constants/constants.d.ts +65 -102
  63. package/dist/wire/constants/constants.js +79 -101
  64. package/dist/wire/constants/discovery.d.ts +25 -0
  65. package/dist/wire/constants/discovery.js +25 -0
  66. package/dist/wire/constants/event-types.d.ts +122 -0
  67. package/dist/wire/constants/event-types.js +121 -0
  68. package/dist/wire/constants/hud-controls.d.ts +19 -0
  69. package/dist/wire/constants/hud-controls.js +95 -0
  70. package/dist/wire/constants/hud-use.d.ts +27 -0
  71. package/dist/wire/constants/hud-use.js +24 -0
  72. package/dist/wire/constants/session-constants.d.ts +10 -0
  73. package/dist/wire/constants/session-constants.js +10 -0
  74. package/dist/wire/event-payloads.d.ts +72 -13
  75. package/dist/wire/event-payloads.js +26 -4
  76. package/dist/wire/messages.d.ts +97 -56
  77. package/dist/wire/messages.js +17 -0
  78. package/dist/wire/net.d.ts +35 -0
  79. package/dist/wire/net.js +41 -0
  80. package/dist/wire/redaction.js +17 -0
  81. package/dist/wire/state-select.d.ts +2 -1
  82. package/dist/wire/state-select.js +56 -3
  83. package/dist/wire/toon.d.ts +1 -1
  84. package/dist/wire/toon.js +30 -8
  85. package/dist/wire/types.d.ts +119 -94
  86. package/dist/wire/types.js +23 -1
  87. package/dist/words/no-session-reason.d.ts +7 -0
  88. package/dist/words/no-session-reason.js +7 -0
  89. package/dist/words/notices.d.ts +7 -0
  90. package/dist/words/notices.js +9 -2
  91. package/package.json +7 -2
@@ -1,13 +1,29 @@
1
1
  import { z } from 'zod';
2
- import { CROSS_STEP_ADDRESS, FlowStepTool } from './flow-step-tool.js';
2
+ import { CROSS_STEP_ADDRESS } from './flow-step-tool.js';
3
+ import { READABLE_FLOW_VERSIONS } from './flow-constants.js';
3
4
  import { StepEffect } from './step-effect.js';
4
- export { CROSS_STEP_ADDRESS, FlowStepTool } from './flow-step-tool.js';
5
5
  import { ActionType } from '../wire/constants/constants.js';
6
- import { CONSEQUENCE_KINDS } from '../verdict/consequence.js';
6
+ import { CONSEQUENCE_KINDS, PRESENCE_GRADED } from '../verdict/consequence.js';
7
+ import { PredicateKind } from '../verdict/consequence.js';
8
+ import { PredicateSchema } from '../verdict/predicate.js';
9
+ import { sessionBoundField, sessionRefRefusal } from '../verdict/predicate-tree.js';
10
+ import { isConsequenceSource } from '../verdict/compare-source.js';
11
+ import { FlowExpectSchema, flowExpectToPredicate } from './flow-expect-flat.js';
12
+ // The older flat shape and its reader live together; both are re-exported so the one public name
13
+ // for "a flow's types" still answers for them.
14
+ export { FlowExpectSchema } from './flow-expect-flat.js';
7
15
  // Its own directory's constants, which this file had been reaching through `wire/constants/constants.js`
8
16
  // to get -- the clearest cost of that re-export: artifacts went out to wire to fetch a symbol
9
17
  // that had been sitting next door the whole time.
10
- import { AnchorKind, FLOW_FILE_VERSION, FlowStatus, } from './flow-constants.js';
18
+ import { AnchorKind, FlowStatus, } from './flow-constants.js';
19
+ /**
20
+ * The MCP tool names that can appear as a recorded flow step's `tool`. These are the ONLY tool names
21
+ * that cross the wire into a persisted flow file — the browser recorder stamps them, the server replays
22
+ * them, and FlowStep types them — so they live in core, the wire contract. The full agent-facing tool
23
+ * surface stays server-side (ReticleTool); ReticleTool references THESE for the flow-persisted three, so
24
+ * there is one source of truth and a rename cannot silently desync the recorder from the replayer (a
25
+ * tool rename once killed four e2e specs — this closes the browser/server half of that drift).
26
+ */
11
27
  /**
12
28
  * A semantic anchor: how a step re-finds its element/event at replay
13
29
  * time. Never a volatile eXX ref. testid/role+name bind a DOM element; signal binds an event.
@@ -41,131 +57,53 @@ export const FlowAnchorSchema = z.discriminatedUnion('kind', [
41
57
  name: z.string().optional(),
42
58
  }),
43
59
  ]);
60
+ // A ref is one session's address. Kept, it resolves to nothing on replay — and a scope that
61
+ // resolves to nothing SATISFIES an absence check — so the step could never go red. Refused here,
62
+ // on the one schema both the save path and the load path go through.
63
+ export const FlowPredicateSchema = PredicateSchema.superRefine((predicate, ctx) => {
64
+ const field = sessionBoundField(predicate);
65
+ if (field === undefined)
66
+ return;
67
+ ctx.addIssue({
68
+ code: z.ZodIssueCode.custom,
69
+ message: sessionRefRefusal(field),
70
+ });
71
+ });
44
72
  /**
45
- * A post-condition a step asserts (compiled from a structured annotation; optional).
73
+ * Accept either shape and always yield a PREDICATE.
74
+ *
75
+ * A v2 file stores the predicate directly; a v1 file stores the flat struct, and is lifted on read
76
+ * by `flowExpectToPredicate`. The discriminator is `kind`, which every predicate has and no flat
77
+ * expect ever did, so the two can never be confused for one another.
46
78
  *
47
- * Strict, at every nesting level: an unrecognized key (a typo, or a predicate kind this schema
48
- * doesn't model, e.g. `allOf`, or a typo'd `net`/`console`/`element`/`state` sub-field) must fail
49
- * to parse instead of being silently dropped. A loose z.object() here would quietly discard the
50
- * extra key and leave the step with a weaker (or empty) assertion than its author wrote — the
51
- * flow then replays green against nothing, having proved no real regression.
79
+ * Nothing is written back. A v1 file read this way stays a v1 file on disk, which is what makes the
80
+ * migration safe for flows that are committed to a shared repository.
52
81
  */
53
- export const FlowExpectSchema = z
54
- .object({
55
- /**
56
- * The route the step must have reached — the consequence of a NAVIGATION.
57
- *
58
- * Absent until now, and its absence was not a corner case: navigation is one of the commonest
59
- * journeys there is, and every route-asserted drive saved a flow that could never go red. Found
60
- * by driving a real app, where `act_and_wait { until: { kind: "route" } }` returned
61
- * `verified: "yes"` and the flow saved from that same drive graded `assertion-free`.
62
- *
63
- * Additive and optional, so a flow file written before it still parses and FLOW_FILE_VERSION
64
- * stays 1 — the same treatment `signalData` and `signalCount` had.
65
- */
66
- route: z
67
- .object({ pathname: z.string().optional(), contains: z.string().optional() })
68
- .optional(),
69
- signal: z.string().optional(),
70
- /**
71
- * Optional payload shape an `assert-signal` annotation requires the signal
72
- * to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
73
- * bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
74
- */
75
- signalData: z.record(z.unknown()).optional(),
76
- /**
77
- * Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
78
- * only way a saved flow can keep a cardinality the agent actually asserted. Without it a
79
- * `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
80
- * one made: the replayed flow then goes green on the double-fire it was recorded to catch.
81
- * Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
82
- */
83
- signalCount: z.number().int().nonnegative().optional(),
84
- net: z
85
- .object({
86
- method: z.string().optional(),
87
- urlContains: z.string().optional(),
88
- status: z.number().optional(),
89
- /**
90
- * Exact number of matching requests since the action — turns presence into a cardinality
91
- * assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
92
- * the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
93
- */
94
- count: z.number().int().nonnegative().optional(),
95
- })
96
- .strict()
97
- .optional(),
98
- /**
99
- * Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
100
- * console message at `level` (default 'error'). `absent:true` is the common case — "the action
101
- * completed with a clean console" — catching the regression where an action throws a caught error
102
- * / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
103
- */
104
- console: z
105
- .object({
106
- level: z.string().optional(),
107
- absent: z.boolean().optional(),
108
- })
109
- .strict()
110
- .optional(),
111
- element: z
112
- .object({
113
- testid: z.string().optional(),
114
- role: z.string().optional(),
115
- name: z.string().optional(),
116
- })
117
- .strict()
118
- .optional(),
119
- /**
120
- * Rendered text as an end-condition, using the shapes the assert surface already accepts.
121
- *
122
- * The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
123
- * network call on the interaction under test -- a discount price computed and rendered, a
124
- * formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
125
- * vocabulary offered needed a channel that app does not have, so the only honest outcome was
126
- * `assertion-free`, which is a permanent green (#811).
127
- *
128
- * Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
129
- * that could not be pinned.
130
- *
131
- * Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
132
- * DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
133
- * which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
134
- */
135
- text: z
136
- .object({
137
- contains: z.string().min(1),
138
- /** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
139
- scope: z.string().optional(),
140
- /** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
141
- absent: z.boolean().optional(),
142
- /** Require the match to be visible, not merely present in the DOM. */
143
- visible: z.boolean().optional(),
144
- })
145
- .strict()
146
- .optional(),
147
- /**
148
- * Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
149
- * to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
150
- * and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
151
- * or a `{ $gte | $contains | $length }` operator pattern.
152
- */
153
- state: z
154
- .object({
155
- store: z.string().optional(),
156
- path: z.string(),
157
- equals: z.unknown().optional(),
158
- /**
159
- * Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
160
- * condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
161
- * moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
162
- */
163
- hold: z.boolean().optional(),
164
- })
165
- .strict()
166
- .optional(),
167
- })
168
- .strict();
82
+ /*
83
+ * A union rather than a preprocess, and the difference is STRICTNESS.
84
+ *
85
+ * A preprocess lifts the raw object before anything validates it, so a v1 expect carrying a
86
+ * misspelled key would have had that key quietly ignored by the lift and the rest accepted — a
87
+ * stripped field and a green, which is the precise shape this schema was made strict to prevent.
88
+ *
89
+ * Running `FlowExpectSchema` as a branch keeps it: a v2 predicate matches the first branch on its
90
+ * `kind`, a well-formed v1 expect matches the second and is lifted by the transform, and an expect
91
+ * that is neither is refused by both. Strictness at every level of the v1 shape survives unchanged.
92
+ */
93
+ const ExpectSchema = z.union([
94
+ FlowPredicateSchema,
95
+ FlowExpectSchema.transform((expect) => flowExpectToPredicate(expect)),
96
+ ]);
97
+ /**
98
+ * The same lift over a LIST, dropping the entries that assert nothing.
99
+ *
100
+ * `requires` and `ensures` are arrays, and an element that lifts to `undefined` is a claim with no
101
+ * content. Keeping a hole in the list would make `canFollow` compare against nothing and report a
102
+ * precondition as met by a claim that says nothing at all.
103
+ */
104
+ const ExpectListSchema = z
105
+ .array(ExpectSchema)
106
+ .transform((list) => list.filter((one) => one !== undefined));
169
107
  const baseFlowStep = z.object({
170
108
  tool: z.string(),
171
109
  anchor: FlowAnchorSchema,
@@ -195,12 +133,17 @@ const baseFlowStep = z.object({
195
133
  id: z.string().min(1).optional(),
196
134
  /** What this step does to the subject; absent means unknown. See StepEffect. */
197
135
  effect: z.nativeEnum(StepEffect).optional(),
136
+ /** Rebound by `heal` rather than recorded — see FlowStep.healed. */
137
+ healed: z.object({ from: z.string(), at: z.number() }).optional(),
198
138
  action: z.nativeEnum(ActionType).optional(),
199
139
  args: z.record(z.unknown()).optional(),
200
- expect: FlowExpectSchema.optional(),
140
+ expect: ExpectSchema.optional(),
201
141
  degraded: z.boolean().optional(),
202
142
  timeoutMs: z.number().int().positive().optional(),
203
143
  invoke: z.string().min(1).optional(),
144
+ /** See FlowStep.page / FlowStep.endPage. */
145
+ page: z.string().optional(),
146
+ endPage: z.string().optional(),
204
147
  });
205
148
  export const FlowStepSchema = baseFlowStep.extend({
206
149
  steps: z.lazy(() => z.array(FlowStepSchema).optional()),
@@ -211,7 +154,14 @@ export const FlowStepSchema = baseFlowStep.extend({
211
154
  * file with neither still parses — back-compat is locked by a test).
212
155
  */
213
156
  export const FlowFileSchema = z.object({
214
- version: z.literal(FLOW_FILE_VERSION),
157
+ /**
158
+ * The format this file was WRITTEN in. Both readable versions are accepted, because a v1 file is
159
+ * lifted rather than refused — see READABLE_FLOW_VERSIONS.
160
+ */
161
+ version: z
162
+ .number()
163
+ .int()
164
+ .refine((v) => READABLE_FLOW_VERSIONS.has(v)),
215
165
  name: z.string(),
216
166
  /**
217
167
  * The business goal this flow exists to verify, one line (e.g. "ship a deploy to production").
@@ -269,8 +219,16 @@ export const FlowFileSchema = z.object({
269
219
  * Same predicate shape as a step's `expect`, deliberately — a precondition is just a consequence
270
220
  * somebody else's flow was responsible for.
271
221
  */
272
- requires: z.array(FlowExpectSchema).optional(),
273
- ensures: z.array(FlowExpectSchema).optional(),
222
+ requires: ExpectListSchema.optional(),
223
+ ensures: ExpectListSchema.optional(),
224
+ /**
225
+ * Who made this flow, stamped at save: the agent that drove it (its MCP client name) and the
226
+ * person signed in to the cloud key on that machine. Either is absent when it was not known —
227
+ * never guessed.
228
+ */
229
+ author: z
230
+ .object({ agent: z.string().min(1).optional(), person: z.string().min(1).optional() })
231
+ .optional(),
274
232
  /** From the injected clock (ms) — deterministic in tests, byte-stable on disk. */
275
233
  createdAt: z.number(),
276
234
  steps: z.array(FlowStepSchema),
@@ -283,7 +241,7 @@ export const FlowFileSchema = z.object({
283
241
  * replays exactly as before and the on-disk version stays FLOW_FILE_VERSION 1.
284
242
  */
285
243
  signalTimeoutMs: z.number().int().positive().optional(),
286
- success: FlowExpectSchema.optional(),
244
+ success: ExpectSchema.optional(),
287
245
  /**
288
246
  * Anchors whose CONTENT must not be asserted (e.g. LLM output). Replay asserts
289
247
  * presence, not words. Compiled from a `mark-dynamic` annotation.
@@ -431,14 +389,9 @@ export function staleKnownBugs(notes, currentAssertions) {
431
389
  }
432
390
  /** True when a FlowExpect asserts at least one consequence (any of the ConsequenceKind fields set). */
433
391
  export function flowExpectHasConsequence(expect) {
434
- if (expect === undefined)
435
- return false;
436
- const fields = expect;
437
- for (const kind of CONSEQUENCE_KINDS) {
438
- if (fields[kind] !== undefined)
439
- return true;
440
- }
441
- return false;
392
+ return expectClauses(expect).some((clause) => CONSEQUENCE_KINDS.has(clause.kind) ||
393
+ (PredicateKind.COMPARE === clause.kind &&
394
+ (isConsequenceSource(clause.left) || isConsequenceSource(clause.right))));
442
395
  }
443
396
  /**
444
397
  * True when a FlowExpect checks ONLY presence — an element, rendered text or a route, no consequence.
@@ -459,5 +412,23 @@ export function flowExpectHasConsequence(expect) {
459
412
  export function flowExpectIsPresenceOnly(expect) {
460
413
  if (expect === undefined || flowExpectHasConsequence(expect))
461
414
  return false;
462
- return expect.element !== undefined || expect.text !== undefined || expect.route !== undefined;
415
+ // A `compare` reaching here reads text on both sides, which is two readings of the same DOM.
416
+ return expectClauses(expect).some((clause) => PRESENCE_GRADED.has(clause.kind) || PredicateKind.COMPARE === clause.kind);
417
+ }
418
+ /**
419
+ * Every clause an expectation contains, composites flattened.
420
+ *
421
+ * The grade is about what a flow CAN prove, so a consequence buried in an `allOf` counts exactly as
422
+ * much as one at the top. It got simpler with the tree rather than harder: the old version had to
423
+ * probe a struct for one key per kind, and a predicate carries its kind on itself.
424
+ */
425
+ function expectClauses(expect) {
426
+ if (expect === undefined)
427
+ return [];
428
+ if (PredicateKind.ALL_OF === expect.kind || PredicateKind.ANY_OF === expect.kind) {
429
+ return expect.predicates.flatMap(expectClauses);
430
+ }
431
+ if (PredicateKind.NOT === expect.kind)
432
+ return expectClauses(expect.predicate);
433
+ return [expect];
463
434
  }
@@ -255,13 +255,13 @@ export declare const ImpactDefectSchema: z.ZodObject<{
255
255
  }, "strip", z.ZodTypeAny, {
256
256
  at: number;
257
257
  title: string;
258
- source?: string | undefined;
259
258
  detail?: string | undefined;
259
+ source?: string | undefined;
260
260
  }, {
261
261
  at: number;
262
262
  title: string;
263
- source?: string | undefined;
264
263
  detail?: string | undefined;
264
+ source?: string | undefined;
265
265
  }>;
266
266
  export type ImpactDefect = z.infer<typeof ImpactDefectSchema>;
267
267
  /** One scope of the record: this project, or everything on this machine. */
@@ -470,13 +470,13 @@ export declare const ImpactScopeSchema: z.ZodObject<{
470
470
  }, "strip", z.ZodTypeAny, {
471
471
  at: number;
472
472
  title: string;
473
- source?: string | undefined;
474
473
  detail?: string | undefined;
474
+ source?: string | undefined;
475
475
  }, {
476
476
  at: number;
477
477
  title: string;
478
- source?: string | undefined;
479
478
  detail?: string | undefined;
479
+ source?: string | undefined;
480
480
  }>, "many">>;
481
481
  }, "strip", z.ZodTypeAny, {
482
482
  since: number;
@@ -527,8 +527,8 @@ export declare const ImpactScopeSchema: z.ZodObject<{
527
527
  defects: {
528
528
  at: number;
529
529
  title: string;
530
- source?: string | undefined;
531
530
  detail?: string | undefined;
531
+ source?: string | undefined;
532
532
  }[];
533
533
  }, {
534
534
  since: number;
@@ -579,8 +579,8 @@ export declare const ImpactScopeSchema: z.ZodObject<{
579
579
  defects?: {
580
580
  at: number;
581
581
  title: string;
582
- source?: string | undefined;
583
582
  detail?: string | undefined;
583
+ source?: string | undefined;
584
584
  }[] | undefined;
585
585
  }>;
586
586
  export type ImpactScope = z.infer<typeof ImpactScopeSchema>;
@@ -639,6 +639,17 @@ export declare const HarnessOfferSchema: z.ZodObject<{
639
639
  daysRemaining: z.ZodOptional<z.ZodNumber>;
640
640
  /** Where claiming happens. Absent ⇒ the HUD shows nothing, because a pitch with no door is noise. */
641
641
  claimUrl: z.ZodOptional<z.ZodString>;
642
+ /**
643
+ * Whether a drive could actually run if the offer were taken.
644
+ *
645
+ * Entitlement is not readiness. A workspace can be fully entitled against a deployment that holds
646
+ * no key for its provider, and then every signal reads healthy while a drive cannot start —
647
+ * including the card, which would sell three free months of something unusable and burn the one
648
+ * claim the person gets. Absent means "not told", which is treated as drivable for the same
649
+ * reason `claimed` is required and the rest are not: silence from an older platform must not
650
+ * switch the feature off.
651
+ */
652
+ drivable: z.ZodOptional<z.ZodBoolean>;
642
653
  /**
643
654
  * Whether claiming would still grant anything.
644
655
  *
@@ -654,12 +665,14 @@ export declare const HarnessOfferSchema: z.ZodObject<{
654
665
  expiresAt?: number | undefined;
655
666
  daysRemaining?: number | undefined;
656
667
  claimUrl?: string | undefined;
668
+ drivable?: boolean | undefined;
657
669
  eligible?: boolean | undefined;
658
670
  }, {
659
671
  claimed: boolean;
660
672
  expiresAt?: number | undefined;
661
673
  daysRemaining?: number | undefined;
662
674
  claimUrl?: string | undefined;
675
+ drivable?: boolean | undefined;
663
676
  eligible?: boolean | undefined;
664
677
  }>;
665
678
  export type HarnessOffer = z.infer<typeof HarnessOfferSchema>;
@@ -892,13 +905,13 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
892
905
  }, "strip", z.ZodTypeAny, {
893
906
  at: number;
894
907
  title: string;
895
- source?: string | undefined;
896
908
  detail?: string | undefined;
909
+ source?: string | undefined;
897
910
  }, {
898
911
  at: number;
899
912
  title: string;
900
- source?: string | undefined;
901
913
  detail?: string | undefined;
914
+ source?: string | undefined;
902
915
  }>, "many">>;
903
916
  }, "strip", z.ZodTypeAny, {
904
917
  since: number;
@@ -949,8 +962,8 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
949
962
  defects: {
950
963
  at: number;
951
964
  title: string;
952
- source?: string | undefined;
953
965
  detail?: string | undefined;
966
+ source?: string | undefined;
954
967
  }[];
955
968
  }, {
956
969
  since: number;
@@ -1001,8 +1014,8 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1001
1014
  defects?: {
1002
1015
  at: number;
1003
1016
  title: string;
1004
- source?: string | undefined;
1005
1017
  detail?: string | undefined;
1018
+ source?: string | undefined;
1006
1019
  }[] | undefined;
1007
1020
  }>;
1008
1021
  global: z.ZodObject<{
@@ -1210,13 +1223,13 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1210
1223
  }, "strip", z.ZodTypeAny, {
1211
1224
  at: number;
1212
1225
  title: string;
1213
- source?: string | undefined;
1214
1226
  detail?: string | undefined;
1227
+ source?: string | undefined;
1215
1228
  }, {
1216
1229
  at: number;
1217
1230
  title: string;
1218
- source?: string | undefined;
1219
1231
  detail?: string | undefined;
1232
+ source?: string | undefined;
1220
1233
  }>, "many">>;
1221
1234
  }, "strip", z.ZodTypeAny, {
1222
1235
  since: number;
@@ -1267,8 +1280,8 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1267
1280
  defects: {
1268
1281
  at: number;
1269
1282
  title: string;
1270
- source?: string | undefined;
1271
1283
  detail?: string | undefined;
1284
+ source?: string | undefined;
1272
1285
  }[];
1273
1286
  }, {
1274
1287
  since: number;
@@ -1319,8 +1332,8 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1319
1332
  defects?: {
1320
1333
  at: number;
1321
1334
  title: string;
1322
- source?: string | undefined;
1323
1335
  detail?: string | undefined;
1336
+ source?: string | undefined;
1324
1337
  }[] | undefined;
1325
1338
  }>;
1326
1339
  /** Project name, for the report's title row. */
@@ -1365,6 +1378,17 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1365
1378
  daysRemaining: z.ZodOptional<z.ZodNumber>;
1366
1379
  /** Where claiming happens. Absent ⇒ the HUD shows nothing, because a pitch with no door is noise. */
1367
1380
  claimUrl: z.ZodOptional<z.ZodString>;
1381
+ /**
1382
+ * Whether a drive could actually run if the offer were taken.
1383
+ *
1384
+ * Entitlement is not readiness. A workspace can be fully entitled against a deployment that holds
1385
+ * no key for its provider, and then every signal reads healthy while a drive cannot start —
1386
+ * including the card, which would sell three free months of something unusable and burn the one
1387
+ * claim the person gets. Absent means "not told", which is treated as drivable for the same
1388
+ * reason `claimed` is required and the rest are not: silence from an older platform must not
1389
+ * switch the feature off.
1390
+ */
1391
+ drivable: z.ZodOptional<z.ZodBoolean>;
1368
1392
  /**
1369
1393
  * Whether claiming would still grant anything.
1370
1394
  *
@@ -1380,12 +1404,14 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1380
1404
  expiresAt?: number | undefined;
1381
1405
  daysRemaining?: number | undefined;
1382
1406
  claimUrl?: string | undefined;
1407
+ drivable?: boolean | undefined;
1383
1408
  eligible?: boolean | undefined;
1384
1409
  }, {
1385
1410
  claimed: boolean;
1386
1411
  expiresAt?: number | undefined;
1387
1412
  daysRemaining?: number | undefined;
1388
1413
  claimUrl?: string | undefined;
1414
+ drivable?: boolean | undefined;
1389
1415
  eligible?: boolean | undefined;
1390
1416
  }>>;
1391
1417
  /**
@@ -1416,6 +1442,7 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1416
1442
  harnessEntitled: boolean;
1417
1443
  }>>;
1418
1444
  }, "strip", z.ZodTypeAny, {
1445
+ schemaVersion: number;
1419
1446
  project: {
1420
1447
  since: number;
1421
1448
  counts: {
@@ -1465,11 +1492,10 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1465
1492
  defects: {
1466
1493
  at: number;
1467
1494
  title: string;
1468
- source?: string | undefined;
1469
1495
  detail?: string | undefined;
1496
+ source?: string | undefined;
1470
1497
  }[];
1471
1498
  };
1472
- schemaVersion: number;
1473
1499
  global: {
1474
1500
  since: number;
1475
1501
  counts: {
@@ -1519,8 +1545,8 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1519
1545
  defects: {
1520
1546
  at: number;
1521
1547
  title: string;
1522
- source?: string | undefined;
1523
1548
  detail?: string | undefined;
1549
+ source?: string | undefined;
1524
1550
  }[];
1525
1551
  };
1526
1552
  projectName?: string | undefined;
@@ -1536,6 +1562,7 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1536
1562
  expiresAt?: number | undefined;
1537
1563
  daysRemaining?: number | undefined;
1538
1564
  claimUrl?: string | undefined;
1565
+ drivable?: boolean | undefined;
1539
1566
  eligible?: boolean | undefined;
1540
1567
  } | undefined;
1541
1568
  harnessConfig?: {
@@ -1544,6 +1571,7 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1544
1571
  harnessEntitled: boolean;
1545
1572
  } | undefined;
1546
1573
  }, {
1574
+ schemaVersion: number;
1547
1575
  project: {
1548
1576
  since: number;
1549
1577
  counts: {
@@ -1593,11 +1621,10 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1593
1621
  defects?: {
1594
1622
  at: number;
1595
1623
  title: string;
1596
- source?: string | undefined;
1597
1624
  detail?: string | undefined;
1625
+ source?: string | undefined;
1598
1626
  }[] | undefined;
1599
1627
  };
1600
- schemaVersion: number;
1601
1628
  global: {
1602
1629
  since: number;
1603
1630
  counts: {
@@ -1647,8 +1674,8 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1647
1674
  defects?: {
1648
1675
  at: number;
1649
1676
  title: string;
1650
- source?: string | undefined;
1651
1677
  detail?: string | undefined;
1678
+ source?: string | undefined;
1652
1679
  }[] | undefined;
1653
1680
  };
1654
1681
  projectName?: string | undefined;
@@ -1664,6 +1691,7 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1664
1691
  expiresAt?: number | undefined;
1665
1692
  daysRemaining?: number | undefined;
1666
1693
  claimUrl?: string | undefined;
1694
+ drivable?: boolean | undefined;
1667
1695
  eligible?: boolean | undefined;
1668
1696
  } | undefined;
1669
1697
  harnessConfig?: {
@@ -159,6 +159,17 @@ export const HarnessOfferSchema = z.object({
159
159
  daysRemaining: z.number().optional(),
160
160
  /** Where claiming happens. Absent ⇒ the HUD shows nothing, because a pitch with no door is noise. */
161
161
  claimUrl: z.string().optional(),
162
+ /**
163
+ * Whether a drive could actually run if the offer were taken.
164
+ *
165
+ * Entitlement is not readiness. A workspace can be fully entitled against a deployment that holds
166
+ * no key for its provider, and then every signal reads healthy while a drive cannot start —
167
+ * including the card, which would sell three free months of something unusable and burn the one
168
+ * claim the person gets. Absent means "not told", which is treated as drivable for the same
169
+ * reason `claimed` is required and the rest are not: silence from an older platform must not
170
+ * switch the feature off.
171
+ */
172
+ drivable: z.boolean().optional(),
162
173
  /**
163
174
  * Whether claiming would still grant anything.
164
175
  *
@@ -162,6 +162,32 @@ export declare const JournalVerdictEffectSchema: z.ZodObject<{
162
162
  }>;
163
163
  /** `file:line` for the element driven, when the page told us one. */
164
164
  source: z.ZodOptional<z.ZodString>;
165
+ /**
166
+ * Which source of truth answering the claim required -- the predicate's own kind.
167
+ *
168
+ * A run folded from this journal has to say what a check READ, and with no field here it had
169
+ * nothing to say it from: every check ever folded was stamped `element`, including the ones whose
170
+ * own `grade` in the same object said `net`. Channel routing reads this, so a network verdict
171
+ * arrived as a UI verdict.
172
+ *
173
+ * Optional, because a record written before this field existed has no kind and must not be read
174
+ * as though it had one.
175
+ */
176
+ kind: z.ZodOptional<z.ZodNativeEnum<{
177
+ readonly ELEMENT: "element";
178
+ readonly TEXT: "text";
179
+ readonly SIGNAL: "signal";
180
+ readonly NET: "net";
181
+ readonly STATE: "state";
182
+ readonly ROUTE: "route";
183
+ readonly CONSOLE: "console";
184
+ readonly ANIMATION: "animation";
185
+ readonly SETTLED: "settled";
186
+ readonly COMPARE: "compare";
187
+ readonly ALL_OF: "allOf";
188
+ readonly ANY_OF: "anyOf";
189
+ readonly NOT: "not";
190
+ }>>;
165
191
  /**
166
192
  * Was the claim written down BEFORE the action, or after it?
167
193
  *
@@ -200,19 +226,21 @@ export declare const JournalVerdictEffectSchema: z.ZodObject<{
200
226
  reason: z.ZodOptional<z.ZodString>;
201
227
  }, "strip", z.ZodTypeAny, {
202
228
  claim: string;
203
- verified: "unknown" | "yes" | "no" | "no-fault";
204
- source?: string | undefined;
205
- reason?: string | undefined;
229
+ verified: "yes" | "no" | "unknown" | "no-fault";
230
+ kind?: "signal" | "net" | "state" | "element" | "text" | "route" | "console" | "animation" | "settled" | "compare" | "allOf" | "anyOf" | "not" | undefined;
206
231
  declaredBeforeActing?: boolean | undefined;
207
232
  grade?: string | undefined;
208
233
  couldNotSee?: string[] | undefined;
234
+ reason?: string | undefined;
235
+ source?: string | undefined;
209
236
  }, {
210
237
  claim: string;
211
- verified: "unknown" | "yes" | "no" | "no-fault";
212
- source?: string | undefined;
213
- reason?: string | undefined;
238
+ verified: "yes" | "no" | "unknown" | "no-fault";
239
+ kind?: "signal" | "net" | "state" | "element" | "text" | "route" | "console" | "animation" | "settled" | "compare" | "allOf" | "anyOf" | "not" | undefined;
214
240
  declaredBeforeActing?: boolean | undefined;
215
241
  grade?: string | undefined;
216
242
  couldNotSee?: string[] | undefined;
243
+ reason?: string | undefined;
244
+ source?: string | undefined;
217
245
  }>;
218
246
  export type JournalVerdictEffect = z.infer<typeof JournalVerdictEffectSchema>;