@actuarial-ts/interchange 0.2.0 → 0.3.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 (42) hide show
  1. package/README.md +28 -1
  2. package/dist/convert/result.d.ts +4 -4
  3. package/dist/convert/result.js +3 -3
  4. package/dist/convert/result.js.map +1 -1
  5. package/dist/envelope.d.ts +1 -1
  6. package/dist/envelope.js +1 -1
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +1 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/parse.d.ts.map +1 -1
  12. package/dist/parse.js +49 -0
  13. package/dist/parse.js.map +1 -1
  14. package/dist/referee/crosscheck.d.ts +12 -0
  15. package/dist/referee/crosscheck.d.ts.map +1 -1
  16. package/dist/referee/crosscheck.js +109 -9
  17. package/dist/referee/crosscheck.js.map +1 -1
  18. package/dist/referee/crosscheckStochastic.d.ts +24 -0
  19. package/dist/referee/crosscheckStochastic.d.ts.map +1 -0
  20. package/dist/referee/crosscheckStochastic.js +367 -0
  21. package/dist/referee/crosscheckStochastic.js.map +1 -0
  22. package/dist/schemas/result.d.ts +552 -0
  23. package/dist/schemas/result.d.ts.map +1 -1
  24. package/dist/schemas/result.js +52 -0
  25. package/dist/schemas/result.js.map +1 -1
  26. package/package.json +4 -2
  27. package/src/convert/result.ts +212 -0
  28. package/src/convert/selection.ts +565 -0
  29. package/src/convert/triangle.ts +208 -0
  30. package/src/envelope.ts +193 -0
  31. package/src/index.ts +15 -0
  32. package/src/parse.ts +175 -0
  33. package/src/referee/crosscheck.ts +459 -0
  34. package/src/referee/crosscheckStochastic.ts +488 -0
  35. package/src/referee/profiles.ts +113 -0
  36. package/src/schemas/bundle.ts +64 -0
  37. package/src/schemas/crosscheck.ts +84 -0
  38. package/src/schemas/manifest.ts +75 -0
  39. package/src/schemas/result.ts +180 -0
  40. package/src/schemas/selection.ts +175 -0
  41. package/src/schemas/study.ts +98 -0
  42. package/src/schemas/triangle.ts +138 -0
