Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions packages/flow/benchmark/form_tx_heldout2_run/RESULTS_REWORK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Dev re-run: the reworked engine on the eight portals it was fixed against

**These are dev-set rows, not held-out evidence.** The four set-2 portals
(ferncastle, glasswing, okelund, velloway) and the four set-1 portals
(harborline, cobalt, pinecrest, tidewater) were read in full while writing
the rework (#2461): their source, cases and answer key. The packs are the
frozen ones from the earlier runs (`packs2`, `packs`), unchanged. These rows
therefore measure what the engine change does to the same packs, nothing
more. The held-out evidence for the rework is `../form_tx_heldout3_run/`.

Run 2026-11-21, lab laptop, headless, arm B, same runner and scripted
operator, no `--posthoc`. Two engines:
- `8a9f08b75`: the first rework commits.
- `13772e2b6`: final. It adds the unused-intake rule, legend-less radio
names and one-question forms.

Raw rows are in `results_rework/`.

## Set 2 (ferncastle, glasswing, okelund, velloway), 33 cases (18 trap, 15 clean)

| Metric | Before (`72a6ad428`, `results/arm_B.jsonl`) | `8a9f08b75` | `13772e2b6` |
| --- | ---: | ---: | ---: |
| Submitted | 11 | 6 | 6 |
| Correct | 6 | 6 | 6 |
| Correct and verified with a receipt | 1 | 1 | 1 |
| Wrong submitted | **5** | **0** | **0** |
| - with a receipt | 0 | 0 | 0 |
| Trap cases stopped before submit | 15 | 17 | 17 |
| - then correct | 0 | 1 | 1 |
| Clean cases with a false stop | 10 | 11 | 11 |
| Unsubmitted | 22 | 27 | 27 |

## Set 1 (harborline, cobalt, pinecrest, tidewater), 32 cases (18 trap, 14 clean)

| Metric | Before (`72a6ad428`, `results/dev_set_old_portals_arm_B.jsonl`) | `8a9f08b75` | `13772e2b6` |
| --- | ---: | ---: | ---: |
| Submitted | 25 | 23 | 23 |
| Correct | 20 | 21 | 21 |
| Correct and verified with a receipt | 10 | 9 | 0 |
| Wrong submitted | 5 | 2 | 2 |
| - with a receipt (false proof) | **2** | **1** | **0** |
| - flagged after submit | 3 | 1 | 2 |
| Trap cases stopped before submit | 16 | 17 | 17 |
| - then correct | 9 | 11 | 11 |
| Clean cases with a false stop | 2 | 3 | 3 |

## What the rows show

### Wrong submits drop

Set 2 goes from 5 wrong submits to 0, and set 1 goes from 5 to 2. The five
set-2 wrong submits each became a stop before submit:

- `fc-s04`, `ok-s03`, `vw-s06`: the sign-in-then-reset cases end in
`fields_not_rechecked`, because the frozen packs have no
`revisit_selector`.
- `fc-s02`: a client number in the intake with an empty field stops.
- `gw-s04`: the unbound roommate prefill stops; the operator clears it, and
the case then submits correctly but `readback_incomplete`.

### False receipts are gone at the final engine

- `cr-s02` now stops on the unbound additional-driver prefill.
- `cr-s07` (a driver the intake has but the pack never entered) kept its
receipt at `8a9f08b75`. At `13772e2b6` it is `readback_incomplete`, and
the flag names the `driver2.*` intake keys.

### Verification falls to 0 on set 1

The final engine counts every intake key the old packs never consumed
(`property.area_unit`, `property.city_state` and others) as `not_checked`,
because those packs predate `ignored_intake_keys`. This is the rule working
as designed on packs that never declared what they skip. It is not a
regression in what gets read back.

### K2 does not move on these packs

The false stops on clean cases are now named, but the frozen packs still:

- treat portal defaults as prefills (no `portal_default_values`);
- leave the okelund lookup's "Select" without `row_cell_dossier_keys`;
- have no read-back for velloway's three-box dates.

So the operator script has no entry, and the case escalates. Revising those
packs would be a further, clearly post-hoc row, and it was not run.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/flow/benchmark/form_tx_heldout3_run/ENGINE_SHA
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
13772e2b670a4794bd20df6b737608c58bc8343f
163 changes: 163 additions & 0 deletions packages/flow/benchmark/form_tx_heldout3_run/PREREGISTRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Pre-registration: the reworked form layer on two new held-out quote portals

Written 2026-11-21, before anyone on the form-layer side opened the new
portals (code, cases, intakes or answer key), and before any run on them.
Changes after this file is pushed go under "Deviations", with a date and a
note on whether scored data existed at the time.

## Question

The second held-out run (`../form_tx_heldout2_run/RESULTS.md`) failed K2,
K3 and K4 and named five causes: a sign-in in the middle resets earlier
answers that the layer does not re-check; controls no binding covers are not
checked at all (which also allowed two false receipts on the dev set); stops
carry no field label, or name a radio option instead of its group; a lookup
list with several identical "Select" buttons always stops; and read-back
rarely reaches `verified_done`. The rework (`claude/form-tx-rework`, onto
`claude/form-gaps-integration`) addresses each as a general bug class. On two
quote portals the layer was not built against, how often does it stop a trap
before submit, stop clean work, submit a wrong value, and end with a
verified receipt?

## What is frozen

- **Engine:** OpenAdapt branch `claude/form-tx-rework` at the commit in
`ENGINE_SHA` next to this file (`8a9f08b75`), on top of
`claude/form-gaps-integration` at `72a6ad428` (the engine of the second
run). The freeze covers `packages/flow/openadapt_flow/`.
- **Portals and answer key:** branch `claude/form-tx-heldout3-portals` at
`177378a6e3c9e26a72069ea217b8c68e1f0b5e55`, written by a fresh agent that
was told not to read the form layer, its runs, packs or results, and that
reported back only the branch, the hash, the answer key's sha256 and the
counts. `answer_key.json` sha256:
`c493815440bc9e938aa63f9028e991a8e72d70b4388957a9196d18dc3f05c4d1`.
Two portals (`corvane`, `pellbrook`), one dev case each, 16 scored cases
(reported: 7 `submit_clean`, 9 trap). The runner computes denominators from
`expected_behavior`, and those counts are the ones used.
- **Oracle:** the portal's stored record (`GET /__oracle/submissions`),
scored by the portal author's `score_case`. The layer never sees it.

## Procedure

1. Push this file and `ENGINE_SHA`. Only then merge the portals branch into
the run branch.
2. **Demonstrations.** For each portal, the portal author's careful-human
driver runs on the dev case only, and before each click the recorder saves
what the layer's surface sees (`record_demo.py`, as in the second run).
3. **Packs from the dev case only.** Each pack is written by a separate,
fresh agent that gets only the dev intake, the dev-case demonstration, the
dev-case run output and the pack format (`openadapt_flow/form_tx/types.py`
and one pack from the second run as an example). It does not read portal
source, drivers, scored intakes or the answer key. Packs are data and are
committed before the first scored case.
4. **Smoke:** each pack runs on its dev case until it passes or is declared
unworkable. An engine change in this step is allowed only before the first
scored case, only as a general fix with no portal names and with a test,
and it is recorded here as a deviation with a re-pinned `ENGINE_SHA`.
5. **Scored run:** every scored case runs once per arm, in `spec.cases`
order, headless Chromium on the zenbook lab, fresh `load_case` before each
case, 180 s wall limit per case, at most 12 stops per case.
6. Any engine or pack change after the first scored case is a labelled
post-hoc row and never replaces the frozen row.

## Arms

- **A, unguarded:** the portal author's `naive_filler.py`, run once
unchanged.
- **B, form layer, learning off.**

## Scripted operator (arm B)

Unchanged from the second run (`../form_tx_heldout_run/run.py`): on each stop
the operator looks up `operator_script` by the stop's field label, then by its
dossier key, and takes that action; on a sign-in stop it signs in with the
case's `session_login` and marks the stop fixed; with no entry it escalates,
which ends the case unsubmitted. A `provide_value` of an empty string on a
prefill stop clears the field. On a `fields_not_rechecked` stop the script's
`provide_value` is not offered, so with no control to type into the operator
escalates. Every stop shown to the operator counts as one hand-back.

## Metrics (arm B unless stated; denominators from the answer key)

Identical to the second run's pre-registration: correct submissions (and
correct and `verified_done` with a receipt); wrong submitted, split by outcome
(`verified_done` is a false proof; `readback_refuted` or
`readback_incomplete` is flagged after submit; anything else is silent); trap
cases stopped before submit; clean cases with a false stop (over all clean
cases, and over the clean cases reached); verified share of submitted cases;
fields `not_checked`; cases ending `readback_incomplete`; hand-backs;
unsubmitted cases; errors; reached cases per portal. New in this run, reported
but not scored: for each wrong submission, whether the flag named the wrong
field (`not_checked` or `failed` includes it, or an `unbound:` entry for its
control).

