Repository navigation
fix(flow): bind API step fields by which step typed them, not by equal values - #1368
Merged
Merged
Conversation
…l values Review of #1269: api_proposal bound a field to a parameter when the posted value equalled the demonstration value and skipped empty values. A blank demonstration note became form_default="", so a later run's "New note" was silently dropped; equal demonstration values made the binding ambiguous. Fields are now bound by provenance: a TYPE step types into the field the click before it targeted (the compiled anchor, else the recorded event's structural target), matched to a form control by id, name selector or name. The proposal refuses a field that carries a parameter's value although no step typed it there, a typed field sent with another value, a typed field the save doesn't send, a typing step whose field isn't a form control, and a field typed twice with different values. The form parser keeps control ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 19, 2026
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.
Second of six fixes from an external review of #1269 (the API step). Independent of the other review fixes; targets
main.Bug
api_proposalbound a posted field to a parameter when the posted value equalled the demonstration value, and skipped empty values. Two failures followed:notebecameform_default="", so a later run's "New note" was silently dropped.Fix
Fields are bound by provenance: a TYPE step types into the field the click before it targeted. The target comes from the compiled anchor, or failing that from the recorded event's structural target. It is matched to a form control by id (
#id), by[name=...]selector, or by name; the form parser now keeps control ids.The proposal refuses, and names the reason, when:
API_TIER.md's binding table and refusal list are updated.Tests
tests/test_api_proposal_provenance.py(new, 7 tests):form_noteas a parameter, and a later run's "New note" is in the body;All 7 fail on
main. The existing proposal tests now give the recorded clicks their targets, as a real recording does. 41 pass.Checked on the real OpenEMR referral recording: the API step is still proposed, with the same 12 fields bound by provenance.
Synthetic values only.
🤖 Generated with Claude Code