@orkestrel/probe 0.0.10 → 0.0.12

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.
@@ -29,9 +29,9 @@ import { StringShape } from '@orkestrel/contract';
29
29
  * ```
30
30
  */
31
31
  export declare interface Case {
32
- /** The candidate drafts the test imports, in the order the claim supplies them. */
32
+ /** Holds the candidate drafts the test imports, in the order the claim supplies them. */
33
33
  readonly files: readonly Draft[];
34
- /** The test that exercises those drafts. */
34
+ /** Holds the test that exercises those drafts. */
35
35
  readonly test: Draft;
36
36
  }
37
37
 
@@ -68,11 +68,11 @@ export declare const CASE_SHAPE: ObjectShape<{
68
68
  * ```
69
69
  */
70
70
  export declare interface Check {
71
- /** The stage that produced this outcome. */
71
+ /** Names the stage that produced this outcome. */
72
72
  readonly stage: Stage;
73
- /** Milliseconds the stage took. */
73
+ /** Holds the milliseconds the stage took. */
74
74
  readonly elapsed: number;
75
- /** Every message the stage's tool reported, in the tool's own order. */
75
+ /** Holds every message the stage's tool reported, in the tool's own order. */
76
76
  readonly issues: readonly Issue[];
77
77
  }
78
78
 