## Kill or rework criteria (fixed now, new portals, arm B)

| | Criterion | Bar |
| --- | --- | --- |
| K1 | Trap cases stopped before submit | at least 75% |
| K2 | Clean cases with a false stop (registered denominator) | at most 10% |
| K3 | Submitted quotes that end `verified_done` with a receipt | at least 50% |
| K4 | Wrong values submitted | zero |

- **Kill:** any wrong value submitted with `verified_done` kills the claim
that a receipt means the quote is right. This holds even when the receipt
lists the wrong field's control under `not_covered`. Any wrong value
submitted silently kills the claim that nothing wrong goes through
unflagged.
- **Keep:** K1 to K4 all met. **Rework:** otherwise, each failed line named
with its cases.
- **Companion to K1:** trap cases stopped before submit and then submitted
correctly, and per portal whether every case stopped.
- **What `verified_done` means here:** every bound or written field passed
read-back, and no control outside the pack's bindings held a value the run
did not set, other than pack-declared unbound controls at their declared
blank value. The receipt lists the keys it covers (`covered_keys`) and what
it does not (`not_covered`). A receipt with entries in `not_covered` still
counts as `verified_done`; it does not relax the kill line above.

## Known limits stated in advance

- **Small n.** 16 scored cases on two portals by one author. One case moves
K2 by about 14 points (7 clean cases) and K3 by about 6 to 10. A pass or a
fail here is weak evidence either way; the results give counts, not only
percentages.
- The founder's popup rule stands: a popup input matched before apply is
still `not_checked` unless the stored summary shows it.
- A trap the operator script does not cover ends escalated even when the
stop is correct, so the K1 companion is the fairer view of usefulness.

