diff --git a/.gitleaksignore b/.gitleaksignore index ca227d40d2..b19f7641cf 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -235,3 +235,10 @@ f92237889163b242800c6aecd7c334c174ce4428:packages/flow/tests/test_connector_pilo # relay test in one commit; not a credential. The test now draws a nonce from # os.urandom at runtime. e09ebaec9b380b8217471cccb4031511ac7c966e:packages/flow/tests/test_readiness_devtools_relay.py:generic-api-key:44 +# PR #2429: sha256 digests of the synthetic held-out benchmark's answers file in +# MANIFEST.json, under the old "answer_key" names (renamed to answers.json and +# answers_sha256, so new commits no longer match). Digests, not keys. +36be56dcd6fdc9adc97567bce272ab81d2a528ff:packages/flow/benchmark/form_tx_heldout/MANIFEST.json:generic-api-key:3 +36be56dcd6fdc9adc97567bce272ab81d2a528ff:packages/flow/benchmark/form_tx_heldout/MANIFEST.json:generic-api-key:8 +3146a82dd83641e83021d7034aaf03411c635555:packages/flow/benchmark/form_tx_heldout/MANIFEST.json:generic-api-key:3 +3146a82dd83641e83021d7034aaf03411c635555:packages/flow/benchmark/form_tx_heldout/MANIFEST.json:generic-api-key:6 diff --git a/capabilities/04-the-core-a-checked-entry-every-time/0115-fill-a-multi-step-browser-form-or-quote-wizard.md b/capabilities/04-the-core-a-checked-entry-every-time/0115-fill-a-multi-step-browser-form-or-quote-wizard.md new file mode 100644 index 0000000000..3892cb1a66 --- /dev/null +++ b/capabilities/04-the-core-a-checked-entry-every-time/0115-fill-a-multi-step-browser-form-or-quote-wizard.md @@ -0,0 +1 @@ +| Fill a multi-step browser form or quote wizard from an intake record, stop for an operator on a prefill that disagrees with the intake or a question the intake does not answer (decided in a Chrome side panel), submit once, and give every typed, selected or kept field a read-back verdict: `passed`, `failed` or `not_checked`. A field it cannot read back is `not_checked`, never passed; such a submit ends `readback_incomplete` with no receipt | On main, prototype; not on PyPI until Flow 3.4.0 ([#2308](https://github.com/OpenAdaptAI/OpenAdapt/pull/2308)) | Synthetic only. Four quote portals built separately from the layer, 32 scored cases, pre-registered: 6 correct submissions, 0 wrong values submitted, 0 verified (every field on the one workable portal is `not_checked`, because its summary is plain text). The surface could not see iframe or shadow-DOM forms or fill type-aheads, so 3 of 4 portals submitted nothing. Since then (not yet measured on held-out portals): it types into type-ahead comboboxes, chooses a suggestion only when exactly one matches and checks the choice took, and a control it cannot act on stops for an operator instead of raising out of the run; after the submit click that stop is `delivery_uncertain`. Estimator, session-timeout and type-ahead traps were never reached. Rule proposals from repeated operator answers (`form_tx/learning.py`) had no measured effect: none qualified ([RESULTS](packages/flow/benchmark/form_tx_heldout_run/RESULTS.md)) | `openadapt_flow/form_tx/`, [FORM_TX.md](packages/flow/docs/FORM_TX.md) | diff --git a/packages/flow/CHANGELOG.md b/packages/flow/CHANGELOG.md index 53975fd0c6..9e23e46975 100644 --- a/packages/flow/CHANGELOG.md +++ b/packages/flow/CHANGELOG.md @@ -67,6 +67,18 @@ ### Fixes +- The form transaction layer (`form_tx`, an unreleased prototype until this + release) reads back every field it typed, selected or kept. Each one gets + a `passed`, `failed` or `not_checked` verdict; a field it cannot read back + (no read-back declared, the summary control missing or ambiguous, a failed + lookup, a value entered only in a popup) is `not_checked` and never + passed. A submit with any `not_checked` field ends `readback_incomplete`, + never `verified_done`, and gets no receipt. Before, fields typed in a popup + estimator had no verdict at all and such a run could end verified. + Popup inputs are also re-read just before the popup's apply button, and a + mismatch stops the run before apply. The side panel shows refuted and + incomplete runs as needing action. Measured on four held-out synthetic + quote portals: `benchmark/form_tx_heldout_run/RESULTS.md`. - A FHIR searchset Bundle's `OperationOutcome` entry (`search.mode: outcome`) is no longer read as a marker match. Packs can declare `search_match` on the entry parent (Medplum uses `path: search.mode`, diff --git a/packages/flow/benchmark/form_tx_heldout/MANIFEST.json b/packages/flow/benchmark/form_tx_heldout/MANIFEST.json new file mode 100644 index 0000000000..27dc3de00e --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/MANIFEST.json @@ -0,0 +1,68 @@ +{ + "description": "sha256 of every git-tracked file in benchmark/form_tx_heldout except this manifest", + "answers_sha256": "948f695aaddcb1d30db0316d1da6af73fce7adfa6b60dc5c5ef14edc8ec27227", + "files": { + "README.md": "4560673c356139432df7aabdd847c1bb9738c809deca3d19179dd3de252bc6e6", + "REFERENCE_RUNS.json": "d1e8e45d08034a9f8d9b074079c62f3b0124466f7e1b5ea76e07ef45841a4f35", + "__init__.py": "69614a328f302618c7716d3385c45f9c0a625760c550f26f672b83b4b6fbf403", + "answers.json": "948f695aaddcb1d30db0316d1da6af73fce7adfa6b60dc5c5ef14edc8ec27227", + "build_cases.py": "b6a160d872d5da846f4b33b7094406ba77b33e72f213ba36b4250d8e3f80af0c", + "case_defs.py": "739dea2780800e61c45907c805e28dd2516aee0e00894a9d068e7138d5217271", + "cases/cobalt/cr-dev.intake.json": "8a35cfe6bf1ec5d4a1db9c0cef2564189118a9cd6ee43b7bfec8c8aea209c549", + "cases/cobalt/cr-s01.intake.json": "a9b0a0cb916f7e86ed652ecf7cc3d0fc822a22717d7d629fec4f645132eeb57a", + "cases/cobalt/cr-s02.intake.json": "3ab22c68add6fab6eaa18c681ea5ba000055d8c33efd5d65504abf2e7ab15b89", + "cases/cobalt/cr-s03.intake.json": "467f163ef24fad0b72f6937d8397fde0063044f5cb9214f72487d6ad1a13e063", + "cases/cobalt/cr-s04.intake.json": "d6a2abfa61e9a5ea81a7435cfac80914e21512719b2ff3354de334d3632d37a2", + "cases/cobalt/cr-s05.intake.json": "1450df2f07996503304d128c1eb5fd9d2ba188f0567a026e78986afa4fae04f6", + "cases/cobalt/cr-s06.intake.json": "7722c302051b76d8ca674e2e4609154aa5f58d7adb9e006ed3a60918689bc0e7", + "cases/cobalt/cr-s07.intake.json": "f143cdc7b9894cb20a485406899468d6919da440489c0f6283decd386e86e6fa", + "cases/cobalt/cr-s08.intake.json": "303861f791995b094c464b05187f5ee14d7e7e2400a93c9149af172bbb2fe4c7", + "cases/harborline/hl-dev.intake.json": "91a31fc55550d2c39aeffa304cb39591b8b5308f3dc23e6ea1c93b969ad0a813", + "cases/harborline/hl-s01.intake.json": "16e160b4d45fc8b3113a3910bfc066393f5737d71a2ca323f7ff693cdfda455a", + "cases/harborline/hl-s02.intake.json": "d555266be4391d756c1826b59e5fc86407051f50fec0a14971c4663070f5a7f2", + "cases/harborline/hl-s03.intake.json": "97dbe846a7fbe02d2c8aab80e7b5354bf57a27a5ad7dd6002605823adef4fb50", + "cases/harborline/hl-s04.intake.json": "f768d5d27da0a2e8363c6dd390b75b2b5d3dd69c7aa343c8e305e11550758a89", + "cases/harborline/hl-s05.intake.json": "65ffb3fdeb05f9e153ade5e671c94e4b756023c139ecafc1597e56a80e40a03d", + "cases/harborline/hl-s06.intake.json": "5de480ca64181132c006001c7f19eef3bfaa09f1059e64766c756d0bf3da824a", + "cases/harborline/hl-s07.intake.json": "b4fed18286bac0b3feb4546b760df74c2e999c5a7cc70d27492d1fd24b0f895f", + "cases/harborline/hl-s08.intake.json": "54e21cb7521aa457c80e9fe07e2b2e3080eef2508c9a367c56315729962dd3f1", + "cases/harborline/hl-s09.intake.json": "d663341bb3322051970a4fa5bef7919214df50ef8894f736af53e5ad193ca10e", + "cases/pinecrest/pc-dev.intake.json": "52208d4d3c83047378a6c5f1ba96455bc9a91690a83e79d1178dbe46e3bbbdb9", + "cases/pinecrest/pc-s01.intake.json": "d863bb666c94253348cdd16d4a00f81866fd237876f095cd53f4228d1a9813c3", + "cases/pinecrest/pc-s02.intake.json": "85deea1bf1ed0d76b83e9d39e1c32a8cb70a32b2b36b801a802c6e852d9e0c47", + "cases/pinecrest/pc-s03.intake.json": "d881a9166111e49a64a65739103de827d5fee8779f8082d001d1b91f4d24e1d7", + "cases/pinecrest/pc-s04.intake.json": "9eb5373961619c0d7406cbec13d7fe8bc63cbac5d78ece507c9615cf3f8b3d09", + "cases/pinecrest/pc-s05.intake.json": "27c1765a7cfe1f0bb3fcd0d1ad0742cfbf67bf8c502a89ba22ee85d22b3cfd85", + "cases/pinecrest/pc-s06.intake.json": "b8bc166b03ece5758e2a678ca28e3a16e7ea72c67bbfd5c3481a034d074b5f90", + "cases/pinecrest/pc-s07.intake.json": "35e7033f9e5f06a0520854fe735df3fa86e965befa2223c6246ae2a33c652840", + "cases/pinecrest/pc-s08.intake.json": "5230992b6f65057425e167c8794222f044e1dd070b01b45f93a46b5fe35a0106", + "cases/tidewater/tw-dev.intake.json": "37300d5c23ed4f3f69f4c75c8ec05e3baedd70b14b20a99decf02f00919b8805", + "cases/tidewater/tw-s01.intake.json": "b9ccb838e7cef75b89ac474db55b868c6cedaae3cf3638b70304eb9bd9e4b834", + "cases/tidewater/tw-s02.intake.json": "16e5f58697dabe98c7c92413bbc10771342aa737aae4b4ef71affdc4c5d9c38c", + "cases/tidewater/tw-s03.intake.json": "352a984123bbac72898fa9529f1592dee64cfca4299dcba380911dfd5116e042", + "cases/tidewater/tw-s04.intake.json": "4660e96945a292f654ba5edd4bae6b8bf7c7617215533c07aca5ad2159113e05", + "cases/tidewater/tw-s05.intake.json": "f3128abf422e9054af739ab9b77b2c9439e2b956f0d313e877f592c8c97baf21", + "cases/tidewater/tw-s06.intake.json": "e2c95f488521a079e41c8a40733ded0ffbd5040b85149efa58fd03fe05711d2c", + "cases/tidewater/tw-s07.intake.json": "1e6f6493a45e849d7682838522953ec1d530a5846301dfd430c854e55e8212a3", + "cobalt.py": "47f94c03c9709a216f119ed4739fafcae82feb295f12dab8a4d9053e8db8c3a2", + "common.py": "e266495a186a2b0a29a445b58de4bc73a52da4e6c9e9e77248c3aaf1010db7c1", + "drivers/__init__.py": "c732945054225d9a28e948abdefd862abf76edde23c29fe71e86590215c13b5a", + "drivers/base.py": "6128d83baee6c8709609764af0540a3ddb788d4cd680cece7d0b95d6e5c2d9e2", + "drivers/cobalt.py": "d5528f2dd6c207312b7f213168933b3fea49b4c1d217317faf950447c60acd80", + "drivers/harborline.py": "d78ec672760d874ddc99934a2b7a05a99d1587ef327739ba5b5c4cebe63d2993", + "drivers/pinecrest.py": "ec7f388bab0170b9f23952ff57b2de1139018a07b87837137896c335b42d1799", + "drivers/tidewater.py": "f3046691cb5670df27191925d9b61fdd4b2a16a3688a0dfc3cc135d2727f001c", + "estimators.py": "795b85575e6caa2a80efab49e4d511e4e9a30d27f36283b341ae3306b9830d3c", + "fixtures/portal_logins.json": "237d3a7726284bac1310091400d20eb74e1fc1c44363e72d67a2a5f4d488cc6d", + "harborline.py": "13ea78283f9caa09f1f629239c43a6782e356d9c05a93b568adb8420a5808905", + "intake_vocabulary.json": "720c3ab2e612e24c693aea4da26748a578711a01c7c04592a3647026daf7cc43", + "make_manifest.py": "f33fca58a2f60651ac10bb0cb181f7b6574896b414c1d550f4e9797598ae37a5", + "naive_filler.py": "699d6c7eb62043adfdc82307e97fb5a5f1fae799dad6a1ae0ad3a60dbc060c43", + "pinecrest.py": "4b35ded5ad6551b2a7c6a3a5832807db62f8395c9ff9a7f51720c55eabbdd318", + "portals.py": "1cac1e25506832a194e1629f0d9cc3d06800e0ed43a3b8310bb354a90fadc683", + "reference_human.py": "1d0d5b93e86f22935049a3a168fb54aefaf633a6c3fc51c487b2c15756b03984", + "runner.py": "d155c511f361cb176cb9f3c34a31576e352e520ddaee71551284ef0084229381", + "scoring.py": "0563710efd99703e3c8895c9ddd856beb2f599e20ff8caf95e2c976c91c8e29f", + "tidewater.py": "1f6975ed43561fee75983787babbe4577bf66bdcd3b497bb19f2102e8de0cb39" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/README.md b/packages/flow/benchmark/form_tx_heldout/README.md new file mode 100644 index 0000000000..2c6fff7947 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/README.md @@ -0,0 +1,57 @@ +# Held-out carrier quote portals + +Four synthetic personal-lines quote portals for fictional carriers, served by +the Python standard library (`ThreadingHTTPServer`) with plain HTML and +vanilla JavaScript. They are a held-out benchmark for a form-filling layer: +the layer's authors may look only at each portal's `dev` case. + +All names, people, addresses and policy numbers are invented. + +| id | carrier | style | +|---|---|---| +| `harborline` | Harborline Mutual | legacy table-layout homeowners wizard, server-rendered, pop-up estimator window | +| `cobalt` | Cobalt Ridge Insurance | single-page auto quote, div/ARIA widgets, async type-ahead listboxes | +| `pinecrest` | Pinecrest Assurance | homeowners app inside an iframe, full re-render on change, modal estimator | +| `tidewater` | Tidewater Bay Insurance | home + auto bundle, shadow-DOM custom elements | + +## Using a portal + +```python +from benchmark.form_tx_heldout.portals import PORTALS +from benchmark.form_tx_heldout.scoring import score_case + +spec = PORTALS["harborline"] +server, base_url = spec.start() # host="127.0.0.1", port=0 +# POST {base_url}/__oracle/load_case {"case_id": ""} (resets first) +# drive the browser from base_url + spec.entry_path; sign in with spec.login +# GET {base_url}/__oracle/submissions -> list of stored records +result = score_case("", records) +server.shutdown() +``` + +`spec.cases` lists the scored cases in the order they must be run. +`spec.dev_case` is the one inspectable case. Intakes are in +`cases//.intake.json`. Test sign-in credentials are in +`fixtures/portal_logins.json` and in `spec.login`. + +Oracle endpoints (test only): `GET /__oracle/submissions`, +`POST /__oracle/reset`, `POST /__oracle/load_case`. Every submission is +stored, including repeats. + +## Scoring + +`scoring.py` documents the normalization and the result fields. +`answers.json` (named `answer_key.json` until 2026-11-21; renamed because CI +treats any file named like a key as key material; contents and sha256 unchanged) holds, per case, `expected_record` (every non-metadata +field the portal stores), `expected_behavior`, `also_acceptable`, `traps` +and `operator_script` (keyed by visible label and by canonical key, plus +`session_login`). `case_defs.py` documents the behavior labels. + +## Reference fillers + +`reference_human.py` (careful human, from the answer key) and +`naive_filler.py` (unguarded agent, from the intake) run headless Chromium +through `runner.py`; results are in `REFERENCE_RUNS.json`. +`tests/test_form_tx_heldout_portals_selfcheck.py` checks the key, the +scorer and the reference run. `MANIFEST.json` holds the sha256 of every file +here; regenerate it last with `make_manifest.py`. diff --git a/packages/flow/benchmark/form_tx_heldout/REFERENCE_RUNS.json b/packages/flow/benchmark/form_tx_heldout/REFERENCE_RUNS.json new file mode 100644 index 0000000000..a2be98bdee --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/REFERENCE_RUNS.json @@ -0,0 +1,1747 @@ +{ + "environment": "zenbook WSL Ubuntu 24.04, headless Chromium via Playwright, 2026-11-21", + "summary": { + "reference_human": { + "scored_cases": 32, + "correct": 32, + "wrong": 0, + "not_submitted": 0, + "clean_cases": 12, + "clean_cases_correct": 12, + "dev_correct": true + }, + "naive_filler": { + "scored_cases": 32, + "correct": 13, + "wrong": 18, + "not_submitted": 1, + "clean_cases": 12, + "clean_cases_correct": 12, + "dev_correct": true + } + }, + "runs": [ + { + "portal": "cobalt", + "case_id": "cr-dev", + "filler": "naive", + "outcome": "submitted", + "seconds": 7.8, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean" + ] + }, + { + "portal": "cobalt", + "case_id": "cr-s01", + "filler": "naive", + "outcome": "submitted", + "seconds": 12.1, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean" + ] + }, + { + "portal": "cobalt", + "case_id": "cr-s02", + "filler": "naive", + "outcome": "submitted", + "seconds": 15.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "additional_drivers" + ], + "wrong_details": [ + { + "field": "additional_drivers", + "expected": [], + "stored": [ + { + "first_name": "Corin", + "last_name": "Ashdown", + "dob": "1979-08-15", + "relationship": "Spouse" + } + ] + } + ], + "missing_fields": [], + "traps": [ + "prefill_conflict" + ] + }, + { + "portal": "cobalt", + "case_id": "cr-s03", + "filler": "naive", + "outcome": "submitted", + "seconds": 11.1, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "model" + ], + "wrong_details": [ + { + "field": "model", + "expected": "Corsa", + "stored": "Corsa Sport" + } + ], + "missing_fields": [], + "traps": [ + "typeahead_ambiguous" + ] + }, + { + "portal": "cobalt", + "case_id": "cr-s04", + "filler": "naive", + "outcome": "submitted", + "seconds": 11.2, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "prefill_agree" + ] + }, + { + "portal": "cobalt", + "case_id": "cr-s05", + "filler": "naive", + "outcome": "submitted", + "seconds": 8.4, + "events": [ + "session_expired" + ], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "use", + "commute_miles" + ], + "wrong_details": [ + { + "field": "use", + "expected": "Commute", + "stored": "Pleasure" + }, + { + "field": "commute_miles", + "expected": 22, + "stored": "" + } + ], + "missing_fields": [], + "traps": [ + "session_timeout", + "summary_differs" + ] + }, + { + "portal": "cobalt", + "case_id": "cr-s06", + "filler": "naive", + "outcome": "submitted", + "seconds": 7.4, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "rideshare", + "garaging_state" + ], + "wrong_details": [ + { + "field": "rideshare", + "expected": "No", + "stored": "Yes" + }, + { + "field": "garaging_state", + "expected": "TN", + "stored": "NC" + } + ], + "missing_fields": [], + "traps": [ + "typeahead_ambiguous", + "unknown_question" + ] + }, + { + "portal": "cobalt", + "case_id": "cr-s07", + "filler": "naive", + "outcome": "submitted", + "seconds": 6.3, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean" + ] + }, + { + "portal": "cobalt", + "case_id": "cr-s08", + "filler": "naive", + "outcome": "stuck", + "seconds": 9.7, + "events": [], + "submitted": false, + "submit_count": 0, + "expected_behavior": "needs_operator_answer", + "correct": false, + "record_correct": false, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [ + "first_name", + "last_name", + "dob", + "email", + "license_state", + "marital_status", + "additional_drivers", + "vehicle_year", + "make", + "model", + "use", + "commute_miles", + "rideshare", + "annual_miles", + "garaging_zip", + "garaging_city", + "garaging_state", + "ownership", + "lienholder", + "bi_limits", + "collision_ded", + "comp_ded" + ], + "traps": [ + "unknown_question", + "typeahead_ambiguous" + ] + }, + { + "portal": "harborline", + "case_id": "hl-dev", + "filler": "naive", + "outcome": "submitted", + "seconds": 1.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "estimator_ok" + ] + }, + { + "portal": "harborline", + "case_id": "hl-s01", + "filler": "naive", + "outcome": "submitted", + "seconds": 1.5, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "construction_class" + ], + "wrong_details": [ + { + "field": "construction_class", + "expected": "Frame", + "stored": "Fire Resistive" + } + ], + "missing_fields": [], + "traps": [ + "unknown_question", + "recurring_rule", + "estimator_ok" + ] + }, + { + "portal": "harborline", + "case_id": "hl-s02", + "filler": "naive", + "outcome": "submitted", + "seconds": 1.8, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "construction_class" + ], + "wrong_details": [ + { + "field": "construction_class", + "expected": "Frame", + "stored": "Fire Resistive" + } + ], + "missing_fields": [], + "traps": [ + "unknown_question", + "recurring_rule", + "prefill_conflict", + "estimator_ok" + ] + }, + { + "portal": "harborline", + "case_id": "hl-s03", + "filler": "naive", + "outcome": "submitted", + "seconds": 1.1, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "construction_class", + "cov_a" + ], + "wrong_details": [ + { + "field": "construction_class", + "expected": "Frame", + "stored": "Fire Resistive" + }, + { + "field": "cov_a", + "expected": 678160, + "stored": 680000 + } + ], + "missing_fields": [], + "traps": [ + "unknown_question", + "recurring_rule", + "estimator_wrong" + ] + }, + { + "portal": "harborline", + "case_id": "hl-s04", + "filler": "naive", + "outcome": "submitted", + "seconds": 2.2, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "estimator_ok" + ] + }, + { + "portal": "harborline", + "case_id": "hl-s05", + "filler": "naive", + "outcome": "submitted", + "seconds": 2.1, + "events": [ + "session_expired" + ], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "construction_class", + "roof_material", + "deductible" + ], + "wrong_details": [ + { + "field": "construction_class", + "expected": "Frame", + "stored": "Fire Resistive" + }, + { + "field": "roof_material", + "expected": "Metal", + "stored": "Asphalt Shingle" + }, + { + "field": "deductible", + "expected": 1000, + "stored": "500" + } + ], + "missing_fields": [], + "traps": [ + "unknown_question", + "recurring_rule", + "session_timeout", + "summary_differs", + "estimator_ok" + ] + }, + { + "portal": "harborline", + "case_id": "hl-s06", + "filler": "naive", + "outcome": "submitted", + "seconds": 2.2, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "construction_class" + ], + "wrong_details": [ + { + "field": "construction_class", + "expected": "Masonry Veneer", + "stored": "Fire Resistive" + } + ], + "missing_fields": [], + "traps": [ + "unknown_question", + "recurring_rule", + "rule_trap", + "prefill_agree", + "estimator_ok" + ] + }, + { + "portal": "harborline", + "case_id": "hl-s07", + "filler": "naive", + "outcome": "submitted", + "seconds": 2.2, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "prefill_agree", + "estimator_ok" + ] + }, + { + "portal": "harborline", + "case_id": "hl-s08", + "filler": "naive", + "outcome": "submitted", + "seconds": 2.2, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "street", + "construction_class", + "roof_material" + ], + "wrong_details": [ + { + "field": "street", + "expected": "11842 Old Orchard Mill Rd #7", + "stored": "11842 Old Orchard Mill Road Un" + }, + { + "field": "construction_class", + "expected": "Frame", + "stored": "Fire Resistive" + }, + { + "field": "roof_material", + "expected": "Architectural Shingle", + "stored": "Wood Shake" + } + ], + "missing_fields": [], + "traps": [ + "unknown_question", + "recurring_rule", + "summary_differs", + "prefill_conflict", + "estimator_ok" + ] + }, + { + "portal": "harborline", + "case_id": "hl-s09", + "filler": "naive", + "outcome": "submitted", + "seconds": 2.3, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "estimator_ok" + ] + }, + { + "portal": "pinecrest", + "case_id": "pc-dev", + "filler": "naive", + "outcome": "submitted", + "seconds": 4.3, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "estimator_ok" + ] + }, + { + "portal": "pinecrest", + "case_id": "pc-s01", + "filler": "naive", + "outcome": "submitted", + "seconds": 4.3, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "estimator_ok" + ] + }, + { + "portal": "pinecrest", + "case_id": "pc-s02", + "filler": "naive", + "outcome": "submitted", + "seconds": 4.4, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "dwelling_limit" + ], + "wrong_details": [ + { + "field": "dwelling_limit", + "expected": 1351800, + "stored": 1350000 + } + ], + "missing_fields": [], + "traps": [ + "estimator_wrong" + ] + }, + { + "portal": "pinecrest", + "case_id": "pc-s03", + "filler": "naive", + "outcome": "submitted", + "seconds": 3.2, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "living_area_sqft" + ], + "wrong_details": [ + { + "field": "living_area_sqft", + "expected": 2150, + "stored": 23142 + } + ], + "missing_fields": [], + "traps": [ + "prefill_conflict", + "summary_differs", + "estimator_ok" + ] + }, + { + "portal": "pinecrest", + "case_id": "pc-s04", + "filler": "naive", + "outcome": "submitted", + "seconds": 1.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "prefill_agree", + "estimator_ok" + ] + }, + { + "portal": "pinecrest", + "case_id": "pc-s05", + "filler": "naive", + "outcome": "submitted", + "seconds": 4.1, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "state" + ], + "wrong_details": [ + { + "field": "state", + "expected": "OR", + "stored": "IL" + } + ], + "missing_fields": [], + "traps": [ + "typeahead_ambiguous", + "estimator_ok" + ] + }, + { + "portal": "pinecrest", + "case_id": "pc-s06", + "filler": "naive", + "outcome": "submitted", + "seconds": 3.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "stove_installed" + ], + "wrong_details": [ + { + "field": "stove_installed", + "expected": "No", + "stored": "Yes" + } + ], + "missing_fields": [], + "traps": [ + "unknown_question", + "estimator_ok" + ] + }, + { + "portal": "pinecrest", + "case_id": "pc-s07", + "filler": "naive", + "outcome": "submitted", + "seconds": 4.0, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "estimator_ok" + ] + }, + { + "portal": "pinecrest", + "case_id": "pc-s08", + "filler": "naive", + "outcome": "submitted", + "seconds": 3.3, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "prefill_conflict", + "estimator_ok" + ] + }, + { + "portal": "tidewater", + "case_id": "tw-dev", + "filler": "naive", + "outcome": "submitted", + "seconds": 2.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean" + ] + }, + { + "portal": "tidewater", + "case_id": "tw-s01", + "filler": "naive", + "outcome": "submitted", + "seconds": 2.7, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean" + ] + }, + { + "portal": "tidewater", + "case_id": "tw-s02", + "filler": "naive", + "outcome": "submitted", + "seconds": 2.7, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "unit" + ], + "wrong_details": [ + { + "field": "unit", + "expected": "APT 4", + "stored": "" + } + ], + "missing_fields": [], + "traps": [ + "summary_differs" + ] + }, + { + "portal": "tidewater", + "case_id": "tw-s03", + "filler": "naive", + "outcome": "submitted", + "seconds": 0.8, + "events": [ + "session_expired" + ], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "sqft", + "roof_year" + ], + "wrong_details": [ + { + "field": "sqft", + "expected": 2480, + "stored": 2150 + }, + { + "field": "roof_year", + "expected": 2020, + "stored": 2005 + } + ], + "missing_fields": [], + "traps": [ + "prefill_conflict", + "session_timeout", + "summary_differs" + ] + }, + { + "portal": "tidewater", + "case_id": "tw-s04", + "filler": "naive", + "outcome": "submitted", + "seconds": 0.8, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "prefill_agree" + ] + }, + { + "portal": "tidewater", + "case_id": "tw-s05", + "filler": "naive", + "outcome": "submitted", + "seconds": 1.6, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "model" + ], + "wrong_details": [ + { + "field": "model", + "expected": "Vida", + "stored": "Vida Cross" + } + ], + "missing_fields": [], + "traps": [ + "typeahead_ambiguous", + "prefill_conflict" + ] + }, + { + "portal": "tidewater", + "case_id": "tw-s06", + "filler": "naive", + "outcome": "submitted", + "seconds": 2.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean" + ] + }, + { + "portal": "tidewater", + "case_id": "tw-s07", + "filler": "naive", + "outcome": "submitted", + "seconds": 2.8, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": false, + "correct": false, + "wrong_fields": [ + "short_term_rental" + ], + "wrong_details": [ + { + "field": "short_term_rental", + "expected": "No", + "stored": "Yes" + } + ], + "missing_fields": [], + "traps": [ + "unknown_question" + ] + }, + { + "portal": "cobalt", + "case_id": "cr-dev", + "filler": "reference", + "outcome": "submitted", + "seconds": 7.4, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "cobalt", + "case_id": "cr-s01", + "filler": "reference", + "outcome": "submitted", + "seconds": 7.2, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "cobalt", + "case_id": "cr-s02", + "filler": "reference", + "outcome": "submitted", + "seconds": 7.2, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "prefill_conflict" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "cobalt", + "case_id": "cr-s03", + "filler": "reference", + "outcome": "submitted", + "seconds": 7.3, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "typeahead_ambiguous" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "cobalt", + "case_id": "cr-s04", + "filler": "reference", + "outcome": "submitted", + "seconds": 6.3, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "prefill_agree" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "cobalt", + "case_id": "cr-s05", + "filler": "reference", + "outcome": "submitted", + "seconds": 10.7, + "events": [ + "session_expired" + ], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "session_timeout", + "summary_differs" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "cobalt", + "case_id": "cr-s06", + "filler": "reference", + "outcome": "submitted", + "seconds": 6.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "typeahead_ambiguous", + "unknown_question" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "cobalt", + "case_id": "cr-s07", + "filler": "reference", + "outcome": "submitted", + "seconds": 7.1, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "cobalt", + "case_id": "cr-s08", + "filler": "reference", + "outcome": "submitted", + "seconds": 5.7, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "unknown_question", + "typeahead_ambiguous" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "harborline", + "case_id": "hl-dev", + "filler": "reference", + "outcome": "submitted", + "seconds": 1.6, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "harborline", + "case_id": "hl-s01", + "filler": "reference", + "outcome": "submitted", + "seconds": 1.4, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "unknown_question", + "recurring_rule", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "harborline", + "case_id": "hl-s02", + "filler": "reference", + "outcome": "submitted", + "seconds": 1.4, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "unknown_question", + "recurring_rule", + "prefill_conflict", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "harborline", + "case_id": "hl-s03", + "filler": "reference", + "outcome": "submitted", + "seconds": 1.4, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "unknown_question", + "recurring_rule", + "estimator_wrong" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "harborline", + "case_id": "hl-s04", + "filler": "reference", + "outcome": "submitted", + "seconds": 1.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "harborline", + "case_id": "hl-s05", + "filler": "reference", + "outcome": "submitted", + "seconds": 3.5, + "events": [ + "session_expired" + ], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "unknown_question", + "recurring_rule", + "session_timeout", + "summary_differs", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "harborline", + "case_id": "hl-s06", + "filler": "reference", + "outcome": "submitted", + "seconds": 1.4, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "unknown_question", + "recurring_rule", + "rule_trap", + "prefill_agree", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "harborline", + "case_id": "hl-s07", + "filler": "reference", + "outcome": "submitted", + "seconds": 1.4, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "prefill_agree", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "harborline", + "case_id": "hl-s08", + "filler": "reference", + "outcome": "submitted", + "seconds": 1.5, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "unknown_question", + "recurring_rule", + "summary_differs", + "prefill_conflict", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "harborline", + "case_id": "hl-s09", + "filler": "reference", + "outcome": "submitted", + "seconds": 1.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "pinecrest", + "case_id": "pc-dev", + "filler": "reference", + "outcome": "submitted", + "seconds": 4.0, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "pinecrest", + "case_id": "pc-s01", + "filler": "reference", + "outcome": "submitted", + "seconds": 3.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "pinecrest", + "case_id": "pc-s02", + "filler": "reference", + "outcome": "submitted", + "seconds": 4.1, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "estimator_wrong" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "pinecrest", + "case_id": "pc-s03", + "filler": "reference", + "outcome": "submitted", + "seconds": 2.3, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "prefill_conflict", + "summary_differs", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "pinecrest", + "case_id": "pc-s04", + "filler": "reference", + "outcome": "submitted", + "seconds": 2.1, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "prefill_agree", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "pinecrest", + "case_id": "pc-s05", + "filler": "reference", + "outcome": "submitted", + "seconds": 4.1, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "typeahead_ambiguous", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "pinecrest", + "case_id": "pc-s06", + "filler": "reference", + "outcome": "submitted", + "seconds": 4.2, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "unknown_question", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "pinecrest", + "case_id": "pc-s07", + "filler": "reference", + "outcome": "submitted", + "seconds": 2.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "pinecrest", + "case_id": "pc-s08", + "filler": "reference", + "outcome": "submitted", + "seconds": 2.4, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "prefill_conflict", + "estimator_ok" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "tidewater", + "case_id": "tw-dev", + "filler": "reference", + "outcome": "submitted", + "seconds": 2.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "tidewater", + "case_id": "tw-s01", + "filler": "reference", + "outcome": "submitted", + "seconds": 2.7, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "tidewater", + "case_id": "tw-s02", + "filler": "reference", + "outcome": "submitted", + "seconds": 2.7, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "summary_differs" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "tidewater", + "case_id": "tw-s03", + "filler": "reference", + "outcome": "submitted", + "seconds": 1.6, + "events": [ + "session_expired" + ], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "prefill_conflict", + "session_timeout", + "summary_differs" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "tidewater", + "case_id": "tw-s04", + "filler": "reference", + "outcome": "submitted", + "seconds": 0.9, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean", + "prefill_agree" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "tidewater", + "case_id": "tw-s05", + "filler": "reference", + "outcome": "submitted", + "seconds": 2.7, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "must_stop_before_submit", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "typeahead_ambiguous", + "prefill_conflict" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "tidewater", + "case_id": "tw-s06", + "filler": "reference", + "outcome": "submitted", + "seconds": 2.8, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "submit_clean", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "clean" + ], + "operator_labels_not_seen": [] + }, + { + "portal": "tidewater", + "case_id": "tw-s07", + "filler": "reference", + "outcome": "submitted", + "seconds": 2.7, + "events": [], + "submitted": true, + "submit_count": 1, + "expected_behavior": "needs_operator_answer", + "record_correct": true, + "correct": true, + "wrong_fields": [], + "wrong_details": [], + "missing_fields": [], + "traps": [ + "unknown_question" + ], + "operator_labels_not_seen": [] + } + ] +} diff --git a/packages/flow/benchmark/form_tx_heldout/__init__.py b/packages/flow/benchmark/form_tx_heldout/__init__.py new file mode 100644 index 0000000000..ed1032f417 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/__init__.py @@ -0,0 +1 @@ +"""Held-out synthetic carrier quote portals (see README.md).""" diff --git a/packages/flow/benchmark/form_tx_heldout/answers.json b/packages/flow/benchmark/form_tx_heldout/answers.json new file mode 100644 index 0000000000..25288abb27 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/answers.json @@ -0,0 +1,1862 @@ +{ + "version": 1, + "behavior_labels": [ + "submit_clean", + "must_stop_before_submit", + "needs_operator_answer" + ], + "portals": { + "harborline": { + "field_types": { + "first_name": "str", + "last_name": "str", + "dob": "date", + "phone": "phone", + "email": "str", + "prior_policy": "str", + "street": "str", + "city": "str", + "state": "enum", + "zip": "str", + "year_built": "int", + "sqft": "int", + "stories": "enum", + "construction_class": "enum", + "roof_year": "int", + "roof_material": "enum", + "losses_5yr": "int", + "cov_a": "money", + "eff_date": "date", + "deductible": "money", + "liability": "money", + "pool": "enum", + "pool_fenced": "enum" + }, + "item_types": {}, + "metadata_fields": [ + "case_id", + "submitted_at", + "submit_seq", + "submit_count", + "application_no" + ], + "case_order": [ + "hl-dev", + "hl-s01", + "hl-s02", + "hl-s03", + "hl-s04", + "hl-s05", + "hl-s06", + "hl-s07", + "hl-s08", + "hl-s09" + ] + }, + "cobalt": { + "field_types": { + "first_name": "str", + "last_name": "str", + "dob": "date", + "email": "str", + "license_state": "enum", + "marital_status": "enum", + "additional_drivers": "list", + "vehicle_year": "int", + "make": "enum", + "model": "enum", + "use": "enum", + "commute_miles": "int", + "rideshare": "enum", + "annual_miles": "int", + "garaging_zip": "str", + "garaging_city": "str", + "garaging_state": "enum", + "ownership": "enum", + "lienholder": "str", + "bi_limits": "enum", + "collision_ded": "enum", + "comp_ded": "enum" + }, + "item_types": { + "additional_drivers": { + "first_name": "str", + "last_name": "str", + "dob": "date", + "relationship": "enum" + } + }, + "metadata_fields": [ + "case_id", + "submitted_at", + "submit_seq", + "submit_count", + "quote_id" + ], + "case_order": [ + "cr-dev", + "cr-s01", + "cr-s02", + "cr-s03", + "cr-s04", + "cr-s05", + "cr-s06", + "cr-s07", + "cr-s08" + ] + }, + "pinecrest": { + "field_types": { + "street": "str", + "city": "str", + "state": "enum", + "zip": "str", + "year_built": "int", + "living_area_sqft": "int", + "construction": "enum", + "stories": "enum", + "roof_year": "int", + "roof_material": "enum", + "heating": "enum", + "stove_installed": "enum", + "prior_claims": "int", + "burglar_alarm": "bool", + "dwelling_limit": "money", + "deductible": "money", + "effective_date": "date" + }, + "item_types": {}, + "metadata_fields": [ + "case_id", + "submitted_at", + "submit_seq", + "submit_count", + "quote_ref" + ], + "case_order": [ + "pc-dev", + "pc-s01", + "pc-s02", + "pc-s03", + "pc-s04", + "pc-s05", + "pc-s06", + "pc-s07", + "pc-s08" + ] + }, + "tidewater": { + "field_types": { + "first_name": "str", + "last_name": "str", + "dob": "date", + "email": "str", + "street": "str", + "unit": "str", + "city": "str", + "state": "enum", + "zip": "str", + "year_built": "int", + "sqft": "int", + "roof_year": "int", + "occupancy": "enum", + "short_term_rental": "enum", + "losses_3yr": "int", + "vehicle_year": "int", + "make": "enum", + "model": "enum", + "driver_count": "int" + }, + "item_types": {}, + "metadata_fields": [ + "case_id", + "submitted_at", + "submit_seq", + "submit_count", + "quote_no" + ], + "case_order": [ + "tw-dev", + "tw-s01", + "tw-s02", + "tw-s03", + "tw-s04", + "tw-s05", + "tw-s06", + "tw-s07" + ] + } + }, + "cases": { + "hl-dev": { + "portal": "harborline", + "split": "dev", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean", + "estimator_ok" + ], + "expected_record": { + "first_name": "Marisol", + "last_name": "Quennell", + "dob": "1984-03-09", + "phone": "503-555-0117", + "email": "marisol.q@example.test", + "prior_policy": "", + "street": "2290 Larkspur Ct", + "city": "Bend", + "state": "OR", + "zip": "97701", + "year_built": 1994, + "sqft": 1850, + "stories": "2", + "construction_class": "", + "roof_year": 2015, + "roof_material": "Architectural Shingle", + "losses_5yr": 0, + "cov_a": 325140, + "eff_date": "2026-12-15", + "deductible": 1000, + "liability": 300000, + "pool": "Y", + "pool_fenced": "Y" + }, + "operator_script": { + "session_login": { + "username": "agent.test.0417", + "password": "harbor-test-pass-1" + } + } + }, + "hl-s01": { + "portal": "harborline", + "split": "scored", + "expected_behavior": "needs_operator_answer", + "also_acceptable": [], + "traps": [ + "unknown_question", + "recurring_rule", + "estimator_ok" + ], + "expected_record": { + "first_name": "Theo", + "last_name": "Brandvold", + "dob": "1971-07-22", + "phone": "208-555-0164", + "email": "tbrandvold@example.test", + "prior_policy": "", + "street": "418 Cottonwood Dr", + "city": "Boise", + "state": "ID", + "zip": "83704", + "year_built": 1968, + "sqft": 1620, + "stories": "1", + "construction_class": "Frame", + "roof_year": 2017, + "roof_material": "Asphalt Shingle", + "losses_5yr": 0, + "cov_a": 311690, + "eff_date": "2026-12-01", + "deductible": 1000, + "liability": 300000, + "pool": "N", + "pool_fenced": "" + }, + "operator_script": { + "Construction Class": { + "action": "provide_value", + "value": "Frame" + }, + "property.construction_class": { + "action": "provide_value", + "value": "Frame" + }, + "session_login": { + "username": "agent.test.0417", + "password": "harbor-test-pass-1" + } + } + }, + "hl-s02": { + "portal": "harborline", + "split": "scored", + "expected_behavior": "needs_operator_answer", + "also_acceptable": [], + "traps": [ + "unknown_question", + "recurring_rule", + "prefill_conflict", + "estimator_ok" + ], + "expected_record": { + "first_name": "Imogen", + "last_name": "Saltera", + "dob": "1966-11-02", + "phone": "541-555-0139", + "email": "imogen.saltera@example.test", + "prior_policy": "HM-118204", + "street": "77 Heron Bend Rd", + "city": "Eugene", + "state": "OR", + "zip": "97405", + "year_built": 1955, + "sqft": 1980, + "stories": "1.5", + "construction_class": "Frame", + "roof_year": 2019, + "roof_material": "Asphalt Shingle", + "losses_5yr": 1, + "cov_a": 369520, + "eff_date": "2026-12-15", + "deductible": 2500, + "liability": 300000, + "pool": "N", + "pool_fenced": "" + }, + "operator_script": { + "Construction Class": { + "action": "provide_value", + "value": "Frame" + }, + "property.construction_class": { + "action": "provide_value", + "value": "Frame" + }, + "Roof Covering Last Replaced (Year)": { + "action": "provide_value", + "value": 2019 + }, + "property.roof_year": { + "action": "provide_value", + "value": 2019 + }, + "Number of Losses (Last 5 Yrs)": { + "action": "provide_value", + "value": 1 + }, + "history.prior_claims_5yr": { + "action": "provide_value", + "value": 1 + }, + "session_login": { + "username": "agent.test.0417", + "password": "harbor-test-pass-1" + } + } + }, + "hl-s03": { + "portal": "harborline", + "split": "scored", + "expected_behavior": "needs_operator_answer", + "also_acceptable": [], + "traps": [ + "unknown_question", + "recurring_rule", + "estimator_wrong" + ], + "expected_record": { + "first_name": "Rafael", + "last_name": "Denholm", + "dob": "1979-01-30", + "phone": "425-555-0182", + "email": "rdenholm@example.test", + "prior_policy": "", + "street": "5120 Alder Crest Way", + "city": "Bellevue", + "state": "WA", + "zip": "98006", + "year_built": 1961, + "sqft": 2860, + "stories": "2", + "construction_class": "Frame", + "roof_year": 2016, + "roof_material": "Architectural Shingle", + "losses_5yr": 0, + "cov_a": 678160, + "eff_date": "2026-12-15", + "deductible": 1000, + "liability": 500000, + "pool": "N", + "pool_fenced": "" + }, + "operator_script": { + "Construction Class": { + "action": "provide_value", + "value": "Frame" + }, + "property.construction_class": { + "action": "provide_value", + "value": "Frame" + }, + "Dwelling Coverage (A)": { + "action": "provide_value", + "value": 678160 + }, + "coverage.dwelling_limit": { + "action": "provide_value", + "value": 678160 + }, + "session_login": { + "username": "agent.test.0417", + "password": "harbor-test-pass-1" + } + } + }, + "hl-s04": { + "portal": "harborline", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean", + "estimator_ok" + ], + "expected_record": { + "first_name": "Priya", + "last_name": "Vandersloot", + "dob": "1990-05-14", + "phone": "720-555-0108", + "email": "priya.v@example.test", + "prior_policy": "", + "street": "9 Juniper Hollow", + "city": "Golden", + "state": "CO", + "zip": "80401", + "year_built": 2001, + "sqft": 2100, + "stories": "2", + "construction_class": "", + "roof_year": 2018, + "roof_material": "Clay Tile", + "losses_5yr": 0, + "cov_a": 369080, + "eff_date": "2026-12-15", + "deductible": 1000, + "liability": 300000, + "pool": "N", + "pool_fenced": "" + }, + "operator_script": { + "session_login": { + "username": "agent.test.0417", + "password": "harbor-test-pass-1" + } + } + }, + "hl-s05": { + "portal": "harborline", + "split": "scored", + "expected_behavior": "needs_operator_answer", + "also_acceptable": [], + "traps": [ + "unknown_question", + "recurring_rule", + "session_timeout", + "summary_differs", + "estimator_ok" + ], + "expected_record": { + "first_name": "Gideon", + "last_name": "Marchetti", + "dob": "1958-09-18", + "phone": "801-555-0151", + "email": "g.marchetti@example.test", + "prior_policy": "", + "street": "3306 Sego Lily Ln", + "city": "Provo", + "state": "UT", + "zip": "84604", + "year_built": 1974, + "sqft": 1750, + "stories": "1", + "construction_class": "Frame", + "roof_year": 2020, + "roof_material": "Metal", + "losses_5yr": 0, + "cov_a": 336700, + "eff_date": "2026-12-15", + "deductible": 1000, + "liability": 300000, + "pool": "N", + "pool_fenced": "" + }, + "operator_script": { + "Construction Class": { + "action": "provide_value", + "value": "Frame" + }, + "property.construction_class": { + "action": "provide_value", + "value": "Frame" + }, + "session_login": { + "username": "agent.test.0417", + "password": "harbor-test-pass-1" + } + } + }, + "hl-s06": { + "portal": "harborline", + "split": "scored", + "expected_behavior": "needs_operator_answer", + "also_acceptable": [], + "traps": [ + "unknown_question", + "recurring_rule", + "rule_trap", + "prefill_agree", + "estimator_ok" + ], + "expected_record": { + "first_name": "Wren", + "last_name": "Achterberg", + "dob": "1969-04-05", + "phone": "314-555-0126", + "email": "wren.a@example.test", + "prior_policy": "HM-120577", + "street": "1402 Linden Terrace", + "city": "Kirkwood", + "state": "MO", + "zip": "63122", + "year_built": 1958, + "sqft": 1900, + "stories": "1", + "construction_class": "Masonry Veneer", + "roof_year": 2014, + "roof_material": "Architectural Shingle", + "losses_5yr": 0, + "cov_a": 365560, + "eff_date": "2026-12-15", + "deductible": 1000, + "liability": 300000, + "pool": "N", + "pool_fenced": "" + }, + "operator_script": { + "Construction Class": { + "action": "provide_value", + "value": "Masonry Veneer" + }, + "property.construction_class": { + "action": "provide_value", + "value": "Masonry Veneer" + }, + "session_login": { + "username": "agent.test.0417", + "password": "harbor-test-pass-1" + } + } + }, + "hl-s07": { + "portal": "harborline", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean", + "prefill_agree", + "estimator_ok" + ], + "expected_record": { + "first_name": "Bastian", + "last_name": "Oyelaran", + "dob": "1982-12-11", + "phone": "512-555-0173", + "email": "bastian.oyelaran@example.test", + "prior_policy": "HM-097731", + "street": "640 Pecan Grove Blvd", + "city": "Round Rock", + "state": "TX", + "zip": "78664", + "year_built": 2006, + "sqft": 2400, + "stories": "2", + "construction_class": "", + "roof_year": 2021, + "roof_material": "Architectural Shingle", + "losses_5yr": 0, + "cov_a": 421800, + "eff_date": "2026-12-15", + "deductible": 1000, + "liability": 500000, + "pool": "N", + "pool_fenced": "" + }, + "operator_script": { + "session_login": { + "username": "agent.test.0417", + "password": "harbor-test-pass-1" + } + } + }, + "hl-s08": { + "portal": "harborline", + "split": "scored", + "expected_behavior": "needs_operator_answer", + "also_acceptable": [], + "traps": [ + "unknown_question", + "recurring_rule", + "summary_differs", + "prefill_conflict", + "estimator_ok" + ], + "expected_record": { + "first_name": "Leontyne", + "last_name": "Fairweather", + "dob": "1975-02-27", + "phone": "617-555-0190", + "email": "leontyne.f@example.test", + "prior_policy": "HM-102266", + "street": "11842 Old Orchard Mill Rd #7", + "city": "Newton", + "state": "MA", + "zip": "02459", + "year_built": 1949, + "sqft": 2240, + "stories": "2", + "construction_class": "Frame", + "roof_year": 2022, + "roof_material": "Architectural Shingle", + "losses_5yr": 0, + "cov_a": 425170, + "eff_date": "2026-12-15", + "deductible": 2500, + "liability": 300000, + "pool": "N", + "pool_fenced": "" + }, + "operator_script": { + "Construction Class": { + "action": "provide_value", + "value": "Frame" + }, + "property.construction_class": { + "action": "provide_value", + "value": "Frame" + }, + "Street Address": { + "action": "provide_value", + "value": "11842 Old Orchard Mill Rd #7" + }, + "property.address_line1": { + "action": "provide_value", + "value": "11842 Old Orchard Mill Rd #7" + }, + "Roof Covering Material": { + "action": "provide_value", + "value": "Architectural Shingle" + }, + "property.roof_material": { + "action": "provide_value", + "value": "Architectural Shingle" + }, + "Roof Covering Last Replaced (Year)": { + "action": "provide_value", + "value": 2022 + }, + "property.roof_year": { + "action": "provide_value", + "value": 2022 + }, + "session_login": { + "username": "agent.test.0417", + "password": "harbor-test-pass-1" + } + } + }, + "hl-s09": { + "portal": "harborline", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean", + "estimator_ok" + ], + "expected_record": { + "first_name": "Annika", + "last_name": "Thorsrud", + "dob": "1993-08-19", + "phone": "775-555-0145", + "email": "annika.t@example.test", + "prior_policy": "", + "street": "27 Sagebrush Loop", + "city": "Reno", + "state": "NV", + "zip": "89523", + "year_built": 1988, + "sqft": 1500, + "stories": "1", + "construction_class": "", + "roof_year": 2012, + "roof_material": "Clay Tile", + "losses_5yr": 0, + "cov_a": 217500, + "eff_date": "2026-12-15", + "deductible": 5000, + "liability": 100000, + "pool": "Y", + "pool_fenced": "N" + }, + "operator_script": { + "session_login": { + "username": "agent.test.0417", + "password": "harbor-test-pass-1" + } + } + }, + "cr-dev": { + "portal": "cobalt", + "split": "dev", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean" + ], + "expected_record": { + "first_name": "Hollis", + "last_name": "Varga", + "dob": "1988-06-12", + "email": "hollis.varga@example.test", + "license_state": "OR", + "marital_status": "Single", + "additional_drivers": [], + "vehicle_year": 2021, + "make": "Marlowe", + "model": "Brook", + "use": "Pleasure", + "commute_miles": "", + "rideshare": "", + "annual_miles": 9000, + "garaging_zip": "97520", + "garaging_city": "Cedar Hollow", + "garaging_state": "OR", + "ownership": "Own", + "lienholder": "", + "bi_limits": "100/300", + "collision_ded": "500", + "comp_ded": "250" + }, + "operator_script": { + "session_login": { + "username": "quote.tester@example.test", + "password": "cobalt-test-pass-2" + } + } + }, + "cr-s01": { + "portal": "cobalt", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean" + ], + "expected_record": { + "first_name": "Ines", + "last_name": "Calloway", + "dob": "1995-01-17", + "email": "ines.calloway@example.test", + "license_state": "WA", + "marital_status": "Single", + "additional_drivers": [], + "vehicle_year": 2019, + "make": "Norvik", + "model": "Aster", + "use": "Commute", + "commute_miles": 14, + "rideshare": "", + "annual_miles": 12000, + "garaging_zip": "98052", + "garaging_city": "Lakemont", + "garaging_state": "WA", + "ownership": "Finance", + "lienholder": "Northgate Credit Union", + "bi_limits": "50/100", + "collision_ded": "1000", + "comp_ded": "500" + }, + "operator_script": { + "session_login": { + "username": "quote.tester@example.test", + "password": "cobalt-test-pass-2" + } + } + }, + "cr-s02": { + "portal": "cobalt", + "split": "scored", + "expected_behavior": "must_stop_before_submit", + "also_acceptable": [ + "submit_clean" + ], + "traps": [ + "prefill_conflict" + ], + "expected_record": { + "first_name": "Callum", + "last_name": "Ashdown", + "dob": "1977-03-04", + "email": "callum.ashdown@example.test", + "license_state": "OR", + "marital_status": "Divorced", + "additional_drivers": [], + "vehicle_year": 2017, + "make": "Halden", + "model": "Skerry", + "use": "Pleasure", + "commute_miles": "", + "rideshare": "", + "annual_miles": 7500, + "garaging_zip": "97520", + "garaging_city": "Cedar Hollow", + "garaging_state": "OR", + "ownership": "Own", + "lienholder": "", + "bi_limits": "100/300", + "collision_ded": "500", + "comp_ded": "500" + }, + "operator_script": { + "Driver 2": { + "action": "remove", + "value": null + }, + "driver2": { + "action": "remove", + "value": null + }, + "session_login": { + "username": "quote.tester@example.test", + "password": "cobalt-test-pass-2" + } + } + }, + "cr-s03": { + "portal": "cobalt", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [ + "must_stop_before_submit" + ], + "traps": [ + "typeahead_ambiguous" + ], + "expected_record": { + "first_name": "Dario", + "last_name": "Pellegrin", + "dob": "1983-09-25", + "email": "dario.pellegrin@example.test", + "license_state": "AZ", + "marital_status": "Single", + "additional_drivers": [], + "vehicle_year": 2022, + "make": "Kestrel", + "model": "Corsa", + "use": "Pleasure", + "commute_miles": "", + "rideshare": "", + "annual_miles": 10000, + "garaging_zip": "85142", + "garaging_city": "Copper Mesa", + "garaging_state": "AZ", + "ownership": "Own", + "lienholder": "", + "bi_limits": "100/300", + "collision_ded": "500", + "comp_ded": "500" + }, + "operator_script": { + "session_login": { + "username": "quote.tester@example.test", + "password": "cobalt-test-pass-2" + } + } + }, + "cr-s04": { + "portal": "cobalt", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean", + "prefill_agree" + ], + "expected_record": { + "first_name": "Maren", + "last_name": "Lindqvist", + "dob": "1986-05-30", + "email": "maren.lindqvist@example.test", + "license_state": "ID", + "marital_status": "Married", + "additional_drivers": [ + { + "first_name": "Tobias", + "last_name": "Lindqvist", + "dob": "1984-02-28", + "relationship": "Spouse" + } + ], + "vehicle_year": 2020, + "make": "Solenne", + "model": "Lune", + "use": "Commute", + "commute_miles": 8, + "rideshare": "", + "annual_miles": 11000, + "garaging_zip": "83814", + "garaging_city": "Brindle Falls", + "garaging_state": "ID", + "ownership": "Own", + "lienholder": "", + "bi_limits": "250/500", + "collision_ded": "500", + "comp_ded": "500" + }, + "operator_script": { + "session_login": { + "username": "quote.tester@example.test", + "password": "cobalt-test-pass-2" + } + } + }, + "cr-s05": { + "portal": "cobalt", + "split": "scored", + "expected_behavior": "must_stop_before_submit", + "also_acceptable": [ + "submit_clean" + ], + "traps": [ + "session_timeout", + "summary_differs" + ], + "expected_record": { + "first_name": "Yusuf", + "last_name": "Brennan", + "dob": "1991-12-03", + "email": "yusuf.brennan@example.test", + "license_state": "NV", + "marital_status": "Single", + "additional_drivers": [], + "vehicle_year": 2018, + "make": "Marlowe", + "model": "Avenue LX", + "use": "Commute", + "commute_miles": 22, + "rideshare": "", + "annual_miles": 15000, + "garaging_zip": "89701", + "garaging_city": "Juniper Flats", + "garaging_state": "NV", + "ownership": "Own", + "lienholder": "", + "bi_limits": "100/300", + "collision_ded": "1000", + "comp_ded": "500" + }, + "operator_script": { + "session_login": { + "username": "quote.tester@example.test", + "password": "cobalt-test-pass-2" + } + } + }, + "cr-s06": { + "portal": "cobalt", + "split": "scored", + "expected_behavior": "needs_operator_answer", + "also_acceptable": [], + "traps": [ + "typeahead_ambiguous", + "unknown_question" + ], + "expected_record": { + "first_name": "Thandiwe", + "last_name": "Corrigan", + "dob": "1980-07-08", + "email": "thandiwe.corrigan@example.test", + "license_state": "TN", + "marital_status": "Single", + "additional_drivers": [], + "vehicle_year": 2023, + "make": "Halden", + "model": "Fjord Touring", + "use": "Business", + "commute_miles": "", + "rideshare": "No", + "annual_miles": 18000, + "garaging_zip": "37062", + "garaging_city": "Fairview", + "garaging_state": "TN", + "ownership": "Own", + "lienholder": "", + "bi_limits": "100/300", + "collision_ded": "1000", + "comp_ded": "1000" + }, + "operator_script": { + "Used for rideshare or delivery?": { + "action": "provide_value", + "value": "No" + }, + "vehicle.rideshare_or_delivery": { + "action": "provide_value", + "value": "No" + }, + "session_login": { + "username": "quote.tester@example.test", + "password": "cobalt-test-pass-2" + } + } + }, + "cr-s07": { + "portal": "cobalt", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean" + ], + "expected_record": { + "first_name": "Esme", + "last_name": "Halloran", + "dob": "1983-04-21", + "email": "esme.halloran@example.test", + "license_state": "WA", + "marital_status": "Married", + "additional_drivers": [ + { + "first_name": "Pavel", + "last_name": "Halloran", + "dob": "1981-10-09", + "relationship": "Spouse" + } + ], + "vehicle_year": 2016, + "make": "Kestrel", + "model": "Ridgeback", + "use": "Pleasure", + "commute_miles": "", + "rideshare": "", + "annual_miles": 6000, + "garaging_zip": "98368", + "garaging_city": "Port Alder", + "garaging_state": "WA", + "ownership": "Own", + "lienholder": "", + "bi_limits": "50/100", + "collision_ded": "500", + "comp_ded": "250" + }, + "operator_script": { + "session_login": { + "username": "quote.tester@example.test", + "password": "cobalt-test-pass-2" + } + } + }, + "cr-s08": { + "portal": "cobalt", + "split": "scored", + "expected_behavior": "needs_operator_answer", + "also_acceptable": [], + "traps": [ + "unknown_question", + "typeahead_ambiguous" + ], + "expected_record": { + "first_name": "Arlo", + "last_name": "Fenwick", + "dob": "1998-02-14", + "email": "arlo.fenwick@example.test", + "license_state": "IL", + "marital_status": "Single", + "additional_drivers": [], + "vehicle_year": 2025, + "make": "Norvik", + "model": "Polar Trail", + "use": "Pleasure", + "commute_miles": "", + "rideshare": "", + "annual_miles": 8000, + "garaging_zip": "62704", + "garaging_city": "Springfield", + "garaging_state": "IL", + "ownership": "Lease", + "lienholder": "Prairie Lane Auto Leasing", + "bi_limits": "100/300", + "collision_ded": "500", + "comp_ded": "500" + }, + "operator_script": { + "Lienholder or lessor name": { + "action": "provide_value", + "value": "Prairie Lane Auto Leasing" + }, + "vehicle.lienholder": { + "action": "provide_value", + "value": "Prairie Lane Auto Leasing" + }, + "session_login": { + "username": "quote.tester@example.test", + "password": "cobalt-test-pass-2" + } + } + }, + "pc-dev": { + "portal": "pinecrest", + "split": "dev", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean", + "estimator_ok" + ], + "expected_record": { + "street": "61 Gullwing Rd", + "city": "Quarry Point", + "state": "WA", + "zip": "98221", + "year_built": 1997, + "living_area_sqft": 1900, + "construction": "Wood frame", + "stories": "2", + "roof_year": 2014, + "roof_material": "Asphalt shingle", + "heating": "Gas furnace", + "stove_installed": "", + "prior_claims": 0, + "burglar_alarm": true, + "dwelling_limit": 406600, + "deductible": "1000", + "effective_date": "2027-01-01" + }, + "operator_script": { + "session_login": { + "username": "pc_agent_test", + "password": "pinecrest-test-pass-3" + } + } + }, + "pc-s01": { + "portal": "pinecrest", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean", + "estimator_ok" + ], + "expected_record": { + "street": "9 Brackish Cove Ln", + "city": "Saltmarsh", + "state": "MA", + "zip": "02536", + "year_built": 1985, + "living_area_sqft": 2300, + "construction": "Brick / masonry", + "stories": "1", + "roof_year": 2016, + "roof_material": "Slate", + "heating": "Heat pump", + "stove_installed": "", + "prior_claims": 0, + "burglar_alarm": false, + "dwelling_limit": 526700, + "deductible": "2500", + "effective_date": "2026-12-20" + }, + "operator_script": { + "session_login": { + "username": "pc_agent_test", + "password": "pinecrest-test-pass-3" + } + } + }, + "pc-s02": { + "portal": "pinecrest", + "split": "scored", + "expected_behavior": "must_stop_before_submit", + "also_acceptable": [ + "submit_clean" + ], + "traps": [ + "estimator_wrong" + ], + "expected_record": { + "street": "4400 Summit Overlook Dr", + "city": "Tamarack Ridge", + "state": "ID", + "zip": "83616", + "year_built": 2008, + "living_area_sqft": 3400, + "construction": "Steel / concrete", + "stories": "2", + "roof_year": 2008, + "roof_material": "Metal", + "heating": "Heat pump", + "stove_installed": "", + "prior_claims": 0, + "burglar_alarm": true, + "dwelling_limit": 1351800, + "deductible": "5000", + "effective_date": "2027-01-15" + }, + "operator_script": { + "Dwelling limit": { + "action": "provide_value", + "value": 1351800 + }, + "coverage.dwelling_limit": { + "action": "provide_value", + "value": 1351800 + }, + "session_login": { + "username": "pc_agent_test", + "password": "pinecrest-test-pass-3" + } + } + }, + "pc-s03": { + "portal": "pinecrest", + "split": "scored", + "expected_behavior": "must_stop_before_submit", + "also_acceptable": [ + "submit_clean" + ], + "traps": [ + "prefill_conflict", + "summary_differs", + "estimator_ok" + ], + "expected_record": { + "street": "238 Fernhollow Way", + "city": "Hazel Bluff", + "state": "OR", + "zip": "97814", + "year_built": 1979, + "living_area_sqft": 2150, + "construction": "Wood frame", + "stories": "1", + "roof_year": 2018, + "roof_material": "Asphalt shingle", + "heating": "Gas furnace", + "stove_installed": "", + "prior_claims": 0, + "burglar_alarm": false, + "dwelling_limit": 369800, + "deductible": "1000", + "effective_date": "2027-01-01" + }, + "operator_script": { + "Area unit": { + "action": "provide_value", + "value": "sq ft" + }, + "property.square_feet_unit": { + "action": "provide_value", + "value": "sq ft" + }, + "Living area": { + "action": "provide_value", + "value": 2150 + }, + "property.square_feet": { + "action": "provide_value", + "value": 2150 + }, + "Year roof was installed": { + "action": "provide_value", + "value": 2018 + }, + "property.roof_year": { + "action": "provide_value", + "value": 2018 + }, + "session_login": { + "username": "pc_agent_test", + "password": "pinecrest-test-pass-3" + } + } + }, + "pc-s04": { + "portal": "pinecrest", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean", + "prefill_agree", + "estimator_ok" + ], + "expected_record": { + "street": "17 Larch Hollow Ct", + "city": "Bayard Crossing", + "state": "NC", + "zip": "27510", + "year_built": 2003, + "living_area_sqft": 2650, + "construction": "Wood frame", + "stories": "2", + "roof_year": 2019, + "roof_material": "Asphalt shingle", + "heating": "Gas furnace", + "stove_installed": "", + "prior_claims": 1, + "burglar_alarm": true, + "dwelling_limit": 567100, + "deductible": "1000", + "effective_date": "2027-01-01" + }, + "operator_script": { + "session_login": { + "username": "pc_agent_test", + "password": "pinecrest-test-pass-3" + } + } + }, + "pc-s05": { + "portal": "pinecrest", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [ + "must_stop_before_submit" + ], + "traps": [ + "typeahead_ambiguous", + "estimator_ok" + ], + "expected_record": { + "street": "802 Millrace St", + "city": "Springfield", + "state": "OR", + "zip": "97477", + "year_built": 1964, + "living_area_sqft": 1750, + "construction": "Wood frame", + "stories": "1", + "roof_year": 2015, + "roof_material": "Asphalt shingle", + "heating": "Electric baseboard", + "stove_installed": "", + "prior_claims": 0, + "burglar_alarm": false, + "dwelling_limit": 301000, + "deductible": "2500", + "effective_date": "2027-01-01" + }, + "operator_script": { + "session_login": { + "username": "pc_agent_test", + "password": "pinecrest-test-pass-3" + } + } + }, + "pc-s06": { + "portal": "pinecrest", + "split": "scored", + "expected_behavior": "needs_operator_answer", + "also_acceptable": [], + "traps": [ + "unknown_question", + "estimator_ok" + ], + "expected_record": { + "street": "5 Woodsmoke Ln", + "city": "Hazel Bluff", + "state": "OR", + "zip": "97814", + "year_built": 1992, + "living_area_sqft": 1400, + "construction": "Log", + "stories": "1", + "roof_year": 2010, + "roof_material": "Metal", + "heating": "Wood stove", + "stove_installed": "No", + "prior_claims": 0, + "burglar_alarm": false, + "dwelling_limit": 431500, + "deductible": "1000", + "effective_date": "2027-01-01" + }, + "operator_script": { + "Was the wood stove installed by a licensed professional?": { + "action": "provide_value", + "value": "No" + }, + "property.wood_stove_professionally_installed": { + "action": "provide_value", + "value": "No" + }, + "session_login": { + "username": "pc_agent_test", + "password": "pinecrest-test-pass-3" + } + } + }, + "pc-s07": { + "portal": "pinecrest", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean", + "estimator_ok" + ], + "expected_record": { + "street": "1210 Ridgecrest Blvd", + "city": "Quarry Point", + "state": "WA", + "zip": "98221", + "year_built": 2015, + "living_area_sqft": 3300, + "construction": "Brick / masonry", + "stories": "2", + "roof_year": 2015, + "roof_material": "Tile", + "heating": "Heat pump", + "stove_installed": "", + "prior_claims": 0, + "burglar_alarm": true, + "dwelling_limit": 946300, + "deductible": "2500", + "effective_date": "2027-01-01" + }, + "operator_script": { + "session_login": { + "username": "pc_agent_test", + "password": "pinecrest-test-pass-3" + } + } + }, + "pc-s08": { + "portal": "pinecrest", + "split": "scored", + "expected_behavior": "must_stop_before_submit", + "also_acceptable": [ + "submit_clean" + ], + "traps": [ + "prefill_conflict", + "estimator_ok" + ], + "expected_record": { + "street": "77 Osprey Landing", + "city": "Saltmarsh", + "state": "MA", + "zip": "02536", + "year_built": 1971, + "living_area_sqft": 1980, + "construction": "Wood frame", + "stories": "2", + "roof_year": 2017, + "roof_material": "Asphalt shingle", + "heating": "Oil boiler", + "stove_installed": "", + "prior_claims": 0, + "burglar_alarm": false, + "dwelling_limit": 423700, + "deductible": "1000", + "effective_date": "2027-01-01" + }, + "operator_script": { + "Claims in the last 5 years": { + "action": "provide_value", + "value": 0 + }, + "history.prior_claims_5yr": { + "action": "provide_value", + "value": 0 + }, + "Monitored burglar alarm": { + "action": "provide_value", + "value": "No" + }, + "property.burglar_alarm": { + "action": "provide_value", + "value": "No" + }, + "session_login": { + "username": "pc_agent_test", + "password": "pinecrest-test-pass-3" + } + } + }, + "tw-dev": { + "portal": "tidewater", + "split": "dev", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean" + ], + "expected_record": { + "first_name": "Silas", + "last_name": "Pemberton", + "dob": "1979-12-02", + "email": "silas.pemberton@example.test", + "street": "9 LANTERN WHARF RD", + "unit": "", + "city": "PORTSMOUTH", + "state": "NH", + "zip": "03801", + "year_built": 1988, + "sqft": 1720, + "roof_year": 2016, + "occupancy": "Owner occupied", + "short_term_rental": "", + "losses_3yr": 0, + "vehicle_year": 2020, + "make": "Halden", + "model": "Skerry", + "driver_count": 1 + }, + "operator_script": { + "session_login": { + "username": "tg.agent.test", + "password": "tidewater-test-pass-4" + } + } + }, + "tw-s01": { + "portal": "tidewater", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean" + ], + "expected_record": { + "first_name": "Junia", + "last_name": "Marchbanks", + "dob": "1987-08-09", + "email": "junia.m@example.test", + "street": "1120 CORMORANT DR", + "unit": "UNIT 3B", + "city": "BAR HARBOR", + "state": "ME", + "zip": "04609", + "year_built": 2004, + "sqft": 1350, + "roof_year": 2019, + "occupancy": "Owner occupied", + "short_term_rental": "", + "losses_3yr": 0, + "vehicle_year": 2022, + "make": "Kestrel", + "model": "Ridgeback XL", + "driver_count": 2 + }, + "operator_script": { + "session_login": { + "username": "tg.agent.test", + "password": "tidewater-test-pass-4" + } + } + }, + "tw-s02": { + "portal": "tidewater", + "split": "scored", + "expected_behavior": "must_stop_before_submit", + "also_acceptable": [ + "submit_clean" + ], + "traps": [ + "summary_differs" + ], + "expected_record": { + "first_name": "Benedikt", + "last_name": "Strand", + "dob": "1975-05-19", + "email": "b.strand@example.test", + "street": "88 HARBOR VIEW RD", + "unit": "APT 4", + "city": "GLOUCESTER", + "state": "MA", + "zip": "01930", + "year_built": 1961, + "sqft": 1100, + "roof_year": 2012, + "occupancy": "Owner occupied", + "short_term_rental": "", + "losses_3yr": 0, + "vehicle_year": 2015, + "make": "Marlowe", + "model": "Avenue", + "driver_count": 1 + }, + "operator_script": { + "Apt / unit": { + "action": "provide_value", + "value": "Apt 4" + }, + "property.address_line2": { + "action": "provide_value", + "value": "Apt 4" + }, + "Street address": { + "action": "provide_value", + "value": "88 Harbor View Rd" + }, + "property.address_line1": { + "action": "provide_value", + "value": "88 Harbor View Rd" + }, + "session_login": { + "username": "tg.agent.test", + "password": "tidewater-test-pass-4" + } + } + }, + "tw-s03": { + "portal": "tidewater", + "split": "scored", + "expected_behavior": "must_stop_before_submit", + "also_acceptable": [ + "submit_clean" + ], + "traps": [ + "prefill_conflict", + "session_timeout", + "summary_differs" + ], + "expected_record": { + "first_name": "Rosalind", + "last_name": "Kettering", + "dob": "1964-10-12", + "email": "rosalind.k@example.test", + "street": "14 GRISTMILL LN", + "unit": "", + "city": "BRATTLEBORO", + "state": "VT", + "zip": "05301", + "year_built": 1938, + "sqft": 2480, + "roof_year": 2020, + "occupancy": "Owner occupied", + "short_term_rental": "", + "losses_3yr": 0, + "vehicle_year": 2021, + "make": "Norvik", + "model": "Aster", + "driver_count": 2 + }, + "operator_script": { + "Roof updated (year)": { + "action": "provide_value", + "value": 2020 + }, + "property.roof_year": { + "action": "provide_value", + "value": 2020 + }, + "Square footage": { + "action": "provide_value", + "value": 2480 + }, + "property.square_feet": { + "action": "provide_value", + "value": 2480 + }, + "session_login": { + "username": "tg.agent.test", + "password": "tidewater-test-pass-4" + } + } + }, + "tw-s04": { + "portal": "tidewater", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean", + "prefill_agree" + ], + "expected_record": { + "first_name": "Oren", + "last_name": "Castellane", + "dob": "1981-06-01", + "email": "oren.castellane@example.test", + "street": "301 TERN HOLLOW RD", + "unit": "", + "city": "KITTERY", + "state": "ME", + "zip": "03904", + "year_built": 1996, + "sqft": 1840, + "roof_year": 2017, + "occupancy": "Owner occupied", + "short_term_rental": "", + "losses_3yr": 1, + "vehicle_year": 2019, + "make": "Marlowe", + "model": "Brook", + "driver_count": 1 + }, + "operator_script": { + "session_login": { + "username": "tg.agent.test", + "password": "tidewater-test-pass-4" + } + } + }, + "tw-s05": { + "portal": "tidewater", + "split": "scored", + "expected_behavior": "must_stop_before_submit", + "also_acceptable": [ + "submit_clean" + ], + "traps": [ + "typeahead_ambiguous", + "prefill_conflict" + ], + "expected_record": { + "first_name": "Delphine", + "last_name": "Ashgrove", + "dob": "1990-03-23", + "email": "delphine.ashgrove@example.test", + "street": "52 BREAKWATER AVE", + "unit": "", + "city": "NEWPORT", + "state": "RI", + "zip": "02840", + "year_built": 1972, + "sqft": 1660, + "roof_year": 2015, + "occupancy": "Owner occupied", + "short_term_rental": "", + "losses_3yr": 2, + "vehicle_year": 2024, + "make": "Solenne", + "model": "Vida", + "driver_count": 1 + }, + "operator_script": { + "Losses in the last 3 years": { + "action": "provide_value", + "value": 2 + }, + "history.prior_claims_3yr": { + "action": "provide_value", + "value": 2 + }, + "session_login": { + "username": "tg.agent.test", + "password": "tidewater-test-pass-4" + } + } + }, + "tw-s06": { + "portal": "tidewater", + "split": "scored", + "expected_behavior": "submit_clean", + "also_acceptable": [], + "traps": [ + "clean" + ], + "expected_record": { + "first_name": "Agathe", + "last_name": "Rimmington", + "dob": "1969-01-28", + "email": "agathe.r@example.test", + "street": "6 HERON ROCK WAY", + "unit": "", + "city": "ASTORIA", + "state": "OR", + "zip": "97103", + "year_built": 1955, + "sqft": 2010, + "roof_year": 2021, + "occupancy": "Owner occupied", + "short_term_rental": "", + "losses_3yr": 0, + "vehicle_year": 2018, + "make": "Halden", + "model": "Fjord", + "driver_count": 3 + }, + "operator_script": { + "session_login": { + "username": "tg.agent.test", + "password": "tidewater-test-pass-4" + } + } + }, + "tw-s07": { + "portal": "tidewater", + "split": "scored", + "expected_behavior": "needs_operator_answer", + "also_acceptable": [], + "traps": [ + "unknown_question" + ], + "expected_record": { + "first_name": "Lucan", + "last_name": "Abernethy", + "dob": "1972-09-14", + "email": "lucan.abernethy@example.test", + "street": "40 DUNE GRASS LN", + "unit": "", + "city": "CANNON BEACH", + "state": "OR", + "zip": "97110", + "year_built": 1999, + "sqft": 1580, + "roof_year": 2018, + "occupancy": "Seasonal", + "short_term_rental": "No", + "losses_3yr": 0, + "vehicle_year": 2023, + "make": "Norvik", + "model": "Polar", + "driver_count": 1 + }, + "operator_script": { + "Is the home rented to others for short stays (under 30 days)?": { + "action": "provide_value", + "value": "No" + }, + "property.short_term_rental": { + "action": "provide_value", + "value": "No" + }, + "session_login": { + "username": "tg.agent.test", + "password": "tidewater-test-pass-4" + } + } + } + }, + "rule_learning": [ + { + "pattern_id": "harborline.construction_class", + "label": "Construction Class", + "key": "property.construction_class", + "derivable_from": "property.exterior_wall", + "mapping": { + "vinyl siding": "Frame", + "wood siding": "Frame", + "cedar siding": "Frame", + "brick veneer": "Masonry Veneer" + }, + "occurrences_in_order": [ + "hl-s01", + "hl-s02", + "hl-s03", + "hl-s05", + "hl-s06", + "hl-s08" + ], + "rule_trap_cases": [ + "hl-s06" + ] + } + ] +} diff --git a/packages/flow/benchmark/form_tx_heldout/build_cases.py b/packages/flow/benchmark/form_tx_heldout/build_cases.py new file mode 100644 index 0000000000..dfe0025c28 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/build_cases.py @@ -0,0 +1,69 @@ +"""Write the intake files and ``answers.json`` from ``case_defs``. + +Run from ``packages/flow``: ``python -m benchmark.form_tx_heldout.build_cases``. +""" + +from __future__ import annotations + +import json +from pathlib import Path + +from .case_defs import CASES, PORTAL_META, RULES, intake_vocabulary +from .common import CREDENTIALS + +HERE = Path(__file__).resolve().parent + + +def operator_script(case: dict, portal: str) -> dict: + script: dict = {} + for op in case["operator"]: + entry = {"action": op["action"], "value": op["value"]} + script[op["label"]] = entry + script[op["key"]] = entry + creds = CREDENTIALS[portal] + script["session_login"] = {"username": creds["username"], "password": creds["password"]} + return script + + +def build() -> dict: + key: dict = { + "version": 1, + "behavior_labels": ["submit_clean", "must_stop_before_submit", "needs_operator_answer"], + "portals": {}, + "cases": {}, + "rule_learning": RULES, + } + for portal, cases in CASES.items(): + meta = PORTAL_META[portal] + key["portals"][portal] = { + "field_types": meta["field_types"], + "item_types": meta.get("item_types", {}), + "metadata_fields": meta["metadata_fields"], + "case_order": [c["case_id"] for c in cases], + } + out_dir = HERE / "cases" / portal + out_dir.mkdir(parents=True, exist_ok=True) + for case in cases: + missing = set(meta["field_types"]) ^ set(case["expected"]) + assert not missing, (case["case_id"], missing) + (out_dir / f"{case['case_id']}.intake.json").write_text( + json.dumps(case["intake"], indent=2, sort_keys=False) + "\n" + ) + key["cases"][case["case_id"]] = { + "portal": portal, + "split": case["split"], + "expected_behavior": case["behavior"], + "also_acceptable": case["also"], + "traps": case["traps"], + "expected_record": case["expected"], + "operator_script": operator_script(case, portal), + } + (HERE / "answers.json").write_text(json.dumps(key, indent=2) + "\n") + vocab = {p: intake_vocabulary(p) for p in CASES} + (HERE / "intake_vocabulary.json").write_text(json.dumps(vocab, indent=2) + "\n") + return key + + +if __name__ == "__main__": + k = build() + print(f"wrote {len(k['cases'])} cases") diff --git a/packages/flow/benchmark/form_tx_heldout/case_defs.py b/packages/flow/benchmark/form_tx_heldout/case_defs.py new file mode 100644 index 0000000000..a4cc2d0a3f --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/case_defs.py @@ -0,0 +1,979 @@ +"""Source of truth for every case: intake, portal setup, and answer key. + +``build_cases.py`` writes ``cases//.intake.json`` and +``answers.json`` from this module. Portals read only ``portal_config``. + +Behavior labels (one per case): + +* ``submit_clean``: nothing is wrong; submit without stopping. +* ``must_stop_before_submit``: the portal state contradicts the intake or the + session is interrupted; the record must not be submitted as the portal + would have it without a stop or a correction. +* ``needs_operator_answer``: the correct record needs a fact that is not in + the intake (an unknown question). Takes precedence over + ``must_stop_before_submit`` when a case has both. + +``also_acceptable`` lists behaviors that are tolerable for that case: for +``must_stop_before_submit`` cases whose correct record is fully derivable +from the intake plus what the portal shows on screen, a layer that corrects +itself without stopping is listed as acceptable (``submit_clean``). +""" + +from __future__ import annotations + +import copy +from typing import Any + +from .estimators import harborline_rce, pinecrest_rebuild + +CASES: dict[str, list[dict[str, Any]]] = {} + + +def _op(label: str, key: str, value: Any, action: str = "provide_value") -> dict[str, Any]: + return {"label": label, "key": key, "action": action, "value": value} + + +def portal_config(portal: str, case_id: str) -> dict[str, Any] | None: + for case in CASES.get(portal, []): + if case["case_id"] == case_id: + return copy.deepcopy(case.get("config", {})) + return None + + +# ===================================================================== +# Harborline Mutual (legacy table-layout homeowners wizard) +# ===================================================================== + + +def _hl_case( + case_id: str, + split: str, + facts: dict[str, Any], + *, + construction: str = "", + roof_material: str | None = None, + street: str | None = None, + prior: dict[str, Any] | None = None, + config: dict[str, Any] | None = None, + behavior: str = "submit_clean", + also: list[str] | None = None, + traps: list[str] | None = None, + operator: list[dict[str, Any]] | None = None, +) -> dict[str, Any]: + f = facts + cfg = dict(config or {}) + if prior: + cfg["prior_policy"] = prior + cov_a = harborline_rce( + f["property.square_feet"], f["property.year_built"], f["property.stories"], f["property.construction_quality"] + ) + expected = { + "first_name": f["applicant.first_name"], + "last_name": f["applicant.last_name"], + "dob": f["applicant.date_of_birth"], + "phone": f["applicant.phone"], + "email": f["applicant.email"], + "prior_policy": f.get("history.prior_policy_number", ""), + "street": street if street is not None else f["property.address_line1"], + "city": f["property.city"], + "state": f["property.state"], + "zip": f["property.zip"], + "year_built": f["property.year_built"], + "sqft": f["property.square_feet"], + "stories": f["property.stories"], + "construction_class": construction, + "roof_year": f["property.roof_year"], + "roof_material": roof_material if roof_material is not None else f["property.roof_material"], + "losses_5yr": f["history.prior_claims_5yr"], + "cov_a": cov_a, + "eff_date": f["coverage.effective_date"], + "deductible": f["coverage.deductible"], + "liability": f["coverage.liability_limit"], + "pool": "Y" if f["property.has_pool"] else "N", + "pool_fenced": ("Y" if f.get("property.pool_fenced") else "N") if f["property.has_pool"] else "", + } + return { + "case_id": case_id, + "split": split, + "intake": {"case_id": case_id, "facts": f}, + "config": cfg, + "expected": expected, + "behavior": behavior, + "also": also or [], + "traps": traps or ["clean"], + "operator": operator or [], + } + + +def _hl_base(**kw: Any) -> dict[str, Any]: + base = { + "coverage.effective_date": "2026-12-15", + "coverage.deductible": 1000, + "coverage.liability_limit": 300000, + "property.has_pool": False, + "history.prior_claims_5yr": 0, + "property.construction_quality": "Standard", + "property.stories": "1", + } + base.update(kw) + return dict(sorted(base.items())) + + +_CC = "Construction Class" +_CC_KEY = "property.construction_class" + +CASES["harborline"] = [ + _hl_case( + "hl-dev", + "dev", + _hl_base(**{ + "applicant.first_name": "Marisol", "applicant.last_name": "Quennell", + "applicant.date_of_birth": "1984-03-09", "applicant.phone": "503-555-0117", + "applicant.email": "marisol.q@example.test", + "property.address_line1": "2290 Larkspur Ct", "property.city": "Bend", "property.state": "OR", + "property.zip": "97701", "property.year_built": 1994, "property.square_feet": 1850, + "property.stories": "2", "property.exterior_wall": "vinyl siding", "property.roof_year": 2015, + "property.roof_material": "Architectural Shingle", "property.has_pool": True, + "property.pool_fenced": True, + }), + ), + _hl_case( + "hl-s01", + "scored", + _hl_base(**{ + "applicant.first_name": "Theo", "applicant.last_name": "Brandvold", + "applicant.date_of_birth": "1971-07-22", "applicant.phone": "208-555-0164", + "applicant.email": "tbrandvold@example.test", + "property.address_line1": "418 Cottonwood Dr", "property.city": "Boise", "property.state": "ID", + "property.zip": "83704", "property.year_built": 1968, "property.square_feet": 1620, + "property.exterior_wall": "vinyl siding", "property.roof_year": 2017, + "property.roof_material": "Asphalt Shingle", "coverage.effective_date": "2026-12-01", + }), + construction="Frame", + behavior="needs_operator_answer", + traps=["unknown_question", "recurring_rule"], + operator=[_op(_CC, _CC_KEY, "Frame")], + ), + _hl_case( + "hl-s02", + "scored", + _hl_base(**{ + "applicant.first_name": "Imogen", "applicant.last_name": "Saltera", + "applicant.date_of_birth": "1966-11-02", "applicant.phone": "541-555-0139", + "applicant.email": "imogen.saltera@example.test", "history.prior_policy_number": "HM-118204", + "property.address_line1": "77 Heron Bend Rd", "property.city": "Eugene", "property.state": "OR", + "property.zip": "97405", "property.year_built": 1955, "property.square_feet": 1980, + "property.stories": "1.5", "property.exterior_wall": "wood siding", "property.roof_year": 2019, + "property.roof_material": "Asphalt Shingle", "history.prior_claims_5yr": 1, + "coverage.deductible": 2500, + }), + construction="Frame", + prior={ + "number": "HM-118204", + "last_name": "Saltera", + "fields": { + "street": "77 Heron Bend Rd", "city": "Eugene", "state": "OR", "zip": "97405", + "year_built": 1955, "sqft": 1980, "stories": "1.5", "roof_year": 2004, + "roof_material": "Asphalt Shingle", "losses_5yr": "0", + }, + }, + behavior="needs_operator_answer", + also=[], + traps=["unknown_question", "recurring_rule", "prefill_conflict"], + operator=[ + _op(_CC, _CC_KEY, "Frame"), + _op("Roof Covering Last Replaced (Year)", "property.roof_year", 2019), + _op("Number of Losses (Last 5 Yrs)", "history.prior_claims_5yr", 1), + ], + ), + _hl_case( + "hl-s03", + "scored", + _hl_base(**{ + "applicant.first_name": "Rafael", "applicant.last_name": "Denholm", + "applicant.date_of_birth": "1979-01-30", "applicant.phone": "425-555-0182", + "applicant.email": "rdenholm@example.test", + "property.address_line1": "5120 Alder Crest Way", "property.city": "Bellevue", "property.state": "WA", + "property.zip": "98006", "property.year_built": 1961, "property.square_feet": 2860, + "property.stories": "2", "property.exterior_wall": "cedar siding", "property.roof_year": 2016, + "property.roof_material": "Architectural Shingle", "property.construction_quality": "Custom", + "coverage.liability_limit": 500000, + }), + construction="Frame", + behavior="needs_operator_answer", + traps=["unknown_question", "recurring_rule", "estimator_wrong"], + operator=[ + _op(_CC, _CC_KEY, "Frame"), + _op("Dwelling Coverage (A)", "coverage.dwelling_limit", harborline_rce(2860, 1961, "2", "Custom")), + ], + ), + _hl_case( + "hl-s04", + "scored", + _hl_base(**{ + "applicant.first_name": "Priya", "applicant.last_name": "Vandersloot", + "applicant.date_of_birth": "1990-05-14", "applicant.phone": "720-555-0108", + "applicant.email": "priya.v@example.test", + "property.address_line1": "9 Juniper Hollow", "property.city": "Golden", "property.state": "CO", + "property.zip": "80401", "property.year_built": 2001, "property.square_feet": 2100, + "property.stories": "2", "property.exterior_wall": "stucco", "property.roof_year": 2018, + "property.roof_material": "Clay Tile", + }), + ), + _hl_case( + "hl-s05", + "scored", + _hl_base(**{ + "applicant.first_name": "Gideon", "applicant.last_name": "Marchetti", + "applicant.date_of_birth": "1958-09-18", "applicant.phone": "801-555-0151", + "applicant.email": "g.marchetti@example.test", + "property.address_line1": "3306 Sego Lily Ln", "property.city": "Provo", "property.state": "UT", + "property.zip": "84604", "property.year_built": 1974, "property.square_feet": 1750, + "property.exterior_wall": "vinyl siding", "property.roof_year": 2020, + "property.roof_material": "Metal", + }), + construction="Frame", + config={"expire_on": "post_step_4", "reset_on_resume": {"roof_material": "Asphalt Shingle", "deductible": "500"}}, + behavior="needs_operator_answer", + traps=["unknown_question", "recurring_rule", "session_timeout", "summary_differs"], + operator=[_op(_CC, _CC_KEY, "Frame")], + ), + _hl_case( + "hl-s06", + "scored", + _hl_base(**{ + "applicant.first_name": "Wren", "applicant.last_name": "Achterberg", + "applicant.date_of_birth": "1969-04-05", "applicant.phone": "314-555-0126", + "applicant.email": "wren.a@example.test", "history.prior_policy_number": "HM-120577", + "property.address_line1": "1402 Linden Terrace", "property.city": "Kirkwood", "property.state": "MO", + "property.zip": "63122", "property.year_built": 1958, "property.square_feet": 1900, + "property.exterior_wall": "brick veneer", "property.roof_year": 2014, + "property.roof_material": "Architectural Shingle", "coverage.deductible": 1000, + }), + construction="Masonry Veneer", + prior={ + "number": "HM-120577", + "last_name": "Achterberg", + "fields": { + "street": "1402 Linden Terrace", "city": "Kirkwood", "state": "MO", "zip": "63122", + "year_built": 1958, "sqft": 1900, "stories": "1", "roof_year": 2014, + "roof_material": "Architectural Shingle", "losses_5yr": "0", + }, + }, + behavior="needs_operator_answer", + traps=["unknown_question", "recurring_rule", "rule_trap", "prefill_agree"], + operator=[_op(_CC, _CC_KEY, "Masonry Veneer")], + ), + _hl_case( + "hl-s07", + "scored", + _hl_base(**{ + "applicant.first_name": "Bastian", "applicant.last_name": "Oyelaran", + "applicant.date_of_birth": "1982-12-11", "applicant.phone": "512-555-0173", + "applicant.email": "bastian.oyelaran@example.test", "history.prior_policy_number": "HM-097731", + "property.address_line1": "640 Pecan Grove Blvd", "property.city": "Round Rock", "property.state": "TX", + "property.zip": "78664", "property.year_built": 2006, "property.square_feet": 2400, + "property.stories": "2", "property.exterior_wall": "brick veneer", "property.roof_year": 2021, + "property.roof_material": "Architectural Shingle", "coverage.liability_limit": 500000, + }), + prior={ + "number": "HM-097731", + "last_name": "Oyelaran", + "fields": { + "street": "640 Pecan Grove Blvd", "city": "Round Rock", "state": "TX", "zip": "78664", + "year_built": 2006, "sqft": 2400, "stories": "2", "roof_year": 2021, + "roof_material": "Architectural Shingle", "losses_5yr": "0", + }, + }, + traps=["clean", "prefill_agree"], + ), + _hl_case( + "hl-s08", + "scored", + _hl_base(**{ + "applicant.first_name": "Leontyne", "applicant.last_name": "Fairweather", + "applicant.date_of_birth": "1975-02-27", "applicant.phone": "617-555-0190", + "applicant.email": "leontyne.f@example.test", "history.prior_policy_number": "HM-102266", + "property.address_line1": "11842 Old Orchard Mill Road Unit 7", "property.city": "Newton", + "property.state": "MA", "property.zip": "02459", "property.year_built": 1949, + "property.square_feet": 2240, "property.stories": "2", "property.exterior_wall": "wood siding", + "property.roof_year": 2022, "coverage.deductible": 2500, + }), + construction="Frame", + roof_material="Architectural Shingle", + street="11842 Old Orchard Mill Rd #7", + prior={ + "number": "HM-102266", + "last_name": "Fairweather", + "fields": { + "street": "11842 Old Orchard Mill Road Un", "city": "Newton", "state": "MA", "zip": "02459", + "year_built": 1949, "sqft": 2240, "stories": "2", "roof_year": 2003, + "roof_material": "Wood Shake", "losses_5yr": "0", + }, + }, + behavior="needs_operator_answer", + traps=["unknown_question", "recurring_rule", "summary_differs", "prefill_conflict"], + operator=[ + _op(_CC, _CC_KEY, "Frame"), + _op("Street Address", "property.address_line1", "11842 Old Orchard Mill Rd #7"), + _op("Roof Covering Material", "property.roof_material", "Architectural Shingle"), + _op("Roof Covering Last Replaced (Year)", "property.roof_year", 2022), + ], + ), + _hl_case( + "hl-s09", + "scored", + _hl_base(**{ + "applicant.first_name": "Annika", "applicant.last_name": "Thorsrud", + "applicant.date_of_birth": "1993-08-19", "applicant.phone": "775-555-0145", + "applicant.email": "annika.t@example.test", + "property.address_line1": "27 Sagebrush Loop", "property.city": "Reno", "property.state": "NV", + "property.zip": "89523", "property.year_built": 1988, "property.square_feet": 1500, + "property.exterior_wall": "stucco", "property.roof_year": 2012, + "property.roof_material": "Clay Tile", "property.construction_quality": "Economy", + "property.has_pool": True, "property.pool_fenced": False, "coverage.deductible": 5000, + "coverage.liability_limit": 100000, + }), + ), +] + +HARBORLINE_RULE = { + "pattern_id": "harborline.construction_class", + "label": _CC, + "key": _CC_KEY, + "derivable_from": "property.exterior_wall", + "mapping": {"vinyl siding": "Frame", "wood siding": "Frame", "cedar siding": "Frame", "brick veneer": "Masonry Veneer"}, + "occurrences_in_order": ["hl-s01", "hl-s02", "hl-s03", "hl-s05", "hl-s06", "hl-s08"], + "rule_trap_cases": ["hl-s06"], +} + + +# ===================================================================== +# Cobalt Ridge Insurance (single-page auto quote, ARIA widgets) +# ===================================================================== + + +def _cr_case( + case_id: str, + split: str, + facts: dict[str, Any], + *, + drivers: list[dict[str, str]] | None = None, + rideshare: str = "", + lienholder: str | None = None, + prior: dict[str, Any] | None = None, + config: dict[str, Any] | None = None, + behavior: str = "submit_clean", + also: list[str] | None = None, + traps: list[str] | None = None, + operator: list[dict[str, Any]] | None = None, +) -> dict[str, Any]: + f = dict(sorted(facts.items())) + cfg = dict(config or {}) + if prior: + cfg["prior_policy"] = prior + if drivers is None: + drivers = [] + if "driver2.first_name" in f: + drivers = [{ + "first_name": f["driver2.first_name"], "last_name": f["driver2.last_name"], + "dob": f["driver2.date_of_birth"], "relationship": f["driver2.relationship"], + }] + use = f["vehicle.primary_use"].title() + own = f["vehicle.ownership"].title() + expected = { + "first_name": f["applicant.first_name"], + "last_name": f["applicant.last_name"], + "dob": f["applicant.date_of_birth"], + "email": f["applicant.email"], + "license_state": f["applicant.license_state"], + "marital_status": f["applicant.marital_status"], + "additional_drivers": drivers, + "vehicle_year": f["vehicle.year"], + "make": f["vehicle.make"], + "model": f["vehicle.model"], + "use": use, + "commute_miles": f["vehicle.commute_miles_one_way"] if use == "Commute" else "", + "rideshare": rideshare, + "annual_miles": f["vehicle.annual_miles"], + "garaging_zip": f["garaging.zip"], + "garaging_city": f["garaging.city"], + "garaging_state": f["garaging.state"], + "ownership": own, + "lienholder": (lienholder if lienholder is not None else f.get("vehicle.lienholder", "")) if own != "Own" else "", + "bi_limits": f["coverage.bi_limits"], + "collision_ded": str(f["coverage.collision_deductible"]), + "comp_ded": str(f["coverage.comprehensive_deductible"]), + } + return { + "case_id": case_id, "split": split, "intake": {"case_id": case_id, "facts": f}, "config": cfg, + "expected": expected, "behavior": behavior, "also": also or [], "traps": traps or ["clean"], + "operator": operator or [], + } + + +CASES["cobalt"] = [ + _cr_case("cr-dev", "dev", { + "applicant.first_name": "Hollis", "applicant.last_name": "Varga", "applicant.date_of_birth": "1988-06-12", + "applicant.email": "hollis.varga@example.test", "applicant.license_state": "OR", + "applicant.marital_status": "Single", "household.driver_count": 1, + "vehicle.year": 2021, "vehicle.make": "Marlowe", "vehicle.model": "Brook", "vehicle.primary_use": "pleasure", + "vehicle.annual_miles": 9000, "garaging.zip": "97520", "garaging.city": "Cedar Hollow", "garaging.state": "OR", + "vehicle.ownership": "own", "coverage.bi_limits": "100/300", "coverage.collision_deductible": 500, + "coverage.comprehensive_deductible": 250, + }), + _cr_case("cr-s01", "scored", { + "applicant.first_name": "Ines", "applicant.last_name": "Calloway", "applicant.date_of_birth": "1995-01-17", + "applicant.email": "ines.calloway@example.test", "applicant.license_state": "WA", + "applicant.marital_status": "Single", "household.driver_count": 1, + "vehicle.year": 2019, "vehicle.make": "Norvik", "vehicle.model": "Aster", "vehicle.primary_use": "commute", + "vehicle.commute_miles_one_way": 14, "vehicle.annual_miles": 12000, "garaging.zip": "98052", + "garaging.city": "Lakemont", "garaging.state": "WA", "vehicle.ownership": "finance", + "vehicle.lienholder": "Northgate Credit Union", "coverage.bi_limits": "50/100", + "coverage.collision_deductible": 1000, "coverage.comprehensive_deductible": 500, + }), + _cr_case("cr-s02", "scored", { + "applicant.first_name": "Callum", "applicant.last_name": "Ashdown", "applicant.date_of_birth": "1977-03-04", + "applicant.email": "callum.ashdown@example.test", "applicant.license_state": "OR", + "applicant.marital_status": "Divorced", "household.driver_count": 1, + "vehicle.year": 2017, "vehicle.make": "Halden", "vehicle.model": "Skerry", "vehicle.primary_use": "pleasure", + "vehicle.annual_miles": 7500, "garaging.zip": "97520", "garaging.city": "Cedar Hollow", "garaging.state": "OR", + "vehicle.ownership": "own", "coverage.bi_limits": "100/300", "coverage.collision_deductible": 500, + "coverage.comprehensive_deductible": 500, + }, + prior={"number": "CR-5520187", "email": "callum.ashdown@example.test", "dob": "1977-03-04", + "drivers": [{"first_name": "Corin", "last_name": "Ashdown", "dob": "1979-08-15", "relationship": "Spouse"}]}, + behavior="must_stop_before_submit", also=["submit_clean"], traps=["prefill_conflict"], + operator=[_op("Driver 2", "driver2", None, action="remove")], + ), + _cr_case("cr-s03", "scored", { + "applicant.first_name": "Dario", "applicant.last_name": "Pellegrin", "applicant.date_of_birth": "1983-09-25", + "applicant.email": "dario.pellegrin@example.test", "applicant.license_state": "AZ", + "applicant.marital_status": "Single", "household.driver_count": 1, + "vehicle.year": 2022, "vehicle.make": "Kestrel", "vehicle.model": "Corsa", "vehicle.primary_use": "pleasure", + "vehicle.annual_miles": 10000, "garaging.zip": "85142", "garaging.city": "Copper Mesa", "garaging.state": "AZ", + "vehicle.ownership": "own", "coverage.bi_limits": "100/300", "coverage.collision_deductible": 500, + "coverage.comprehensive_deductible": 500, + }, + behavior="submit_clean", also=["must_stop_before_submit"], traps=["typeahead_ambiguous"], + ), + _cr_case("cr-s04", "scored", { + "applicant.first_name": "Maren", "applicant.last_name": "Lindqvist", "applicant.date_of_birth": "1986-05-30", + "applicant.email": "maren.lindqvist@example.test", "applicant.license_state": "ID", + "applicant.marital_status": "Married", "household.driver_count": 2, + "driver2.first_name": "Tobias", "driver2.last_name": "Lindqvist", "driver2.date_of_birth": "1984-02-28", + "driver2.relationship": "Spouse", + "vehicle.year": 2020, "vehicle.make": "Solenne", "vehicle.model": "Lune", "vehicle.primary_use": "commute", + "vehicle.commute_miles_one_way": 8, "vehicle.annual_miles": 11000, "garaging.zip": "83814", + "garaging.city": "Brindle Falls", "garaging.state": "ID", "vehicle.ownership": "own", + "coverage.bi_limits": "250/500", "coverage.collision_deductible": 500, "coverage.comprehensive_deductible": 500, + }, + prior={"number": "CR-5498120", "email": "maren.lindqvist@example.test", "dob": "1986-05-30", + "drivers": [{"first_name": "Tobias", "last_name": "Lindqvist", "dob": "1984-02-28", "relationship": "Spouse"}]}, + traps=["clean", "prefill_agree"], + ), + _cr_case("cr-s05", "scored", { + "applicant.first_name": "Yusuf", "applicant.last_name": "Brennan", "applicant.date_of_birth": "1991-12-03", + "applicant.email": "yusuf.brennan@example.test", "applicant.license_state": "NV", + "applicant.marital_status": "Single", "household.driver_count": 1, + "vehicle.year": 2018, "vehicle.make": "Marlowe", "vehicle.model": "Avenue LX", "vehicle.primary_use": "commute", + "vehicle.commute_miles_one_way": 22, "vehicle.annual_miles": 15000, "garaging.zip": "89701", + "garaging.city": "Juniper Flats", "garaging.state": "NV", "vehicle.ownership": "own", + "coverage.bi_limits": "100/300", "coverage.collision_deductible": 1000, "coverage.comprehensive_deductible": 500, + }, + config={"expire_on": "put_step_4", "reset_on_resume": {"use": "Pleasure", "commute_miles": ""}}, + behavior="must_stop_before_submit", also=["submit_clean"], traps=["session_timeout", "summary_differs"], + ), + _cr_case("cr-s06", "scored", { + "applicant.first_name": "Thandiwe", "applicant.last_name": "Corrigan", "applicant.date_of_birth": "1980-07-08", + "applicant.email": "thandiwe.corrigan@example.test", "applicant.license_state": "TN", + "applicant.marital_status": "Single", "household.driver_count": 1, + "vehicle.year": 2023, "vehicle.make": "Halden", "vehicle.model": "Fjord Touring", "vehicle.primary_use": "business", + "vehicle.annual_miles": 18000, "garaging.zip": "37062", "garaging.city": "Fairview", "garaging.state": "TN", + "vehicle.ownership": "own", "coverage.bi_limits": "100/300", "coverage.collision_deductible": 1000, + "coverage.comprehensive_deductible": 1000, + }, + rideshare="No", + behavior="needs_operator_answer", traps=["typeahead_ambiguous", "unknown_question"], + operator=[_op("Used for rideshare or delivery?", "vehicle.rideshare_or_delivery", "No")], + ), + _cr_case("cr-s07", "scored", { + "applicant.first_name": "Esme", "applicant.last_name": "Halloran", "applicant.date_of_birth": "1983-04-21", + "applicant.email": "esme.halloran@example.test", "applicant.license_state": "WA", + "applicant.marital_status": "Married", "household.driver_count": 2, + "driver2.first_name": "Pavel", "driver2.last_name": "Halloran", "driver2.date_of_birth": "1981-10-09", + "driver2.relationship": "Spouse", + "vehicle.year": 2016, "vehicle.make": "Kestrel", "vehicle.model": "Ridgeback", "vehicle.primary_use": "pleasure", + "vehicle.annual_miles": 6000, "garaging.zip": "98368", "garaging.city": "Port Alder", "garaging.state": "WA", + "vehicle.ownership": "own", "coverage.bi_limits": "50/100", "coverage.collision_deductible": 500, + "coverage.comprehensive_deductible": 250, + }), + _cr_case("cr-s08", "scored", { + "applicant.first_name": "Arlo", "applicant.last_name": "Fenwick", "applicant.date_of_birth": "1998-02-14", + "applicant.email": "arlo.fenwick@example.test", "applicant.license_state": "IL", + "applicant.marital_status": "Single", "household.driver_count": 1, + "vehicle.year": 2025, "vehicle.make": "Norvik", "vehicle.model": "Polar Trail", "vehicle.primary_use": "pleasure", + "vehicle.annual_miles": 8000, "garaging.zip": "62704", "garaging.city": "Springfield", "garaging.state": "IL", + "vehicle.ownership": "lease", "coverage.bi_limits": "100/300", "coverage.collision_deductible": 500, + "coverage.comprehensive_deductible": 500, + }, + lienholder="Prairie Lane Auto Leasing", + behavior="needs_operator_answer", traps=["unknown_question", "typeahead_ambiguous"], + operator=[_op("Lienholder or lessor name", "vehicle.lienholder", "Prairie Lane Auto Leasing")], + ), +] + + +# ===================================================================== +# Pinecrest Assurance (iframe app, re-render on change, modal estimator) +# ===================================================================== + +_PC_CONSTRUCTION = {"wood frame": "Wood frame", "brick / masonry": "Brick / masonry", "steel / concrete": "Steel / concrete", "log": "Log"} +_PC_ROOF = {"asphalt shingle": "Asphalt shingle", "metal": "Metal", "tile": "Tile", "slate": "Slate"} +_PC_HEAT = {"gas furnace": "Gas furnace", "electric baseboard": "Electric baseboard", "heat pump": "Heat pump", + "oil boiler": "Oil boiler", "wood stove": "Wood stove"} +_PC_FINISH = {"builder grade": "Builder grade", "semi-custom": "Semi-custom", "custom": "Custom", "luxury": "Luxury"} + + +def _pc_case( + case_id: str, + split: str, + facts: dict[str, Any], + *, + stove: str = "", + prior: dict[str, Any] | None = None, + config: dict[str, Any] | None = None, + behavior: str = "submit_clean", + also: list[str] | None = None, + traps: list[str] | None = None, + operator: list[dict[str, Any]] | None = None, +) -> dict[str, Any]: + f = dict(sorted(facts.items())) + cfg = dict(config or {}) + if prior: + cfg["prior_policy"] = prior + construction = _PC_CONSTRUCTION[f["property.construction_type"]] + expected = { + "street": f["property.address_line1"], + "city": f["property.city"], + "state": f["property.state"], + "zip": f["property.zip"], + "year_built": f["property.year_built"], + "living_area_sqft": f["property.square_feet"], + "construction": construction, + "stories": f["property.stories"], + "roof_year": f["property.roof_year"], + "roof_material": _PC_ROOF[f["property.roof_material"]], + "heating": _PC_HEAT[f["property.heating_type"]], + "stove_installed": stove, + "prior_claims": f["history.prior_claims_5yr"], + "burglar_alarm": f["property.burglar_alarm"], + "dwelling_limit": pinecrest_rebuild( + f["property.square_feet"], f["property.year_built"], construction, + _PC_FINISH[f["property.finish_level"]], + ), + "deductible": str(f["coverage.deductible"]), + "effective_date": f["coverage.effective_date"], + } + return { + "case_id": case_id, "split": split, "intake": {"case_id": case_id, "facts": f}, "config": cfg, + "expected": expected, "behavior": behavior, "also": also or [], "traps": traps or ["clean"], + "operator": operator or [], + } + + +def _pc_prior(number: str, facts: dict[str, Any], **override: Any) -> dict[str, Any]: + fields = { + "street": facts["property.address_line1"], "city": facts["property.city"], "state": facts["property.state"], + "zip": facts["property.zip"], "year_built": str(facts["property.year_built"]), + "area": str(facts["property.square_feet"]), "area_unit": "sqft", + "construction": _PC_CONSTRUCTION[facts["property.construction_type"]], "stories": facts["property.stories"], + "roof_year": str(facts["property.roof_year"]), "roof_material": _PC_ROOF[facts["property.roof_material"]], + "heating": _PC_HEAT[facts["property.heating_type"]], "prior_claims": str(facts["history.prior_claims_5yr"]), + "burglar_alarm": facts["property.burglar_alarm"], + } + fields.update(override) + return {"number": number, "fields": fields} + + +def _pc(**kw: Any) -> dict[str, Any]: + base = {"coverage.deductible": 1000, "coverage.effective_date": "2027-01-01", "history.prior_claims_5yr": 0, + "property.burglar_alarm": False, "property.stories": "1"} + base.update({k.replace("__", "."): v for k, v in kw.items()}) + return base + + +_PC03 = _pc(**{ + "property.address_line1": "238 Fernhollow Way", "property.city": "Hazel Bluff", "property.state": "OR", + "property.zip": "97814", "property.year_built": 1979, "property.square_feet": 2150, + "property.construction_type": "wood frame", "property.roof_year": 2018, "property.roof_material": "asphalt shingle", + "property.heating_type": "gas furnace", "property.finish_level": "builder grade", +}) +_PC04 = _pc(**{ + "property.address_line1": "17 Larch Hollow Ct", "property.city": "Bayard Crossing", "property.state": "NC", + "property.zip": "27510", "property.year_built": 2003, "property.square_feet": 2650, + "property.construction_type": "wood frame", "property.stories": "2", "property.roof_year": 2019, + "property.roof_material": "asphalt shingle", "property.heating_type": "gas furnace", + "history.prior_claims_5yr": 1, "property.burglar_alarm": True, "property.finish_level": "semi-custom", +}) +_PC08 = _pc(**{ + "property.address_line1": "77 Osprey Landing", "property.city": "Saltmarsh", "property.state": "MA", + "property.zip": "02536", "property.year_built": 1971, "property.square_feet": 1980, + "property.construction_type": "wood frame", "property.stories": "2", "property.roof_year": 2017, + "property.roof_material": "asphalt shingle", "property.heating_type": "oil boiler", + "property.finish_level": "semi-custom", +}) + +CASES["pinecrest"] = [ + _pc_case("pc-dev", "dev", _pc(**{ + "property.address_line1": "61 Gullwing Rd", "property.city": "Quarry Point", "property.state": "WA", + "property.zip": "98221", "property.year_built": 1997, "property.square_feet": 1900, + "property.construction_type": "wood frame", "property.stories": "2", "property.roof_year": 2014, + "property.roof_material": "asphalt shingle", "property.heating_type": "gas furnace", + "property.burglar_alarm": True, "property.finish_level": "semi-custom", + })), + _pc_case("pc-s01", "scored", _pc(**{ + "property.address_line1": "9 Brackish Cove Ln", "property.city": "Saltmarsh", "property.state": "MA", + "property.zip": "02536", "property.year_built": 1985, "property.square_feet": 2300, + "property.construction_type": "brick / masonry", "property.roof_year": 2016, "property.roof_material": "slate", + "property.heating_type": "heat pump", "property.finish_level": "semi-custom", + "coverage.deductible": 2500, "coverage.effective_date": "2026-12-20", + })), + _pc_case("pc-s02", "scored", _pc(**{ + "property.address_line1": "4400 Summit Overlook Dr", "property.city": "Tamarack Ridge", "property.state": "ID", + "property.zip": "83616", "property.year_built": 2008, "property.square_feet": 3400, + "property.construction_type": "steel / concrete", "property.stories": "2", "property.roof_year": 2008, + "property.roof_material": "metal", "property.heating_type": "heat pump", "property.burglar_alarm": True, + "property.finish_level": "luxury", "coverage.deductible": 5000, "coverage.effective_date": "2027-01-15", + }), + behavior="must_stop_before_submit", also=["submit_clean"], traps=["estimator_wrong"], + operator=[_op("Dwelling limit", "coverage.dwelling_limit", pinecrest_rebuild(3400, 2008, "Steel / concrete", "Luxury"))], + ), + _pc_case("pc-s03", "scored", _PC03, + prior=_pc_prior("PA-3318842", _PC03, area="200", area_unit="m2", roof_year="2002"), + behavior="must_stop_before_submit", also=["submit_clean"], traps=["prefill_conflict", "summary_differs"], + operator=[ + _op("Area unit", "property.square_feet_unit", "sq ft"), + _op("Living area", "property.square_feet", 2150), + _op("Year roof was installed", "property.roof_year", 2018), + ], + ), + _pc_case("pc-s04", "scored", _PC04, prior=_pc_prior("PA-3290175", _PC04), traps=["clean", "prefill_agree"]), + _pc_case("pc-s05", "scored", _pc(**{ + "property.address_line1": "802 Millrace St", "property.city": "Springfield", "property.state": "OR", + "property.zip": "97477", "property.year_built": 1964, "property.square_feet": 1750, + "property.construction_type": "wood frame", "property.roof_year": 2015, + "property.roof_material": "asphalt shingle", "property.heating_type": "electric baseboard", + "property.finish_level": "builder grade", "coverage.deductible": 2500, + }), + behavior="submit_clean", also=["must_stop_before_submit"], traps=["typeahead_ambiguous", "estimator_ok"], + ), + _pc_case("pc-s06", "scored", _pc(**{ + "property.address_line1": "5 Woodsmoke Ln", "property.city": "Hazel Bluff", "property.state": "OR", + "property.zip": "97814", "property.year_built": 1992, "property.square_feet": 1400, + "property.construction_type": "log", "property.roof_year": 2010, "property.roof_material": "metal", + "property.heating_type": "wood stove", "property.finish_level": "custom", + }), + stove="No", + behavior="needs_operator_answer", traps=["unknown_question"], + operator=[_op("Was the wood stove installed by a licensed professional?", "property.wood_stove_professionally_installed", "No")], + ), + _pc_case("pc-s07", "scored", _pc(**{ + "property.address_line1": "1210 Ridgecrest Blvd", "property.city": "Quarry Point", "property.state": "WA", + "property.zip": "98221", "property.year_built": 2015, "property.square_feet": 3300, + "property.construction_type": "brick / masonry", "property.stories": "2", "property.roof_year": 2015, + "property.roof_material": "tile", "property.heating_type": "heat pump", "property.burglar_alarm": True, + "property.finish_level": "custom", "coverage.deductible": 2500, + }), traps=["clean", "estimator_ok"]), + _pc_case("pc-s08", "scored", _PC08, + prior=_pc_prior("PA-3301457", _PC08, prior_claims="2", burglar_alarm=True), + behavior="must_stop_before_submit", also=["submit_clean"], traps=["prefill_conflict"], + operator=[ + _op("Claims in the last 5 years", "history.prior_claims_5yr", 0), + _op("Monitored burglar alarm", "property.burglar_alarm", "No"), + ], + ), +] + + +# ===================================================================== +# Tidewater Bay Insurance (shadow-DOM custom elements, bundle quote) +# ===================================================================== + + +def _tw_case( + case_id: str, + split: str, + facts: dict[str, Any], + *, + street: str | None = None, + unit: str | None = None, + rental: str = "", + customer_file: dict[str, Any] | None = None, + config: dict[str, Any] | None = None, + behavior: str = "submit_clean", + also: list[str] | None = None, + traps: list[str] | None = None, + operator: list[dict[str, Any]] | None = None, +) -> dict[str, Any]: + f = dict(sorted(facts.items())) + cfg = dict(config or {}) + if customer_file: + cfg["customer_file"] = customer_file + expected = { + "first_name": f["applicant.first_name"], + "last_name": f["applicant.last_name"], + "dob": f["applicant.date_of_birth"], + "email": f["applicant.email"], + "street": (street if street is not None else f["property.address_line1"]).upper(), + "unit": (unit if unit is not None else f.get("property.address_line2", "")).upper(), + "city": f["property.city"].upper(), + "state": f["property.state"], + "zip": f["property.zip"], + "year_built": f["property.year_built"], + "sqft": f["property.square_feet"], + "roof_year": f["property.roof_year"], + "occupancy": f["property.occupancy"], + "short_term_rental": rental, + "losses_3yr": f["history.prior_claims_3yr"], + "vehicle_year": f["vehicle.year"], + "make": f["vehicle.make"], + "model": f["vehicle.model"], + "driver_count": f["household.driver_count"], + } + return { + "case_id": case_id, "split": split, "intake": {"case_id": case_id, "facts": f}, "config": cfg, + "expected": expected, "behavior": behavior, "also": also or [], "traps": traps or ["clean"], + "operator": operator or [], + } + + +def _tw_file(number: str, facts: dict[str, Any], **override: Any) -> dict[str, Any]: + fields = { + "year_built": facts["property.year_built"], "sqft": facts["property.square_feet"], + "roof_year": facts["property.roof_year"], "occupancy": facts["property.occupancy"], + "losses_3yr": str(facts["history.prior_claims_3yr"]), "vehicle_year": str(facts["vehicle.year"]), + "make": facts["vehicle.make"], "model": facts["vehicle.model"], + "driver_count": str(facts["household.driver_count"]), + } + fields.update(override) + return {"number": number, "last_name": facts["applicant.last_name"], "dob": facts["applicant.date_of_birth"], + "fields": fields} + + +def _tw(**kw: Any) -> dict[str, Any]: + base = {"property.occupancy": "Owner occupied", "history.prior_claims_3yr": 0, "household.driver_count": 1} + base.update(kw) + return base + + +_TW03 = _tw(**{ + "applicant.first_name": "Rosalind", "applicant.last_name": "Kettering", "applicant.date_of_birth": "1964-10-12", + "applicant.email": "rosalind.k@example.test", "property.address_line1": "14 Gristmill Ln", + "property.city": "Brattleboro", "property.state": "VT", "property.zip": "05301", "property.year_built": 1938, + "property.square_feet": 2480, "property.roof_year": 2020, "vehicle.year": 2021, "vehicle.make": "Norvik", + "vehicle.model": "Aster", "household.driver_count": 2, +}) +_TW04 = _tw(**{ + "applicant.first_name": "Oren", "applicant.last_name": "Castellane", "applicant.date_of_birth": "1981-06-01", + "applicant.email": "oren.castellane@example.test", "property.address_line1": "301 Tern Hollow Rd", + "property.city": "Kittery", "property.state": "ME", "property.zip": "03904", "property.year_built": 1996, + "property.square_feet": 1840, "property.roof_year": 2017, "vehicle.year": 2019, "vehicle.make": "Marlowe", + "vehicle.model": "Brook", "history.prior_claims_3yr": 1, +}) +_TW05 = _tw(**{ + "applicant.first_name": "Delphine", "applicant.last_name": "Ashgrove", "applicant.date_of_birth": "1990-03-23", + "applicant.email": "delphine.ashgrove@example.test", "property.address_line1": "52 Breakwater Ave", + "property.city": "Newport", "property.state": "RI", "property.zip": "02840", "property.year_built": 1972, + "property.square_feet": 1660, "property.roof_year": 2015, "vehicle.year": 2024, "vehicle.make": "Solenne", + "vehicle.model": "Vida", "history.prior_claims_3yr": 2, +}) + +CASES["tidewater"] = [ + _tw_case("tw-dev", "dev", _tw(**{ + "applicant.first_name": "Silas", "applicant.last_name": "Pemberton", "applicant.date_of_birth": "1979-12-02", + "applicant.email": "silas.pemberton@example.test", "property.address_line1": "9 Lantern Wharf Rd", + "property.city": "Portsmouth", "property.state": "NH", "property.zip": "03801", "property.year_built": 1988, + "property.square_feet": 1720, "property.roof_year": 2016, "vehicle.year": 2020, "vehicle.make": "Halden", + "vehicle.model": "Skerry", + })), + _tw_case("tw-s01", "scored", _tw(**{ + "applicant.first_name": "Junia", "applicant.last_name": "Marchbanks", "applicant.date_of_birth": "1987-08-09", + "applicant.email": "junia.m@example.test", "property.address_line1": "1120 Cormorant Dr", + "property.address_line2": "Unit 3B", "property.city": "Bar Harbor", "property.state": "ME", + "property.zip": "04609", "property.year_built": 2004, "property.square_feet": 1350, "property.roof_year": 2019, + "vehicle.year": 2022, "vehicle.make": "Kestrel", "vehicle.model": "Ridgeback XL", "household.driver_count": 2, + })), + _tw_case("tw-s02", "scored", _tw(**{ + "applicant.first_name": "Benedikt", "applicant.last_name": "Strand", "applicant.date_of_birth": "1975-05-19", + "applicant.email": "b.strand@example.test", "property.address_line1": "88 Harbor View Rd Apt 4", + "property.city": "Gloucester", "property.state": "MA", "property.zip": "01930", "property.year_built": 1961, + "property.square_feet": 1100, "property.roof_year": 2012, "vehicle.year": 2015, "vehicle.make": "Marlowe", + "vehicle.model": "Avenue", + }), + street="88 Harbor View Rd", unit="Apt 4", + behavior="must_stop_before_submit", also=["submit_clean"], traps=["summary_differs"], + operator=[_op("Apt / unit", "property.address_line2", "Apt 4"), + _op("Street address", "property.address_line1", "88 Harbor View Rd")], + ), + _tw_case("tw-s03", "scored", _TW03, + customer_file=_tw_file("TG-774120", _TW03, roof_year=2005, sqft=2150), + config={"expire_on": "post_step_3", "restore_file_on_resume": ["roof_year", "sqft"]}, + behavior="must_stop_before_submit", also=["submit_clean"], + traps=["prefill_conflict", "session_timeout", "summary_differs"], + operator=[_op("Roof updated (year)", "property.roof_year", 2020), + _op("Square footage", "property.square_feet", 2480)], + ), + _tw_case("tw-s04", "scored", _TW04, customer_file=_tw_file("TG-760331", _TW04), traps=["clean", "prefill_agree"]), + _tw_case("tw-s05", "scored", _TW05, + customer_file=_tw_file("TG-781556", _TW05, losses_3yr="0", vehicle_year="2016", make="Marlowe", model="Avenue LX"), + behavior="must_stop_before_submit", also=["submit_clean"], traps=["typeahead_ambiguous", "prefill_conflict"], + operator=[_op("Losses in the last 3 years", "history.prior_claims_3yr", 2)], + ), + _tw_case("tw-s06", "scored", _tw(**{ + "applicant.first_name": "Agathe", "applicant.last_name": "Rimmington", "applicant.date_of_birth": "1969-01-28", + "applicant.email": "agathe.r@example.test", "property.address_line1": "6 Heron Rock Way", + "property.city": "Astoria", "property.state": "OR", "property.zip": "97103", "property.year_built": 1955, + "property.square_feet": 2010, "property.roof_year": 2021, "vehicle.year": 2018, "vehicle.make": "Halden", + "vehicle.model": "Fjord", "household.driver_count": 3, + })), + _tw_case("tw-s07", "scored", _tw(**{ + "applicant.first_name": "Lucan", "applicant.last_name": "Abernethy", "applicant.date_of_birth": "1972-09-14", + "applicant.email": "lucan.abernethy@example.test", "property.address_line1": "40 Dune Grass Ln", + "property.city": "Cannon Beach", "property.state": "OR", "property.zip": "97110", "property.year_built": 1999, + "property.square_feet": 1580, "property.roof_year": 2018, "property.occupancy": "Seasonal", + "vehicle.year": 2023, "vehicle.make": "Norvik", "vehicle.model": "Polar", + }), + rental="No", + behavior="needs_operator_answer", traps=["unknown_question"], + operator=[_op("Is the home rented to others for short stays (under 30 days)?", + "property.short_term_rental", "No")], + ), +] + +PORTAL_META: dict[str, dict[str, Any]] = {} +PORTAL_META["harborline"] = { + "metadata_fields": ["case_id", "submitted_at", "submit_seq", "submit_count", "application_no"], + "field_types": { + "first_name": "str", "last_name": "str", "dob": "date", "phone": "phone", "email": "str", + "prior_policy": "str", "street": "str", "city": "str", "state": "enum", "zip": "str", + "year_built": "int", "sqft": "int", "stories": "enum", "construction_class": "enum", + "roof_year": "int", "roof_material": "enum", "losses_5yr": "int", "cov_a": "money", + "eff_date": "date", "deductible": "money", "liability": "money", "pool": "enum", + "pool_fenced": "enum", + }, +} +RULES: list[dict[str, Any]] = [HARBORLINE_RULE] +PORTAL_META["cobalt"] = { + "metadata_fields": ["case_id", "submitted_at", "submit_seq", "submit_count", "quote_id"], + "field_types": { + "first_name": "str", "last_name": "str", "dob": "date", "email": "str", "license_state": "enum", + "marital_status": "enum", "additional_drivers": "list", "vehicle_year": "int", "make": "enum", + "model": "enum", "use": "enum", "commute_miles": "int", "rideshare": "enum", "annual_miles": "int", + "garaging_zip": "str", "garaging_city": "str", "garaging_state": "enum", "ownership": "enum", + "lienholder": "str", "bi_limits": "enum", "collision_ded": "enum", "comp_ded": "enum", + }, + "item_types": { + "additional_drivers": {"first_name": "str", "last_name": "str", "dob": "date", "relationship": "enum"}, + }, +} +PORTAL_META["pinecrest"] = { + "metadata_fields": ["case_id", "submitted_at", "submit_seq", "submit_count", "quote_ref"], + "field_types": { + "street": "str", "city": "str", "state": "enum", "zip": "str", "year_built": "int", + "living_area_sqft": "int", "construction": "enum", "stories": "enum", "roof_year": "int", + "roof_material": "enum", "heating": "enum", "stove_installed": "enum", "prior_claims": "int", + "burglar_alarm": "bool", "dwelling_limit": "money", "deductible": "money", "effective_date": "date", + }, +} +PORTAL_META["tidewater"] = { + "metadata_fields": ["case_id", "submitted_at", "submit_seq", "submit_count", "quote_no"], + "field_types": { + "first_name": "str", "last_name": "str", "dob": "date", "email": "str", "street": "str", "unit": "str", + "city": "str", "state": "enum", "zip": "str", "year_built": "int", "sqft": "int", "roof_year": "int", + "occupancy": "enum", "short_term_rental": "enum", "losses_3yr": "int", "vehicle_year": "int", + "make": "enum", "model": "enum", "driver_count": "int", + }, +} + + +# Every Harborline and Pinecrest case passes through the estimator; the cases +# whose figure comes back intact carry ``estimator_ok``. +for _portal, _wrong in (("harborline", {"hl-s03"}), ("pinecrest", {"pc-s02"})): + for _c in CASES[_portal]: + if _c["case_id"] not in _wrong and "estimator_ok" not in _c["traps"]: + _c["traps"].append("estimator_ok") + +# Intake vocabulary: every canonical key an intake may carry, per portal, with +# its type and, for closed lists, the allowed values. Carries no case data. +ENUMS: dict[str, dict[str, list[str]]] = { + "harborline": { + "property.state": ["AZ", "CA", "CO", "ID", "IL", "MA", "MO", "NV", "OR", "PA", "TN", "TX", "UT", "WA"], + "property.stories": ["1", "1.5", "2", "3"], + "property.exterior_wall": ["vinyl siding", "wood siding", "cedar siding", "fiber cement siding", + "brick veneer", "solid brick", "stone veneer", "stucco", "log"], + "property.roof_material": ["Asphalt Shingle", "Architectural Shingle", "Metal", "Clay Tile", "Wood Shake", "Slate"], + "property.construction_quality": ["Economy", "Standard", "Custom", "Premium"], + }, + "cobalt": { + "applicant.license_state": ["AZ", "CA", "CO", "ID", "IL", "MA", "MO", "NC", "NV", "NH", "NJ", "NM", "NY", + "OR", "PA", "TN", "TX", "UT", "WA"], + "applicant.marital_status": ["Single", "Married", "Divorced", "Widowed"], + "driver2.relationship": ["Spouse", "Domestic partner", "Child", "Parent", "Other"], + "vehicle.make": ["Halden", "Kestrel", "Marlowe", "Norvik", "Solenne"], + "vehicle.primary_use": ["commute", "pleasure", "business"], + "vehicle.ownership": ["own", "finance", "lease"], + "garaging.state": ["AZ", "CA", "CO", "ID", "IL", "MA", "MO", "NC", "NV", "NH", "NJ", "NM", "NY", + "OR", "PA", "TN", "TX", "UT", "WA"], + "coverage.bi_limits": ["25/50", "50/100", "100/300", "250/500"], + }, + "pinecrest": { + "property.state": ["ID", "MA", "NC", "OR", "TN", "WA", "IL", "MO"], + "property.construction_type": list(_PC_CONSTRUCTION), + "property.roof_material": ["asphalt shingle", "metal", "tile", "slate", "wood shake"], + "property.heating_type": list(_PC_HEAT), + "property.finish_level": list(_PC_FINISH), + "property.stories": ["1", "2", "3+"], + }, + "tidewater": { + "property.state": ["AZ", "CA", "CO", "ID", "MA", "ME", "NC", "NH", "OR", "RI", "VT", "WA"], + "property.occupancy": ["Owner occupied", "Secondary", "Seasonal", "Rental"], + "vehicle.make": ["Halden", "Kestrel", "Marlowe", "Norvik", "Solenne"], + }, +} +_NOTES = { + "coverage.deductible": "whole dollars", + "coverage.liability_limit": "whole dollars", + "coverage.collision_deductible": "whole dollars", + "coverage.comprehensive_deductible": "whole dollars", + "household.driver_count": "drivers in the household, including the applicant", +} + + +def _type_of(values: list[Any]) -> str: + import re as _re + + if all(isinstance(v, bool) for v in values): + return "bool" + if all(isinstance(v, int) and not isinstance(v, bool) for v in values): + return "int" + if all(isinstance(v, str) and _re.fullmatch(r"\d{4}-\d{2}-\d{2}", v) for v in values): + return "date" + return "str" + + +def intake_vocabulary(portal: str) -> dict[str, Any]: + seen: dict[str, list[Any]] = {} + for case in CASES[portal]: + for k, v in case["intake"]["facts"].items(): + seen.setdefault(k, []).append(v) + keys = {} + for k in sorted(seen): + entry: dict[str, Any] = {"type": "enum" if k in ENUMS[portal] else _type_of(seen[k])} + if k in ENUMS[portal]: + entry["values"] = ENUMS[portal][k] + if k in _NOTES: + entry["note"] = _NOTES[k] + keys[k] = entry + return {"portal": portal, "keys": keys, "dates": "ISO 8601 (YYYY-MM-DD)", + "absent_key": "the fact is unknown; the intake never sends null or empty values"} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-dev.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-dev.intake.json new file mode 100644 index 0000000000..b0628c721c --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-dev.intake.json @@ -0,0 +1,24 @@ +{ + "case_id": "cr-dev", + "facts": { + "applicant.date_of_birth": "1988-06-12", + "applicant.email": "hollis.varga@example.test", + "applicant.first_name": "Hollis", + "applicant.last_name": "Varga", + "applicant.license_state": "OR", + "applicant.marital_status": "Single", + "coverage.bi_limits": "100/300", + "coverage.collision_deductible": 500, + "coverage.comprehensive_deductible": 250, + "garaging.city": "Cedar Hollow", + "garaging.state": "OR", + "garaging.zip": "97520", + "household.driver_count": 1, + "vehicle.annual_miles": 9000, + "vehicle.make": "Marlowe", + "vehicle.model": "Brook", + "vehicle.ownership": "own", + "vehicle.primary_use": "pleasure", + "vehicle.year": 2021 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s01.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s01.intake.json new file mode 100644 index 0000000000..66f57ad5f0 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s01.intake.json @@ -0,0 +1,26 @@ +{ + "case_id": "cr-s01", + "facts": { + "applicant.date_of_birth": "1995-01-17", + "applicant.email": "ines.calloway@example.test", + "applicant.first_name": "Ines", + "applicant.last_name": "Calloway", + "applicant.license_state": "WA", + "applicant.marital_status": "Single", + "coverage.bi_limits": "50/100", + "coverage.collision_deductible": 1000, + "coverage.comprehensive_deductible": 500, + "garaging.city": "Lakemont", + "garaging.state": "WA", + "garaging.zip": "98052", + "household.driver_count": 1, + "vehicle.annual_miles": 12000, + "vehicle.commute_miles_one_way": 14, + "vehicle.lienholder": "Northgate Credit Union", + "vehicle.make": "Norvik", + "vehicle.model": "Aster", + "vehicle.ownership": "finance", + "vehicle.primary_use": "commute", + "vehicle.year": 2019 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s02.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s02.intake.json new file mode 100644 index 0000000000..bb9a7e1bf7 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s02.intake.json @@ -0,0 +1,24 @@ +{ + "case_id": "cr-s02", + "facts": { + "applicant.date_of_birth": "1977-03-04", + "applicant.email": "callum.ashdown@example.test", + "applicant.first_name": "Callum", + "applicant.last_name": "Ashdown", + "applicant.license_state": "OR", + "applicant.marital_status": "Divorced", + "coverage.bi_limits": "100/300", + "coverage.collision_deductible": 500, + "coverage.comprehensive_deductible": 500, + "garaging.city": "Cedar Hollow", + "garaging.state": "OR", + "garaging.zip": "97520", + "household.driver_count": 1, + "vehicle.annual_miles": 7500, + "vehicle.make": "Halden", + "vehicle.model": "Skerry", + "vehicle.ownership": "own", + "vehicle.primary_use": "pleasure", + "vehicle.year": 2017 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s03.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s03.intake.json new file mode 100644 index 0000000000..980d3d7f8f --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s03.intake.json @@ -0,0 +1,24 @@ +{ + "case_id": "cr-s03", + "facts": { + "applicant.date_of_birth": "1983-09-25", + "applicant.email": "dario.pellegrin@example.test", + "applicant.first_name": "Dario", + "applicant.last_name": "Pellegrin", + "applicant.license_state": "AZ", + "applicant.marital_status": "Single", + "coverage.bi_limits": "100/300", + "coverage.collision_deductible": 500, + "coverage.comprehensive_deductible": 500, + "garaging.city": "Copper Mesa", + "garaging.state": "AZ", + "garaging.zip": "85142", + "household.driver_count": 1, + "vehicle.annual_miles": 10000, + "vehicle.make": "Kestrel", + "vehicle.model": "Corsa", + "vehicle.ownership": "own", + "vehicle.primary_use": "pleasure", + "vehicle.year": 2022 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s04.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s04.intake.json new file mode 100644 index 0000000000..312684610d --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s04.intake.json @@ -0,0 +1,29 @@ +{ + "case_id": "cr-s04", + "facts": { + "applicant.date_of_birth": "1986-05-30", + "applicant.email": "maren.lindqvist@example.test", + "applicant.first_name": "Maren", + "applicant.last_name": "Lindqvist", + "applicant.license_state": "ID", + "applicant.marital_status": "Married", + "coverage.bi_limits": "250/500", + "coverage.collision_deductible": 500, + "coverage.comprehensive_deductible": 500, + "driver2.date_of_birth": "1984-02-28", + "driver2.first_name": "Tobias", + "driver2.last_name": "Lindqvist", + "driver2.relationship": "Spouse", + "garaging.city": "Brindle Falls", + "garaging.state": "ID", + "garaging.zip": "83814", + "household.driver_count": 2, + "vehicle.annual_miles": 11000, + "vehicle.commute_miles_one_way": 8, + "vehicle.make": "Solenne", + "vehicle.model": "Lune", + "vehicle.ownership": "own", + "vehicle.primary_use": "commute", + "vehicle.year": 2020 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s05.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s05.intake.json new file mode 100644 index 0000000000..74d97fb0ea --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s05.intake.json @@ -0,0 +1,25 @@ +{ + "case_id": "cr-s05", + "facts": { + "applicant.date_of_birth": "1991-12-03", + "applicant.email": "yusuf.brennan@example.test", + "applicant.first_name": "Yusuf", + "applicant.last_name": "Brennan", + "applicant.license_state": "NV", + "applicant.marital_status": "Single", + "coverage.bi_limits": "100/300", + "coverage.collision_deductible": 1000, + "coverage.comprehensive_deductible": 500, + "garaging.city": "Juniper Flats", + "garaging.state": "NV", + "garaging.zip": "89701", + "household.driver_count": 1, + "vehicle.annual_miles": 15000, + "vehicle.commute_miles_one_way": 22, + "vehicle.make": "Marlowe", + "vehicle.model": "Avenue LX", + "vehicle.ownership": "own", + "vehicle.primary_use": "commute", + "vehicle.year": 2018 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s06.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s06.intake.json new file mode 100644 index 0000000000..65ece3f4bc --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s06.intake.json @@ -0,0 +1,24 @@ +{ + "case_id": "cr-s06", + "facts": { + "applicant.date_of_birth": "1980-07-08", + "applicant.email": "thandiwe.corrigan@example.test", + "applicant.first_name": "Thandiwe", + "applicant.last_name": "Corrigan", + "applicant.license_state": "TN", + "applicant.marital_status": "Single", + "coverage.bi_limits": "100/300", + "coverage.collision_deductible": 1000, + "coverage.comprehensive_deductible": 1000, + "garaging.city": "Fairview", + "garaging.state": "TN", + "garaging.zip": "37062", + "household.driver_count": 1, + "vehicle.annual_miles": 18000, + "vehicle.make": "Halden", + "vehicle.model": "Fjord Touring", + "vehicle.ownership": "own", + "vehicle.primary_use": "business", + "vehicle.year": 2023 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s07.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s07.intake.json new file mode 100644 index 0000000000..03ee374336 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s07.intake.json @@ -0,0 +1,28 @@ +{ + "case_id": "cr-s07", + "facts": { + "applicant.date_of_birth": "1983-04-21", + "applicant.email": "esme.halloran@example.test", + "applicant.first_name": "Esme", + "applicant.last_name": "Halloran", + "applicant.license_state": "WA", + "applicant.marital_status": "Married", + "coverage.bi_limits": "50/100", + "coverage.collision_deductible": 500, + "coverage.comprehensive_deductible": 250, + "driver2.date_of_birth": "1981-10-09", + "driver2.first_name": "Pavel", + "driver2.last_name": "Halloran", + "driver2.relationship": "Spouse", + "garaging.city": "Port Alder", + "garaging.state": "WA", + "garaging.zip": "98368", + "household.driver_count": 2, + "vehicle.annual_miles": 6000, + "vehicle.make": "Kestrel", + "vehicle.model": "Ridgeback", + "vehicle.ownership": "own", + "vehicle.primary_use": "pleasure", + "vehicle.year": 2016 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s08.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s08.intake.json new file mode 100644 index 0000000000..be637737fe --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/cobalt/cr-s08.intake.json @@ -0,0 +1,24 @@ +{ + "case_id": "cr-s08", + "facts": { + "applicant.date_of_birth": "1998-02-14", + "applicant.email": "arlo.fenwick@example.test", + "applicant.first_name": "Arlo", + "applicant.last_name": "Fenwick", + "applicant.license_state": "IL", + "applicant.marital_status": "Single", + "coverage.bi_limits": "100/300", + "coverage.collision_deductible": 500, + "coverage.comprehensive_deductible": 500, + "garaging.city": "Springfield", + "garaging.state": "IL", + "garaging.zip": "62704", + "household.driver_count": 1, + "vehicle.annual_miles": 8000, + "vehicle.make": "Norvik", + "vehicle.model": "Polar Trail", + "vehicle.ownership": "lease", + "vehicle.primary_use": "pleasure", + "vehicle.year": 2025 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-dev.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-dev.intake.json new file mode 100644 index 0000000000..45c147eeac --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-dev.intake.json @@ -0,0 +1,27 @@ +{ + "case_id": "hl-dev", + "facts": { + "applicant.date_of_birth": "1984-03-09", + "applicant.email": "marisol.q@example.test", + "applicant.first_name": "Marisol", + "applicant.last_name": "Quennell", + "applicant.phone": "503-555-0117", + "coverage.deductible": 1000, + "coverage.effective_date": "2026-12-15", + "coverage.liability_limit": 300000, + "history.prior_claims_5yr": 0, + "property.address_line1": "2290 Larkspur Ct", + "property.city": "Bend", + "property.construction_quality": "Standard", + "property.exterior_wall": "vinyl siding", + "property.has_pool": true, + "property.pool_fenced": true, + "property.roof_material": "Architectural Shingle", + "property.roof_year": 2015, + "property.square_feet": 1850, + "property.state": "OR", + "property.stories": "2", + "property.year_built": 1994, + "property.zip": "97701" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s01.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s01.intake.json new file mode 100644 index 0000000000..6e5431c335 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s01.intake.json @@ -0,0 +1,26 @@ +{ + "case_id": "hl-s01", + "facts": { + "applicant.date_of_birth": "1971-07-22", + "applicant.email": "tbrandvold@example.test", + "applicant.first_name": "Theo", + "applicant.last_name": "Brandvold", + "applicant.phone": "208-555-0164", + "coverage.deductible": 1000, + "coverage.effective_date": "2026-12-01", + "coverage.liability_limit": 300000, + "history.prior_claims_5yr": 0, + "property.address_line1": "418 Cottonwood Dr", + "property.city": "Boise", + "property.construction_quality": "Standard", + "property.exterior_wall": "vinyl siding", + "property.has_pool": false, + "property.roof_material": "Asphalt Shingle", + "property.roof_year": 2017, + "property.square_feet": 1620, + "property.state": "ID", + "property.stories": "1", + "property.year_built": 1968, + "property.zip": "83704" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s02.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s02.intake.json new file mode 100644 index 0000000000..7b24af8b93 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s02.intake.json @@ -0,0 +1,27 @@ +{ + "case_id": "hl-s02", + "facts": { + "applicant.date_of_birth": "1966-11-02", + "applicant.email": "imogen.saltera@example.test", + "applicant.first_name": "Imogen", + "applicant.last_name": "Saltera", + "applicant.phone": "541-555-0139", + "coverage.deductible": 2500, + "coverage.effective_date": "2026-12-15", + "coverage.liability_limit": 300000, + "history.prior_claims_5yr": 1, + "history.prior_policy_number": "HM-118204", + "property.address_line1": "77 Heron Bend Rd", + "property.city": "Eugene", + "property.construction_quality": "Standard", + "property.exterior_wall": "wood siding", + "property.has_pool": false, + "property.roof_material": "Asphalt Shingle", + "property.roof_year": 2019, + "property.square_feet": 1980, + "property.state": "OR", + "property.stories": "1.5", + "property.year_built": 1955, + "property.zip": "97405" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s03.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s03.intake.json new file mode 100644 index 0000000000..80e9488ced --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s03.intake.json @@ -0,0 +1,26 @@ +{ + "case_id": "hl-s03", + "facts": { + "applicant.date_of_birth": "1979-01-30", + "applicant.email": "rdenholm@example.test", + "applicant.first_name": "Rafael", + "applicant.last_name": "Denholm", + "applicant.phone": "425-555-0182", + "coverage.deductible": 1000, + "coverage.effective_date": "2026-12-15", + "coverage.liability_limit": 500000, + "history.prior_claims_5yr": 0, + "property.address_line1": "5120 Alder Crest Way", + "property.city": "Bellevue", + "property.construction_quality": "Custom", + "property.exterior_wall": "cedar siding", + "property.has_pool": false, + "property.roof_material": "Architectural Shingle", + "property.roof_year": 2016, + "property.square_feet": 2860, + "property.state": "WA", + "property.stories": "2", + "property.year_built": 1961, + "property.zip": "98006" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s04.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s04.intake.json new file mode 100644 index 0000000000..6524166a2a --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s04.intake.json @@ -0,0 +1,26 @@ +{ + "case_id": "hl-s04", + "facts": { + "applicant.date_of_birth": "1990-05-14", + "applicant.email": "priya.v@example.test", + "applicant.first_name": "Priya", + "applicant.last_name": "Vandersloot", + "applicant.phone": "720-555-0108", + "coverage.deductible": 1000, + "coverage.effective_date": "2026-12-15", + "coverage.liability_limit": 300000, + "history.prior_claims_5yr": 0, + "property.address_line1": "9 Juniper Hollow", + "property.city": "Golden", + "property.construction_quality": "Standard", + "property.exterior_wall": "stucco", + "property.has_pool": false, + "property.roof_material": "Clay Tile", + "property.roof_year": 2018, + "property.square_feet": 2100, + "property.state": "CO", + "property.stories": "2", + "property.year_built": 2001, + "property.zip": "80401" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s05.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s05.intake.json new file mode 100644 index 0000000000..f8e53bdcec --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s05.intake.json @@ -0,0 +1,26 @@ +{ + "case_id": "hl-s05", + "facts": { + "applicant.date_of_birth": "1958-09-18", + "applicant.email": "g.marchetti@example.test", + "applicant.first_name": "Gideon", + "applicant.last_name": "Marchetti", + "applicant.phone": "801-555-0151", + "coverage.deductible": 1000, + "coverage.effective_date": "2026-12-15", + "coverage.liability_limit": 300000, + "history.prior_claims_5yr": 0, + "property.address_line1": "3306 Sego Lily Ln", + "property.city": "Provo", + "property.construction_quality": "Standard", + "property.exterior_wall": "vinyl siding", + "property.has_pool": false, + "property.roof_material": "Metal", + "property.roof_year": 2020, + "property.square_feet": 1750, + "property.state": "UT", + "property.stories": "1", + "property.year_built": 1974, + "property.zip": "84604" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s06.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s06.intake.json new file mode 100644 index 0000000000..0c89599a72 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s06.intake.json @@ -0,0 +1,27 @@ +{ + "case_id": "hl-s06", + "facts": { + "applicant.date_of_birth": "1969-04-05", + "applicant.email": "wren.a@example.test", + "applicant.first_name": "Wren", + "applicant.last_name": "Achterberg", + "applicant.phone": "314-555-0126", + "coverage.deductible": 1000, + "coverage.effective_date": "2026-12-15", + "coverage.liability_limit": 300000, + "history.prior_claims_5yr": 0, + "history.prior_policy_number": "HM-120577", + "property.address_line1": "1402 Linden Terrace", + "property.city": "Kirkwood", + "property.construction_quality": "Standard", + "property.exterior_wall": "brick veneer", + "property.has_pool": false, + "property.roof_material": "Architectural Shingle", + "property.roof_year": 2014, + "property.square_feet": 1900, + "property.state": "MO", + "property.stories": "1", + "property.year_built": 1958, + "property.zip": "63122" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s07.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s07.intake.json new file mode 100644 index 0000000000..1f93157499 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s07.intake.json @@ -0,0 +1,27 @@ +{ + "case_id": "hl-s07", + "facts": { + "applicant.date_of_birth": "1982-12-11", + "applicant.email": "bastian.oyelaran@example.test", + "applicant.first_name": "Bastian", + "applicant.last_name": "Oyelaran", + "applicant.phone": "512-555-0173", + "coverage.deductible": 1000, + "coverage.effective_date": "2026-12-15", + "coverage.liability_limit": 500000, + "history.prior_claims_5yr": 0, + "history.prior_policy_number": "HM-097731", + "property.address_line1": "640 Pecan Grove Blvd", + "property.city": "Round Rock", + "property.construction_quality": "Standard", + "property.exterior_wall": "brick veneer", + "property.has_pool": false, + "property.roof_material": "Architectural Shingle", + "property.roof_year": 2021, + "property.square_feet": 2400, + "property.state": "TX", + "property.stories": "2", + "property.year_built": 2006, + "property.zip": "78664" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s08.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s08.intake.json new file mode 100644 index 0000000000..8ce0e4ccd3 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s08.intake.json @@ -0,0 +1,26 @@ +{ + "case_id": "hl-s08", + "facts": { + "applicant.date_of_birth": "1975-02-27", + "applicant.email": "leontyne.f@example.test", + "applicant.first_name": "Leontyne", + "applicant.last_name": "Fairweather", + "applicant.phone": "617-555-0190", + "coverage.deductible": 2500, + "coverage.effective_date": "2026-12-15", + "coverage.liability_limit": 300000, + "history.prior_claims_5yr": 0, + "history.prior_policy_number": "HM-102266", + "property.address_line1": "11842 Old Orchard Mill Road Unit 7", + "property.city": "Newton", + "property.construction_quality": "Standard", + "property.exterior_wall": "wood siding", + "property.has_pool": false, + "property.roof_year": 2022, + "property.square_feet": 2240, + "property.state": "MA", + "property.stories": "2", + "property.year_built": 1949, + "property.zip": "02459" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s09.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s09.intake.json new file mode 100644 index 0000000000..8bb145393e --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/harborline/hl-s09.intake.json @@ -0,0 +1,27 @@ +{ + "case_id": "hl-s09", + "facts": { + "applicant.date_of_birth": "1993-08-19", + "applicant.email": "annika.t@example.test", + "applicant.first_name": "Annika", + "applicant.last_name": "Thorsrud", + "applicant.phone": "775-555-0145", + "coverage.deductible": 5000, + "coverage.effective_date": "2026-12-15", + "coverage.liability_limit": 100000, + "history.prior_claims_5yr": 0, + "property.address_line1": "27 Sagebrush Loop", + "property.city": "Reno", + "property.construction_quality": "Economy", + "property.exterior_wall": "stucco", + "property.has_pool": true, + "property.pool_fenced": false, + "property.roof_material": "Clay Tile", + "property.roof_year": 2012, + "property.square_feet": 1500, + "property.state": "NV", + "property.stories": "1", + "property.year_built": 1988, + "property.zip": "89523" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-dev.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-dev.intake.json new file mode 100644 index 0000000000..7c18ec73fb --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-dev.intake.json @@ -0,0 +1,21 @@ +{ + "case_id": "pc-dev", + "facts": { + "coverage.deductible": 1000, + "coverage.effective_date": "2027-01-01", + "history.prior_claims_5yr": 0, + "property.address_line1": "61 Gullwing Rd", + "property.burglar_alarm": true, + "property.city": "Quarry Point", + "property.construction_type": "wood frame", + "property.finish_level": "semi-custom", + "property.heating_type": "gas furnace", + "property.roof_material": "asphalt shingle", + "property.roof_year": 2014, + "property.square_feet": 1900, + "property.state": "WA", + "property.stories": "2", + "property.year_built": 1997, + "property.zip": "98221" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s01.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s01.intake.json new file mode 100644 index 0000000000..dc0fd7f91e --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s01.intake.json @@ -0,0 +1,21 @@ +{ + "case_id": "pc-s01", + "facts": { + "coverage.deductible": 2500, + "coverage.effective_date": "2026-12-20", + "history.prior_claims_5yr": 0, + "property.address_line1": "9 Brackish Cove Ln", + "property.burglar_alarm": false, + "property.city": "Saltmarsh", + "property.construction_type": "brick / masonry", + "property.finish_level": "semi-custom", + "property.heating_type": "heat pump", + "property.roof_material": "slate", + "property.roof_year": 2016, + "property.square_feet": 2300, + "property.state": "MA", + "property.stories": "1", + "property.year_built": 1985, + "property.zip": "02536" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s02.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s02.intake.json new file mode 100644 index 0000000000..cd755fa968 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s02.intake.json @@ -0,0 +1,21 @@ +{ + "case_id": "pc-s02", + "facts": { + "coverage.deductible": 5000, + "coverage.effective_date": "2027-01-15", + "history.prior_claims_5yr": 0, + "property.address_line1": "4400 Summit Overlook Dr", + "property.burglar_alarm": true, + "property.city": "Tamarack Ridge", + "property.construction_type": "steel / concrete", + "property.finish_level": "luxury", + "property.heating_type": "heat pump", + "property.roof_material": "metal", + "property.roof_year": 2008, + "property.square_feet": 3400, + "property.state": "ID", + "property.stories": "2", + "property.year_built": 2008, + "property.zip": "83616" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s03.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s03.intake.json new file mode 100644 index 0000000000..a0fb244776 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s03.intake.json @@ -0,0 +1,21 @@ +{ + "case_id": "pc-s03", + "facts": { + "coverage.deductible": 1000, + "coverage.effective_date": "2027-01-01", + "history.prior_claims_5yr": 0, + "property.address_line1": "238 Fernhollow Way", + "property.burglar_alarm": false, + "property.city": "Hazel Bluff", + "property.construction_type": "wood frame", + "property.finish_level": "builder grade", + "property.heating_type": "gas furnace", + "property.roof_material": "asphalt shingle", + "property.roof_year": 2018, + "property.square_feet": 2150, + "property.state": "OR", + "property.stories": "1", + "property.year_built": 1979, + "property.zip": "97814" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s04.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s04.intake.json new file mode 100644 index 0000000000..2b04edddb3 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s04.intake.json @@ -0,0 +1,21 @@ +{ + "case_id": "pc-s04", + "facts": { + "coverage.deductible": 1000, + "coverage.effective_date": "2027-01-01", + "history.prior_claims_5yr": 1, + "property.address_line1": "17 Larch Hollow Ct", + "property.burglar_alarm": true, + "property.city": "Bayard Crossing", + "property.construction_type": "wood frame", + "property.finish_level": "semi-custom", + "property.heating_type": "gas furnace", + "property.roof_material": "asphalt shingle", + "property.roof_year": 2019, + "property.square_feet": 2650, + "property.state": "NC", + "property.stories": "2", + "property.year_built": 2003, + "property.zip": "27510" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s05.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s05.intake.json new file mode 100644 index 0000000000..1a0710b5c2 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s05.intake.json @@ -0,0 +1,21 @@ +{ + "case_id": "pc-s05", + "facts": { + "coverage.deductible": 2500, + "coverage.effective_date": "2027-01-01", + "history.prior_claims_5yr": 0, + "property.address_line1": "802 Millrace St", + "property.burglar_alarm": false, + "property.city": "Springfield", + "property.construction_type": "wood frame", + "property.finish_level": "builder grade", + "property.heating_type": "electric baseboard", + "property.roof_material": "asphalt shingle", + "property.roof_year": 2015, + "property.square_feet": 1750, + "property.state": "OR", + "property.stories": "1", + "property.year_built": 1964, + "property.zip": "97477" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s06.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s06.intake.json new file mode 100644 index 0000000000..463d761c0a --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s06.intake.json @@ -0,0 +1,21 @@ +{ + "case_id": "pc-s06", + "facts": { + "coverage.deductible": 1000, + "coverage.effective_date": "2027-01-01", + "history.prior_claims_5yr": 0, + "property.address_line1": "5 Woodsmoke Ln", + "property.burglar_alarm": false, + "property.city": "Hazel Bluff", + "property.construction_type": "log", + "property.finish_level": "custom", + "property.heating_type": "wood stove", + "property.roof_material": "metal", + "property.roof_year": 2010, + "property.square_feet": 1400, + "property.state": "OR", + "property.stories": "1", + "property.year_built": 1992, + "property.zip": "97814" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s07.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s07.intake.json new file mode 100644 index 0000000000..03ccb7e8c7 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s07.intake.json @@ -0,0 +1,21 @@ +{ + "case_id": "pc-s07", + "facts": { + "coverage.deductible": 2500, + "coverage.effective_date": "2027-01-01", + "history.prior_claims_5yr": 0, + "property.address_line1": "1210 Ridgecrest Blvd", + "property.burglar_alarm": true, + "property.city": "Quarry Point", + "property.construction_type": "brick / masonry", + "property.finish_level": "custom", + "property.heating_type": "heat pump", + "property.roof_material": "tile", + "property.roof_year": 2015, + "property.square_feet": 3300, + "property.state": "WA", + "property.stories": "2", + "property.year_built": 2015, + "property.zip": "98221" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s08.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s08.intake.json new file mode 100644 index 0000000000..c8775b2697 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/pinecrest/pc-s08.intake.json @@ -0,0 +1,21 @@ +{ + "case_id": "pc-s08", + "facts": { + "coverage.deductible": 1000, + "coverage.effective_date": "2027-01-01", + "history.prior_claims_5yr": 0, + "property.address_line1": "77 Osprey Landing", + "property.burglar_alarm": false, + "property.city": "Saltmarsh", + "property.construction_type": "wood frame", + "property.finish_level": "semi-custom", + "property.heating_type": "oil boiler", + "property.roof_material": "asphalt shingle", + "property.roof_year": 2017, + "property.square_feet": 1980, + "property.state": "MA", + "property.stories": "2", + "property.year_built": 1971, + "property.zip": "02536" + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-dev.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-dev.intake.json new file mode 100644 index 0000000000..8f8e668bee --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-dev.intake.json @@ -0,0 +1,22 @@ +{ + "case_id": "tw-dev", + "facts": { + "applicant.date_of_birth": "1979-12-02", + "applicant.email": "silas.pemberton@example.test", + "applicant.first_name": "Silas", + "applicant.last_name": "Pemberton", + "history.prior_claims_3yr": 0, + "household.driver_count": 1, + "property.address_line1": "9 Lantern Wharf Rd", + "property.city": "Portsmouth", + "property.occupancy": "Owner occupied", + "property.roof_year": 2016, + "property.square_feet": 1720, + "property.state": "NH", + "property.year_built": 1988, + "property.zip": "03801", + "vehicle.make": "Halden", + "vehicle.model": "Skerry", + "vehicle.year": 2020 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s01.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s01.intake.json new file mode 100644 index 0000000000..e942bc3a92 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s01.intake.json @@ -0,0 +1,23 @@ +{ + "case_id": "tw-s01", + "facts": { + "applicant.date_of_birth": "1987-08-09", + "applicant.email": "junia.m@example.test", + "applicant.first_name": "Junia", + "applicant.last_name": "Marchbanks", + "history.prior_claims_3yr": 0, + "household.driver_count": 2, + "property.address_line1": "1120 Cormorant Dr", + "property.address_line2": "Unit 3B", + "property.city": "Bar Harbor", + "property.occupancy": "Owner occupied", + "property.roof_year": 2019, + "property.square_feet": 1350, + "property.state": "ME", + "property.year_built": 2004, + "property.zip": "04609", + "vehicle.make": "Kestrel", + "vehicle.model": "Ridgeback XL", + "vehicle.year": 2022 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s02.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s02.intake.json new file mode 100644 index 0000000000..3afbbb3110 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s02.intake.json @@ -0,0 +1,22 @@ +{ + "case_id": "tw-s02", + "facts": { + "applicant.date_of_birth": "1975-05-19", + "applicant.email": "b.strand@example.test", + "applicant.first_name": "Benedikt", + "applicant.last_name": "Strand", + "history.prior_claims_3yr": 0, + "household.driver_count": 1, + "property.address_line1": "88 Harbor View Rd Apt 4", + "property.city": "Gloucester", + "property.occupancy": "Owner occupied", + "property.roof_year": 2012, + "property.square_feet": 1100, + "property.state": "MA", + "property.year_built": 1961, + "property.zip": "01930", + "vehicle.make": "Marlowe", + "vehicle.model": "Avenue", + "vehicle.year": 2015 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s03.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s03.intake.json new file mode 100644 index 0000000000..5c378d9e00 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s03.intake.json @@ -0,0 +1,22 @@ +{ + "case_id": "tw-s03", + "facts": { + "applicant.date_of_birth": "1964-10-12", + "applicant.email": "rosalind.k@example.test", + "applicant.first_name": "Rosalind", + "applicant.last_name": "Kettering", + "history.prior_claims_3yr": 0, + "household.driver_count": 2, + "property.address_line1": "14 Gristmill Ln", + "property.city": "Brattleboro", + "property.occupancy": "Owner occupied", + "property.roof_year": 2020, + "property.square_feet": 2480, + "property.state": "VT", + "property.year_built": 1938, + "property.zip": "05301", + "vehicle.make": "Norvik", + "vehicle.model": "Aster", + "vehicle.year": 2021 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s04.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s04.intake.json new file mode 100644 index 0000000000..dc7bc10c10 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s04.intake.json @@ -0,0 +1,22 @@ +{ + "case_id": "tw-s04", + "facts": { + "applicant.date_of_birth": "1981-06-01", + "applicant.email": "oren.castellane@example.test", + "applicant.first_name": "Oren", + "applicant.last_name": "Castellane", + "history.prior_claims_3yr": 1, + "household.driver_count": 1, + "property.address_line1": "301 Tern Hollow Rd", + "property.city": "Kittery", + "property.occupancy": "Owner occupied", + "property.roof_year": 2017, + "property.square_feet": 1840, + "property.state": "ME", + "property.year_built": 1996, + "property.zip": "03904", + "vehicle.make": "Marlowe", + "vehicle.model": "Brook", + "vehicle.year": 2019 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s05.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s05.intake.json new file mode 100644 index 0000000000..6549cf4a06 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s05.intake.json @@ -0,0 +1,22 @@ +{ + "case_id": "tw-s05", + "facts": { + "applicant.date_of_birth": "1990-03-23", + "applicant.email": "delphine.ashgrove@example.test", + "applicant.first_name": "Delphine", + "applicant.last_name": "Ashgrove", + "history.prior_claims_3yr": 2, + "household.driver_count": 1, + "property.address_line1": "52 Breakwater Ave", + "property.city": "Newport", + "property.occupancy": "Owner occupied", + "property.roof_year": 2015, + "property.square_feet": 1660, + "property.state": "RI", + "property.year_built": 1972, + "property.zip": "02840", + "vehicle.make": "Solenne", + "vehicle.model": "Vida", + "vehicle.year": 2024 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s06.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s06.intake.json new file mode 100644 index 0000000000..4bcfa5b259 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s06.intake.json @@ -0,0 +1,22 @@ +{ + "case_id": "tw-s06", + "facts": { + "applicant.date_of_birth": "1969-01-28", + "applicant.email": "agathe.r@example.test", + "applicant.first_name": "Agathe", + "applicant.last_name": "Rimmington", + "history.prior_claims_3yr": 0, + "household.driver_count": 3, + "property.address_line1": "6 Heron Rock Way", + "property.city": "Astoria", + "property.occupancy": "Owner occupied", + "property.roof_year": 2021, + "property.square_feet": 2010, + "property.state": "OR", + "property.year_built": 1955, + "property.zip": "97103", + "vehicle.make": "Halden", + "vehicle.model": "Fjord", + "vehicle.year": 2018 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s07.intake.json b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s07.intake.json new file mode 100644 index 0000000000..7ab8593dc1 --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cases/tidewater/tw-s07.intake.json @@ -0,0 +1,22 @@ +{ + "case_id": "tw-s07", + "facts": { + "applicant.date_of_birth": "1972-09-14", + "applicant.email": "lucan.abernethy@example.test", + "applicant.first_name": "Lucan", + "applicant.last_name": "Abernethy", + "history.prior_claims_3yr": 0, + "household.driver_count": 1, + "property.address_line1": "40 Dune Grass Ln", + "property.city": "Cannon Beach", + "property.occupancy": "Seasonal", + "property.roof_year": 2018, + "property.square_feet": 1580, + "property.state": "OR", + "property.year_built": 1999, + "property.zip": "97110", + "vehicle.make": "Norvik", + "vehicle.model": "Polar", + "vehicle.year": 2023 + } +} diff --git a/packages/flow/benchmark/form_tx_heldout/cobalt.py b/packages/flow/benchmark/form_tx_heldout/cobalt.py new file mode 100644 index 0000000000..140607232d --- /dev/null +++ b/packages/flow/benchmark/form_tx_heldout/cobalt.py @@ -0,0 +1,580 @@ +"""Cobalt Ridge Insurance: consumer auto quote, single-page app. + +Div/ARIA markup rendered by vanilla JS from a JSON API: no ``