@@ -114,11 +114,14 @@ export declare interface Check {
114
114
  * ```
115
115
  */
116
116
  export declare interface Claim {
117
- /** Workspace-relative path of the TypeScript project the candidate drafts are checked against. */
117
+ /**
118
+ * Names the workspace-relative path of the TypeScript project the candidate drafts are checked
119
+ * against.
120
+ */
118
121
  readonly project: string;
119
- /** The drafts and test the claim asserts about. */
122
+ /** Holds the drafts and test the claim asserts about. */
120
123
  readonly case: Case;
121
- /** The negative control that must break, and where. */
124
+ /** Holds the negative control that must break, and where. */
122
125
  readonly control: Control;
123
126
  }
124
127
 
@@ -233,9 +236,9 @@ export declare function computeReceipt(verdict: Verdict, stage: Stage): string |
233
236
  * ```
234
237
  */
235
238
  export declare interface Control extends Case {
236
- /** The stage this control must report issues at. */
239
+ /** Names the stage this control must report issues at. */
237
240
  readonly stage: Stage;
238
- /** Why the control fails there, in the claimant's own words. */
241
+ /** Explains why the control fails there, in the claimant's own words. */
239
242
  readonly reason: string;
240
243
  }
241
244
 
@@ -298,9 +301,9 @@ export declare function createDestroyedError(subject: string): ProbeError;
298
301
  * ```
299
302
  */
300
303
  export declare interface Draft {
301
- /** Workspace-relative path the stages resolve the text against. */
304
+ /** Names the workspace-relative path the stages resolve the text against. */
302
305
  readonly path: string;
303
- /** The file's full contents. */
306
+ /** Holds the file's full contents. */
304
307
  readonly text: string;
305
308
  }
306
309
 
@@ -374,6 +377,46 @@ export declare function formatCheck(check: Check): string;
374
377
  */
375
378
  export declare function formatIssue(issue: Issue): string;
376
379
 
380
+ /**
381
+ * Renders the closing line a rendered verdict ends with: the receipt it earned, or its absence.
382
+ *
383
+ * @remarks
384
+ * One implementation serves every rendering of that line, so the line a reader quotes off a whole
385
+ * verdict and the line a bounded reply falls back to cannot drift apart.
386
+ *
387
+ * @param verdict - The verdict whose `receipt` decides the line
388
+ * @returns `receipt <token>` when the verdict carries a receipt, and `no receipt` when it does not
389
+ *
390
+ * @example
391
+ * ```ts
392
+ * formatProof(proven)
393
+ * // 'receipt probe:6ca20c3bff623031d3955b9d1a76d71d:type:typescript@6.0.3:oxlint@1.79.0:vitest@4.1.11:configs/src/tsconfig.core.json@3b674fdf121c85efb9ed1bab25ceeec8'
394
+ * formatProof(disproven) // 'no receipt'
395
+ * ```
396
+ */
397
+ export declare function formatProof(verdict: Verdict): string;
398
+
399
+ /**
400
+ * Renders the smallest text a verdict can travel as: what it judged, and how it ended.
401
+ *
402
+ * @remarks
403
+ * A reply whose bounds refuse both the record and the whole rendering answers with this text, so it
404
+ * carries what a reader cannot recompute — the call's identity, the claim's digest, and the
405
+ * control's reason when the verdict carries one — and closes with the same line `formatVerdict`
406
+ * closes with. Every line here is a line `formatVerdict` renders at the same position relative to
407
+ * the ones around it, so a reader meets one shape whichever answer arrived.
408
+ *
409
+ * @param verdict - The verdict to render
410
+ * @returns The identity and claim lines, the reason when present, then the closing receipt line
411
+ *
412
+ * @example
413
+ * ```ts
414
+ * formatReceipt(disproven).split('\n')
415
+ * // ['probe 88a5addc-7d33-40dc-9a5a-104b71f8787d (549 ms)', 'claim 6ca20c3bff623031d3955b9d1a76d71d', 'no receipt']
416
+ * ```
417
+ */
418
+ export declare function formatReceipt(verdict: Verdict): string;
419
+
377
420
  /**
378
421
  * Renders one generated specification: the caller's own test text, then the marker naming the
379
422
  * revision that wrote it.
@@ -558,7 +601,7 @@ export declare const isParty: Guard<Party>;
558
601
  * condition all stay outside the type.
559
602
  *
560
603
  * @param value - The value to inspect
561
- * @returns True only for a `ProbeError` instance; false otherwise
604
+ * @returns True if the value is a `ProbeError` instance; false otherwise
562
605
  *
563
606
  * @example
564
607
  * ```ts
@@ -640,13 +683,15 @@ export declare const isStage: Guard<Stage>;
640
683
  * ```
641
684
  */
642
685
  export declare interface Issue {
643
- /** The party that must act on this message. */
686
+ /** Names the party that must act on this message. */
644
687
  readonly origin: Party;
645
- /** Workspace-relative path this message is reported against. */
688
+ /** Names the workspace-relative path this message is reported against. */
646
689
  readonly path: string;
647
- /** The diagnostic or failure message. */
690
+ /** Holds the diagnostic or failure message. */
648
691
  readonly message: string;
649
- /** Zero-based UTF-16 span the tool reported, or absent when it reported no location. */
692
+ /**
693
+ * Holds the zero-based UTF-16 span the tool reported, or is absent when it reported no location.
694
+ */
650
695
  readonly range?: LSPRange;
651
696
  }
652
697
 
@@ -684,6 +729,24 @@ export declare const isToolchain: Guard<Toolchain>;
684
729
  */
685
730
  export declare const isVerdict: Guard<Verdict>;
686
731
 
732
+ /**
733
+ * Names the bound the lint stage holds over the lifecycle exchanges the protocol leaves to the
734
+ * server: the `initialize` reply warming waits for and the `shutdown` reply ending waits for.
735
+ *
736
+ * @remarks
737
+ * It does not reach the diagnostics an inspection waits for, which the caller's own signal bounds.
738
+ * The transport's cooperative window is half of it, so a child that ignores its ending is
739
+ * signalled and released inside the same bound rather than outliving the client's own wait for
740
+ * the close. Measured 2026-08-27: the workspace `oxlint --lsp` answers `initialize` in 155 ms, so
741
+ * this bound is more than ten times that reply.
742
+ *
743
+ * @example
744
+ * ```ts
745
+ * LINT_DEADLINE // 2_000
746
+ * ```
747
+ */
748
+ export declare const LINT_DEADLINE = 2000;
749
+
687
750
  /**
688
751
  * Checks whether one file's text is the generated specification written for one revision.
689
752
  *
@@ -718,6 +781,19 @@ export declare function matchesSpecification(text: string, revision: string): bo
718
781
  */
719
782
  export declare type Party = (typeof PROBE_PARTIES)[number];
720
783
 
784
+ /**
785
+ * Names the default inspection deadline a `Probe` applies when its construction omits one.
786
+ *
787
+ * @remarks
788
+ * `ProbeOptions.deadline` overrides this value per instance.
789
+ *
790
+ * @example
791
+ * ```ts
792
+ * PROBE_DEADLINE // 30_000
793
+ * ```
794
+ */
795
+ export declare const PROBE_DEADLINE = 30000;
796
+
721
797
  /**
722
798
  * Lists the conditions that can end a probe operation.
723
799
  *
@@ -733,6 +809,25 @@ export declare type Party = (typeof PROBE_PARTIES)[number];
733
809
  */
734
810
  export declare const PROBE_ERROR_CODES: readonly ["refused", "missing", "malformed", "destroyed", "deadline"];
735
811
 
812
+ /**
813
+ * Names the total enumerable key bound `ProbeServer` applies to inbound metadata and to produced
814
+ * tool content alike.
815
+ *
816
+ * @remarks
817
+ * `@orkestrel/mcp`'s default leaf is sized for metadata: a verdict costs 38 keys empty and 11 more
818
+ * for each issue a stage reports, so the default carries a verdict whose control refuses one
819
+ * declaration and stops carrying the next one. A whole tool-call result carrying the record beside
820
+ * its rendering costs 44 keys plus 11 for each issue, so this bound carries a record reporting up
821
+ * to 368 issues. Past that the reply falls back to the rendered text, and past the 4 MiB content
822
+ * bound to the receipt block.
823
+ *
824
+ * @example
825
+ * ```ts
826
+ * PROBE_KEYS // 4096
827
+ * ```
828
+ */
829
+ export declare const PROBE_KEYS = 4096;
830
+
736
831
  /**
737
832
  * Lists the parties that can own action on an issue or probe failure.
738
833
  *
@@ -747,6 +842,26 @@ export declare const PROBE_ERROR_CODES: readonly ["refused", "missing", "malform
747
842
  */
748
843
  export declare const PROBE_PARTIES: readonly ["claimant", "workspace", "instrument"];
749
844
 
845
+ /**
846
+ * Names the specification lifetime the runtime stage replaces its resident Vitest service at.
847
+ *
848
+ * @remarks
849
+ * Vite retains one unresolved URL for every fresh specification path, so an inspection that writes
850
+ * a specification grows a map the resident service never releases. The stage replaces that service
851
+ * rather than deleting from each map it owns, and this is the count of specifications one service
852
+ * carries before the replacement. Any bound holds the retention flat, because the replacement
853
+ * releases everything the instance held; this value trades the cost of the replacement against how
854
+ * far the map grows between them. On 2026-08-20, over this package's own workspace on the host
855
+ * `guides/probe.md` § Cost names, two runs of 66 inspections put the crossing inspection at 480 ms
856
+ * and 269 ms against median inspections of 156 ms and 155 ms.
857
+ *
858
+ * @example
859
+ * ```ts
860
+ * PROBE_SPECIFICATIONS // 64
861
+ * ```
862
+ */
863
+ export declare const PROBE_SPECIFICATIONS = 64;
864
+
750
865
  /**
751
866
  * Lists the stages a claim passes through, in the order a verdict reports them.
752
867
  *
@@ -829,20 +944,20 @@ export declare type ProbeErrorCode = (typeof PROBE_ERROR_CODES)[number];
829
944
  * ```
830
945
  */
831
946
  export declare interface ProbeErrorContext {
832
- /** The stage the failure belongs to, when one stage owns it. */
947
+ /** Names the stage the failure belongs to, when one stage owns it. */
833
948
  readonly stage?: Stage;
834
949
  /**
835
- * The path involved, spelled as the refusing operation named it: workspace-relative for an
950
+ * Names the path involved, spelled as the refusing operation named it: workspace-relative for an
836
951
  * input a caller supplied, absolute for a file this package resolved.
837
952
  */
838
953
  readonly path?: string;
839
- /** The workspace-relative TypeScript project involved, for a project failure. */
954
+ /** Names the workspace-relative TypeScript project involved, for a project failure. */
840
955
  readonly project?: string;
841
- /** The installed package name involved, for a workspace toolchain failure. */
956
+ /** Identifies the installed package involved, for a workspace toolchain failure. */
842
957
  readonly name?: string;
843
- /** Milliseconds the expired budget allowed, for a deadline failure. */
958
+ /** Holds the milliseconds the expired budget allowed, for a deadline failure. */
844
959
  readonly deadline?: number;
845
- /** The rejected value, for an input the guards refused. */
960
+ /** Holds the rejected value, for an input the guards refused. */
846
961
  readonly value?: unknown;
847
962
  }
848
963
 
@@ -864,13 +979,13 @@ export declare interface ProbeErrorContext {
864
979
  * ```
865
980
  */
866
981
  export declare interface ProbeErrorOptions {
867
- /** The party that must act on this failure. */
982
+ /** Names the party that must act on this failure. */
868
983
  readonly origin: Party;
869
- /** The condition that ended the operation. */
984
+ /** Names the condition that ended the operation. */
870
985
  readonly code: ProbeErrorCode;
871
- /** Structured detail about the failure. */
986
+ /** Holds structured detail about the failure. */
872
987
  readonly context?: ProbeErrorContext;
873
- /** The underlying fault, when one ended the operation. */
988
+ /** Holds the underlying fault, when one ended the operation. */
874
989
  readonly cause?: unknown;
875
990
  }
876
991
 
@@ -892,13 +1007,16 @@ export declare interface ProbeErrorOptions {
892
1007
  * ```
893
1008
  */
894
1009
  export declare type ProbeEventMap = {
895
- /** The boot control reported red and the instrument has begun answering calls. */
1010
+ /** Fires when the boot control has reported red and the instrument has begun answering calls. */
896
1011
  readonly arm: readonly [toolchain: Toolchain];
897
- /** A claim was answered. */
1012
+ /** Fires when a claim is answered. */
898
1013
  readonly prove: readonly [verdict: Verdict];
899
- /** The coordinator's deadline fired at one stage and that stage was replaced before this event. */
1014
+ /** Fires after the coordinator's deadline fired at one stage and that stage was replaced. */
900
1015
  readonly expire: readonly [claim: Claim];
901
- /** A fault surfaced for observation, once per fault, including a rejected arming attempt. */
1016
+ /**
1017
+ * Fires when a fault surfaces for observation, once per fault, including a rejected arming
1018
+ * attempt.
1019
+ */
902
1020
  readonly error: readonly [error: unknown];
903
1021
  };
904
1022
 
@@ -922,9 +1040,9 @@ export declare type ProbeEventMap = {
922
1040
  * ```
923
1041
  */
924
1042
  export declare interface ProbeInterface {
925
- /** Observation surface for arming, answers, deadline expiry, and faults. */
1043
+ /** Publishes arming, answers, deadline expiry, and faults for observation. */
926
1044
  readonly emitter: EmitterInterface<ProbeEventMap>;
927
- /** The tool versions resolved from the workspace at construction. */
1045
+ /** Names the tool versions resolved from the workspace at construction. */
928
1046
  readonly toolchain: Toolchain;
929
1047
  /**
930
1048
  * Answers one claim with every stage's evidence.
@@ -974,15 +1092,15 @@ export declare interface ProbeInterface {
974
1092
  * ```
975
1093
  */
976
1094
  export declare interface ProbeOptions {
977
- /** Initial listeners, wired at construction. */
1095
+ /** Declares the initial listeners, wired at construction. */
978
1096
  readonly on?: EmitterHooks<ProbeEventMap>;
979
- /** Handler for a listener throw. */
1097
+ /** Holds the handler for a listener throw. */
980
1098
  readonly error?: EmitterErrorHandler;
981
- /** Target workspace root. Default: the current working directory. */
1099
+ /** Names the target workspace root. Default: the current working directory. */
982
1100
  readonly workspace?: string;
983
1101
  /**
984
- * Milliseconds one active stage inspection may take; an expired stage is replaced. Default:
985
- * 30,000 ms.
1102
+ * Holds the milliseconds one active stage inspection may take; an expired stage is replaced.
1103
+ * Default: 30,000 ms.
986
1104
  */
987
1105
  readonly deadline?: number;
988
1106
  }
@@ -1006,9 +1124,12 @@ export declare interface ProbeOptions {
1006
1124
  * ```
1007
1125
  */
1008
1126
  export declare interface Project {
1009
- /** Resolved workspace-relative path of the project file the type stage applied. */
1127
+ /** Names the resolved workspace-relative path of the project file the type stage applied. */
1010
1128
  readonly path: string;
1011
- /** Digest of that project's resolved compiler options, workspace-relative and key-sorted. */
1129
+ /**
1130
+ * Holds the digest of that project's resolved compiler options, workspace-relative and
1131
+ * key-sorted.
1132
+ */
1012
1133
  readonly digest: string;
1013
1134
  }
1014
1135
 
@@ -1044,6 +1165,21 @@ export declare const RECEIPT_PREFIX = "probe";
1044
1165
  */
1045
1166
  export declare const RECEIPT_SEPARATOR = ":";
1046
1167
 
1168
+ /**
1169
+ * Names the Vite plugin the runtime stage installs into a target workspace's Vitest configuration.
1170
+ *
1171
+ * @remarks
1172
+ * The stage declares the plugin under this name and reads a configured project's plugin list for
1173
+ * the same name to decide whether that project carries the overlay. One name feeds both, so a
1174
+ * project the stage instrumented is never reported as a workspace project it could not reach.
1175
+ *
1176
+ * @example
1177
+ * ```ts
1178
+ * RUNTIME_PLUGIN // 'orkestrel-runtime-overlay'
1179
+ * ```
1180
+ */
1181
+ export declare const RUNTIME_PLUGIN = "orkestrel-runtime-overlay";
1182
+
1047
1183
  /**
1048
1184
  * Names an inspection a claim passes through, derived from {@link PROBE_STAGES}.
1049
1185
  *
@@ -1072,11 +1208,11 @@ export declare type Stage = (typeof PROBE_STAGES)[number];
1072
1208
  * ```
1073
1209
  */
1074
1210
  export declare interface Toolchain {
1075
- /** Resolved `typescript` version the type stage ran. */
1211
+ /** Names the resolved `typescript` version the type stage ran. */
1076
1212
  readonly typescript: string;
1077
- /** Resolved `oxlint` version the lint stage ran. */
1213
+ /** Names the resolved `oxlint` version the lint stage ran. */
1078
1214
  readonly oxlint: string;
1079
- /** Resolved `vitest` version the runtime stage ran. */
1215
+ /** Names the resolved `vitest` version the runtime stage ran. */
1080
1216
  readonly vitest: string;
1081
1217
  }
1082
1218
 
@@ -1141,26 +1277,26 @@ export declare interface Toolchain {
1141
1277
  * ```
1142
1278
  */
1143
1279
  export declare interface Verdict {
1144
- /** The revision identity this verdict was produced for, fresh per call. */
1280
+ /** Names the revision identity this verdict was produced for, fresh per call. */
1145
1281
  readonly id: string;
1146
- /** Digest of the case and control this verdict answers. */
1282
+ /** Holds the digest of the case and control this verdict answers. */
1147
1283
  readonly digest: string;
1148
- /** The tool versions that produced it. */
1284
+ /** Names the tool versions that produced it. */
1149
1285
  readonly toolchain: Toolchain;
1150
- /** The TypeScript project the candidate drafts were judged against. */
1286
+ /** Names the TypeScript project the candidate drafts were judged against. */
1151
1287
  readonly project: Project;
1152
1288
  /**
1153
- * The claimant's explanation for the selected control, when the verdict came from a claim. Part
1154
- * of the control, so it enters `digest` and through it the receipt token.
1289
+ * Holds the claimant's explanation for the selected control, when the verdict came from a claim.
1290
+ * Part of the control, so it enters `digest` and through it the receipt token.
1155
1291
  */
1156
1292
  readonly reason?: string;
1157
- /** One outcome per stage for the claim's case. */
1293
+ /** Holds one outcome per stage for the claim's case. */
1158
1294
  readonly case: readonly Check[];
1159
- /** One outcome per stage for the claim's control. */
1295
+ /** Holds one outcome per stage for the claim's control. */
1160
1296
  readonly control: readonly Check[];
1161
- /** Milliseconds the whole call took, including both the case and the control. */
1297
+ /** Holds the milliseconds the whole call took, including both the case and the control. */
1162
1298
  readonly elapsed: number;
1163
- /** The proof token, absent when either phase reports an instrument failure. */
1299
+ /** Holds the proof token, absent when either phase reports an instrument failure. */
1164
1300
  readonly receipt?: string;
1165
1301
  }
1166
1302
 
@@ -86,6 +86,86 @@ var RECEIPT_PREFIX = "probe";
86
86
  * ```
87
87
  */
88
88
  var RECEIPT_SEPARATOR = ":";
89
+ /**
90
+ * Names the default inspection deadline a `Probe` applies when its construction omits one.
91
+ *
92
+ * @remarks
93
+ * `ProbeOptions.deadline` overrides this value per instance.
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * PROBE_DEADLINE // 30_000
98
+ * ```
99
+ */
100
+ var PROBE_DEADLINE = 3e4;
101
+ /**
102
+ * Names the bound the lint stage holds over the lifecycle exchanges the protocol leaves to the
103
+ * server: the `initialize` reply warming waits for and the `shutdown` reply ending waits for.
104
+ *
105
+ * @remarks
106
+ * It does not reach the diagnostics an inspection waits for, which the caller's own signal bounds.
107
+ * The transport's cooperative window is half of it, so a child that ignores its ending is
108
+ * signalled and released inside the same bound rather than outliving the client's own wait for
109
+ * the close. Measured 2026-08-27: the workspace `oxlint --lsp` answers `initialize` in 155 ms, so
110
+ * this bound is more than ten times that reply.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * LINT_DEADLINE // 2_000
115
+ * ```
116
+ */
117
+ var LINT_DEADLINE = 2e3;
118
+ /**
119
+ * Names the total enumerable key bound `ProbeServer` applies to inbound metadata and to produced
120
+ * tool content alike.
121
+ *
122
+ * @remarks
123
+ * `@orkestrel/mcp`'s default leaf is sized for metadata: a verdict costs 38 keys empty and 11 more
124
+ * for each issue a stage reports, so the default carries a verdict whose control refuses one
125
+ * declaration and stops carrying the next one. A whole tool-call result carrying the record beside
126
+ * its rendering costs 44 keys plus 11 for each issue, so this bound carries a record reporting up
127
+ * to 368 issues. Past that the reply falls back to the rendered text, and past the 4 MiB content
128
+ * bound to the receipt block.
129
+ *
130
+ * @example
131
+ * ```ts
132
+ * PROBE_KEYS // 4096
133
+ * ```
134
+ */
135
+ var PROBE_KEYS = 4096;
136
+ /**
137
+ * Names the specification lifetime the runtime stage replaces its resident Vitest service at.
138
+ *
139
+ * @remarks
140
+ * Vite retains one unresolved URL for every fresh specification path, so an inspection that writes
141
+ * a specification grows a map the resident service never releases. The stage replaces that service
142
+ * rather than deleting from each map it owns, and this is the count of specifications one service
143
+ * carries before the replacement. Any bound holds the retention flat, because the replacement
144
+ * releases everything the instance held; this value trades the cost of the replacement against how
145
+ * far the map grows between them. On 2026-08-20, over this package's own workspace on the host
146
+ * `guides/probe.md` § Cost names, two runs of 66 inspections put the crossing inspection at 480 ms
147
+ * and 269 ms against median inspections of 156 ms and 155 ms.
148
+ *
149
+ * @example
150
+ * ```ts
151
+ * PROBE_SPECIFICATIONS // 64
152
+ * ```
153
+ */
154
+ var PROBE_SPECIFICATIONS = 64;
155
+ /**
156
+ * Names the Vite plugin the runtime stage installs into a target workspace's Vitest configuration.
157
+ *
158
+ * @remarks
159
+ * The stage declares the plugin under this name and reads a configured project's plugin list for
160
+ * the same name to decide whether that project carries the overlay. One name feeds both, so a
161
+ * project the stage instrumented is never reported as a workspace project it could not reach.
162
+ *
163
+ * @example
164
+ * ```ts
165
+ * RUNTIME_PLUGIN // 'orkestrel-runtime-overlay'
166
+ * ```
167
+ */
168
+ var RUNTIME_PLUGIN = "orkestrel-runtime-overlay";
89
169
  //#endregion
90
170
  //#region src/core/errors.ts
91
171
  /**
@@ -143,7 +223,7 @@ var ProbeError = class extends Error {
143
223
  * condition all stay outside the type.
144
224
  *
145
225
  * @param value - The value to inspect
146
- * @returns True only for a `ProbeError` instance; false otherwise
226
+ * @returns True if the value is a `ProbeError` instance; false otherwise
147
227
  *
148
228
  * @example
149
229
  * ```ts
@@ -478,6 +558,54 @@ function formatCheck(check) {
478
558
  return [`${check.stage}: ${count} ${noun} (${check.elapsed} ms)`, ...check.issues.map((issue) => ` ${formatIssue(issue)}`)].join("\n");
479
559
  }
480
560
  /**
561
+ * Renders the closing line a rendered verdict ends with: the receipt it earned, or its absence.
562
+ *
563
+ * @remarks
564
+ * One implementation serves every rendering of that line, so the line a reader quotes off a whole
565
+ * verdict and the line a bounded reply falls back to cannot drift apart.
566
+ *
567
+ * @param verdict - The verdict whose `receipt` decides the line
568
+ * @returns `receipt <token>` when the verdict carries a receipt, and `no receipt` when it does not
569
+ *
570
+ * @example
571
+ * ```ts
572
+ * formatProof(proven)
573
+ * // 'receipt probe:6ca20c3bff623031d3955b9d1a76d71d:type:typescript@6.0.3:oxlint@1.79.0:vitest@4.1.11:configs/src/tsconfig.core.json@3b674fdf121c85efb9ed1bab25ceeec8'
574
+ * formatProof(disproven) // 'no receipt'
575
+ * ```
576
+ */
577
+ function formatProof(verdict) {
578
+ return verdict.receipt === void 0 ? "no receipt" : `receipt ${verdict.receipt}`;
579
+ }
580
+ /**
581
+ * Renders the smallest text a verdict can travel as: what it judged, and how it ended.
582
+ *
583
+ * @remarks
584
+ * A reply whose bounds refuse both the record and the whole rendering answers with this text, so it
585
+ * carries what a reader cannot recompute — the call's identity, the claim's digest, and the
586
+ * control's reason when the verdict carries one — and closes with the same line `formatVerdict`
587
+ * closes with. Every line here is a line `formatVerdict` renders at the same position relative to
588
+ * the ones around it, so a reader meets one shape whichever answer arrived.
589
+ *
590
+ * @param verdict - The verdict to render
591
+ * @returns The identity and claim lines, the reason when present, then the closing receipt line
592
+ *
593
+ * @example
594
+ * ```ts
595
+ * formatReceipt(disproven).split('\n')
596
+ * // ['probe 88a5addc-7d33-40dc-9a5a-104b71f8787d (549 ms)', 'claim 6ca20c3bff623031d3955b9d1a76d71d', 'no receipt']
597
+ * ```
598
+ */
599
+ function formatReceipt(verdict) {
600
+ const reason = verdict.reason === void 0 ? [] : [`reason ${verdict.reason}`];
601
+ return [
602
+ `probe ${verdict.id} (${verdict.elapsed} ms)`,
603
+ `claim ${verdict.digest}`,
604
+ ...reason,
605
+ formatProof(verdict)
606
+ ].join("\n");
607
+ }
608
+ /**
481
609
  * Renders a whole verdict as the text an agent reads.
482
610
  *
483
611
  * @remarks
@@ -505,7 +633,6 @@ function formatVerdict(verdict) {
505
633
  const tools = `toolchain typescript ${typescript}, oxlint ${oxlint}, vitest ${vitest}`;
506
634
  const project = `project ${verdict.project.path} ${verdict.project.digest}`;
507
635
  const reason = verdict.reason === void 0 ? [] : [`reason ${verdict.reason}`];
508
- const proof = verdict.receipt === void 0 ? "no receipt" : `receipt ${verdict.receipt}`;
509
636
  return [
510
637
  `probe ${verdict.id} (${verdict.elapsed} ms)`,
511
638
  `claim ${verdict.digest}`,
@@ -514,7 +641,7 @@ function formatVerdict(verdict) {
514
641
  ...reason,
515
642
  ...verdict.case.map((check) => `case ${formatCheck(check)}`),
516
643
  ...verdict.control.map((check) => `control ${formatCheck(check)}`),
517
- proof
644
+ formatProof(verdict)
518
645
  ].join("\n");
519
646
  }
520
647
  /**
@@ -709,6 +836,6 @@ var CLAIM_SHAPE = objectShape({
709
836
  control: CONTROL_SHAPE
710
837
  }, { description: "One claim: the project, the case, and the control that must break." });
711
838
  //#endregion
712
- export { CASE_SHAPE, CLAIM_SHAPE, CONTROL_SHAPE, DRAFT_SHAPE, PROBE_ERROR_CODES, PROBE_PARTIES, PROBE_STAGES, ProbeError, RECEIPT_PREFIX, RECEIPT_SEPARATOR, computeReceipt, createDestroyedError, formatCheck, formatIssue, formatSpecification, formatVerdict, isCase, isCheck, isClaim, isControl, isDraft, isIssue, isParty, isProbeError, isProject, isStage, isToolchain, isVerdict, matchesSpecification };
839
+ export { CASE_SHAPE, CLAIM_SHAPE, CONTROL_SHAPE, DRAFT_SHAPE, LINT_DEADLINE, PROBE_DEADLINE, PROBE_ERROR_CODES, PROBE_KEYS, PROBE_PARTIES, PROBE_SPECIFICATIONS, PROBE_STAGES, ProbeError, RECEIPT_PREFIX, RECEIPT_SEPARATOR, RUNTIME_PLUGIN, computeReceipt, createDestroyedError, formatCheck, formatIssue, formatProof, formatReceipt, formatSpecification, formatVerdict, isCase, isCheck, isClaim, isControl, isDraft, isIssue, isParty, isProbeError, isProject, isStage, isToolchain, isVerdict, matchesSpecification };
713
840
 
714
841
  //# sourceMappingURL=index.js.map