fix(resolver): refuse ambiguous OCR targets#226
Conversation
|
Patched the protected e2e-browser regression at exact head Root cause: the first safety pass flattened all repeated OCR labels into an immediate refusal and treated stale fixed-offset landmarks as a veto, which over-halted four valid drift runs. The repair enumerates candidates and selects only when independent retained evidence uniquely establishes one (recorded target region and/or landmark relations). It never selects by OCR order or fuzzy-score arg-max. A sole target label survives legitimate layout reflow. Conflicting observed candidates and unresolved repeats remain typed terminal halts. Also incorporated the cross-run MoveDrift evidence: incompatible geometry estimates are never averaged. A unique in-recorded-region estimate can win; otherwise only a unique coherent cluster can win, with tied/unresolved conflicts halting. Local evidence on this head:
PR remains draft and unmerged while protected CI runs. |
a689272 to
429824f
Compare
|
Independent follow-up review incorporated at
Focused rerun: 138 passed; new geometry subset 12 passed; Ruff, formatting, strict mypy, and artifact replay check passed. CI restarted on this exact head. |
429824f to
6d0151d
Compare
|
Stale merge base corrected at exact head Verified:
PR remains draft and unmerged. Protected CI restarted on this exact head. |
|
Cross-PR integration evidence for the current exact heads:
The combined tree passed the focused headless browser suite: 18 passed in 187.84s (three baseline replays, MoveDrift plus healed replay, and all cosmetic-drift tests). The formerly failing moved-textarea path resolved Recommended order: land #226 after its own required CI is green, then rebase #227 and rerun its required/full macOS CI before landing #227. |
What changed
Why
PR #167 is a historical adversarial battery explicitly marked DO NOT MERGE. Its useful unresolved class is repeated OCR labels on pixel-only surfaces. This replacement turns that class into a permanent fail-closed implementation and deterministic regression suite rather than merging historical
xfailevidence.The initial local-first patch represented both “not found” and “multiple candidates” as
None. That allowed ambiguity to fall through to weaker geometry or grounding. The final patch adds a typed ambiguity signal consumed by the resolver, so only a true miss may continue down the ladder.Validation
230 passed, 3 deselectedacross resolver, OCR, replay, healing, backend-factory, and structural-unit suites (the deselected tests launch Playwright locally; protected CI runs them)openimis,AGPL, private corpus, identity ROC, or real-EMR payloads240924ff7c2027afd7cbcaa93282072545764844ef01102f6d31e1cc43bbcc02e14b141de46cda49afb8fe6c3168fa228070b6dc105018a9057b3b4623ee2205Disposition
After this PR passes protected CI and independent review, merge this replacement. Then close #167 unmerged with a pointer here; retain its branch/history as the original design record.