@reticlehq/core 2.11.0 → 2.13.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 (58) hide show
  1. package/dist/constants.d.ts +40 -0
  2. package/dist/constants.js +41 -1
  3. package/dist/dev-server-registry.d.ts +85 -0
  4. package/dist/dev-server-registry.js +120 -0
  5. package/dist/document-identity.d.ts +39 -0
  6. package/dist/document-identity.js +53 -0
  7. package/dist/edit-epoch.d.ts +36 -0
  8. package/dist/edit-epoch.js +40 -0
  9. package/dist/event-payloads.d.ts +24 -4
  10. package/dist/event-payloads.js +13 -1
  11. package/dist/findings.d.ts +62 -0
  12. package/dist/findings.js +75 -0
  13. package/dist/flow-types.d.ts +88 -0
  14. package/dist/flow-types.js +22 -0
  15. package/dist/impact.d.ts +176 -0
  16. package/dist/impact.js +36 -0
  17. package/dist/index.d.ts +8 -0
  18. package/dist/index.js +9 -0
  19. package/dist/instrumentation-gap.d.ts +59 -1
  20. package/dist/instrumentation-gap.js +0 -0
  21. package/dist/intent.d.ts +332 -0
  22. package/dist/intent.js +133 -0
  23. package/dist/journal.d.ts +33 -0
  24. package/dist/journal.js +20 -0
  25. package/dist/messages.d.ts +84 -10
  26. package/dist/messages.js +20 -0
  27. package/dist/net.d.ts +34 -0
  28. package/dist/net.js +86 -0
  29. package/dist/no-session-reason.d.ts +35 -0
  30. package/dist/no-session-reason.js +34 -0
  31. package/dist/notices.d.ts +79 -6
  32. package/dist/notices.js +83 -6
  33. package/dist/run-context.d.ts +122 -0
  34. package/dist/run-context.js +118 -0
  35. package/dist/schema/event-message.json +10 -0
  36. package/dist/schema/event-type.json +1 -0
  37. package/dist/schema/reticle-event.json +10 -0
  38. package/dist/schema/reticle-message.json +10 -0
  39. package/dist/security.d.ts +8 -2
  40. package/dist/security.js +37 -3
  41. package/dist/session-constants.d.ts +8 -0
  42. package/dist/session-constants.js +8 -0
  43. package/dist/source-constants.cjs +9 -0
  44. package/dist/source-constants.d.cts +4 -0
  45. package/dist/telemetry-license.d.ts +12 -0
  46. package/dist/telemetry-license.js +12 -0
  47. package/dist/telemetry-refusal.d.ts +94 -0
  48. package/dist/telemetry-refusal.js +61 -0
  49. package/dist/telemetry-session.d.ts +151 -2
  50. package/dist/telemetry-session.js +114 -0
  51. package/dist/telemetry.d.ts +167 -95
  52. package/dist/telemetry.js +46 -44
  53. package/dist/types.d.ts +9 -0
  54. package/dist/unreachable-notice.d.ts +19 -0
  55. package/dist/unreachable-notice.js +26 -0
  56. package/dist/verified-constants.d.ts +8 -0
  57. package/dist/verified-constants.js +10 -0
  58. package/package.json +6 -2
