@actuarial-ts/agents 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -1
- package/dist/advisor.d.ts +1 -0
- package/dist/advisor.d.ts.map +1 -1
- package/dist/advisor.js +2 -0
- package/dist/advisor.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +18 -0
- package/dist/errors.js.map +1 -1
- package/dist/evals.d.ts +1 -1
- package/dist/evals.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/judgment.d.ts +1 -1
- package/dist/judgment.js +1 -1
- package/dist/review.d.ts +729 -0
- package/dist/review.d.ts.map +1 -0
- package/dist/review.js +674 -0
- package/dist/review.js.map +1 -0
- package/dist/tools.d.ts +2 -2
- package/dist/tools.js +1 -1
- package/package.json +6 -6
- package/src/advisor.ts +4 -0
- package/src/errors.ts +18 -0
- package/src/evals.ts +1 -1
- package/src/index.ts +1 -0
- package/src/judgment.ts +1 -1
- package/src/remote.ts +1 -1
- package/src/review.ts +1116 -0
- package/src/tools.ts +2 -2
package/dist/review.d.ts
ADDED
|
@@ -0,0 +1,729 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trusted agent boundary for a complete analytical review.
|
|
3
|
+
*
|
|
4
|
+
* The model can select only opaque identifiers from a host-owned catalog. It
|
|
5
|
+
* cannot author a plan, formula, source location, financial definition, input
|
|
6
|
+
* payload or tenant id. The host resolves those identifiers, performs the
|
|
7
|
+
* calculation, and returns a current-process VerifiedReviewSnapshot together
|
|
8
|
+
* with an exact scope receipt. This module validates that receipt before
|
|
9
|
+
* projecting review evidence back to the model.
|
|
10
|
+
*
|
|
11
|
+
* Manual priors, factor overrides, selections, waivers and adopted ranges are
|
|
12
|
+
* separate judgment gates. They reuse createJudgmentChain so every adopted
|
|
13
|
+
* decision suspends, requires a rationale, reads actor identity from trusted
|
|
14
|
+
* request context and enters the compliance ledger.
|
|
15
|
+
*/
|
|
16
|
+
import { type AnalysisReference } from "@actuarial-ts/core";
|
|
17
|
+
import { type ReviewSnapshotReadiness, type VerifiedReviewSnapshot } from "@actuarial-ts/compliance";
|
|
18
|
+
import { z } from "zod";
|
|
19
|
+
import { type CreateJudgmentChainOptions, type JudgmentApplication, type JudgmentChainWorkflow, type JudgmentGateContext } from "./judgment.js";
|
|
20
|
+
import { type DefinedActuarialTool, type ToolEnvelopeFailure } from "./tools.js";
|
|
21
|
+
export declare const REVIEW_AGENT_LIMITS: Readonly<{
|
|
22
|
+
maximumPresets: 64;
|
|
23
|
+
maximumMethods: 64;
|
|
24
|
+
maximumAssumptions: 256;
|
|
25
|
+
maximumOptions: 128;
|
|
26
|
+
maximumJudgments: 128;
|
|
27
|
+
maximumCandidatesPerJudgment: 128;
|
|
28
|
+
maximumEligibilityItems: 640;
|
|
29
|
+
maximumReasonCodes: 64;
|
|
30
|
+
maximumAffectedCoordinates: 1000;
|
|
31
|
+
maximumRemedies: 64;
|
|
32
|
+
maximumTextCharacters: 20000;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const reviewAgentDiscoveryInputSchema: z.ZodObject<{
|
|
35
|
+
runPresetId: z.ZodEffects<z.ZodString, string, string>;
|
|
36
|
+
}, "strict", z.ZodTypeAny, {
|
|
37
|
+
runPresetId: string;
|
|
38
|
+
}, {
|
|
39
|
+
runPresetId: string;
|
|
40
|
+
}>;
|
|
41
|
+
export declare const reviewAgentExecutionInputSchema: z.ZodObject<{
|
|
42
|
+
runPresetId: z.ZodEffects<z.ZodString, string, string>;
|
|
43
|
+
planId: z.ZodEffects<z.ZodString, string, string>;
|
|
44
|
+
inputId: z.ZodEffects<z.ZodString, string, string>;
|
|
45
|
+
methodIds: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">, string[], string[]>;
|
|
46
|
+
assumptionIds: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">, string[], string[]>;
|
|
47
|
+
optionIds: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">, string[], string[]>;
|
|
48
|
+
}, "strict", z.ZodTypeAny, {
|
|
49
|
+
runPresetId: string;
|
|
50
|
+
planId: string;
|
|
51
|
+
inputId: string;
|
|
52
|
+
methodIds: string[];
|
|
53
|
+
assumptionIds: string[];
|
|
54
|
+
optionIds: string[];
|
|
55
|
+
}, {
|
|
56
|
+
runPresetId: string;
|
|
57
|
+
planId: string;
|
|
58
|
+
inputId: string;
|
|
59
|
+
methodIds: string[];
|
|
60
|
+
assumptionIds: string[];
|
|
61
|
+
optionIds: string[];
|
|
62
|
+
}>;
|
|
63
|
+
export type ReviewAgentDiscoveryInput = z.output<typeof reviewAgentDiscoveryInputSchema>;
|
|
64
|
+
export type ReviewAgentExecutionInput = z.output<typeof reviewAgentExecutionInputSchema>;
|
|
65
|
+
export declare const REVIEW_AGENT_ELIGIBILITY_STATUSES: readonly ["supported", "supported-with-warnings", "requires-input", "unsupported"];
|
|
66
|
+
export type ReviewAgentEligibilityStatus = (typeof REVIEW_AGENT_ELIGIBILITY_STATUSES)[number];
|
|
67
|
+
export declare const REVIEW_AGENT_SUBJECT_KINDS: readonly ["plan", "input", "method", "assumption", "option"];
|
|
68
|
+
export type ReviewAgentSubjectKind = (typeof REVIEW_AGENT_SUBJECT_KINDS)[number];
|
|
69
|
+
export interface ReviewAgentEligibility {
|
|
70
|
+
readonly kind: ReviewAgentSubjectKind;
|
|
71
|
+
readonly id: string;
|
|
72
|
+
readonly status: ReviewAgentEligibilityStatus;
|
|
73
|
+
readonly reasonCodes: readonly string[];
|
|
74
|
+
readonly affectedCoordinates: readonly string[];
|
|
75
|
+
readonly remedies: readonly string[];
|
|
76
|
+
}
|
|
77
|
+
export declare const reviewAgentEligibilitySchema: z.ZodType<ReviewAgentEligibility>;
|
|
78
|
+
export declare const REVIEW_AGENT_JUDGMENT_KINDS: readonly ["manual-prior", "factor-override", "manual-selection", "requirement-waiver", "adopted-range"];
|
|
79
|
+
export type ReviewAgentJudgmentKind = (typeof REVIEW_AGENT_JUDGMENT_KINDS)[number];
|
|
80
|
+
export interface ReviewAgentCatalogItem {
|
|
81
|
+
readonly id: string;
|
|
82
|
+
readonly label: string;
|
|
83
|
+
}
|
|
84
|
+
export interface ReviewAgentMethod extends ReviewAgentCatalogItem {
|
|
85
|
+
/** Exact node and operation which must occur in the returned review plan. */
|
|
86
|
+
readonly nodeId: string;
|
|
87
|
+
readonly operation: string;
|
|
88
|
+
}
|
|
89
|
+
export interface ReviewAgentAssumption extends ReviewAgentCatalogItem {
|
|
90
|
+
readonly reference: AnalysisReference;
|
|
91
|
+
}
|
|
92
|
+
export interface ReviewAgentJudgmentDescriptor {
|
|
93
|
+
readonly id: string;
|
|
94
|
+
readonly kind: ReviewAgentJudgmentKind;
|
|
95
|
+
readonly targetId: string;
|
|
96
|
+
readonly candidateIds: readonly string[];
|
|
97
|
+
}
|
|
98
|
+
export interface ReviewAgentPresetInspectionInput {
|
|
99
|
+
readonly tenantId: string;
|
|
100
|
+
readonly runPresetId: string;
|
|
101
|
+
readonly presetVersion: string;
|
|
102
|
+
}
|
|
103
|
+
export interface ReviewAgentPresetExecutionInput extends ReviewAgentPresetInspectionInput {
|
|
104
|
+
readonly requestIdentity: string;
|
|
105
|
+
readonly planId: string;
|
|
106
|
+
readonly inputId: string;
|
|
107
|
+
readonly methodIds: readonly string[];
|
|
108
|
+
readonly assumptionIds: readonly string[];
|
|
109
|
+
readonly optionIds: readonly string[];
|
|
110
|
+
}
|
|
111
|
+
export interface ReviewAgentExecutionScope extends ReviewAgentPresetExecutionInput {
|
|
112
|
+
}
|
|
113
|
+
export interface ReviewAgentExecutionReceipt {
|
|
114
|
+
readonly scope: ReviewAgentExecutionScope;
|
|
115
|
+
/** Must retain its current-process authenticity brand. Copies are refused. */
|
|
116
|
+
readonly snapshot: VerifiedReviewSnapshot;
|
|
117
|
+
}
|
|
118
|
+
export interface ReviewAgentRunPreset {
|
|
119
|
+
readonly id: string;
|
|
120
|
+
readonly version: string;
|
|
121
|
+
readonly label: string;
|
|
122
|
+
readonly plan: {
|
|
123
|
+
readonly id: string;
|
|
124
|
+
readonly reference: AnalysisReference;
|
|
125
|
+
};
|
|
126
|
+
readonly input: {
|
|
127
|
+
readonly id: string;
|
|
128
|
+
/** Exact input/scope reference which must occur in the verified run. */
|
|
129
|
+
readonly reference: AnalysisReference;
|
|
130
|
+
};
|
|
131
|
+
readonly profile: {
|
|
132
|
+
readonly id: string;
|
|
133
|
+
readonly version: string;
|
|
134
|
+
};
|
|
135
|
+
readonly methods: readonly ReviewAgentMethod[];
|
|
136
|
+
readonly assumptions: readonly ReviewAgentAssumption[];
|
|
137
|
+
readonly options: readonly ReviewAgentCatalogItem[];
|
|
138
|
+
readonly judgments: readonly ReviewAgentJudgmentDescriptor[];
|
|
139
|
+
/** Returns one contextual eligibility item for every exposed catalog item. */
|
|
140
|
+
readonly inspect: (input: ReviewAgentPresetInspectionInput) => Promise<readonly ReviewAgentEligibility[]>;
|
|
141
|
+
readonly execute: (input: ReviewAgentPresetExecutionInput) => Promise<ReviewAgentExecutionReceipt>;
|
|
142
|
+
}
|
|
143
|
+
export declare const reviewAgentDiscoveryResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
144
|
+
success: z.ZodLiteral<true>;
|
|
145
|
+
data: z.ZodObject<{
|
|
146
|
+
runPresetId: z.ZodEffects<z.ZodString, string, string>;
|
|
147
|
+
presetVersion: z.ZodEffects<z.ZodString, string, string>;
|
|
148
|
+
label: z.ZodEffects<z.ZodString, string, string>;
|
|
149
|
+
planId: z.ZodEffects<z.ZodString, string, string>;
|
|
150
|
+
inputId: z.ZodEffects<z.ZodString, string, string>;
|
|
151
|
+
profile: z.ZodObject<{
|
|
152
|
+
id: z.ZodEffects<z.ZodString, string, string>;
|
|
153
|
+
version: z.ZodEffects<z.ZodString, string, string>;
|
|
154
|
+
}, "strict", z.ZodTypeAny, {
|
|
155
|
+
id: string;
|
|
156
|
+
version: string;
|
|
157
|
+
}, {
|
|
158
|
+
id: string;
|
|
159
|
+
version: string;
|
|
160
|
+
}>;
|
|
161
|
+
methods: z.ZodArray<z.ZodObject<{
|
|
162
|
+
id: z.ZodEffects<z.ZodString, string, string>;
|
|
163
|
+
label: z.ZodEffects<z.ZodString, string, string>;
|
|
164
|
+
} & {
|
|
165
|
+
nodeId: z.ZodEffects<z.ZodString, string, string>;
|
|
166
|
+
operation: z.ZodEffects<z.ZodString, string, string>;
|
|
167
|
+
}, "strict", z.ZodTypeAny, {
|
|
168
|
+
id: string;
|
|
169
|
+
label: string;
|
|
170
|
+
operation: string;
|
|
171
|
+
nodeId: string;
|
|
172
|
+
}, {
|
|
173
|
+
id: string;
|
|
174
|
+
label: string;
|
|
175
|
+
operation: string;
|
|
176
|
+
nodeId: string;
|
|
177
|
+
}>, "many">;
|
|
178
|
+
assumptions: z.ZodArray<z.ZodObject<{
|
|
179
|
+
id: z.ZodEffects<z.ZodString, string, string>;
|
|
180
|
+
label: z.ZodEffects<z.ZodString, string, string>;
|
|
181
|
+
}, "strict", z.ZodTypeAny, {
|
|
182
|
+
id: string;
|
|
183
|
+
label: string;
|
|
184
|
+
}, {
|
|
185
|
+
id: string;
|
|
186
|
+
label: string;
|
|
187
|
+
}>, "many">;
|
|
188
|
+
options: z.ZodArray<z.ZodObject<{
|
|
189
|
+
id: z.ZodEffects<z.ZodString, string, string>;
|
|
190
|
+
label: z.ZodEffects<z.ZodString, string, string>;
|
|
191
|
+
}, "strict", z.ZodTypeAny, {
|
|
192
|
+
id: string;
|
|
193
|
+
label: string;
|
|
194
|
+
}, {
|
|
195
|
+
id: string;
|
|
196
|
+
label: string;
|
|
197
|
+
}>, "many">;
|
|
198
|
+
judgments: z.ZodArray<z.ZodObject<{
|
|
199
|
+
id: z.ZodEffects<z.ZodString, string, string>;
|
|
200
|
+
kind: z.ZodEnum<["manual-prior", "factor-override", "manual-selection", "requirement-waiver", "adopted-range"]>;
|
|
201
|
+
targetId: z.ZodEffects<z.ZodString, string, string>;
|
|
202
|
+
candidateIds: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">, string[], string[]>;
|
|
203
|
+
}, "strict", z.ZodTypeAny, {
|
|
204
|
+
id: string;
|
|
205
|
+
kind: "manual-prior" | "factor-override" | "manual-selection" | "requirement-waiver" | "adopted-range";
|
|
206
|
+
targetId: string;
|
|
207
|
+
candidateIds: string[];
|
|
208
|
+
}, {
|
|
209
|
+
id: string;
|
|
210
|
+
kind: "manual-prior" | "factor-override" | "manual-selection" | "requirement-waiver" | "adopted-range";
|
|
211
|
+
targetId: string;
|
|
212
|
+
candidateIds: string[];
|
|
213
|
+
}>, "many">;
|
|
214
|
+
eligibility: z.ZodArray<z.ZodType<ReviewAgentEligibility, z.ZodTypeDef, ReviewAgentEligibility>, "many">;
|
|
215
|
+
}, "strict", z.ZodTypeAny, {
|
|
216
|
+
options: {
|
|
217
|
+
id: string;
|
|
218
|
+
label: string;
|
|
219
|
+
}[];
|
|
220
|
+
runPresetId: string;
|
|
221
|
+
label: string;
|
|
222
|
+
planId: string;
|
|
223
|
+
inputId: string;
|
|
224
|
+
presetVersion: string;
|
|
225
|
+
profile: {
|
|
226
|
+
id: string;
|
|
227
|
+
version: string;
|
|
228
|
+
};
|
|
229
|
+
methods: {
|
|
230
|
+
id: string;
|
|
231
|
+
label: string;
|
|
232
|
+
operation: string;
|
|
233
|
+
nodeId: string;
|
|
234
|
+
}[];
|
|
235
|
+
assumptions: {
|
|
236
|
+
id: string;
|
|
237
|
+
label: string;
|
|
238
|
+
}[];
|
|
239
|
+
judgments: {
|
|
240
|
+
id: string;
|
|
241
|
+
kind: "manual-prior" | "factor-override" | "manual-selection" | "requirement-waiver" | "adopted-range";
|
|
242
|
+
targetId: string;
|
|
243
|
+
candidateIds: string[];
|
|
244
|
+
}[];
|
|
245
|
+
eligibility: ReviewAgentEligibility[];
|
|
246
|
+
}, {
|
|
247
|
+
options: {
|
|
248
|
+
id: string;
|
|
249
|
+
label: string;
|
|
250
|
+
}[];
|
|
251
|
+
runPresetId: string;
|
|
252
|
+
label: string;
|
|
253
|
+
planId: string;
|
|
254
|
+
inputId: string;
|
|
255
|
+
presetVersion: string;
|
|
256
|
+
profile: {
|
|
257
|
+
id: string;
|
|
258
|
+
version: string;
|
|
259
|
+
};
|
|
260
|
+
methods: {
|
|
261
|
+
id: string;
|
|
262
|
+
label: string;
|
|
263
|
+
operation: string;
|
|
264
|
+
nodeId: string;
|
|
265
|
+
}[];
|
|
266
|
+
assumptions: {
|
|
267
|
+
id: string;
|
|
268
|
+
label: string;
|
|
269
|
+
}[];
|
|
270
|
+
judgments: {
|
|
271
|
+
id: string;
|
|
272
|
+
kind: "manual-prior" | "factor-override" | "manual-selection" | "requirement-waiver" | "adopted-range";
|
|
273
|
+
targetId: string;
|
|
274
|
+
candidateIds: string[];
|
|
275
|
+
}[];
|
|
276
|
+
eligibility: ReviewAgentEligibility[];
|
|
277
|
+
}>;
|
|
278
|
+
}, "strict", z.ZodTypeAny, {
|
|
279
|
+
data: {
|
|
280
|
+
options: {
|
|
281
|
+
id: string;
|
|
282
|
+
label: string;
|
|
283
|
+
}[];
|
|
284
|
+
runPresetId: string;
|
|
285
|
+
label: string;
|
|
286
|
+
planId: string;
|
|
287
|
+
inputId: string;
|
|
288
|
+
presetVersion: string;
|
|
289
|
+
profile: {
|
|
290
|
+
id: string;
|
|
291
|
+
version: string;
|
|
292
|
+
};
|
|
293
|
+
methods: {
|
|
294
|
+
id: string;
|
|
295
|
+
label: string;
|
|
296
|
+
operation: string;
|
|
297
|
+
nodeId: string;
|
|
298
|
+
}[];
|
|
299
|
+
assumptions: {
|
|
300
|
+
id: string;
|
|
301
|
+
label: string;
|
|
302
|
+
}[];
|
|
303
|
+
judgments: {
|
|
304
|
+
id: string;
|
|
305
|
+
kind: "manual-prior" | "factor-override" | "manual-selection" | "requirement-waiver" | "adopted-range";
|
|
306
|
+
targetId: string;
|
|
307
|
+
candidateIds: string[];
|
|
308
|
+
}[];
|
|
309
|
+
eligibility: ReviewAgentEligibility[];
|
|
310
|
+
};
|
|
311
|
+
success: true;
|
|
312
|
+
}, {
|
|
313
|
+
data: {
|
|
314
|
+
options: {
|
|
315
|
+
id: string;
|
|
316
|
+
label: string;
|
|
317
|
+
}[];
|
|
318
|
+
runPresetId: string;
|
|
319
|
+
label: string;
|
|
320
|
+
planId: string;
|
|
321
|
+
inputId: string;
|
|
322
|
+
presetVersion: string;
|
|
323
|
+
profile: {
|
|
324
|
+
id: string;
|
|
325
|
+
version: string;
|
|
326
|
+
};
|
|
327
|
+
methods: {
|
|
328
|
+
id: string;
|
|
329
|
+
label: string;
|
|
330
|
+
operation: string;
|
|
331
|
+
nodeId: string;
|
|
332
|
+
}[];
|
|
333
|
+
assumptions: {
|
|
334
|
+
id: string;
|
|
335
|
+
label: string;
|
|
336
|
+
}[];
|
|
337
|
+
judgments: {
|
|
338
|
+
id: string;
|
|
339
|
+
kind: "manual-prior" | "factor-override" | "manual-selection" | "requirement-waiver" | "adopted-range";
|
|
340
|
+
targetId: string;
|
|
341
|
+
candidateIds: string[];
|
|
342
|
+
}[];
|
|
343
|
+
eligibility: ReviewAgentEligibility[];
|
|
344
|
+
};
|
|
345
|
+
success: true;
|
|
346
|
+
}>, z.ZodObject<{
|
|
347
|
+
success: z.ZodLiteral<false>;
|
|
348
|
+
error: z.ZodObject<{
|
|
349
|
+
code: z.ZodString;
|
|
350
|
+
message: z.ZodString;
|
|
351
|
+
}, "strict", z.ZodTypeAny, {
|
|
352
|
+
code: string;
|
|
353
|
+
message: string;
|
|
354
|
+
}, {
|
|
355
|
+
code: string;
|
|
356
|
+
message: string;
|
|
357
|
+
}>;
|
|
358
|
+
}, "strict", z.ZodTypeAny, {
|
|
359
|
+
error: {
|
|
360
|
+
code: string;
|
|
361
|
+
message: string;
|
|
362
|
+
};
|
|
363
|
+
success: false;
|
|
364
|
+
}, {
|
|
365
|
+
error: {
|
|
366
|
+
code: string;
|
|
367
|
+
message: string;
|
|
368
|
+
};
|
|
369
|
+
success: false;
|
|
370
|
+
}>]>;
|
|
371
|
+
export declare const reviewAgentExecutionResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
372
|
+
success: z.ZodLiteral<true>;
|
|
373
|
+
data: z.ZodObject<{
|
|
374
|
+
runPresetId: z.ZodEffects<z.ZodString, string, string>;
|
|
375
|
+
presetVersion: z.ZodEffects<z.ZodString, string, string>;
|
|
376
|
+
requestIdentity: z.ZodString;
|
|
377
|
+
planId: z.ZodEffects<z.ZodString, string, string>;
|
|
378
|
+
inputId: z.ZodEffects<z.ZodString, string, string>;
|
|
379
|
+
methodIds: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
380
|
+
assumptionIds: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
381
|
+
optionIds: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
382
|
+
snapshot: z.ZodObject<{
|
|
383
|
+
id: z.ZodEffects<z.ZodString, string, string>;
|
|
384
|
+
version: z.ZodEffects<z.ZodString, string, string>;
|
|
385
|
+
reference: z.ZodObject<{
|
|
386
|
+
kind: z.ZodEnum<["source", "scope", "amount-basis", "exposure-basis", "period", "assumption", "result", "adjustment", "context"]>;
|
|
387
|
+
id: z.ZodEffects<z.ZodString, string, string>;
|
|
388
|
+
version: z.ZodEffects<z.ZodString, string, string>;
|
|
389
|
+
contentIdentity: z.ZodEffects<z.ZodString, string, string>;
|
|
390
|
+
}, "strict", z.ZodTypeAny, {
|
|
391
|
+
id: string;
|
|
392
|
+
kind: "source" | "scope" | "period" | "amount-basis" | "exposure-basis" | "assumption" | "result" | "adjustment" | "context";
|
|
393
|
+
version: string;
|
|
394
|
+
contentIdentity: string;
|
|
395
|
+
}, {
|
|
396
|
+
id: string;
|
|
397
|
+
kind: "source" | "scope" | "period" | "amount-basis" | "exposure-basis" | "assumption" | "result" | "adjustment" | "context";
|
|
398
|
+
version: string;
|
|
399
|
+
contentIdentity: string;
|
|
400
|
+
}>;
|
|
401
|
+
profile: z.ZodObject<{
|
|
402
|
+
id: z.ZodEffects<z.ZodString, string, string>;
|
|
403
|
+
version: z.ZodEffects<z.ZodString, string, string>;
|
|
404
|
+
}, "strict", z.ZodTypeAny, {
|
|
405
|
+
id: string;
|
|
406
|
+
version: string;
|
|
407
|
+
}, {
|
|
408
|
+
id: string;
|
|
409
|
+
version: string;
|
|
410
|
+
}>;
|
|
411
|
+
readiness: z.ZodType<ReviewSnapshotReadiness, z.ZodTypeDef, ReviewSnapshotReadiness>;
|
|
412
|
+
limitations: z.ZodArray<z.ZodObject<{
|
|
413
|
+
id: z.ZodEffects<z.ZodString, string, string>;
|
|
414
|
+
disposition: z.ZodEnum<["unresolved", "accepted"]>;
|
|
415
|
+
}, "strict", z.ZodTypeAny, {
|
|
416
|
+
id: string;
|
|
417
|
+
disposition: "unresolved" | "accepted";
|
|
418
|
+
}, {
|
|
419
|
+
id: string;
|
|
420
|
+
disposition: "unresolved" | "accepted";
|
|
421
|
+
}>, "many">;
|
|
422
|
+
findingCodes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
423
|
+
assurance: z.ZodObject<{
|
|
424
|
+
frozen: z.ZodLiteral<true>;
|
|
425
|
+
review: z.ZodLiteral<"not-attested">;
|
|
426
|
+
publication: z.ZodLiteral<"not-reported">;
|
|
427
|
+
}, "strict", z.ZodTypeAny, {
|
|
428
|
+
review: "not-attested";
|
|
429
|
+
publication: "not-reported";
|
|
430
|
+
frozen: true;
|
|
431
|
+
}, {
|
|
432
|
+
review: "not-attested";
|
|
433
|
+
publication: "not-reported";
|
|
434
|
+
frozen: true;
|
|
435
|
+
}>;
|
|
436
|
+
}, "strict", z.ZodTypeAny, {
|
|
437
|
+
id: string;
|
|
438
|
+
version: string;
|
|
439
|
+
reference: {
|
|
440
|
+
id: string;
|
|
441
|
+
kind: "source" | "scope" | "period" | "amount-basis" | "exposure-basis" | "assumption" | "result" | "adjustment" | "context";
|
|
442
|
+
version: string;
|
|
443
|
+
contentIdentity: string;
|
|
444
|
+
};
|
|
445
|
+
assurance: {
|
|
446
|
+
review: "not-attested";
|
|
447
|
+
publication: "not-reported";
|
|
448
|
+
frozen: true;
|
|
449
|
+
};
|
|
450
|
+
profile: {
|
|
451
|
+
id: string;
|
|
452
|
+
version: string;
|
|
453
|
+
};
|
|
454
|
+
readiness: ReviewSnapshotReadiness;
|
|
455
|
+
limitations: {
|
|
456
|
+
id: string;
|
|
457
|
+
disposition: "unresolved" | "accepted";
|
|
458
|
+
}[];
|
|
459
|
+
findingCodes: string[];
|
|
460
|
+
}, {
|
|
461
|
+
id: string;
|
|
462
|
+
version: string;
|
|
463
|
+
reference: {
|
|
464
|
+
id: string;
|
|
465
|
+
kind: "source" | "scope" | "period" | "amount-basis" | "exposure-basis" | "assumption" | "result" | "adjustment" | "context";
|
|
466
|
+
version: string;
|
|
467
|
+
contentIdentity: string;
|
|
468
|
+
};
|
|
469
|
+
assurance: {
|
|
470
|
+
review: "not-attested";
|
|
471
|
+
publication: "not-reported";
|
|
472
|
+
frozen: true;
|
|
473
|
+
};
|
|
474
|
+
profile: {
|
|
475
|
+
id: string;
|
|
476
|
+
version: string;
|
|
477
|
+
};
|
|
478
|
+
readiness: ReviewSnapshotReadiness;
|
|
479
|
+
limitations: {
|
|
480
|
+
id: string;
|
|
481
|
+
disposition: "unresolved" | "accepted";
|
|
482
|
+
}[];
|
|
483
|
+
findingCodes: string[];
|
|
484
|
+
}>;
|
|
485
|
+
}, "strict", z.ZodTypeAny, {
|
|
486
|
+
runPresetId: string;
|
|
487
|
+
planId: string;
|
|
488
|
+
inputId: string;
|
|
489
|
+
methodIds: string[];
|
|
490
|
+
assumptionIds: string[];
|
|
491
|
+
optionIds: string[];
|
|
492
|
+
presetVersion: string;
|
|
493
|
+
requestIdentity: string;
|
|
494
|
+
snapshot: {
|
|
495
|
+
id: string;
|
|
496
|
+
version: string;
|
|
497
|
+
reference: {
|
|
498
|
+
id: string;
|
|
499
|
+
kind: "source" | "scope" | "period" | "amount-basis" | "exposure-basis" | "assumption" | "result" | "adjustment" | "context";
|
|
500
|
+
version: string;
|
|
501
|
+
contentIdentity: string;
|
|
502
|
+
};
|
|
503
|
+
assurance: {
|
|
504
|
+
review: "not-attested";
|
|
505
|
+
publication: "not-reported";
|
|
506
|
+
frozen: true;
|
|
507
|
+
};
|
|
508
|
+
profile: {
|
|
509
|
+
id: string;
|
|
510
|
+
version: string;
|
|
511
|
+
};
|
|
512
|
+
readiness: ReviewSnapshotReadiness;
|
|
513
|
+
limitations: {
|
|
514
|
+
id: string;
|
|
515
|
+
disposition: "unresolved" | "accepted";
|
|
516
|
+
}[];
|
|
517
|
+
findingCodes: string[];
|
|
518
|
+
};
|
|
519
|
+
}, {
|
|
520
|
+
runPresetId: string;
|
|
521
|
+
planId: string;
|
|
522
|
+
inputId: string;
|
|
523
|
+
methodIds: string[];
|
|
524
|
+
assumptionIds: string[];
|
|
525
|
+
optionIds: string[];
|
|
526
|
+
presetVersion: string;
|
|
527
|
+
requestIdentity: string;
|
|
528
|
+
snapshot: {
|
|
529
|
+
id: string;
|
|
530
|
+
version: string;
|
|
531
|
+
reference: {
|
|
532
|
+
id: string;
|
|
533
|
+
kind: "source" | "scope" | "period" | "amount-basis" | "exposure-basis" | "assumption" | "result" | "adjustment" | "context";
|
|
534
|
+
version: string;
|
|
535
|
+
contentIdentity: string;
|
|
536
|
+
};
|
|
537
|
+
assurance: {
|
|
538
|
+
review: "not-attested";
|
|
539
|
+
publication: "not-reported";
|
|
540
|
+
frozen: true;
|
|
541
|
+
};
|
|
542
|
+
profile: {
|
|
543
|
+
id: string;
|
|
544
|
+
version: string;
|
|
545
|
+
};
|
|
546
|
+
readiness: ReviewSnapshotReadiness;
|
|
547
|
+
limitations: {
|
|
548
|
+
id: string;
|
|
549
|
+
disposition: "unresolved" | "accepted";
|
|
550
|
+
}[];
|
|
551
|
+
findingCodes: string[];
|
|
552
|
+
};
|
|
553
|
+
}>;
|
|
554
|
+
}, "strict", z.ZodTypeAny, {
|
|
555
|
+
data: {
|
|
556
|
+
runPresetId: string;
|
|
557
|
+
planId: string;
|
|
558
|
+
inputId: string;
|
|
559
|
+
methodIds: string[];
|
|
560
|
+
assumptionIds: string[];
|
|
561
|
+
optionIds: string[];
|
|
562
|
+
presetVersion: string;
|
|
563
|
+
requestIdentity: string;
|
|
564
|
+
snapshot: {
|
|
565
|
+
id: string;
|
|
566
|
+
version: string;
|
|
567
|
+
reference: {
|
|
568
|
+
id: string;
|
|
569
|
+
kind: "source" | "scope" | "period" | "amount-basis" | "exposure-basis" | "assumption" | "result" | "adjustment" | "context";
|
|
570
|
+
version: string;
|
|
571
|
+
contentIdentity: string;
|
|
572
|
+
};
|
|
573
|
+
assurance: {
|
|
574
|
+
review: "not-attested";
|
|
575
|
+
publication: "not-reported";
|
|
576
|
+
frozen: true;
|
|
577
|
+
};
|
|
578
|
+
profile: {
|
|
579
|
+
id: string;
|
|
580
|
+
version: string;
|
|
581
|
+
};
|
|
582
|
+
readiness: ReviewSnapshotReadiness;
|
|
583
|
+
limitations: {
|
|
584
|
+
id: string;
|
|
585
|
+
disposition: "unresolved" | "accepted";
|
|
586
|
+
}[];
|
|
587
|
+
findingCodes: string[];
|
|
588
|
+
};
|
|
589
|
+
};
|
|
590
|
+
success: true;
|
|
591
|
+
}, {
|
|
592
|
+
data: {
|
|
593
|
+
runPresetId: string;
|
|
594
|
+
planId: string;
|
|
595
|
+
inputId: string;
|
|
596
|
+
methodIds: string[];
|
|
597
|
+
assumptionIds: string[];
|
|
598
|
+
optionIds: string[];
|
|
599
|
+
presetVersion: string;
|
|
600
|
+
requestIdentity: string;
|
|
601
|
+
snapshot: {
|
|
602
|
+
id: string;
|
|
603
|
+
version: string;
|
|
604
|
+
reference: {
|
|
605
|
+
id: string;
|
|
606
|
+
kind: "source" | "scope" | "period" | "amount-basis" | "exposure-basis" | "assumption" | "result" | "adjustment" | "context";
|
|
607
|
+
version: string;
|
|
608
|
+
contentIdentity: string;
|
|
609
|
+
};
|
|
610
|
+
assurance: {
|
|
611
|
+
review: "not-attested";
|
|
612
|
+
publication: "not-reported";
|
|
613
|
+
frozen: true;
|
|
614
|
+
};
|
|
615
|
+
profile: {
|
|
616
|
+
id: string;
|
|
617
|
+
version: string;
|
|
618
|
+
};
|
|
619
|
+
readiness: ReviewSnapshotReadiness;
|
|
620
|
+
limitations: {
|
|
621
|
+
id: string;
|
|
622
|
+
disposition: "unresolved" | "accepted";
|
|
623
|
+
}[];
|
|
624
|
+
findingCodes: string[];
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
success: true;
|
|
628
|
+
}>, z.ZodObject<{
|
|
629
|
+
success: z.ZodLiteral<false>;
|
|
630
|
+
error: z.ZodObject<{
|
|
631
|
+
code: z.ZodString;
|
|
632
|
+
message: z.ZodString;
|
|
633
|
+
}, "strict", z.ZodTypeAny, {
|
|
634
|
+
code: string;
|
|
635
|
+
message: string;
|
|
636
|
+
}, {
|
|
637
|
+
code: string;
|
|
638
|
+
message: string;
|
|
639
|
+
}>;
|
|
640
|
+
}, "strict", z.ZodTypeAny, {
|
|
641
|
+
error: {
|
|
642
|
+
code: string;
|
|
643
|
+
message: string;
|
|
644
|
+
};
|
|
645
|
+
success: false;
|
|
646
|
+
}, {
|
|
647
|
+
error: {
|
|
648
|
+
code: string;
|
|
649
|
+
message: string;
|
|
650
|
+
};
|
|
651
|
+
success: false;
|
|
652
|
+
}>]>;
|
|
653
|
+
export type ReviewAgentDiscoverySuccess = Extract<z.output<typeof reviewAgentDiscoveryResultSchema>, {
|
|
654
|
+
success: true;
|
|
655
|
+
}>;
|
|
656
|
+
export type ReviewAgentExecutionSuccess = Extract<z.output<typeof reviewAgentExecutionResultSchema>, {
|
|
657
|
+
success: true;
|
|
658
|
+
}>;
|
|
659
|
+
export interface CreateReviewAgentToolsInput {
|
|
660
|
+
readonly runPresets: readonly ReviewAgentRunPreset[];
|
|
661
|
+
readonly discoveryId?: string;
|
|
662
|
+
readonly executionId?: string;
|
|
663
|
+
readonly tenantContextKey?: string;
|
|
664
|
+
}
|
|
665
|
+
export interface ReviewAgentTools {
|
|
666
|
+
readonly discover: DefinedActuarialTool<z.input<typeof reviewAgentDiscoveryInputSchema>, z.output<typeof reviewAgentDiscoveryResultSchema>>;
|
|
667
|
+
readonly execute: DefinedActuarialTool<z.input<typeof reviewAgentExecutionInputSchema>, z.output<typeof reviewAgentExecutionResultSchema>>;
|
|
668
|
+
}
|
|
669
|
+
/** Builds the paired read-only tools over one immutable host catalog. */
|
|
670
|
+
export declare function createReviewAgentTools(input: CreateReviewAgentToolsInput): ReviewAgentTools;
|
|
671
|
+
export interface ReviewAgentJudgmentDecision {
|
|
672
|
+
readonly decision: "adopt" | "decline";
|
|
673
|
+
readonly candidateId: string | null;
|
|
674
|
+
readonly rationale: string;
|
|
675
|
+
readonly actor?: "actuary" | "agent";
|
|
676
|
+
}
|
|
677
|
+
export interface ReviewAgentJudgmentContext {
|
|
678
|
+
readonly tenantId: string;
|
|
679
|
+
readonly presetId: string;
|
|
680
|
+
readonly presetVersion: string;
|
|
681
|
+
readonly gateId: string;
|
|
682
|
+
readonly kind: ReviewAgentJudgmentKind;
|
|
683
|
+
readonly targetId: string;
|
|
684
|
+
readonly decisions: JudgmentGateContext["decisions"];
|
|
685
|
+
readonly trail: JudgmentGateContext["trail"];
|
|
686
|
+
}
|
|
687
|
+
export interface ReviewAgentJudgmentGateSpec {
|
|
688
|
+
readonly id: string;
|
|
689
|
+
readonly stage: string;
|
|
690
|
+
readonly presetId: string;
|
|
691
|
+
readonly presetVersion: string;
|
|
692
|
+
readonly kind: ReviewAgentJudgmentKind;
|
|
693
|
+
readonly targetId: string;
|
|
694
|
+
readonly allowedCandidateIds: readonly string[];
|
|
695
|
+
readonly gatherEvidence: (context: ReviewAgentJudgmentContext) => Promise<{
|
|
696
|
+
readonly recommendation: string;
|
|
697
|
+
readonly evidence: unknown;
|
|
698
|
+
}> | {
|
|
699
|
+
readonly recommendation: string;
|
|
700
|
+
readonly evidence: unknown;
|
|
701
|
+
};
|
|
702
|
+
readonly applyDecision: (context: ReviewAgentJudgmentContext, decision: ReviewAgentJudgmentDecision) => Promise<JudgmentApplication>;
|
|
703
|
+
}
|
|
704
|
+
export interface CreateReviewAgentJudgmentChainInput {
|
|
705
|
+
readonly id: string;
|
|
706
|
+
readonly gates: readonly ReviewAgentJudgmentGateSpec[];
|
|
707
|
+
readonly now: () => string;
|
|
708
|
+
readonly tenantContextKey?: string;
|
|
709
|
+
readonly onComplete?: CreateJudgmentChainOptions["onComplete"];
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Creates a resumable review-judgment workflow. The fixed schema admits only
|
|
713
|
+
* an allowlisted candidate ID and a documented adopt/decline decision. The
|
|
714
|
+
* wrapper always records the review judgment in the ledger, even when the
|
|
715
|
+
* host application has no additional assumption entries to append.
|
|
716
|
+
*/
|
|
717
|
+
export declare function createReviewAgentJudgmentChain(input: CreateReviewAgentJudgmentChainInput): JudgmentChainWorkflow;
|
|
718
|
+
/** Ready-to-run offline eval cases for the default review tool IDs. */
|
|
719
|
+
export declare const REVIEW_AGENT_TOOL_SELECTION_CASES: readonly [{
|
|
720
|
+
readonly id: "discover-approved-review";
|
|
721
|
+
readonly prompt: "Show which approved review methods and assumptions are eligible before calculating anything.";
|
|
722
|
+
readonly expectTools: readonly ["discover-approved-review"];
|
|
723
|
+
}, {
|
|
724
|
+
readonly id: "run-approved-review";
|
|
725
|
+
readonly prompt: "Run the approved review I selected and return its verified readiness evidence.";
|
|
726
|
+
readonly expectTools: readonly ["run-approved-review"];
|
|
727
|
+
}];
|
|
728
|
+
export type ReviewAgentToolResult = ReviewAgentDiscoverySuccess | ReviewAgentExecutionSuccess | ToolEnvelopeFailure;
|
|
729
|
+
//# sourceMappingURL=review.d.ts.map
|