@actuarial-ts/data 0.7.0 → 0.8.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 +58 -3
- package/dist/customizationContracts.d.ts +2473 -0
- package/dist/customizationContracts.d.ts.map +1 -0
- package/dist/customizationContracts.js +845 -0
- package/dist/customizationContracts.js.map +1 -0
- package/dist/customizationExternalState.d.ts +42 -0
- package/dist/customizationExternalState.d.ts.map +1 -0
- package/dist/customizationExternalState.js +121 -0
- package/dist/customizationExternalState.js.map +1 -0
- package/dist/customizationHistoryStream.d.ts +26 -0
- package/dist/customizationHistoryStream.d.ts.map +1 -0
- package/dist/customizationHistoryStream.js +66 -0
- package/dist/customizationHistoryStream.js.map +1 -0
- package/dist/diagnosticInput.d.ts +33 -0
- package/dist/diagnosticInput.d.ts.map +1 -1
- package/dist/diagnosticInput.js +71 -1
- package/dist/diagnosticInput.js.map +1 -1
- package/dist/diagnosticPreparedReview.d.ts.map +1 -1
- package/dist/diagnosticPreparedReview.js +38 -0
- package/dist/diagnosticPreparedReview.js.map +1 -1
- package/dist/historyMapping.d.ts +898 -0
- package/dist/historyMapping.d.ts.map +1 -0
- package/dist/historyMapping.js +395 -0
- package/dist/historyMapping.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/src/customizationContracts.ts +963 -0
- package/src/customizationExternalState.ts +208 -0
- package/src/customizationHistoryStream.ts +90 -0
- package/src/diagnosticInput.ts +101 -0
- package/src/diagnosticPreparedReview.ts +48 -0
- package/src/historyMapping.ts +514 -0
- package/src/index.ts +4 -0
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -3,18 +3,23 @@
|
|
|
3
3
|
Typed ingestion, preparation, and data-review boundaries for the actuarial-ts SDK. It supports loss-run/exposure CSVs, annual claim-development adaptation, triangle assembly, and generalized diagnostic review designed to support ASOP No. 23 work.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npm install @actuarial-ts/data@0.
|
|
6
|
+
npm install @actuarial-ts/data@0.8.0 @actuarial-ts/core@0.8.0
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Node 20+, ESM. Responsibility for the review and resulting actuarial work remains with the actuary.
|
|
10
10
|
|
|
11
|
+
SDK 0.8 adds strict parsers, source mapping, externally staged revision
|
|
12
|
+
history, and complete customization resource-policy validation. See the
|
|
13
|
+
[0.8 adoption guide](https://github.com/yerromnitsuj/actng/blob/v0.8.0/docs/migrations/0.8-reusable-customization.md)
|
|
14
|
+
and [customization reference](https://github.com/yerromnitsuj/actng/blob/v0.8.0/docs/reference/reusable-customization.md).
|
|
15
|
+
|
|
11
16
|
## Existing ingestion and triangle review
|
|
12
17
|
|
|
13
18
|
`parseLossRunCsv`, `parseExposureCsv`, `adaptAnnualClaimDevelopment`, `triangleFromLongFormat`, `reviewClaimData`, and `reviewTriangles` return structured errors/findings rather than silently cleaning source records. Physical source-line numbers are retained where available.
|
|
14
19
|
|
|
15
20
|
## Diagnostic run boundary
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
The example below uses the retained eager path: `validateDiagnosticRunInput` before `runValidatedMetricDiagnostics`. Validation parses the entire configuration atomically and compiles its definition; no partially validated run escapes. The compact path below uses the same input model and execution policies with a distinct evidence representation.
|
|
18
23
|
|
|
19
24
|
```ts
|
|
20
25
|
import { runValidatedMetricDiagnostics, validateDiagnosticRunInput } from "@actuarial-ts/data";
|
|
@@ -59,7 +64,57 @@ Definitions add declarative `compare`, `reconcile`, `monotonic`, `layer-order`,
|
|
|
59
64
|
|
|
60
65
|
Completed outcomes are owner-branded and include the exact prepared data, review receipt, run preset, dataset artifact, grouping, result, and two-gate receipt. Compliance provenance accepts only that completed object.
|
|
61
66
|
|
|
62
|
-
|
|
67
|
+
## Compact runs and paged review
|
|
68
|
+
|
|
69
|
+
Introduced in 0.7.0, `validateDiagnosticRunInputCompact` followed by
|
|
70
|
+
`runValidatedMetricDiagnosticsCompact` retains complete review evidence behind
|
|
71
|
+
authenticated owners. Check `outcome.status` before using a completed run: a
|
|
72
|
+
review-blocked result is `null`, while a metric-blocked outcome includes its
|
|
73
|
+
diagnostic result but still cannot authorize provenance. Neither blocked path
|
|
74
|
+
should be presented as a successfully reviewed analysis.
|
|
75
|
+
|
|
76
|
+
Compact receipts have summary checks with `findingCount`, an `evaluations`
|
|
77
|
+
store, and a `findings` store. They do not contain eager per-check finding arrays.
|
|
78
|
+
Use the store from the same receipt throughout paging:
|
|
79
|
+
|
|
80
|
+
| Need | Public API |
|
|
81
|
+
|---|---|
|
|
82
|
+
| Finding summaries without expanded source lists | `pageDiagnosticReviewFindings(receipt.findings, query)` from data |
|
|
83
|
+
| Sources for one finding's stable index | `pageDiagnosticReviewFindingSources(receipt.findings, index, query)` from data |
|
|
84
|
+
| Passed, triggered, and not-evaluated evaluation summaries | `pageDiagnosticReviewEvaluations(receipt.evaluations, query)` from core |
|
|
85
|
+
| Sources for one evaluation | `pageDiagnosticReviewEvaluationSources` from core |
|
|
86
|
+
|
|
87
|
+
Finding-source queries distinguish `context` and review `scope` sources. Page
|
|
88
|
+
results disclose totals and continuation offsets; a summary's source count is
|
|
89
|
+
not the source list. `getDiagnosticReviewFinding` and
|
|
90
|
+
`iterateDiagnosticReviewFindings` provide full individual findings when needed,
|
|
91
|
+
but can expand their source arrays. Do not collect every full finding merely to
|
|
92
|
+
paginate it afterward.
|
|
93
|
+
|
|
94
|
+
`getCompletedCompactDiagnosticRunInput` exposes the retained immutable input
|
|
95
|
+
owner for a genuine completed run. Keeping that run alive also keeps its replay
|
|
96
|
+
inputs alive; release obsolete runs when the host no longer needs them. Parsed
|
|
97
|
+
JSON, spreads, and casts cannot recreate these owners. Use
|
|
98
|
+
`createCompactDiagnosticRunIdentity` in compliance for compact completed runs;
|
|
99
|
+
the eager provenance function is not interchangeable.
|
|
100
|
+
|
|
101
|
+
See the runnable [compact adoption guide](https://github.com/yerromnitsuj/actng/blob/v0.8.0/docs/migrations/0.7-compact-diagnostics.md)
|
|
102
|
+
and [replay/resource-policy reference](https://github.com/yerromnitsuj/actng/blob/v0.8.0/docs/reference/diagnostic-replay-stream.md).
|
|
103
|
+
Compact representation preserves evidence; it is not a claim that an arbitrary
|
|
104
|
+
large dataset or host memory budget has passed acceptance.
|
|
105
|
+
|
|
106
|
+
## Compact diagnostic queries
|
|
107
|
+
|
|
108
|
+
`createDiagnosticQueryContext` owns one compact run input, and
|
|
109
|
+
`runDiagnosticQueryCompact` validates, prepares, reviews, calculates, and gates
|
|
110
|
+
each requested scope. Queries can replace declared filters, cutoffs, expected
|
|
111
|
+
cells, grouping, and evidence labels. Definition, source rows, review evidence,
|
|
112
|
+
and execution policy stay fixed. Eligible clean aggregate selections reuse
|
|
113
|
+
immutable preparation and exact review evidence; every other selection follows
|
|
114
|
+
the ordinary compact preparation path. The API does not promise a latency or
|
|
115
|
+
process-memory target.
|
|
116
|
+
|
|
117
|
+
See the [formula catalog](https://github.com/yerromnitsuj/actng/blob/v0.8.0/docs/reference/diagnostic-formulas.md) and [migration guide](https://github.com/yerromnitsuj/actng/blob/v0.8.0/docs/migrations/0.6-generalized-diagnostics.md).
|
|
63
118
|
|
|
64
119
|
## License
|
|
65
120
|
|