Repository navigation
fix(transducer): confirm saved values where they reappear, bound to the pinned record - #2867
Conversation
…he pinned record wrap verified a save only when every compiled value showed on one screen as non-editable text that its label vocabulary accepts. Real apps spread a record over screens, cut long values in summary views, and show the full saved value only when the record is reopened in its form. Labels such as From:, To: and DOB: never matched. On the OpenEMR prior-authorization dev split, every correct save the wrapped agent made ended unverified. wrap now remembers which field each typed value went into before a commit. After the commit, a write is confirmed on a screen whose saved text shows every pinned identity value, when either its full value appears verbatim in that saved text (six characters or more), or the same field shows the same value in a form the read-back provider marks reopened (loaded again after the save, untouched) and the agent has not typed into it since. At done, an obligation still missing from the current screen is met by a confirmed write that contains it as a whole token, or by a pinned identity value seen on a saved screen. Without pinned identity nothing changes.
Independent adversarial review: REQUEST CHANGESFrom: Grok A write can be confirmed, and the run can be stamped What holdsThe reopened-field path compares the field value exactly, and Blocker: verbatim confirmation is an unanchored substring, and it outranks a failed field match
I ran the PR's own
Please confirm a verbatim write only as a whole token (the same boundary GeneralityThe new confirmation logic is field-key and pinned-identity based, not application-specific. No application name was added to engine code. I did not run the Flow generality script because these files are outside CI and releaseCI at this head is otherwise green; |
…r over a disagreeing reopened field Review (Grok) found that verbatim confirmation used an unanchored substring: a typed "CPT 29881; units 1" was confirmed by a screen showing "CPT 29881; units 12", and the run went VERIFIED. It also fell through to page text when the reopened form showed the field with a different value. A write now confirms from saved text only as a whole token (the boundary the obligation check already uses), and a reopened field that is on screen decides alone: a different value there is never overruled by page text elsewhere. Regression: the screen shows units 12 where units 1 was typed, on a summary and on a reopened form; the run ends unverified.
|
Response to the Grok review at f8e4065. Fixed at ca4b84a. Blocker: verbatim confirmation was an unanchored substring, and it outranked a failed field match. Both parts are fixed.
Regression: The fix is merged up into #2871, #2872 and #2873. Re-review requested at ca4b84a. |
Independent adversarial review: APPROVEFrom: Grok I re-reviewed this exact head (R2 after my REQUEST CHANGES at Previous blockers at this head
Tests I ran at this exact head
Generality: no per-app engine code. The rule is token-boundary and field-key generic. Fixtures are synthetic. CI at this headSmoke, packages, and launcher are green except No release decision from me. |
Problem
openadapt.wrapverified a save only when every compiled value showed on one screen, as non-editable text, under a label its vocabulary accepts. Real apps break that in three ways:Labels such as
From:,To:andDOB:also never matched the date vocabulary. On a prior-authorization benchmark on a real EMR (OpenEMR 8.0.0.3, synthetic patients), every correct save the wrapped agent made ended unverified: 6 of 6 dev episodes that a screen-only judge scored correct.HOLD_DONEkept sending the agent back to look until it ran out of steps.Change
wrap now remembers which field each typed or selected value went into before a commit. After the commit, a write is confirmed on a screen whose saved text shows every pinned identity value, in one of two ways:
reopened(loaded again after the save, untouched), and the agent has not typed into that field since the save.At done, an obligation that is still missing from the current screen is met by a confirmed write that contains it as a whole token (
units 1is not met byunits 12), or by a pinned identity value already seen on a saved screen. With nopinnedidentity, nothing changes.Evidence
units 12forunits 1, and a refused save all end unverified.Limits