@@ -21,6 +21,29 @@ export declare const ContradictionKind: {
21
21
  readonly SIGNAL_CONTRADICTED: "signal-contradicted";
22
22
  /** A write succeeded on the server and nothing on the client moved — the response went nowhere. */
23
23
  readonly RESPONSE_IGNORED: "response-ignored";
24
+ /**
25
+ * The app fired a success signal and NOTHING else in the window moved — no DOM, no store, no
26
+ * route, no request. The only evidence that anything happened is the app's own claim.
27
+ *
28
+ * `DEAD_CONTROL` describes almost exactly this and deliberately excludes it: its definition is
29
+ * "dispatched but the app did NOTHING (no DOM/net/route/signal)", so firing a signal was enough to
30
+ * rescue a control that did nothing at all. That is the hole. An app whose signal is emitted from
31
+ * the value it was ASKED for rather than the one it COMMITTED gets a verdict at signal grade —
32
+ * the strongest we award — for a click that changed nothing. Measured on the bench fixture: a
33
+ * modal that never opened came back `verified: "yes" / proved`.
34
+ *
35
+ * Absence-derived on purpose (see below). "Nothing corroborated it" is not "it did not happen":
36
+ * a signal about genuinely non-visual state is legitimate. This downgrades the verdict to UNKNOWN
37
+ * so the false green cannot stand, without asserting a fault nobody proved.
38
+ */
39
+ readonly SIGNAL_WITHOUT_CONSEQUENCE: "signal-without-consequence";
40
+ /**
41
+ * A write succeeded on the server and nothing moved in THIS document — because the page opened
42
+ * another browsing context (an OAuth popup is the archetype) and the consequence lives there,
43
+ * where an in-page SDK cannot follow. Reported instead of response-ignored, which would read as
44
+ * "the client ignored the response" about a client that did no such thing.
45
+ */
46
+ readonly CONSEQUENCE_ELSEWHERE: "consequence-elsewhere";
24
47
  /** The same write fired more than once in one action — double-submit / retry storm. */
25
48
  readonly DUPLICATE_REQUEST: "duplicate-request";
26
49
  /**
@@ -108,6 +131,45 @@ export declare const ContradictionKind: {
108
131
  * working does not), so it is reported with that ceiling stated rather than tuned into silence.
109
132
  */
110
133
  readonly ROUTE_RENDERED_NOTHING: "route-rendered-nothing";
134
+ /**
135
+ * Everything this window held belongs to a document that has SINCE been replaced.
136
+ *
137
+ * Not a disagreement between channels; a disagreement between the evidence and the clock. A window
138
+ * is scoped by time and by ring-buffer capacity, so it can still hold the network calls, console
139
+ * errors and signals of a page that a full navigation or a reload has already thrown away. Citing
140
+ * one of those as the cause of an action taken now is true about the bytes and false about the
141
+ * world — reported from the field with a failing request that named a database row which no longer
142
+ * exists.
143
+ *
144
+ * Dropping that evidence is only half the fix. The other half is that its absence must not read as
145
+ * "nothing happened", which would trade a wrong citation for a wrong all-clear, and an all-clear is
146
+ * the more expensive of the two. This kind is what the engine says instead, and the distinction is
147
+ * the whole user-visible point: an agent told its evidence was superseded knows to re-drive, and an
148
+ * agent told the window was empty does not.
149
+ */
150
+ readonly EVIDENCE_SUPERSEDED: "evidence-superseded";
151
+ /**
152
+ * Everything this window held was observed BEFORE the last source edit landed in the page.
153
+ *
154
+ * The sibling of `EVIDENCE_SUPERSEDED`, for the loop an agent actually runs: verify, edit source,
155
+ * verify again. A hot update replaces modules and re-renders inside the SAME document, so the
156
+ * document id — the only thing that could previously say "this evidence is about a page that is
157
+ * gone" — never moves, and observations of code the agent has already rewritten go on answering
158
+ * for it in silence.
159
+ *
160
+ * Reported rather than EXCLUDED, and the difference from the document case is deliberate. A
161
+ * navigation is total: it throws away the page, the refs, the in-flight requests and the state, so
162
+ * nothing recorded under it is still about the world. An edit is not. Most modules, most of the
163
+ * DOM, the whole network log and every console line survive a hot update, so most of what was
164
+ * observed a second before it is still true a second after. Dropping that window would empty
165
+ * verdicts that hold real findings, and an emptied window reads as "nothing happened" — the more
166
+ * expensive of the two wrong answers, and the one this family of checks exists to prevent.
167
+ *
168
+ * So the evidence stays and the caveat is said out loud: absence-derived, because nothing here
169
+ * claims the app is wrong. It downgrades a verdict to unknown, which is the honest reading of
170
+ * "you changed the code and then looked only at what happened before you did".
171
+ */
172
+ readonly EVIDENCE_PREDATES_EDIT: "evidence-predates-edit";
111
173
  };
112
174
  export type ContradictionKind = (typeof ContradictionKind)[keyof typeof ContradictionKind];
