fairpolicy-additional-insureds 0.0.0-stage → 0.1.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/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +153 -2
- package/bin/fairpolicy-additional-insureds.js +7 -0
- package/evals/cases.json +241 -0
- package/evals/domain-cases.json +22 -0
- package/fixtures/README.md +14 -0
- package/fixtures/clean/README.md +5 -0
- package/fixtures/clean/endorsements.csv +4 -0
- package/fixtures/clean/requests.csv +8 -0
- package/fixtures/endorsements.csv +4 -0
- package/fixtures/phi-canaries.json +1 -0
- package/fixtures/requests.csv +8 -0
- package/package.json +57 -4
- package/server.json +37 -0
- package/src/demo.js +8 -0
- package/src/index.js +2 -0
- package/src/logic.js +46 -0
- package/src/manifest.js +53 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kurt Francisco
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,154 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Fairpolicy Additional Insureds (`fairpolicy-additional-insureds`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Sorts additional insured, waiver of subrogation and primary/non-contributory requests: which the policy already covers (blanket wording or a scheduled holder) and can be issued, which need an endorsement from the carrier, endorsements the carrier has not sent, and requests left open too long. Never issues a certificate or asks a carrier for an endorsement itself.
|
|
4
|
+
|
|
5
|
+
**It never issues a certificate. It never asks a carrier for an endorsement.**
|
|
6
|
+
|
|
7
|
+
MIT · Node 20 or newer · local files only · client identifiers masked before results reach the model · built on [`fairpolicy-core`](../fairpolicy-core)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx -y fairpolicy-additional-insureds demo
|
|
11
|
+
npx -y fairpolicy-additional-insureds mcp --root ./agency-exports
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
<!-- generated:start -->
|
|
15
|
+
|
|
16
|
+
## A demo run
|
|
17
|
+
|
|
18
|
+
`npx -y fairpolicy-additional-insureds demo` runs the agent on the fictional files in [`fixtures/`](fixtures) in a temporary folder. Captured output:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
Fairpolicy Additional Insureds demo (fictional agency, carriers and clients)
|
|
22
|
+
|
|
23
|
+
▶ Sort every additional insured and waiver request
|
|
24
|
+
status: executed decision: allow
|
|
25
|
+
7 request(s), 5 open as of 2026-11-18: 1 need an endorsement from the carrier, 1 endorsement(s) overdue from the carrier, 1 covered but still open, 1 ready to issue, 1 waiting on the carrier.
|
|
26
|
+
R-3 pnc 16 not on the policy needs_endorsement
|
|
27
|
+
R-4 waiver 29 not on the policy endorsement_pending
|
|
28
|
+
R-2 ai 16 blanket wording on the open_overdue
|
|
29
|
+
R-1 ai 2 blanket wording on the ready_to_issue
|
|
30
|
+
R-5 waiver 8 not on the policy awaiting_carrier
|
|
31
|
+
R-6 ai 0 holder scheduled on th complete
|
|
32
|
+
R-7 ai 0 endorsement received complete
|
|
33
|
+
|
|
34
|
+
▶ Explain the request that needs an endorsement
|
|
35
|
+
status: executed decision: allow
|
|
36
|
+
R-3: needs_endorsement. PNC for Demo Hospital: not on the policy. Next: The policy has no blanket wording and does not schedule this holder: ask the carrier for the endorsement before a certificate shows it.
|
|
37
|
+
|
|
38
|
+
▶ Write the worklist (CSV and HTML, real names stay on this computer)
|
|
39
|
+
status: executed decision: allow
|
|
40
|
+
Additional insured and waiver requests written: 7 request(s), 5 open as of 2026-11-18: 1 need an endorsement from the carrier, 1 endorsement(s) overdue from the carrier, 1 covered but still open, 1 ready to issue, 1 waiting on the carrier. Files: fairpolicy-out/insureds/additional-insureds.csv, fairpolicy-out/insureds/additional-insureds.html.
|
|
41
|
+
|
|
42
|
+
▶ The agent tries certificate_issue itself
|
|
43
|
+
status: blocked decision: block
|
|
44
|
+
reason: It never issues a certificate.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Tools
|
|
48
|
+
|
|
49
|
+
| Tool | What it does | Policy |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| `insureds_check` | Each request: what it asks for, whether the policy covers it and how, days open, and a status (needs_endorsement, endorsement_pending, open_overdue, ready_to_issue, awaiting_carrier, complete). | runs |
|
|
52
|
+
| `insureds_explain` | Show one request from insureds_check in full: its status, every finding and the figures behind it. | runs |
|
|
53
|
+
| `insureds_write_report` | Write additional-insureds.csv (every request with its status and the figures behind it, plus blank owner and notes columns) and additional-insureds.html into out_dir (default fairpolicy-out/insureds). | runs |
|
|
54
|
+
| `certificate_issue` | It never issues a certificate. | refused |
|
|
55
|
+
| `endorsement_request_send` | It never asks a carrier for an endorsement. | refused |
|
|
56
|
+
|
|
57
|
+
Any tool name not in this table is blocked, including names a model invents. `refused` tools are listed so a model can see they exist and are refused.
|
|
58
|
+
|
|
59
|
+
## Columns it reads
|
|
60
|
+
|
|
61
|
+
Table inputs can be CSV, TSV, semicolon- or pipe-separated text, Excel `.xlsx`, JSON or JSONL. Columns are matched by the agent's own name, then by the English names below, then by their names in German, French, Spanish, Portuguese, Italian, Japanese, Chinese and Korean. Dates become `YYYY-MM-DD`; amounts are read with either decimal mark. Every result lists under `sources` how each file was read. Columns marked *masked* hold patient identifiers: the model sees a pseudonym, a birth year or nothing (see Patient data).
|
|
62
|
+
|
|
63
|
+
### Requests (`requests`)
|
|
64
|
+
|
|
65
|
+
| Column | Type | Also read as | For example, in other languages |
|
|
66
|
+
|---|---|---|---|
|
|
67
|
+
| `request_id` (required) | text | Request ID, Request #, Request, Ticket, Activity ID | - |
|
|
68
|
+
| `client` | text (masked) | Insured, Named Insured, Client Name, Account Name | Versicherungsnehmer, Assuré, 契約者, 投保人 |
|
|
69
|
+
| `policy_number` | text | Policy Number, Policy #, Policy | Vertragsnummer, N° de police, 証券番号, 保单号 |
|
|
70
|
+
| `holder` | text | Holder, Certificate Holder, Additional Insured Name, Requested For | - |
|
|
71
|
+
| `requirement` | text | Requirement, Request Type, Type, Wording Requested | - |
|
|
72
|
+
| `requested_date` | date | Requested Date, Request Date, Received Date, Date Requested | - |
|
|
73
|
+
| `endorsement_requested_date` | date | Endorsement Requested, Sent To Carrier, Carrier Requested Date | - |
|
|
74
|
+
| `endorsement_received_date` | date | Endorsement Received, Received From Carrier, Endorsement Date | - |
|
|
75
|
+
| `completed_date` | date | Completed Date, Completed, Closed Date, Certificate Issued | - |
|
|
76
|
+
| `csr` | text | CSR, Account Manager, Assigned To | Sachbearbeiter, Gestionnaire, 事務担当, 客服 |
|
|
77
|
+
|
|
78
|
+
### Policy endorsements (`coverage`)
|
|
79
|
+
|
|
80
|
+
| Column | Type | Also read as | For example, in other languages |
|
|
81
|
+
|---|---|---|---|
|
|
82
|
+
| `policy_number` (required) | text | Policy Number, Policy #, Policy | Vertragsnummer, N° de police, 証券番号, 保单号 |
|
|
83
|
+
| `client` | text (masked) | Insured, Named Insured, Client Name | Versicherungsnehmer, Assuré, 契約者, 投保人 |
|
|
84
|
+
| `blanket_ai` | text | Blanket AI, Blanket Additional Insured, AI Endorsement | - |
|
|
85
|
+
| `blanket_waiver` | text | Blanket Waiver, Waiver Endorsement, Blanket Waiver of Subrogation | - |
|
|
86
|
+
| `primary_noncontributory` | text | Primary Non-Contributory, Primary Noncontributory, PNC | - |
|
|
87
|
+
| `scheduled_holders` | text | Scheduled Holders, Scheduled Additional Insureds, Scheduled AI | - |
|
|
88
|
+
|
|
89
|
+
### Files from other countries
|
|
90
|
+
|
|
91
|
+
A German export in Windows-1252 with semicolons, `1.234,56` and `03.11.2026`, or a Japanese one in Shift_JIS with `2026/11/03`, is read the same way as the English file: `npm run intl` in the repository rewrites every eval fixture the way a German, French, Spanish, Brazilian, Italian, Japanese, Chinese and Korean export would write it and requires the same results. Columns named differently? Run `npx fairpolicy-additional-insureds inspect <file>` (names and shapes only, never values) and name them in `fairpolicy-sources.json`:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{ "files": { "exports/claims.csv": { "columns": { "claim_id": "Fallnummer" }, "date_order": "dmy" } } }
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Install
|
|
98
|
+
|
|
99
|
+
Node 20 or newer. No other dependencies.
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx -y fairpolicy-additional-insureds demo
|
|
103
|
+
npx -y fairpolicy-additional-insureds mcp --root /path/to/your/files
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Claude Desktop, Cursor and other MCP hosts:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"mcpServers": {
|
|
111
|
+
"fairpolicy-additional-insureds": {
|
|
112
|
+
"command": "npx",
|
|
113
|
+
"args": [
|
|
114
|
+
"-y",
|
|
115
|
+
"fairpolicy-additional-insureds",
|
|
116
|
+
"mcp",
|
|
117
|
+
"--root",
|
|
118
|
+
"/path/to/your/files"
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Claude Code: `claude mcp add fairpolicy-additional-insureds -- npx -y fairpolicy-additional-insureds mcp --root .`, or install the `fairpolicy-additional-insureds` plugin from this repository's marketplace (`fairpolicy-medical-billing`).
|
|
126
|
+
|
|
127
|
+
## Modes and approvals
|
|
128
|
+
|
|
129
|
+
- **Review** (`--mode review`): reads and reports only.
|
|
130
|
+
- **Assist** (default): the policy above. A tool that asks returns an `approval_id`; a person approves it once with `fairpolicy-additional-insureds approve <id> --as "Your Name"` (or on the local approvals page, `fairpolicy-additional-insureds approvals`), and the same call is repeated.
|
|
131
|
+
- **Auto** (`--mode auto --auto <tool,...>`): opt-in per tool, with step caps and a kill switch (`fairpolicy-additional-insureds kill`). Sending, moving money, going live and accepting a learned fact stay **one named click even in Auto**; an approval is tied to the sha256 of the reviewed draft, so a changed draft needs a new click.
|
|
132
|
+
|
|
133
|
+
## CLI
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
fairpolicy-additional-insureds tools # every tool, its policy and arguments
|
|
137
|
+
fairpolicy-additional-insureds sources # the columns each input is read from
|
|
138
|
+
fairpolicy-additional-insureds inspect <file> # how a file would be read (names and shapes, never values)
|
|
139
|
+
fairpolicy-additional-insureds call insureds_check '{"requests":"<requests>","coverage":"<coverage>"}'
|
|
140
|
+
fairpolicy-additional-insureds eval # the private eval cases on the fictional fixtures
|
|
141
|
+
fairpolicy-additional-insureds demo
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Client data
|
|
145
|
+
|
|
146
|
+
Results go to an AI model, so client identifiers are masked before they leave the agent (`--phi mask`, the default; the flag name comes from the shared core): client and insured names and client codes become stable pseudonyms such as `CL-3f9a1c2e`; birth dates become the birth year; driver licence numbers, addresses, phones, e-mails and SSNs are removed, also inside free text. `--phi strict` also hides policy numbers, claim numbers and VINs and cuts ZIP codes to three digits. Producers, account managers and carriers are not masked. The files the agent writes on your computer keep the real values, because your staff need them: keep them in a secure folder. Masking is not anonymisation, and it does not replace your agency's information-security program.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
## Limits
|
|
150
|
+
|
|
151
|
+
- It checks only what is in the files and settings you load. Commission schedules, state rules, deadlines and carrier requirements are as current as what you give it; the example settings are starting points, not any carrier's or state's rule.
|
|
152
|
+
- It is not legal, tax, accounting or coverage advice. It never binds, cancels, endorses or places coverage, and it never tells a client what to buy. A person reviews every result before anything goes to a client, carrier or producer; the agent sends nothing.
|
|
153
|
+
- Export layouts named in "Columns it reads" were written from knowledge of each system and not tested against a live account; `inspect` shows how a file was read.
|
|
154
|
+
- Client-data masking keeps identifiers away from the model; it does not replace your agency's privacy and information-security program (state insurance data security rules, access control, retention).
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { main } from 'fairpolicy-core';
|
|
4
|
+
import { manifest } from '../src/manifest.js';
|
|
5
|
+
import { demo } from '../src/demo.js';
|
|
6
|
+
|
|
7
|
+
main(manifest, { bin: 'fairpolicy-additional-insureds', demo, evalFile: fileURLToPath(new URL('../evals/cases.json', import.meta.url)) });
|
package/evals/cases.json
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
{
|
|
2
|
+
"suite": "fairpolicy-additional-insureds",
|
|
3
|
+
"root": "..",
|
|
4
|
+
"data_note": "Fictional requests and policy endorsements in ../fixtures. No model is called.",
|
|
5
|
+
"cases": [
|
|
6
|
+
{
|
|
7
|
+
"id": "check-totals",
|
|
8
|
+
"tool": "insureds_check",
|
|
9
|
+
"args": {
|
|
10
|
+
"requests": "fixtures/requests.csv",
|
|
11
|
+
"coverage": "fixtures/endorsements.csv",
|
|
12
|
+
"as_of": "2026-11-18"
|
|
13
|
+
},
|
|
14
|
+
"expect": {
|
|
15
|
+
"status": "executed",
|
|
16
|
+
"equals": {
|
|
17
|
+
"result.requests": 7,
|
|
18
|
+
"result.open": 5
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "every-status",
|
|
24
|
+
"tool": "insureds_check",
|
|
25
|
+
"args": {
|
|
26
|
+
"requests": "fixtures/requests.csv",
|
|
27
|
+
"coverage": "fixtures/endorsements.csv",
|
|
28
|
+
"as_of": "2026-11-18"
|
|
29
|
+
},
|
|
30
|
+
"expect": {
|
|
31
|
+
"equals": {
|
|
32
|
+
"result.by_status.needs_endorsement": 1,
|
|
33
|
+
"result.by_status.endorsement_pending": 1,
|
|
34
|
+
"result.by_status.open_overdue": 1,
|
|
35
|
+
"result.by_status.ready_to_issue": 1,
|
|
36
|
+
"result.by_status.awaiting_carrier": 1,
|
|
37
|
+
"result.by_status.complete": 2
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "needs-endorsement-first",
|
|
43
|
+
"tool": "insureds_check",
|
|
44
|
+
"args": {
|
|
45
|
+
"requests": "fixtures/requests.csv",
|
|
46
|
+
"coverage": "fixtures/endorsements.csv",
|
|
47
|
+
"as_of": "2026-11-18"
|
|
48
|
+
},
|
|
49
|
+
"expect": {
|
|
50
|
+
"equals": {
|
|
51
|
+
"result.items.0.request_id": "R-3",
|
|
52
|
+
"result.items.0.requirement": "pnc"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "blanket-but-open",
|
|
58
|
+
"tool": "insureds_explain",
|
|
59
|
+
"args": {
|
|
60
|
+
"requests": "fixtures/requests.csv",
|
|
61
|
+
"coverage": "fixtures/endorsements.csv",
|
|
62
|
+
"as_of": "2026-11-18",
|
|
63
|
+
"request_id": "R-2"
|
|
64
|
+
},
|
|
65
|
+
"expect": {
|
|
66
|
+
"equals": {
|
|
67
|
+
"result.request.status": "open_overdue",
|
|
68
|
+
"result.request.days_open": 16,
|
|
69
|
+
"result.request.covered_by": "blanket wording on the policy"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "carrier-endorsement-late",
|
|
75
|
+
"tool": "insureds_explain",
|
|
76
|
+
"args": {
|
|
77
|
+
"requests": "fixtures/requests.csv",
|
|
78
|
+
"coverage": "fixtures/endorsements.csv",
|
|
79
|
+
"as_of": "2026-11-18",
|
|
80
|
+
"request_id": "R-4"
|
|
81
|
+
},
|
|
82
|
+
"expect": {
|
|
83
|
+
"equals": {
|
|
84
|
+
"result.request.status": "endorsement_pending",
|
|
85
|
+
"result.request.requirement": "waiver"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": "scheduled-holder",
|
|
91
|
+
"tool": "insureds_explain",
|
|
92
|
+
"args": {
|
|
93
|
+
"requests": "fixtures/requests.csv",
|
|
94
|
+
"coverage": "fixtures/endorsements.csv",
|
|
95
|
+
"as_of": "2026-11-18",
|
|
96
|
+
"request_id": "R-6"
|
|
97
|
+
},
|
|
98
|
+
"expect": {
|
|
99
|
+
"equals": {
|
|
100
|
+
"result.request.covered_by": "holder scheduled on the policy"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "longer-pending-days",
|
|
106
|
+
"tool": "insureds_check",
|
|
107
|
+
"args": {
|
|
108
|
+
"requests": "fixtures/requests.csv",
|
|
109
|
+
"coverage": "fixtures/endorsements.csv",
|
|
110
|
+
"as_of": "2026-11-18",
|
|
111
|
+
"pending_days": 30
|
|
112
|
+
},
|
|
113
|
+
"expect": {
|
|
114
|
+
"equals": {
|
|
115
|
+
"result.by_status.awaiting_carrier": 2
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": "report-written",
|
|
121
|
+
"tool": "insureds_write_report",
|
|
122
|
+
"args": {
|
|
123
|
+
"requests": "fixtures/requests.csv",
|
|
124
|
+
"coverage": "fixtures/endorsements.csv",
|
|
125
|
+
"as_of": "2026-11-18"
|
|
126
|
+
},
|
|
127
|
+
"expect": {
|
|
128
|
+
"status": "executed",
|
|
129
|
+
"contains": [
|
|
130
|
+
"additional-insureds.csv",
|
|
131
|
+
"additional-insureds.html"
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "safety-invented-tool-refused",
|
|
137
|
+
"tool": "insureds_pay_and_send_everything_now",
|
|
138
|
+
"args": {},
|
|
139
|
+
"expect": {
|
|
140
|
+
"status": "blocked"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": "safety-file-outside-root-refused",
|
|
145
|
+
"tool": "insureds_check",
|
|
146
|
+
"args": {
|
|
147
|
+
"requests": "../../outside.csv",
|
|
148
|
+
"coverage": "fixtures/endorsements.csv",
|
|
149
|
+
"as_of": "2026-11-18"
|
|
150
|
+
},
|
|
151
|
+
"expect": {
|
|
152
|
+
"status": "error",
|
|
153
|
+
"contains": [
|
|
154
|
+
"outside"
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"id": "safety-review-mode-still-reads",
|
|
160
|
+
"tool": "insureds_check",
|
|
161
|
+
"mode": "review",
|
|
162
|
+
"args": {
|
|
163
|
+
"requests": "fixtures/requests.csv",
|
|
164
|
+
"coverage": "fixtures/endorsements.csv",
|
|
165
|
+
"as_of": "2026-11-18"
|
|
166
|
+
},
|
|
167
|
+
"expect": {
|
|
168
|
+
"status": "executed",
|
|
169
|
+
"equals": {
|
|
170
|
+
"result.requests": 7,
|
|
171
|
+
"result.open": 5
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"id": "safety-missing-argument-named",
|
|
177
|
+
"tool": "insureds_check",
|
|
178
|
+
"args": {
|
|
179
|
+
"coverage": "fixtures/endorsements.csv",
|
|
180
|
+
"as_of": "2026-11-18"
|
|
181
|
+
},
|
|
182
|
+
"expect": {
|
|
183
|
+
"status": "error",
|
|
184
|
+
"contains": [
|
|
185
|
+
"requests"
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"id": "safety-unknown-argument-refused",
|
|
191
|
+
"tool": "insureds_check",
|
|
192
|
+
"args": {
|
|
193
|
+
"requests": "fixtures/requests.csv",
|
|
194
|
+
"coverage": "fixtures/endorsements.csv",
|
|
195
|
+
"as_of": "2026-11-18",
|
|
196
|
+
"send_to": "carrier@example.test"
|
|
197
|
+
},
|
|
198
|
+
"expect": {
|
|
199
|
+
"status": "error",
|
|
200
|
+
"contains": [
|
|
201
|
+
"send_to"
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"id": "safety-refused-certificate_issue",
|
|
207
|
+
"tool": "certificate_issue",
|
|
208
|
+
"mode": "auto",
|
|
209
|
+
"args": {},
|
|
210
|
+
"expect": {
|
|
211
|
+
"status": "blocked"
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"id": "safety-refused-endorsement_request_send",
|
|
216
|
+
"tool": "endorsement_request_send",
|
|
217
|
+
"mode": "auto",
|
|
218
|
+
"args": {},
|
|
219
|
+
"expect": {
|
|
220
|
+
"status": "blocked"
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"id": "safety-masking-hides-names",
|
|
225
|
+
"tool": "insureds_check",
|
|
226
|
+
"args": {
|
|
227
|
+
"requests": "fixtures/requests.csv",
|
|
228
|
+
"coverage": "fixtures/endorsements.csv",
|
|
229
|
+
"as_of": "2026-11-18"
|
|
230
|
+
},
|
|
231
|
+
"expect": {
|
|
232
|
+
"status": "executed",
|
|
233
|
+
"not_contains": [
|
|
234
|
+
"Yarrowby Builders",
|
|
235
|
+
"Ostrowe Paving",
|
|
236
|
+
"Yarrowby"
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
]
|
|
241
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"suite": "fairpolicy-additional-insureds", "root": "..",
|
|
3
|
+
"data_note": "Fictional requests and policy endorsements in ../fixtures. No model is called.",
|
|
4
|
+
"cases": [
|
|
5
|
+
{ "id": "check-totals", "tool": "insureds_check", "args": { "requests": "fixtures/requests.csv", "coverage": "fixtures/endorsements.csv", "as_of": "2026-11-18" },
|
|
6
|
+
"expect": { "status": "executed", "equals": { "result.requests": 7, "result.open": 5 } } },
|
|
7
|
+
{ "id": "every-status", "tool": "insureds_check", "args": { "requests": "fixtures/requests.csv", "coverage": "fixtures/endorsements.csv", "as_of": "2026-11-18" },
|
|
8
|
+
"expect": { "equals": { "result.by_status.needs_endorsement": 1, "result.by_status.endorsement_pending": 1, "result.by_status.open_overdue": 1, "result.by_status.ready_to_issue": 1, "result.by_status.awaiting_carrier": 1, "result.by_status.complete": 2 } } },
|
|
9
|
+
{ "id": "needs-endorsement-first", "tool": "insureds_check", "args": { "requests": "fixtures/requests.csv", "coverage": "fixtures/endorsements.csv", "as_of": "2026-11-18" },
|
|
10
|
+
"expect": { "equals": { "result.items.0.request_id": "R-3", "result.items.0.requirement": "pnc" } } },
|
|
11
|
+
{ "id": "blanket-but-open", "tool": "insureds_explain", "args": { "requests": "fixtures/requests.csv", "coverage": "fixtures/endorsements.csv", "as_of": "2026-11-18", "request_id": "R-2" },
|
|
12
|
+
"expect": { "equals": { "result.request.status": "open_overdue", "result.request.days_open": 16, "result.request.covered_by": "blanket wording on the policy" } } },
|
|
13
|
+
{ "id": "carrier-endorsement-late", "tool": "insureds_explain", "args": { "requests": "fixtures/requests.csv", "coverage": "fixtures/endorsements.csv", "as_of": "2026-11-18", "request_id": "R-4" },
|
|
14
|
+
"expect": { "equals": { "result.request.status": "endorsement_pending", "result.request.requirement": "waiver" } } },
|
|
15
|
+
{ "id": "scheduled-holder", "tool": "insureds_explain", "args": { "requests": "fixtures/requests.csv", "coverage": "fixtures/endorsements.csv", "as_of": "2026-11-18", "request_id": "R-6" },
|
|
16
|
+
"expect": { "equals": { "result.request.covered_by": "holder scheduled on the policy" } } },
|
|
17
|
+
{ "id": "longer-pending-days", "tool": "insureds_check", "args": { "requests": "fixtures/requests.csv", "coverage": "fixtures/endorsements.csv", "as_of": "2026-11-18", "pending_days": 30 },
|
|
18
|
+
"expect": { "equals": { "result.by_status.awaiting_carrier": 2 } } },
|
|
19
|
+
{ "id": "report-written", "tool": "insureds_write_report", "args": { "requests": "fixtures/requests.csv", "coverage": "fixtures/endorsements.csv", "as_of": "2026-11-18" },
|
|
20
|
+
"expect": { "status": "executed", "contains": ["additional-insureds.csv", "additional-insureds.html"] } }
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Fairpolicy Additional Insureds fixtures
|
|
2
|
+
|
|
3
|
+
Everything here is fictional: agency, carriers, insureds, holders and dates.
|
|
4
|
+
|
|
5
|
+
- `endorsements.csv`: three policies with their blanket wording and one scheduled holder.
|
|
6
|
+
- `requests.csv`: seven requests from the activity log.
|
|
7
|
+
|
|
8
|
+
Planted, as of 2026-11-18 (open more than 7 days is overdue; endorsements asked more than 14 days ago are overdue):
|
|
9
|
+
- R-3: primary/non-contributory wording; the GL policy has none: needs an endorsement.
|
|
10
|
+
- R-4: waiver on workers comp asked of the carrier on 22 October, not received: endorsement pending.
|
|
11
|
+
- R-2: additional insured is blanket on the GL policy, but the request has been open 16 days.
|
|
12
|
+
- R-1: blanket AI, two days old: ready to issue.
|
|
13
|
+
- R-5: waiver asked of the carrier six days ago: waiting.
|
|
14
|
+
- R-6 (holder scheduled on the auto policy) and R-7 (endorsement received): complete.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Clean set
|
|
2
|
+
|
|
3
|
+
The demo files with every planted problem in [../README.md](../README.md) removed, made by `scripts/accuracy.mjs --write` from `scripts/accuracy-specs.mjs` in the repository. Only the files listed here change; the agent reads the other demo files as they are. The check must report nothing that needs a person on these files. Fictional data.
|
|
4
|
+
|
|
5
|
+
Files: `requests.csv`, `endorsements.csv`.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Request ID,Insured,Policy Number,Holder,Requirement,Requested Date,Endorsement Requested,Endorsement Received,Completed Date,CSR
|
|
2
|
+
R-1,Yarrowby Builders LLC,CGL-1901,Sample Developers LLC,Additional Insured,11/16/2026,,,11/17/2026,Drew Kim
|
|
3
|
+
R-2,Yarrowby Builders LLC,CGL-1901,Demo Hospital,Additional Insured,11/02/2026,,,11/03/2026,Drew Kim
|
|
4
|
+
R-3,Yarrowby Builders LLC,CGL-1901,Demo Hospital,Primary non-contributory,11/02/2026,,,11/04/2026,Drew Kim
|
|
5
|
+
R-4,Yarrowby Builders LLC,WC-1902,Sample Developers LLC,Waiver of subrogation,10/20/2026,10/22/2026,11/05/2026,11/06/2026,Drew Kim
|
|
6
|
+
R-5,Yarrowby Builders LLC,WC-1902,Example Stadium Authority,WOS,11/10/2026,11/12/2026,,,Casey Park
|
|
7
|
+
R-6,Yarrowby Builders LLC,CA-1903,Example County Roads,AI,10/01/2026,,,10/03/2026,Casey Park
|
|
8
|
+
R-7,Ostrowe Paving Inc,CA-1903,Sample Developers LLC,AI,11/01/2026,11/03/2026,11/14/2026,11/15/2026,Casey Park
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "note": "Fictional client names from the fixtures. None may appear in a result the model sees.", "values": ["Yarrowby Builders", "Ostrowe Paving", "Yarrowby"] }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Request ID,Insured,Policy Number,Holder,Requirement,Requested Date,Endorsement Requested,Endorsement Received,Completed Date,CSR
|
|
2
|
+
R-1,Yarrowby Builders LLC,CGL-1901,Sample Developers LLC,Additional Insured,11/16/2026,,,,Drew Kim
|
|
3
|
+
R-2,Yarrowby Builders LLC,CGL-1901,Demo Hospital,Additional Insured,11/02/2026,,,,Drew Kim
|
|
4
|
+
R-3,Yarrowby Builders LLC,CGL-1901,Demo Hospital,Primary non-contributory,11/02/2026,,,,Drew Kim
|
|
5
|
+
R-4,Yarrowby Builders LLC,WC-1902,Sample Developers LLC,Waiver of subrogation,10/20/2026,10/22/2026,,,Drew Kim
|
|
6
|
+
R-5,Yarrowby Builders LLC,WC-1902,Example Stadium Authority,WOS,11/10/2026,11/12/2026,,,Casey Park
|
|
7
|
+
R-6,Yarrowby Builders LLC,CA-1903,Example County Roads,AI,10/01/2026,,,10/03/2026,Casey Park
|
|
8
|
+
R-7,Ostrowe Paving Inc,CA-1903,Sample Developers LLC,AI,11/01/2026,11/03/2026,11/14/2026,11/15/2026,Casey Park
|
package/package.json
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fairpolicy-additional-insureds",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"mcpName": "io.github.fpavia111-creator/fairpolicy-additional-insureds",
|
|
5
|
+
"description": "Sorts additional insured, waiver of subrogation and primary/non-contributory requests: covered by the policy, needing a carrier endorsement, waiting on the carrier, or open too long. Never issues a certificate.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "Kurt Francisco",
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=20"
|
|
11
|
+
},
|
|
12
|
+
"main": "src/index.js",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./src/index.js",
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"bin": {
|
|
18
|
+
"fairpolicy-additional-insureds": "bin/fairpolicy-additional-insureds.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"src",
|
|
22
|
+
"bin",
|
|
23
|
+
"fixtures",
|
|
24
|
+
"evals",
|
|
25
|
+
"README.md",
|
|
26
|
+
"CHANGELOG.md",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"server.json"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"test": "node scripts/run-tests.cjs",
|
|
32
|
+
"demo": "node bin/fairpolicy-additional-insureds.js demo",
|
|
33
|
+
"eval": "node bin/fairpolicy-additional-insureds.js eval"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"fairpolicy-core": "^0.1.0"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/fpavia111-creator/fairpolicy-agents.git",
|
|
41
|
+
"directory": "packages/fairpolicy-additional-insureds"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/fpavia111-creator/fairpolicy-agents/tree/master/packages/fairpolicy-additional-insureds#readme",
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/fpavia111-creator/fairpolicy-agents/issues"
|
|
46
|
+
},
|
|
47
|
+
"keywords": [
|
|
48
|
+
"mcp",
|
|
49
|
+
"mcp-server",
|
|
50
|
+
"insurance",
|
|
51
|
+
"insurance-agency",
|
|
52
|
+
"agency-management",
|
|
53
|
+
"fairpolicy",
|
|
54
|
+
"additional-insured",
|
|
55
|
+
"waiver-of-subrogation",
|
|
56
|
+
"certificates",
|
|
57
|
+
"endorsements"
|
|
58
|
+
]
|
|
59
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.fpavia111-creator/fairpolicy-additional-insureds",
|
|
4
|
+
"title": "Fairpolicy Additional Insureds",
|
|
5
|
+
"description": "Sorts additional insured, waiver of subrogation and primary/non-contributory requests",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"url": "https://github.com/fpavia111-creator/fairpolicy-agents",
|
|
9
|
+
"source": "github",
|
|
10
|
+
"subfolder": "packages/fairpolicy-additional-insureds"
|
|
11
|
+
},
|
|
12
|
+
"websiteUrl": "https://fair-agents.com/fairpolicy.html",
|
|
13
|
+
"packages": [
|
|
14
|
+
{
|
|
15
|
+
"registryType": "npm",
|
|
16
|
+
"identifier": "fairpolicy-additional-insureds",
|
|
17
|
+
"version": "0.1.0",
|
|
18
|
+
"transport": {
|
|
19
|
+
"type": "stdio"
|
|
20
|
+
},
|
|
21
|
+
"packageArguments": [
|
|
22
|
+
{
|
|
23
|
+
"type": "positional",
|
|
24
|
+
"value": "mcp"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "named",
|
|
28
|
+
"name": "--root",
|
|
29
|
+
"description": "Folder holding the exports this agent may read and write (it cannot reach outside it)",
|
|
30
|
+
"isRequired": true,
|
|
31
|
+
"format": "filepath",
|
|
32
|
+
"valueHint": "exports_folder"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
package/src/demo.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { familyDemo } from 'fairpolicy-core';
|
|
3
|
+
|
|
4
|
+
export const demo = (manifest) => familyDemo(manifest, fileURLToPath(new URL('../fixtures', import.meta.url)), {
|
|
5
|
+
title: 'Fairpolicy Additional Insureds', args: { requests: 'requests.csv', coverage: 'endorsements.csv', as_of: '2026-11-18' },
|
|
6
|
+
checkLabel: 'Sort every additional insured and waiver request', columns: ['request_id', 'requirement', 'days_open', 'covered_by'],
|
|
7
|
+
explain: { request_id: 'R-3' }, explainLabel: 'Explain the request that needs an endorsement',
|
|
8
|
+
});
|
package/src/index.js
ADDED
package/src/logic.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Additional insured, waiver and primary/non-contributory requests: covered by the policy, waiting on the carrier, or stuck.
|
|
2
|
+
import { str, policyIndex, daysBetween, countBy, normalizeName } from 'fairpolicy-core';
|
|
3
|
+
|
|
4
|
+
export const STATUSES = ['needs_endorsement', 'endorsement_pending', 'open_overdue', 'ready_to_issue', 'awaiting_carrier', 'complete'];
|
|
5
|
+
const NEXT = {
|
|
6
|
+
needs_endorsement: 'The policy has no blanket wording and does not schedule this holder: ask the carrier for the endorsement before a certificate shows it.',
|
|
7
|
+
endorsement_pending: 'The carrier has not sent the endorsement: follow up with the underwriter.',
|
|
8
|
+
open_overdue: 'Covered by the policy but the request is still open: issue the certificate after a person checks the contract wording.',
|
|
9
|
+
ready_to_issue: 'Covered by the policy: a person issues the certificate.',
|
|
10
|
+
awaiting_carrier: 'Endorsement requested recently; waiting on the carrier.',
|
|
11
|
+
complete: '',
|
|
12
|
+
};
|
|
13
|
+
export function requirementOf(text) {
|
|
14
|
+
const t = normalizeName(text);
|
|
15
|
+
if (/\b(waiver|wos|subrogation|subro)\b/.test(t)) return 'waiver';
|
|
16
|
+
if (/\b(pnc|primary|non contributory|noncontributory)\b/.test(t)) return 'pnc';
|
|
17
|
+
if (/\b(ai|additional insured|addl insd|addl insured|additional)\b/.test(t)) return 'ai';
|
|
18
|
+
return 'other';
|
|
19
|
+
}
|
|
20
|
+
const yes = (v) => /^(y|yes|true|1|x|blanket)$/i.test(str(v));
|
|
21
|
+
|
|
22
|
+
export function checkRequests(requestRows, coverageRows, { asOf, overdueDays = 7, pendingDays = 14 } = {}) {
|
|
23
|
+
const cov = policyIndex(coverageRows.map((r) => ({ policy_number: str(r.policy_number), client: str(r.client), ai: yes(r.blanket_ai), waiver: yes(r.blanket_waiver), pnc: yes(r.primary_noncontributory), scheduled: str(r.scheduled_holders).split(/[;|]/).map((h) => normalizeName(h)).filter(Boolean) })));
|
|
24
|
+
const rows = requestRows.filter((r) => str(r.request_id)).map((r) => {
|
|
25
|
+
const req = requirementOf(r.requirement); const p = cov.find(r.policy_number)[0] || null;
|
|
26
|
+
const holder = str(r.holder);
|
|
27
|
+
const blanket = p && (req === 'ai' ? p.ai : req === 'waiver' ? p.waiver : req === 'pnc' ? p.pnc : false);
|
|
28
|
+
const scheduled = p && p.scheduled.includes(normalizeName(holder));
|
|
29
|
+
const received = str(r.endorsement_received_date) && str(r.endorsement_received_date) <= asOf;
|
|
30
|
+
const available = blanket || scheduled || received;
|
|
31
|
+
const completed = str(r.completed_date) && str(r.completed_date) <= asOf;
|
|
32
|
+
const age = daysBetween(str(r.requested_date), asOf);
|
|
33
|
+
const asked = str(r.endorsement_requested_date) && str(r.endorsement_requested_date) <= asOf ? daysBetween(str(r.endorsement_requested_date), asOf) : null;
|
|
34
|
+
let status;
|
|
35
|
+
if (completed) status = 'complete';
|
|
36
|
+
else if (available) status = age !== null && age > overdueDays ? 'open_overdue' : 'ready_to_issue';
|
|
37
|
+
else if (asked !== null) status = asked > pendingDays ? 'endorsement_pending' : 'awaiting_carrier';
|
|
38
|
+
else status = 'needs_endorsement';
|
|
39
|
+
const how = blanket ? 'blanket wording on the policy' : scheduled ? 'holder scheduled on the policy' : received ? 'endorsement received' : p ? 'not on the policy' : 'policy not in the coverage file';
|
|
40
|
+
return { status, request_id: str(r.request_id), client: str(r.client) || (p ? p.client : ''), policy_number: str(r.policy_number), holder, requirement: req, requested_date: str(r.requested_date), days_open: completed ? 0 : age, covered_by: how, endorsement_requested_date: str(r.endorsement_requested_date), csr: str(r.csr), detail: `${req.toUpperCase()} for ${holder}: ${how}.${asked !== null && !available ? ` Endorsement asked for ${asked} days ago.` : ''}`, next_step: NEXT[status] };
|
|
41
|
+
});
|
|
42
|
+
rows.sort((a, b) => STATUSES.indexOf(a.status) - STATUSES.indexOf(b.status) || (b.days_open ?? 0) - (a.days_open ?? 0) || a.request_id.localeCompare(b.request_id));
|
|
43
|
+
return { as_of: asOf, requests: rows.length, open: rows.filter((r) => r.status !== 'complete').length, by_status: countBy(rows, STATUSES), rows };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const summaryLine = (o) => `${o.requests} request(s), ${o.open} open as of ${o.as_of}: ${o.by_status.needs_endorsement || 0} need an endorsement from the carrier, ${o.by_status.endorsement_pending || 0} endorsement(s) overdue from the carrier, ${o.by_status.open_overdue || 0} covered but still open, ${o.by_status.ready_to_issue || 0} ready to issue, ${o.by_status.awaiting_carrier || 0} waiting on the carrier.`;
|
package/src/manifest.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { fairpolicyAgent, AS_OF_ARG, asOf } from 'fairpolicy-core';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { checkRequests, summaryLine, STATUSES } from './logic.js';
|
|
4
|
+
|
|
5
|
+
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
|
6
|
+
const d = (aliases) => ({ type: 'date', aliases });
|
|
7
|
+
const REQUEST_FIELDS = {
|
|
8
|
+
request_id: { aliases: ['Request ID', 'Request #', 'Request', 'Ticket', 'Activity ID'], required: true, translate: false },
|
|
9
|
+
client: { aliases: ['Insured', 'Named Insured', 'Client Name', 'Account Name'] },
|
|
10
|
+
policy_number: { aliases: ['Policy Number', 'Policy #', 'Policy'] },
|
|
11
|
+
holder: { aliases: ['Holder', 'Certificate Holder', 'Additional Insured Name', 'Requested For'], translate: false },
|
|
12
|
+
requirement: { aliases: ['Requirement', 'Request Type', 'Type', 'Wording Requested'], translate: false },
|
|
13
|
+
requested_date: d(['Requested Date', 'Request Date', 'Received Date', 'Date Requested']),
|
|
14
|
+
endorsement_requested_date: d(['Endorsement Requested', 'Sent To Carrier', 'Carrier Requested Date']),
|
|
15
|
+
endorsement_received_date: d(['Endorsement Received', 'Received From Carrier', 'Endorsement Date']),
|
|
16
|
+
completed_date: d(['Completed Date', 'Completed', 'Closed Date', 'Certificate Issued']),
|
|
17
|
+
csr: { aliases: ['CSR', 'Account Manager', 'Assigned To'] },
|
|
18
|
+
};
|
|
19
|
+
const COVERAGE_FIELDS = {
|
|
20
|
+
policy_number: { aliases: ['Policy Number', 'Policy #', 'Policy'], required: true },
|
|
21
|
+
client: { aliases: ['Insured', 'Named Insured', 'Client Name'] },
|
|
22
|
+
blanket_ai: { aliases: ['Blanket AI', 'Blanket Additional Insured', 'AI Endorsement'], translate: false },
|
|
23
|
+
blanket_waiver: { aliases: ['Blanket Waiver', 'Waiver Endorsement', 'Blanket Waiver of Subrogation'], translate: false },
|
|
24
|
+
primary_noncontributory: { aliases: ['Primary Non-Contributory', 'Primary Noncontributory', 'PNC'], translate: false },
|
|
25
|
+
scheduled_holders: { aliases: ['Scheduled Holders', 'Scheduled Additional Insureds', 'Scheduled AI'], translate: false },
|
|
26
|
+
};
|
|
27
|
+
const files = {
|
|
28
|
+
requests: { type: 'string', description: 'Additional insured, waiver and primary/non-contributory requests from your activity or certificate log' },
|
|
29
|
+
coverage: { type: 'string', description: 'For each policy: blanket additional insured, blanket waiver, primary/non-contributory wording, and holders scheduled by name' },
|
|
30
|
+
};
|
|
31
|
+
const args = { as_of: AS_OF_ARG, overdue_days: { type: 'integer', minimum: 1, maximum: 90, description: 'A covered request open longer than this is overdue (default 7)' }, pending_days: { type: 'integer', minimum: 1, maximum: 120, description: 'An endorsement asked of the carrier longer ago than this is overdue (default 14)' } };
|
|
32
|
+
const run = (a, ctx) => checkRequests(ctx.records(a.requests, 'requests'), ctx.records(a.coverage, 'coverage'), { asOf: asOf(a), overdueDays: a.overdue_days ?? 7, pendingDays: a.pending_days ?? 14 });
|
|
33
|
+
|
|
34
|
+
export const manifest = fairpolicyAgent({
|
|
35
|
+
name: 'fairpolicy-additional-insureds', version: pkg.version, prefix: 'insureds', key: 'request_id', keyKind: 'request', noun: 'request',
|
|
36
|
+
role: 'an agency account manager',
|
|
37
|
+
description: 'Sorts additional insured, waiver of subrogation and primary/non-contributory requests: which the policy already covers (blanket wording or a scheduled holder) and can be issued, which need an endorsement from the carrier, endorsements the carrier has not sent, and requests left open too long. Never issues a certificate or asks a carrier for an endorsement itself.',
|
|
38
|
+
files, args, required: ['requests', 'coverage'], statuses: STATUSES,
|
|
39
|
+
sources: { requests: { label: 'Requests', args: ['requests'], fields: REQUEST_FIELDS }, coverage: { label: 'Policy endorsements', args: ['coverage'], fields: COVERAGE_FIELDS } },
|
|
40
|
+
run, summary: summaryLine,
|
|
41
|
+
check: { title: 'Sort additional insured requests', description: 'Each request: what it asks for, whether the policy covers it and how, days open, and a status (needs_endorsement, endorsement_pending, open_overdue, ready_to_issue, awaiting_carrier, complete).' },
|
|
42
|
+
report: {
|
|
43
|
+
base: 'additional-insureds', titleShort: 'Write the request worklist',
|
|
44
|
+
title: { en: 'Additional insured and waiver requests', de: 'Anfragen zu Mitversicherten und Regressverzicht', fr: 'Demandes d’assurés additionnels et de renonciation à recours', es: 'Solicitudes de asegurado adicional y renuncia de subrogación', pt: 'Pedidos de segurado adicional e renúncia de sub-rogação', it: 'Richieste di assicurato aggiuntivo e rinuncia alla rivalsa', ja: '追加被保険者と代位権放棄の依頼', zh: '附加被保险人与放弃代位请求', ko: '추가 피보험자 및 대위권 포기 요청' },
|
|
45
|
+
columns: ['status', 'request_id', 'client', 'policy_number', 'holder', 'requirement', 'requested_date', 'days_open', 'covered_by', 'endorsement_requested_date', 'csr', 'detail', 'next_step'],
|
|
46
|
+
htmlColumns: ['status', 'request_id', 'policy_number', 'holder', 'requirement', 'days_open', 'covered_by'],
|
|
47
|
+
limits: ['Whether blanket wording satisfies a contract depends on both documents; a person reads the contract and the endorsement before a certificate shows it.'],
|
|
48
|
+
},
|
|
49
|
+
refused: [
|
|
50
|
+
{ name: 'certificate_issue', category: 'binding_send', description: 'It never issues a certificate.' },
|
|
51
|
+
{ name: 'endorsement_request_send', category: 'binding_send', description: 'It never asks a carrier for an endorsement.' },
|
|
52
|
+
],
|
|
53
|
+
});
|