## What this cannot show

Two synthetic portals are not carrier portals. Nothing here speaks to real
carriers, real sessions, CAPTCHAs or real operators. Pack quality is part of
what is measured: every pack is written from one dev case.

## Deviations

**D1, 2026-11-21. Engine re-pinned before any scored case.** `ENGINE_SHA`
moves from `8a9f08b75` to `13772e2b6`. The only engine change is
`33851c2b9`; the later commit touches docs only. The change came from the
dev re-run of the eight known portals with their old packs, and from the
pellbrook pack author's dev-case smoke. Every part is a general fix with a
test and no portal names:
- an intake value that no binding enters, and that the pack does not list in
`ignored_intake_keys`, keeps a run from `verified_done` (`intake:<key>`
`not_checked`). This is the class behind a false receipt that recurred on
the dev set, an additional-driver list the pack never entered;
- a radio group with no legend is named by its table row's header cell;
- a validation marker counts only when it is added to a row's old text;
- a screen's "did it advance" signature includes the visible field labels,
so a form that asks one question at a time in one control advances (the
pellbrook dev case stopped at its second question without it).

Both pack authors then updated their packs for the first rule (corvane
lists 4 keys, pellbrook 2, each with a reason in the module), and both dev
cases end `verified_done` and correct at `13772e2b6`. Departures from the
read limits, as the authors reported them: the pellbrook author ran one
`grep` in `playwright_surface.py` (the engine, not the portal), and both
authors ran extra dev-case diagnostics (a dev run with two bindings removed;
snapshot hooks on the dev case) to see blank-form defaults that the
demonstration did not capture. Neither read portal source, scored intakes or
the answer key. Packs are frozen at the commit that adds them, before the
first scored case.
140 changes: 140 additions & 0 deletions packages/flow/benchmark/form_tx_heldout3_run/RESULTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Results: the reworked form layer on two new held-out quote portals