113
175
  /**
package/dist/findings.js CHANGED
@@ -21,6 +21,29 @@ export const ContradictionKind = {
21
21
  SIGNAL_CONTRADICTED: 'signal-contradicted',
22
22
  /** A write succeeded on the server and nothing on the client moved — the response went nowhere. */
23
23
  RESPONSE_IGNORED: 'response-ignored',
24
+ /**
25
+ * The app fired a success signal and NOTHING else in the window moved — no DOM, no store, no
26
+ * route, no request. The only evidence that anything happened is the app's own claim.
27
+ *
28
+ * `DEAD_CONTROL` describes almost exactly this and deliberately excludes it: its definition is
29
+ * "dispatched but the app did NOTHING (no DOM/net/route/signal)", so firing a signal was enough to
30
+ * rescue a control that did nothing at all. That is the hole. An app whose signal is emitted from
31
+ * the value it was ASKED for rather than the one it COMMITTED gets a verdict at signal grade —
32
+ * the strongest we award — for a click that changed nothing. Measured on the bench fixture: a
33
+ * modal that never opened came back `verified: "yes" / proved`.
34
+ *
35
+ * Absence-derived on purpose (see below). "Nothing corroborated it" is not "it did not happen":
36
+ * a signal about genuinely non-visual state is legitimate. This downgrades the verdict to UNKNOWN
37
+ * so the false green cannot stand, without asserting a fault nobody proved.
38
+ */
39
+ SIGNAL_WITHOUT_CONSEQUENCE: 'signal-without-consequence',
40
+ /**
41
+ * A write succeeded on the server and nothing moved in THIS document — because the page opened
42
+ * another browsing context (an OAuth popup is the archetype) and the consequence lives there,
43
+ * where an in-page SDK cannot follow. Reported instead of response-ignored, which would read as
44
+ * "the client ignored the response" about a client that did no such thing.
45
+ */
46
+ CONSEQUENCE_ELSEWHERE: 'consequence-elsewhere',
24
47
  /** The same write fired more than once in one action — double-submit / retry storm. */
25
48
  DUPLICATE_REQUEST: 'duplicate-request',
26
49
  /**
@@ -108,6 +131,45 @@ export const ContradictionKind = {
108
131
  * working does not), so it is reported with that ceiling stated rather than tuned into silence.
109
132
  */
110
133
  ROUTE_RENDERED_NOTHING: 'route-rendered-nothing',
134
+ /**
135
+ * Everything this window held belongs to a document that has SINCE been replaced.
136
+ *
137
+ * Not a disagreement between channels; a disagreement between the evidence and the clock. A window
138
+ * is scoped by time and by ring-buffer capacity, so it can still hold the network calls, console
139
+ * errors and signals of a page that a full navigation or a reload has already thrown away. Citing
140
+ * one of those as the cause of an action taken now is true about the bytes and false about the
141
+ * world — reported from the field with a failing request that named a database row which no longer
142
+ * exists.
143
+ *
144
+ * Dropping that evidence is only half the fix. The other half is that its absence must not read as
145
+ * "nothing happened", which would trade a wrong citation for a wrong all-clear, and an all-clear is
146
+ * the more expensive of the two. This kind is what the engine says instead, and the distinction is
147
+ * the whole user-visible point: an agent told its evidence was superseded knows to re-drive, and an
148
+ * agent told the window was empty does not.
149
+ */
150
+ EVIDENCE_SUPERSEDED: 'evidence-superseded',
151
+ /**
152
+ * Everything this window held was observed BEFORE the last source edit landed in the page.
153
+ *
154
+ * The sibling of `EVIDENCE_SUPERSEDED`, for the loop an agent actually runs: verify, edit source,
155
+ * verify again. A hot update replaces modules and re-renders inside the SAME document, so the
156
+ * document id — the only thing that could previously say "this evidence is about a page that is
157
+ * gone" — never moves, and observations of code the agent has already rewritten go on answering
158
+ * for it in silence.
159
+ *
160
+ * Reported rather than EXCLUDED, and the difference from the document case is deliberate. A
161
+ * navigation is total: it throws away the page, the refs, the in-flight requests and the state, so
162
+ * nothing recorded under it is still about the world. An edit is not. Most modules, most of the
163
+ * DOM, the whole network log and every console line survive a hot update, so most of what was
164
+ * observed a second before it is still true a second after. Dropping that window would empty
165
+ * verdicts that hold real findings, and an emptied window reads as "nothing happened" — the more
166
+ * expensive of the two wrong answers, and the one this family of checks exists to prevent.
167
+ *
168
+ * So the evidence stays and the caveat is said out loud: absence-derived, because nothing here
169
+ * claims the app is wrong. It downgrades a verdict to unknown, which is the honest reading of
170
+ * "you changed the code and then looked only at what happened before you did".
171
+ */
172
+ EVIDENCE_PREDATES_EDIT: 'evidence-predates-edit',
111
173
  };
