Repository navigation
fix(jit): lift a retyped input from the saved record; distill drops a corrected save - #1336
Merged
Merged
Conversation
… corrected save
An agent that types a run input into the wrong field, gets a validation
error, and types it into the right field left the input unlifted ("typed in
2 steps") and the detour in the program (#1328).
- lift_params: an input typed whole in more than one step is lifted at the
step whose field the mined record check holds it in. The other steps are
listed in also_typed_in. No record check, no holding field, or several
holding fields: not lifted, and the reason names the steps.
- distill: a save the app refused (write-labelled click, record unchanged,
same page), pressed again after a correction, is dropped (save_retried).
A literal typed before the refused save and retyped into another field is
dropped with its focus click and Enter (entry_corrected), only when the
saved record holds the value under the second field's name and has no
field named like the first.
On the scoreboard's recorded OpenEMR run this drops steps 9-11 (Gender
Identity) and 31 (the refused Create) and lifts sex at Birth Sex.
Closes #1328
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 19, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1328.
Problem
In the scoreboard's OpenEMR run (arm 2,
2026-10-18-a) the agent typedFemaleinto Gender Identity, pressed Create New Patient, got "Birth Sex is not valid", typedFemaleinto Birth Sex and pressed Create again.lift_paramsgave up onsex("typed in 2 steps"), so admission failed at--accept-params. Distill kept all 39 steps, so the program would also write Gender Identity and press Create once for nothing (that click also left a placeholder effect, which admission refuses).Change
Lift (
jit/lift.py). An input typed whole in more than one step is lifted at the step whose field the mined record check holds it in. Field names are compared whole after dropping a leading#andform_, soform_sexmatches the record fieldsexandform_sex_identifieddoes not. The proposal lists the other steps inalso_typed_in; they still type the demonstrated text. It fails closed and names the steps when:Distill (
compiler/distill.py). There's a new correction rule. It needs the system-of-record snapshots.save_retried: a click on a write-labelled control with no record change and the same URL, title and page count, when the same control is pressed again later, nothing was written before then, and something was typed in between.entry_corrected: inside such a correction, a literal typed before the refused save and retyped into a different field between the two saves is dropped, with its focus click and the Enter after it. This happens only when the record the run saved holds the value under the second field's name and has no field named like the first. Otherwise both entries stay.Evidence
On the recorded OpenEMR run (from #1303, replayed offline, no model calls):
entry_correctedand 31 (the refused Create) assave_retried.sex→step_034(form_sex),also_typed_in: [step_010].launch-4: nothing dropped.Tests
Synthetic fixtures shaped like the OpenEMR evidence:
tests/test_distill.py: the correction, plus each condition that keeps both entries: the record has the first field, the record lacks the value, no refused save, the refused save wrote, nothing typed between the saves, no snapshots, and a parameter in the first field.tests/test_jit.py: lift binding, the four fail-closed reasons, and a placeholder ignored.pytest tests/test_jit.py tests/test_distill.py: 73 passed.test_authoring.py -k distillpassed. I didn't run the full suite because of host load.No new command, so CAPABILITIES.md doesn't change.
docs/JIT.md(Pruning, Parameters) is updated.🤖 Generated with Claude Code