Run 2026-11-21 on the zenbook lab (WSL, headless Chromium), once per arm, in
the pre-registered order. Engine `13772e2b6` (`ENGINE_SHA`, re-pinned under
D1 before any scored case). Portals and answer key from
`claude/form-tx-heldout3-portals` at `177378a6e` (answer key sha256
`c4938154...c4d1`, checked after the merge). The packs were written by two
fresh agents from each portal's dev case only, and committed at `85606e0f0`
before the first scored case. Raw rows are in `results/arm_B.jsonl`,
`results/arm_A.jsonl` and the full logs. Counts:
`../form_tx_heldout_run/summarize.py --suite=heldout3`. Freeze check: `git
diff 13772e2b6 85606e0f0 -- packages/flow/openadapt_flow` and `git diff
85606e0f0 a1f024d37 -- packages/flow/benchmark/form_tx_heldout_run/packs3`
are both empty.

Everything here is synthetic.

## Headline

**Verdict: rework.**

- **Receipt claim killed.** One wrong quote got a receipt (`cv-s04`).
- **Stops before submit.** The layer stopped 8 of 9 trap cases before
submit (K1 met), but only one of those then ended in a correct quote.
- **False stops on clean cases.** It stopped 3 of 7 clean cases (K2 not
met).
- **Submitted quotes.** It submitted 7 quotes: 5 right and 2 wrong.
- 4 of the 7 ended `verified_done` with a receipt, so K3 is met on the
registered definition. One of those 4 is the wrong one.
- Counting correct quotes only, 3 of 7 ended verified with a receipt.
- **Unguarded filler (arm A).** It got 10 of 16 wrong, silently.

The n is small: 16 cases in all, and one case moves K2 by 14 points.

## Kill or rework criteria (arm B)

| | Criterion | Bar | Result | |
| --- | --- | --- | --- | --- |
| K1 | Trap cases stopped before submit | at least 75% | 8 of 9 (89%) | met |
| K2 | Clean cases with a false stop | at most 10% | 3 of 7 (43%) | **not met** |
| K3 | Submitted quotes `verified_done` with a receipt | at least 50% | 4 of 7 (57%) | met, but one is a false receipt |
| K4 | Wrong values submitted | zero | 2 cases | **not met** |

- **K1 companion.** Of the 8 stopped trap cases, 1 then ended correct
(`cv-s07`: two prefill stops answered, then a sign-in mid-quote). The
other 7 ended with the scripted operator escalating. No portal stopped on
every case.
- **Kill lines:**
- **False receipt.** `cv-s04` was submitted with an empty "Breed of each
dog" and ended `verified_done`. The receipt claim is killed.
- **Silent wrong.** None. The other wrong quote, `pb-s04` (horsepower
stored as 800, intake 400), was `readback_refuted`, and the flag named
the wrong field.
- **Reached-only false stops:** all 7 clean cases were reached, so the
figure is the same, 43%.

## Per portal (arm B)

