@claritylabs/cl-sdk 3.2.3 → 3.2.5
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/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4163,6 +4163,7 @@ Rules:
|
|
|
4163
4163
|
- Keep a coverage when it is a real operational coverage/benefit even if only one term needs cleanup.
|
|
4164
4164
|
- When changing a term's semantic meaning, set kind to the corrected normalized term kind.
|
|
4165
4165
|
- Do not add new coverage rows or new terms; this pass cleans the existing projection.
|
|
4166
|
+
- If one existing term combines multiple real limit bases, such as "Each Claim / Aggregate", keep the combined term unless another existing term already represents the other basis. Do not relabel it to only one basis and lose information.
|
|
4166
4167
|
- Include every JSON key in each decision. Use null for scalar fields you are not changing and [] for source ID lists you are not changing.
|
|
4167
4168
|
- For each coverage decision, always include termDecisions. Use [] when no terms need cleanup.
|
|
4168
4169
|
- Keep reasons concise and factual.
|
|
@@ -5581,6 +5582,21 @@ function spanTableId(span) {
|
|
|
5581
5582
|
function isTableCellSpan(span) {
|
|
5582
5583
|
return spanSourceUnit(span) === "table_cell";
|
|
5583
5584
|
}
|
|
5585
|
+
function isOperationalEvidenceAnchor(span) {
|
|
5586
|
+
const sourceUnit3 = spanSourceUnit(span);
|
|
5587
|
+
if (sourceUnit3 === "table_cell") return false;
|
|
5588
|
+
if (sourceUnit3 === "table" || sourceUnit3 === "table_row") return true;
|
|
5589
|
+
const text = cleanText([span.text, span.formNumber].filter(Boolean).join(" "), "");
|
|
5590
|
+
if (!text) return false;
|
|
5591
|
+
if (sourceUnit3 === "page") {
|
|
5592
|
+
return hasSubstantiveDeclarationsScheduleText(text) || /\b(declarations?|named insured|policy number|policy period|effective date|expiration date|premium|total due|producer)\b/i.test(text);
|
|
5593
|
+
}
|
|
5594
|
+
if (/\bitem\s+\d+\.?\s*(?:named insured|policy number|policy period|renewal|form of business|coverage parts?|premium|extended reporting|producer|forms? and endorsements?)\b/i.test(text)) return true;
|
|
5595
|
+
if (/\b(policy\s*(number|period)|effective date|expiration date|expiry date|named insured|insurer|carrier|broker|producer|premium|total due)\b/i.test(text)) return true;
|
|
5596
|
+
if (/\b(coverage part|forms? and endorsements?|attached at inception|endorsement\s+(?:no\.?|number|#)?\s*[A-Z0-9])\b/i.test(text)) return true;
|
|
5597
|
+
if (/\$[\d,.]+|[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{2,4}|[0-9]{1,2}\s+[A-Za-z]{3,9}\s+[0-9]{4}/.test(text)) return true;
|
|
5598
|
+
return false;
|
|
5599
|
+
}
|
|
5584
5600
|
function operationalProfileEvidence(sourceTree, sourceSpans) {
|
|
5585
5601
|
const sorted = [...sourceSpans].sort(
|
|
5586
5602
|
(left, right) => (spanPageStart(left) ?? Number.MAX_SAFE_INTEGER) - (spanPageStart(right) ?? Number.MAX_SAFE_INTEGER) || (left.location?.charStart ?? Number.MAX_SAFE_INTEGER) - (right.location?.charStart ?? Number.MAX_SAFE_INTEGER) || left.id.localeCompare(right.id)
|
|
@@ -5590,6 +5606,7 @@ function operationalProfileEvidence(sourceTree, sourceSpans) {
|
|
|
5590
5606
|
for (let index = 0; index < sorted.length; index += 1) {
|
|
5591
5607
|
const score = operationalEvidenceScore(sorted[index]);
|
|
5592
5608
|
if (score < 8) continue;
|
|
5609
|
+
if (!isOperationalEvidenceAnchor(sorted[index])) continue;
|
|
5593
5610
|
const tableId2 = spanTableId(sorted[index]);
|
|
5594
5611
|
if (tableId2 && !isTableCellSpan(sorted[index])) selectedTableIds.add(tableId2);
|
|
5595
5612
|
const page = spanPageStart(sorted[index]);
|
|
@@ -5630,7 +5647,7 @@ function operationalProfileEvidence(sourceTree, sourceSpans) {
|
|
|
5630
5647
|
});
|
|
5631
5648
|
const detailEntries = entries.filter((entry) => entry.sourceUnit !== "page");
|
|
5632
5649
|
const pageEntries = entries.filter((entry) => entry.sourceUnit === "page");
|
|
5633
|
-
return
|
|
5650
|
+
return [...detailEntries, ...pageEntries].slice(0, 180);
|
|
5634
5651
|
}
|
|
5635
5652
|
function sourceTreeRootId(sourceTree) {
|
|
5636
5653
|
return sourceTree.find((node) => node.kind === "document")?.id;
|
|
@@ -5677,6 +5694,7 @@ Rules:
|
|
|
5677
5694
|
- On declarations pages, treat "Item N" labels as section boundaries. Use Item 6 or equivalent coverage-schedule rows for coverage limits, deductibles, aggregate terms, and retroactive dates; do not merge Item 7 premium, Item 8 ERP, Item 9 producer, or Item 10 forms into Item 6 coverage facts.
|
|
5678
5695
|
- A coverage schedule row's coverage name should come from the "Coverage Part" or equivalent row label. Limit, deductible, aggregate, sublimit, retention, and retroactive-date values belong as nested terms under that coverage, not in the coverage title.
|
|
5679
5696
|
- If a coverage schedule continues onto the next page before the next item marker, include the continuation rows in the same coverage or declaration item.
|
|
5697
|
+
- If one schedule row or continuation row states the same amount with multiple bases, such as "$1,000,000 Each Claim / Aggregate", return separate limit terms for each basis using the same value instead of one combined "Each Claim / Aggregate" term.
|
|
5680
5698
|
- Forms-and-endorsements schedules are operational form inventory evidence, not coverage limits. Do not turn form schedule rows into coverage units unless the row also states a coverage-specific limit or deductible.
|
|
5681
5699
|
- Keep each coverage unit tied to one evidence scope: a declaration/core schedule row, a core policy form section, or one specific endorsement schedule. Do not merge declaration facts and endorsement schedule facts into the same coverage unit, even when they use the same coverage name.
|
|
5682
5700
|
- If the declarations schedule and an endorsement schedule both list Network Security, Social Engineering Fraud, Regulatory Proceedings, or another same-named coverage, return separate coverage units for each supported source scope.
|