112
174
  /**
113
175
  * Contradictions inferred from the ABSENCE of evidence in a window whose end Reticle itself chose.
@@ -140,9 +202,22 @@ export const ContradictionKind = {
140
202
  export const ABSENCE_DERIVED_CONTRADICTIONS = new Set([
141
203
  ContradictionKind.REQUEST_NEVER_SETTLED,
142
204
  ContradictionKind.RESPONSE_IGNORED,
205
+ // The app said something happened and nothing corroborated it. That is an absence of agreement,
206
+ // never proof the app is wrong — a signal about non-visual state has nothing to corroborate it by
207
+ // construction. UNKNOWN removes the false green; NO would invent a fault.
208
+ ContradictionKind.SIGNAL_WITHOUT_CONSEQUENCE,
209
+ // The consequence is not missing, it is somewhere this document's SDK cannot look — a claim about
210
+ // the reach of the observation, never a positive fault in the app.
211
+ ContradictionKind.CONSEQUENCE_ELSEWHERE,
143
212
  ContradictionKind.ROUTE_RENDERED_NOTHING,
144
213
  ContradictionKind.ACTION_HAD_NO_EFFECT,
145
214
  ContradictionKind.DUPLICATE_REQUEST,
215
+ // Absence in the strictest sense: the evidence that would have answered the question was thrown
216
+ // away with the document it belonged to. Nothing here says the app is wrong, so it must downgrade
217
+ // the verdict to UNKNOWN rather than assert NO — the same reasoning `unclean_capture` follows.
218
+ ContradictionKind.EVIDENCE_SUPERSEDED,
219
+ // Nothing here says the app is wrong either — only that the window predates the edit under test.
220
+ ContradictionKind.EVIDENCE_PREDATES_EDIT,
146
221
  ]);
147
222
  /** True when this kind was inferred from absence rather than positively observed. */