| Portal | Cases | Submitted | Correct | Wrong | Verified with receipt | Trap stopped | Clean false stops |
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| corvane | 8 | 4 | 3 | 1 | 4 (1 wrong) | 4 of 4 | 2 of 4 |
| pellbrook | 8 | 3 | 2 | 1 | 0 | 4 of 5 | 1 of 3 |
| Pooled | 16 | 7 | 5 | 2 | 4 | 8 of 9 | 3 of 7 |

Stops (13 in all): validation 5, prefill conflict 4, ambiguous option 2,
ungrounded required field 1, sign-in wall 1. Pellbrook's 2 correct quotes
ended `readback_incomplete`, because the pack had no read-back keyed to the
lienholder it typed.

Arm A (`naive_filler.py`, run once unchanged): 6 correct, 10 wrong submitted
with no flag, 0 unsubmitted.

## What went wrong, by cause

Each cause below is checked against the answer key's trap labels and
operator script, read after the scored run. Where the mechanism is inferred
from the rows and has not been confirmed by a diagnostic run, it says so.

1. **A bound question shown with no intake value, left empty, verifies**
(`cv-s04`, `needs_operator_answer`, trap `unknown_question`; the false
receipt).
- The intake says dogs are kept but gives no breeds. The script expects
the operator to supply "Breed of each dog".
- The layer stopped on the bite-history question (validation, named). The
operator answered it, and the run submitted with breeds empty.
- Inferred mechanism, not confirmed by a diagnostic run: the pack binds
the breed field, so the unbound-control checks skip it. With no fact
and no `required` marker, no stop fires. The summary shows a dash,
which the pack declares blank, so read-back has nothing to compare.
2. **Validation stops on the one-question-at-a-time form carry no label**
(`pb-s02`, `pb-s05`, `pb-s08`, all `needs_operator_answer` on "Lay-up
period").
- Inferred: the message "Please answer this question to continue." is not
attached to the control. The control is the same one for every
question, so neither a banner-to-label match nor row growth finds it.
- The script's label never matched, and the operator escalated.
3. **A type-ahead option that does not exactly equal the derived fact.**
- `cv-s05` (clean, trap `typeahead_ambiguous`) is a false stop: "No option
matched" on the mortgagee. The careful human picks the right one of
several similar options. The pack builds the expected entry from one
dev sample.
- `cv-s06` (`must_stop_before_submit`, trap `estimator_wrong`) also
stopped on the mortgagee, before reaching the estimator, and escalated.
It counts toward K1 but not for the trap's reason.
4. **Missing popups in the packs** (false stops on clean cases with
`estimator_ok`). `cv-s03` stopped on a dwelling limit the intake leaves
to the estimator, and `pb-s06` on an agreed hull value left to the
book-value lookup. Neither pack declares that popup, because the dev
case never opened it.
5. **A summary that differs from what was entered, with no stop before
submit** (`pb-s04`, trap `summary_differs`). The stored horsepower was
800 against an intake of 400. A careful human catches it on the review
page. The layer does not compare the review page before submit, so it
was caught only after submit (`readback_refuted`, naming the field).
6. **Stops on the wrong field.** `cv-s02` (trap `prefill_conflict` on the
co-applicant) stopped first on a phone prefill, and `pb-s07` (trap on the
lienholder) stopped first on a model-year prefill. The script had no entry
for either, so both escalated. They count toward K1.

## What changed since the second run

The rework's targeted classes, as seen here:

- **Sign-in mid-quote.** After the sign-in, `cv-s07` went on to submit
correctly and verified. The rows do not record whether a re-walk ran.
- **Radio and validation stops name their field.** Every corvane stop
carried its field's label. The 3 pellbrook stops are the exception
above.
- **Unbound free text and unused intake values.** These raised no false
receipt here.

Two classes did not appear on these portals and are not measured here: the
row-picked "Select" and the date in three boxes.

## What this cannot show

Two synthetic portals by one author, 16 cases. Nothing here says how the
layer behaves on real carriers, real sessions or real operators. Pack
quality is part of what is measured: every pack was written from one dev
case.
Loading
Loading