@@ -0,0 +1,367 @@
1
+ import { ReservingError } from "@actuarial-ts/core";
2
+ import { DEFAULT_GENERATOR, INTERCHANGE_SPEC_VERSION, stampIntegrity, verifyIntegrity, } from "../envelope.js";
3
+ import { stochasticResultDocSchema, } from "../schemas/result.js";
4
+ import { crosscheckReportDocSchema, } from "../schemas/crosscheck.js";
5
+ /**
6
+ * The stochastic referee (spec 5 / 16): cross-implementation comparison of two
7
+ * StochasticResultDocs. Like `crosscheck`, it is NOT an agent — no judgment,
8
+ * no persuasion, just tags, deviations, a derived tolerance, and a verdict.
9
+ *
10
+ * WHY THIS IS A SEPARATE ENTRY POINT, not an overload of `crosscheck`:
11
+ *
12
+ * A deterministic comparison asks "did two engines DERIVE the same number?" and
13
+ * any deviation beyond float noise is a real disagreement. A stochastic
14
+ * comparison usually asks something different — "did two engines DRAW from the
15
+ * same distribution?" — and there the expected disagreement is nonzero and
16
+ * governed by sampling theory. Applying a deterministic tolerance to two Monte
17
+ * Carlo samples manufactures `disagree` verdicts out of ordinary sampling
18
+ * noise. (We learned this the hard way: a sidecar test asserting 1%/5%
19
+ * agreement between two bootstrap runs flaked ~4 times in 5, because both
20
+ * bounds sat at or below the noise floor. See docs/interop/reproducibility.md.)
21
+ *
22
+ * THE TOLERANCE IS DERIVED, NOT DECLARED. For n simulations with coefficient
23
+ * of variation CV:
24
+ *
25
+ * relative MC standard error of the mean ~= CV / sqrt(n)
26
+ * relative MC standard error of a sample sd ~= 1 / sqrt(2n)
27
+ *
28
+ * Two independent runs differ by sqrt(2) times those, and the bound is `sigmas`
29
+ * of that (default 4). So the referee's strictness scales correctly with n:
30
+ * more simulations, tighter bound, automatically.
31
+ *
32
+ * STRICTNESS ADAPTS TO THE REPRODUCIBILITY CLASS (spec 16). If BOTH results
33
+ * declare `seeded-reproducible` and carry the SAME seed, they are claiming
34
+ * byte-reproducibility — sampling noise is not an excuse and the MC allowance
35
+ * is NOT granted; they are held to `exactTolerance`. The allowance exists for
36
+ * genuinely independent draws, not as a blanket loosening.
37
+ */
38
+ /** Relative MC standard error of a sample mean, given the CV. */
39
+ function meanMcSe(cv, n) {
40
+ return cv / Math.sqrt(n);
41
+ }
42
+ /** Relative MC standard error of a sample standard deviation. */
43
+ function sdMcSe(n) {
44
+ return 1 / Math.sqrt(2 * n);
45
+ }
46
+ function relativeDeviation(x, y) {
47
+ const scale = Math.max(Math.abs(x), Math.abs(y));
48
+ return scale === 0 ? 0 : Math.abs(x - y) / scale;
49
+ }
50
+ function validateInput(label, doc) {
51
+ const parsed = stochasticResultDocSchema.safeParse(doc);
52
+ if (!parsed.success) {
53
+ throw new ReservingError("BAD_INTERCHANGE", `crosscheckStochastic input "${label}" is not a valid StochasticResultDoc: ${parsed.error.issues
54
+ .map((i) => `${i.path.join(".") || "$"}: ${i.message}`)
55
+ .join("; ")}`);
56
+ }
57
+ const integrity = verifyIntegrity(parsed.data);
58
+ if (!integrity.ok) {
59
+ throw new ReservingError("BAD_INTERCHANGE", `crosscheckStochastic input "${label}" fails its integrity check: stated ` +
60
+ `${integrity.actual ?? "(none)"}, semantic body hashes to ${integrity.expected}`);
61
+ }
62
+ return parsed.data;
63
+ }
64
+ /** `summary.mean` / `summary.sd` as numbers, or null when unusable. */
65
+ function summaryStat(doc, key) {
66
+ const value = doc.result.summary[key];
67
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
68
+ }
69
+ function originStat(row, key) {
70
+ const value = row[key];
71
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
72
+ }
73
+ export function crosscheckStochastic(options) {
74
+ const a = validateInput("a", options.a);
75
+ const b = validateInput("b", options.b);
76
+ const sigmas = options.sigmas ?? 4;
77
+ if (!(sigmas > 0)) {
78
+ throw new ReservingError("BAD_INTERCHANGE", "crosscheckStochastic 'sigmas' must be positive");
79
+ }
80
+ const exactTolerance = options.exactTolerance ?? 1e-9;
81
+ if (!(exactTolerance > 0)) {
82
+ // The report schema requires positive tolerances; catching it here hands
83
+ // the caller their own mistake instead of an internal validation dump.
84
+ throw new ReservingError("BAD_INTERCHANGE", "crosscheckStochastic 'exactTolerance' must be positive");
85
+ }
86
+ const warnings = [];
87
+ const notComparable = [];
88
+ // --- comparability: the same tags the deterministic referee requires ---
89
+ const aTo = a.result.appliesTo;
90
+ const bTo = b.result.appliesTo;
91
+ const sameTriangle = aTo.triangleIntegrity === bTo.triangleIntegrity;
92
+ const sameSelection = aTo.selectionIntegrity === bTo.selectionIntegrity;
93
+ if (!sameTriangle) {
94
+ notComparable.push(`the results apply to different triangles (${aTo.triangleIntegrity} vs ${bTo.triangleIntegrity})`);
95
+ }
96
+ if (!sameSelection) {
97
+ notComparable.push(`the results apply to different selections (${aTo.selectionIntegrity ?? "null"} vs ` +
98
+ `${bTo.selectionIntegrity ?? "null"}); comparability requires the same selection or both null`);
99
+ }
100
+ const profileA = a.result.engine.conventionProfile;
101
+ const profileB = b.result.engine.conventionProfile;
102
+ if (profileA !== undefined && profileB !== undefined && profileA !== profileB) {
103
+ notComparable.push(`the results claim different convention profiles ("${profileA}" vs "${profileB}")`);
104
+ }
105
+ // --- comparability: origin sets ---
106
+ const aRows = a.result.byOrigin;
107
+ const bRows = b.result.byOrigin;
108
+ for (const [label, rows] of [["a", aRows], ["b", bRows]]) {
109
+ const seen = new Set();
110
+ for (const row of rows) {
111
+ const origin = String(row["origin"]);
112
+ if (seen.has(origin)) {
113
+ throw new ReservingError("BAD_INTERCHANGE", `Result "${label}" lists origin "${origin}" more than once; per-origin comparison is ill-defined`);
114
+ }
115
+ seen.add(origin);
116
+ }
117
+ }
118
+ const bByOrigin = new Map(bRows.map((r) => [String(r["origin"]), r]));
119
+ const aOrigins = aRows.map((r) => String(r["origin"]));
120
+ const aOnly = aOrigins.filter((o) => !bByOrigin.has(o));
121
+ const bOnly = bRows.map((r) => String(r["origin"])).filter((o) => !aOrigins.includes(o));
122
+ if (aOnly.length > 0 || bOnly.length > 0) {
123
+ notComparable.push(`the results cover different origin sets (only in a: [${aOnly.join(", ")}]; only in b: [${bOnly.join(", ")}])`);
124
+ }
125
+ const comparable = notComparable.length === 0;
126
+ // --- requested vs effective downgrade (spec 3.2 / 5) ---
127
+ for (const [label, doc] of [
128
+ ["a", a],
129
+ ["b", b],
130
+ ]) {
131
+ if (doc.result.effectiveParameters !== undefined) {
132
+ warnings.push(`Comparability downgrade: engine "${label}" (${doc.result.engine.name}) ran with effective ` +
133
+ `parameters ${JSON.stringify(doc.result.effectiveParameters)} deviating from the requested ` +
134
+ `${JSON.stringify(doc.result.parameters)}`);
135
+ }
136
+ }
137
+ // --- reproducibility class drives how strict we are (spec 16) ---
138
+ const classA = a.result.reproducibility;
139
+ const classB = b.result.reproducibility;
140
+ const witnessed = classA === "witnessed" || classB === "witnessed";
141
+ const sameSeed = a.result.seed !== undefined && a.result.seed === b.result.seed;
142
+ const bothSeededReproducible = classA === "seeded-reproducible" && classB === "seeded-reproducible";
143
+ // The MC allowance is for genuinely independent draws. Two results that BOTH
144
+ // claim byte-reproducibility at the SAME seed are asserting they must match
145
+ // exactly, so sampling noise is not available to them as an excuse.
146
+ // ...and the SAME simulation count. A 1,000-sim and a 10,000-sim run at seed
147
+ // 42 are legitimately different samples; holding them to float noise would
148
+ // report that difference as a broken reproducibility promise.
149
+ const sameNSims = a.result.nSims === b.result.nSims;
150
+ const holdToExact = bothSeededReproducible && sameSeed && sameNSims;
151
+ for (const [label, cls] of [
152
+ ["a", classA],
153
+ ["b", classB],
154
+ ]) {
155
+ if (cls === undefined) {
156
+ warnings.push(`Result "${label}" does not state a reproducibility class; it is being compared as if ` +
157
+ "independently drawn (the Monte Carlo allowance is granted). An unstated class is " +
158
+ "unknown, not a guarantee (spec 16).");
159
+ }
160
+ }
161
+ if (witnessed) {
162
+ warnings.push("At least one input is WITNESSED: that engine is not byte-reproducible even at a fixed " +
163
+ "seed, so re-running this comparison will NOT reproduce these exact numbers. Agreement " +
164
+ "here is distributional and attests that the engines drew from the same distribution; it " +
165
+ "is not a replay a reviewer can regenerate (spec 16).");
166
+ }
167
+ if (holdToExact) {
168
+ warnings.push(`Both inputs claim seeded-reproducible at the same seed (${a.result.seed}), so the Monte ` +
169
+ `Carlo allowance is WITHHELD and they are held to ${exactTolerance}. Two engines that ` +
170
+ "both promise byte-reproducibility at one seed must agree exactly.");
171
+ }
172
+ else if (bothSeededReproducible && sameSeed && !sameNSims) {
173
+ warnings.push(`Both inputs claim seeded-reproducible at seed ${a.result.seed}, but they ran different ` +
174
+ `simulation counts (${a.result.nSims} vs ${b.result.nSims}), so they are different draws ` +
175
+ "and the Monte Carlo allowance is granted.");
176
+ }
177
+ else if (comparable && sameSeed && witnessed) {
178
+ warnings.push(`Both inputs carry seed ${a.result.seed}, but a witnessed engine does not reproduce under ` +
179
+ "a fixed seed, so the shared seed does not imply the samples are identical.");
180
+ }
181
+ // --- the derived tolerance ---
182
+ const meanA = summaryStat(a, "mean");
183
+ const meanB = summaryStat(b, "mean");
184
+ const sdA = summaryStat(a, "sd");
185
+ const sdB = summaryStat(b, "sd");
186
+ // Conservative: the smaller sample governs the noise, the larger CV governs it.
187
+ const nEffective = Math.min(a.result.nSims, b.result.nSims);
188
+ const cvCandidates = [];
189
+ for (const [mean, sd] of [
190
+ [meanA, sdA],
191
+ [meanB, sdB],
192
+ ]) {
193
+ if (mean !== null && sd !== null && mean !== 0)
194
+ cvCandidates.push(Math.abs(sd / mean));
195
+ }
196
+ const cv = cvCandidates.length > 0 ? Math.max(...cvCandidates) : null;
197
+ let central;
198
+ let standardError;
199
+ if (holdToExact) {
200
+ central = exactTolerance;
201
+ standardError = exactTolerance;
202
+ }
203
+ else {
204
+ // sqrt(2) because we compare TWO independent samples, not one against truth.
205
+ const meanBound = cv !== null ? meanMcSe(cv, nEffective) * Math.SQRT2 * sigmas : Number.NaN;
206
+ const sdBound = sdMcSe(nEffective) * Math.SQRT2 * sigmas;
207
+ if (cv === null) {
208
+ warnings.push("Neither result carries a usable summary mean and sd, so the Monte Carlo bound on the " +
209
+ "central estimate could not be derived; the standard-error bound is used for both.");
210
+ }
211
+ central = Number.isFinite(meanBound) ? meanBound : sdBound;
212
+ standardError = sdBound;
213
+ warnings.push(`Tolerance DERIVED from sampling theory at n=${nEffective}` +
214
+ (cv !== null ? `, CV=${cv.toFixed(4)}` : "") +
215
+ `, ${sigmas} sigma: central ${central.toExponential(3)}, standard error ` +
216
+ `${standardError.toExponential(3)}. It is not a declared constant — it tightens as n grows.`);
217
+ }
218
+ // --- deviations, each cell judged against ITS OWN derived bound ---
219
+ //
220
+ // `unpaid` carries the central estimate of the reserve (the bootstrap's mean)
221
+ // and `standardError` its dispersion (the bootstrap sd IS the estimated
222
+ // prediction error). `ultimate` has no distributional analogue here.
223
+ //
224
+ // The central bound is derived PER CELL, not once from the total. A single
225
+ // origin is far more volatile than the diversified total — on a realistic
226
+ // Taylor/Ashe bootstrap the per-origin CV runs 0.35-0.45 against a total CV
227
+ // near 0.15 — so judging origins by the total's bound holds them to roughly
228
+ // 3x too tight a standard and manufactures `disagree` verdicts out of
229
+ // ordinary sampling noise. The sd bound (1/sqrt(2n)) has no CV term, so it is
230
+ // common to every cell.
231
+ const centralBoundFor = (cv) => holdToExact
232
+ ? exactTolerance
233
+ : cv !== null
234
+ ? meanMcSe(cv, nEffective) * Math.SQRT2 * sigmas
235
+ : standardError;
236
+ const cvOfCell = (mean, sd) => mean !== null && sd !== null && mean !== 0 ? Math.abs(sd / mean) : null;
237
+ const perOrigin = aOrigins.map((origin) => {
238
+ const rowA = aRows.find((r) => String(r["origin"]) === origin);
239
+ const rowB = bByOrigin.get(origin);
240
+ if (rowB === undefined) {
241
+ return { origin, ultimate: null, unpaid: null, standardError: null, centralBound: central };
242
+ }
243
+ const oMeanA = originStat(rowA, "mean");
244
+ const oMeanB = originStat(rowB, "mean");
245
+ const oSdA = originStat(rowA, "sd");
246
+ const oSdB = originStat(rowB, "sd");
247
+ // Conservative: the more volatile of the two engines governs this cell.
248
+ const cvs = [cvOfCell(oMeanA, oSdA), cvOfCell(oMeanB, oSdB)].filter((v) => v !== null);
249
+ return {
250
+ origin,
251
+ ultimate: null,
252
+ unpaid: oMeanA !== null && oMeanB !== null ? relativeDeviation(oMeanA, oMeanB) : null,
253
+ standardError: oSdA !== null && oSdB !== null ? relativeDeviation(oSdA, oSdB) : null,
254
+ centralBound: centralBoundFor(cvs.length > 0 ? Math.max(...cvs) : null),
255
+ };
256
+ });
257
+ // A stochastic body MAY carry point estimates (`rows`/`totals`) beside the
258
+ // distribution. Ignoring them lets two results whose point ultimates differ
259
+ // 10x still return `agree` because the distribution summaries happen to
260
+ // match — a hole an adversarial review found. Compare them.
261
+ const pointStat = (totalsRecord, key) => {
262
+ const value = totalsRecord?.[key];
263
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
264
+ };
265
+ const pointA = pointStat(a.result.totals, "ultimate");
266
+ const pointB = pointStat(b.result.totals, "ultimate");
267
+ const comparedPointEstimates = pointA !== null && pointB !== null;
268
+ if (comparedPointEstimates) {
269
+ warnings.push("Both results carry POINT estimates beside the distribution; their ultimates were compared " +
270
+ "and are reported in deviations.totals.ultimate. Note they are held to the DISTRIBUTIONAL " +
271
+ "bound, which is loose for a deterministic quantity — run crosscheck() on the " +
272
+ "corresponding method-result documents for a strict point-estimate comparison.");
273
+ }
274
+ else if (pointA !== null || pointB !== null) {
275
+ warnings.push("Only one result carries point estimates beside its distribution; point ultimates were not " +
276
+ "compared.");
277
+ }
278
+ const totals = {
279
+ ultimate: comparedPointEstimates ? relativeDeviation(pointA, pointB) : null,
280
+ unpaid: meanA !== null && meanB !== null ? relativeDeviation(meanA, meanB) : null,
281
+ standardError: sdA !== null && sdB !== null ? relativeDeviation(sdA, sdB) : null,
282
+ };
283
+ // --- verdict ---
284
+ let verdict;
285
+ let breached = null;
286
+ if (!comparable) {
287
+ verdict = "not-comparable";
288
+ warnings.push(...notComparable.map((reason) => `Not comparable: ${reason}`));
289
+ }
290
+ else {
291
+ for (const cell of perOrigin) {
292
+ if (cell.unpaid !== null && cell.unpaid > cell.centralBound) {
293
+ breached = `origin ${cell.origin} central deviation ${cell.unpaid.toExponential(3)} exceeds its derived bound ${cell.centralBound.toExponential(3)}`;
294
+ break;
295
+ }
296
+ if (cell.standardError !== null && cell.standardError > standardError) {
297
+ breached = `origin ${cell.origin} standard-error deviation ${cell.standardError.toExponential(3)} exceeds the derived bound ${standardError.toExponential(3)}`;
298
+ break;
299
+ }
300
+ }
301
+ if (breached === null && totals.ultimate !== null && totals.ultimate > central) {
302
+ breached = `total point-estimate ultimate deviation ${totals.ultimate.toExponential(3)} exceeds the derived bound ${central.toExponential(3)}`;
303
+ }
304
+ if (breached === null && totals.unpaid !== null && totals.unpaid > central) {
305
+ breached = `total central deviation ${totals.unpaid.toExponential(3)} exceeds the derived bound ${central.toExponential(3)}`;
306
+ }
307
+ if (breached === null && totals.standardError !== null && totals.standardError > standardError) {
308
+ breached = `total standard-error deviation ${totals.standardError.toExponential(3)} exceeds the derived bound ${standardError.toExponential(3)}`;
309
+ }
310
+ if (breached !== null) {
311
+ verdict = "disagree";
312
+ warnings.push(`Disagreement: ${breached}.`);
313
+ }
314
+ else {
315
+ verdict = "agree";
316
+ }
317
+ }
318
+ const body = {
319
+ engines: { a: a.result.engine, b: b.result.engine },
320
+ appliesTo: sameTriangle && sameSelection ? aTo : null,
321
+ parameters: {
322
+ a: { requested: a.result.parameters, effective: a.result.effectiveParameters ?? null },
323
+ b: { requested: b.result.parameters, effective: b.result.effectiveParameters ?? null },
324
+ },
325
+ tolerance: { central, standardError },
326
+ deviations: { perOrigin, totals },
327
+ verdict,
328
+ warnings,
329
+ // Passthrough: what a reader needs to interpret a distributional verdict.
330
+ comparison: {
331
+ kind: "distributional",
332
+ nSims: { a: a.result.nSims, b: b.result.nSims },
333
+ seed: { a: a.result.seed ?? null, b: b.result.seed ?? null },
334
+ reproducibility: { a: classA ?? null, b: classB ?? null },
335
+ monteCarloAllowance: !holdToExact,
336
+ sigmas,
337
+ /**
338
+ * `tolerance.central` above is the bound applied to the TOTAL. Each
339
+ * origin is judged against its OWN bound, derived from that origin's
340
+ * coefficient of variation, because a single origin is materially more
341
+ * volatile than the diversified total. Those bounds are on each
342
+ * `deviations.perOrigin[].centralBound`.
343
+ */
344
+ centralBoundIsPerCell: !holdToExact,
345
+ },
346
+ // Cast through unknown: the body carries passthrough extras (`comparison`,
347
+ // per-cell `centralBound`) whose zod-inferred output type is not
348
+ // structurally assignable. crosscheckReportDocSchema.safeParse below is the
349
+ // real check — an invalid body throws rather than escaping.
350
+ };
351
+ const doc = stampIntegrity({
352
+ interchangeVersion: INTERCHANGE_SPEC_VERSION,
353
+ kind: "crosscheck-report",
354
+ generator: options.generator ?? DEFAULT_GENERATOR,
355
+ createdAt: options.createdAt,
356
+ extensions: {},
357
+ report: body,
358
+ });
359
+ const checked = crosscheckReportDocSchema.safeParse(doc);
360
+ if (!checked.success) {
361
+ throw new ReservingError("BAD_INTERCHANGE", `crosscheckStochastic produced an invalid report: ${checked.error.issues
362
+ .map((i) => `${i.path.join(".") || "$"}: ${i.message}`)
363
+ .join("; ")}`);
364
+ }
365
+ return checked.data;
366
+ }
367
+ //# sourceMappingURL=crosscheckStochastic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crosscheckStochastic.js","sourceRoot":"","sources":["../../src/referee/crosscheckStochastic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EAExB,cAAc,EACd,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,iEAAiE;AACjE,SAAS,QAAQ,CAAC,EAAU,EAAE,CAAS;IACrC,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,C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