148
223
  export function isAbsenceDerived(kind) {
@@ -120,6 +120,14 @@ export declare const FlowExpectSchema: z.ZodObject<{
120
120
  * bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
121
121
  */
122
122
  signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
123
+ /**
124
+ * Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
125
+ * only way a saved flow can keep a cardinality the agent actually asserted. Without it a
126
+ * `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
127
+ * one made: the replayed flow then goes green on the double-fire it was recorded to catch.
128
+ * Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
129
+ */
130
+ signalCount: z.ZodOptional<z.ZodNumber>;
123
131
  net: z.ZodOptional<z.ZodObject<{
124
132
  method: z.ZodOptional<z.ZodString>;
125
133
  urlContains: z.ZodOptional<z.ZodString>;
@@ -200,6 +208,7 @@ export declare const FlowExpectSchema: z.ZodObject<{
200
208
  }, "strip", z.ZodTypeAny, {
201
209
  signal?: string | undefined;
202
210
  signalData?: Record<string, unknown> | undefined;
211
+ signalCount?: number | undefined;
203
212
  net?: {
204
213
  status?: number | undefined;
205
214
  method?: string | undefined;
@@ -224,6 +233,7 @@ export declare const FlowExpectSchema: z.ZodObject<{
224
233
  }, {
225
234
  signal?: string | undefined;
226
235
  signalData?: Record<string, unknown> | undefined;
236
+ signalCount?: number | undefined;
227
237
  net?: {
228
238
  status?: number | undefined;
229
239
  method?: string | undefined;
@@ -429,6 +439,24 @@ export interface FlowReplayResult {
429
439
  * envelope, or a fall-back note below N=3 runs). Additive; present when segments were observed.
430
440
  */
431
441
  deviation?: unknown;
442
+ /**
443
+ * What the project already knows about this flow, fetched from shared memory on the agent's
444
+ * behalf.
445
+ *
446
+ * Present only when the project is linked, memory sync is on, and the team has actually captured
447
+ * something about this flow. Consulting shared memory used to be a separate act an agent had to
448
+ * remember to perform — measured across a real corpus, every subject showed zero reads, not
449
+ * because the knowledge was useless but because nothing ever asked for it. A verification that
450
+ * asks on the agent's behalf is the difference between memory the platform stores and memory the
451
+ * platform uses.
452
+ *
453
+ * Deliberately additive and deliberately small: a verdict whose own result has been pushed below
454
+ * a wall of statements is a worse verdict.
455
+ */
456
+ knows?: {
457
+ statement: string;
458
+ status: string;
459
+ }[];
432
460
  }
433
461
  /**
434
462
  * The on-disk flow file: diffable, git-tracked, anchor-resolved.
@@ -446,6 +474,20 @@ export declare const FlowFileSchema: z.ZodObject<{
446
474
  * cannot actually check — flow-classify flags that gap.
447
475
  */
448
476
  intent: z.ZodOptional<z.ZodString>;
477
+ /**
478
+ * The intent-ledger row this flow discharges — the id in `.reticle/intent.json`.
479
+ *
480
+ * `intent` above is the prose a recorder captured; this is the LINK to the ledger that already
481
+ * models declared → bound → proved and records which verdict discharged what. Without it there
482
+ * would be two ways to say what a change is for, which is the defect this codebase keeps paying
483
+ * for: a flow's goal and an intent's statement would drift apart with nothing to reconcile them.
484
+ *
485
+ * Set at save time from the flow's own prose, or written by hand to point a flow at an intent
486
+ * declared earlier via `reticle_intent` — a flow can prove something somebody else declared.
487
+ * Optional + back-compat: a flow without it replays exactly as before, and the on-disk version
488
+ * stays FLOW_FILE_VERSION 1.
489
+ */
490
+ intentId: z.ZodOptional<z.ZodString>;
449
491
  /**
450
492
  * The project the flow was recorded against (the connecting session's HELLO `projectId`), stamped at
451
493
  * save time. Scopes a flow to its app so a shared daemon's HUD lists only the current project's flows
@@ -473,6 +515,14 @@ export declare const FlowFileSchema: z.ZodObject<{
473
515
  * bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
474
516
  */
475
517
  signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
518
+ /**
519
+ * Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
520
+ * only way a saved flow can keep a cardinality the agent actually asserted. Without it a
521
+ * `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
522
+ * one made: the replayed flow then goes green on the double-fire it was recorded to catch.
523
+ * Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
524
+ */
525
+ signalCount: z.ZodOptional<z.ZodNumber>;
476
526
  net: z.ZodOptional<z.ZodObject<{
477
527
  method: z.ZodOptional<z.ZodString>;
478
528
  urlContains: z.ZodOptional<z.ZodString>;
@@ -553,6 +603,7 @@ export declare const FlowFileSchema: z.ZodObject<{
553
603
  }, "strip", z.ZodTypeAny, {
554
604
  signal?: string | undefined;
555
605
  signalData?: Record<string, unknown> | undefined;
606
+ signalCount?: number | undefined;
556
607
  net?: {
557
608
  status?: number | undefined;
558
609
  method?: string | undefined;
@@ -577,6 +628,7 @@ export declare const FlowFileSchema: z.ZodObject<{
577
628
  }, {
578
629
  signal?: string | undefined;
579
630
  signalData?: Record<string, unknown> | undefined;
631
+ signalCount?: number | undefined;
580
632
  net?: {
581
633
  status?: number | undefined;
582
634
  method?: string | undefined;
@@ -702,11 +754,13 @@ export declare const FlowFileSchema: z.ZodObject<{
702
754
  createdAt: number;
703
755
  intent?: string | undefined;
704
756
  projectId?: string | undefined;
757
+ intentId?: string | undefined;
705
758
  startPath?: string | undefined;
706
759
  fixture?: string | undefined;
707
760
  success?: {
708
761
  signal?: string | undefined;
709
762
  signalData?: Record<string, unknown> | undefined;
763
+ signalCount?: number | undefined;
710
764
  net?: {
711
765
  status?: number | undefined;
712
766
  method?: string | undefined;
@@ -762,11 +816,13 @@ export declare const FlowFileSchema: z.ZodObject<{
762
816
  createdAt: number;
763
817
  intent?: string | undefined;
764
818
  projectId?: string | undefined;
819
+ intentId?: string | undefined;
765
820
  startPath?: string | undefined;
766
821
  fixture?: string | undefined;
767
822
  success?: {
768
823
  signal?: string | undefined;
769
824
  signalData?: Record<string, unknown> | undefined;
825
+ signalCount?: number | undefined;
770
826
  net?: {
771
827
  status?: number | undefined;
772
828
  method?: string | undefined;
@@ -835,6 +891,20 @@ export declare const RecordedFlowSchema: z.ZodObject<{
835
891
  * cannot actually check — flow-classify flags that gap.
836
892
  */
837
893
  intent: z.ZodOptional<z.ZodString>;
894
+ /**
895
+ * The intent-ledger row this flow discharges — the id in `.reticle/intent.json`.
896
+ *
897
+ * `intent` above is the prose a recorder captured; this is the LINK to the ledger that already
898
+ * models declared → bound → proved and records which verdict discharged what. Without it there
899
+ * would be two ways to say what a change is for, which is the defect this codebase keeps paying
900
+ * for: a flow's goal and an intent's statement would drift apart with nothing to reconcile them.
901
+ *
902
+ * Set at save time from the flow's own prose, or written by hand to point a flow at an intent
903
+ * declared earlier via `reticle_intent` — a flow can prove something somebody else declared.
904
+ * Optional + back-compat: a flow without it replays exactly as before, and the on-disk version
905
+ * stays FLOW_FILE_VERSION 1.
906
+ */
907
+ intentId: z.ZodOptional<z.ZodString>;
838
908
  /**
839
909
  * The project the flow was recorded against (the connecting session's HELLO `projectId`), stamped at
840
910
  * save time. Scopes a flow to its app so a shared daemon's HUD lists only the current project's flows
@@ -862,6 +932,14 @@ export declare const RecordedFlowSchema: z.ZodObject<{
862
932
  * bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
863
933
  */
864
934
  signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
935
+ /**
936
+ * Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
937
+ * only way a saved flow can keep a cardinality the agent actually asserted. Without it a
938
+ * `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
939
+ * one made: the replayed flow then goes green on the double-fire it was recorded to catch.
940
+ * Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
941
+ */
942
+ signalCount: z.ZodOptional<z.ZodNumber>;
865
943
  net: z.ZodOptional<z.ZodObject<{
866
944
  method: z.ZodOptional<z.ZodString>;
867
945
  urlContains: z.ZodOptional<z.ZodString>;
@@ -942,6 +1020,7 @@ export declare const RecordedFlowSchema: z.ZodObject<{
942
1020
  }, "strip", z.ZodTypeAny, {
943
1021
  signal?: string | undefined;
944
1022
  signalData?: Record<string, unknown> | undefined;
1023
+ signalCount?: number | undefined;
945
1024
  net?: {
946
1025
  status?: number | undefined;
947
1026
  method?: string | undefined;
@@ -966,6 +1045,7 @@ export declare const RecordedFlowSchema: z.ZodObject<{
966
1045
  }, {
967
1046
  signal?: string | undefined;
968
1047
  signalData?: Record<string, unknown> | undefined;
1048
+ signalCount?: number | undefined;
969
1049
  net?: {
970
1050
  status?: number | undefined;
971
1051
  method?: string | undefined;
@@ -1091,11 +1171,13 @@ export declare const RecordedFlowSchema: z.ZodObject<{
1091
1171
  createdAt: number;
1092
1172
  intent?: string | undefined;
1093
1173
  projectId?: string | undefined;
1174
+ intentId?: string | undefined;
1094
1175
  startPath?: string | undefined;
1095
1176
  fixture?: string | undefined;
1096
1177
  success?: {
1097
1178
  signal?: string | undefined;
1098
1179
  signalData?: Record<string, unknown> | undefined;
1180
+ signalCount?: number | undefined;
1099
1181
  net?: {
1100
1182
  status?: number | undefined;
1101
1183
  method?: string | undefined;
@@ -1151,11 +1233,13 @@ export declare const RecordedFlowSchema: z.ZodObject<{
1151
1233
  createdAt: number;
1152
1234
  intent?: string | undefined;
1153
1235
  projectId?: string | undefined;
1236
+ intentId?: string | undefined;
1154
1237
  startPath?: string | undefined;
1155
1238
  fixture?: string | undefined;
1156
1239
  success?: {
1157
1240
  signal?: string | undefined;
1158
1241
  signalData?: Record<string, unknown> | undefined;
1242
+ signalCount?: number | undefined;
1159
1243
  net?: {
1160
1244
  status?: number | undefined;
1161
1245
  method?: string | undefined;
@@ -1213,11 +1297,13 @@ export declare const RecordedFlowSchema: z.ZodObject<{
1213
1297
  createdAt: number;
1214
1298
  intent?: string | undefined;
1215
1299
  projectId?: string | undefined;
1300
+ intentId?: string | undefined;
1216
1301
  startPath?: string | undefined;
1217
1302
  fixture?: string | undefined;
1218
1303
  success?: {
1219
1304
  signal?: string | undefined;
1220
1305
  signalData?: Record<string, unknown> | undefined;
1306
+ signalCount?: number | undefined;
1221
1307
  net?: {
1222
1308
  status?: number | undefined;
1223
1309
  method?: string | undefined;
@@ -1276,11 +1362,13 @@ export declare const RecordedFlowSchema: z.ZodObject<{
1276
1362
  createdAt: number;
1277
1363
  intent?: string | undefined;
1278
1364
  projectId?: string | undefined;
1365
+ intentId?: string | undefined;
1279
1366
  startPath?: string | undefined;
1280
1367
  fixture?: string | undefined;
1281
1368
  success?: {
1282
1369
  signal?: string | undefined;
1283
1370
  signalData?: Record<string, unknown> | undefined;
1371
+ signalCount?: number | undefined;
1284
1372
  net?: {
1285
1373
  status?: number | undefined;
1286
1374
  method?: string | undefined;
@@ -55,6 +55,14 @@ export const FlowExpectSchema = z.object({
55
55
  * bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
56
56
  */
57
57
  signalData: z.record(z.unknown()).optional(),
58
+ /**
59
+ * Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
60
+ * only way a saved flow can keep a cardinality the agent actually asserted. Without it a
61
+ * `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
62
+ * one made: the replayed flow then goes green on the double-fire it was recorded to catch.
63
+ * Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
64
+ */
65
+ signalCount: z.number().int().nonnegative().optional(),
58
66
  net: z
59
67
  .object({
60
68
  method: z.string().optional(),
@@ -134,6 +142,20 @@ export const FlowFileSchema = z.object({
134
142
  * cannot actually check — flow-classify flags that gap.
135
143
  */
136
144
  intent: z.string().optional(),
145
+ /**
146
+ * The intent-ledger row this flow discharges — the id in `.reticle/intent.json`.
147
+ *
148
+ * `intent` above is the prose a recorder captured; this is the LINK to the ledger that already
149
+ * models declared → bound → proved and records which verdict discharged what. Without it there
150
+ * would be two ways to say what a change is for, which is the defect this codebase keeps paying
151
+ * for: a flow's goal and an intent's statement would drift apart with nothing to reconcile them.
152
+ *
153
+ * Set at save time from the flow's own prose, or written by hand to point a flow at an intent
154
+ * declared earlier via `reticle_intent` — a flow can prove something somebody else declared.
155
+ * Optional + back-compat: a flow without it replays exactly as before, and the on-disk version
156
+ * stays FLOW_FILE_VERSION 1.
157
+ */
158
+ intentId: z.string().optional(),
137
159
  /**
138
160
  * The project the flow was recorded against (the connecting session's HELLO `projectId`), stamped at
139
161
  * save time. Scopes a flow to its app so a shared daemon's HUD lists only the current project's flows