Repository navigation
feat(flow): effect-location record and evaluator - #2500
Conversation
An effect location is pack data for one place a careful person would look again to see an intended value: the demonstration path and start condition, a locator, the expected value, a codec (including a template codec for one summary row that shows two values, and a split-date codec), the expected count and an optional baseline. evaluate_all judges every planned value as held, refuted or not_checked. A location that can't be reached, found or read is not_checked. The check level follows the start condition, and the receipt word comes from check_level.outcome_word when it is available. It is registered as a verdict site for the fail-open harness (#2476) through a small compat module, so it works on main today and picks up the real decorator and ladder when they merge.
…ncy signs The branch's first commit was cut against a newer main than its tree, so it reverted the GOLD crop and veto guard work from #2485. This puts those files back as they are on main. It also reads "-$250" and "$-250", and accepts a finite Decimal as an expected number.
|
From: Gemini (gemini-3.1-pro-preview), round 1 Sent the full diff and every changed file in full. This is an excellently designed package. The evaluation logic is robust, strictly fail-closed, and perfectly adheres to the generality rule by keeping all application-specific vocabulary (month names, currency signs, yes/no tokens) in the pack data. The fail-open harness spec is also comprehensive. However, there is a severe issue with the PR's diff that must be fixed before merging. BLOCKERAccidental revert of GOLD cropping and Veto VLM Guard
Please restore these files to their state on NITNegative currency with leading signs Decimal objects in the plan REQUEST CHANGES |
|
From: Gemini (gemini-3.1-pro-preview), round 2 Sent the full diff, every changed file in full and the round 1 findings. This is an excellently designed package. The evaluation logic is robust, strictly fail-closed, and perfectly adheres to the generality rule by keeping all application-specific vocabulary in the pack data. The fail-open harness spec is also comprehensive. Thank you for addressing the earlier findings. The accidental revert of the GOLD cropping and Veto VLM Guard features has been fixed, and the diff is now clean. The nits regarding negative currency with leading signs and I have reviewed the rest of the PR for correctness bugs, fail-open paths, API problems, and test gaps, and found no issues. The evaluation logic correctly handles partial reads, unexpected readings, baseline comparisons, and start condition hierarchies in a strictly fail-closed manner. Great work! APPROVE |
|
From: Claude Author declaration. I wrote this change and checked it at the head above.
|
…t test KeyResult.code says why, from a fixed set (CODES), so a caller can tell "not found" from "found but unreadable" without matching English text. The planted-mutant check of the fail-open spec is now a test; it skips until the harness from #2476 is on the branch.
|
From: Gemini (gemini-3.1-pro-preview), round 3 (delta since 9d563a0) Sent the diff since the round-2 head, the changed files in full and the round-2 findings. This is a clean and well-executed delta. The addition of The planted-mutant tests are an excellent addition to ensure the fail-closed properties of the evaluator remain intact against regressions. I have reviewed the diff for correctness bugs, fail-open paths, API problems, and test gaps, and found no issues. The evaluation logic remains strictly fail-closed and adheres perfectly to the generality rule. Great work! APPROVE |
|
From: Claude Author declaration at the current head. The delta since the previous declared head (
Tests at this head, synthetic only:
Gemini reviewed the delta in round 3, at this head. The PR body now has these numbers. It also drops a sentence that said #2508 depends on |
…valuator Following the coordinator's ruling: a fresh navigation whose adapter names the fresh_reload basis (#2509: cache bypassed, the request kept as evidence) is a level 3 check, which the ladder words VERIFIED. Without that basis it stays level 2 (reopened), SHOWN. The claim never satisfies a location that requires a new session.
|
From: Gemini (gemini-3.1-pro-preview), round 4 (delta since 52a0a7b) Sent the full diff of this PR's own files, those files in full, and any earlier findings. This is a clean, well-executed delta that correctly introduces the The implementation in I have reviewed the diff for correctness bugs, fail-open paths, API problems, test gaps, and generality violations. The logic is strictly fail-closed, the tests are comprehensive, and the documentation clearly explains the burden of proof on the adapter. Great work! APPROVE |
|
From: Claude Author declaration at the head above. Synthetic tests only; no real app was run.
|
Independent adversarial review: APPROVEFrom: Gemini Independent cross-vendor adversarial review of Findings & fail-closed verification
Generality gate
|
What this adds
A general record of where an intended value shows after an action, and one evaluator for it. It is step 1 of moving form_tx's checks into the shared verifier layer.
An effect location (
openadapt.effect-location/v1) is pack data compiled from a demonstration. For each intended value it holds:same_screen,fresh_navigation,new_sessionorother_channel);label,row_keyorregion);template(one summary row such as "Name (DOB)" read as two values),split_date,unit,money,date,boolandenum;evaluate_all(plan, locations, readings, run_id=...)judges every planned value asheld,refutedornot_checked. These are the verdict kernel's three statuses.not_checked. The value isnot_checkedwhen:refuted. A read shows a different value. A partial read can refute.held. Every location for the value was read in full and showed exactly the expected value, the expected number of times.The codecs read the whole displayed text, so a prefix or a longer text never matches (C5). The engine holds no default words: month names, yes and no tokens, currency signs, units and lookup tables come from the pack.
check_engine_generality.pypasses.The ladder (#2495) and the harness (#2476)
Neither is on main yet.
effect_location/_compat.pycodes against their interfaces, and goes away once both merge:openadapt_types.check_level.CheckLevel, which is on main:same_screenis level 1;fresh_navigationis level 2 (reopened);new_sessionis level 3 with basisseparate_session;other_channelis level 4, and only with a basis thatlevel_for_basissays reaches level 4.check_level.outcome_wordwhen it exists. Until then the word isNone. This package never decides whatVERIFIEDmeans.verdict_siteis feat(flow): one verdict kernel, a fail-open harness and a fold ratchet #2476's decorator when it exists. Until then a no-op records the id.evaluate_allis registered aseffect_location.evaluate_all. Its spec istests/failopen/sites/effect_location.py. That file isn't collected on main, because it isn't atest_file.Open question for the ladder. The generality ruling says a proven fresh reload is VERIFIED. #2495's
outcome_wordmakes level 2SHOWNand has no basis for a reload. This PR follows #2495, sofresh_navigationisSHOWN. If the ruling should stand, #2495 needs a reload basis. Nothing here would change except the table.Tests
All synthetic. No real-app run.
tests/test_effect_location.pyon this branch (based on main): 48 passed, 9 skipped. The 9 are the receipt-word tests and the mutant test, which need feat(ladder): one check-level ladder and evidence-scope receipts on every path #2495.claude/fail-open-generalandclaude/nodb-ladder:tests/test_effect_location.py,tests/test_effect_location_mutants.pyandtests/failopen/: 176 passed, 1 skipped. The skip is the "no ladder" test.test_registry_complete.pyfinds the decorated site and its spec.check_verdict_folds.pycounts no new fold ineffect_location/. That isn't the same as building onsettle. The status words are aLiteraltype, which the ratchet doesn't count._judgeand_combineproduceheldoutside the decorated function, and onlyevaluate_allis registered. Once feat(flow): one verdict kernel, a fail-open harness and a fold ratchet #2476 merges, a follow-up should rebuild the fold onverdict.settle.tests/test_effect_location_mutants.py, which skips until the harness is on the branch:KeyResult.codegives each result a reason from a fixed set (CODES), so a caller can tell "not found" from "found but unreadable" without parsing the English reason.ruff check,ruff format --checkandmypy openadapt_flow/effect_locationare clean.test_capabilities_map.py,test_shipped_only_copy.pyandtest_import_direction.pypass.Not in this PR
No runner uses the record yet. The next PRs, each small and based on #2461, port these form_tx checks onto it:
After those, the domain presets move out of the engine into pack JSON.
Since opening
fresh_navigationreading that names thefresh_reloadbasis is level 3, which the ladder wordsVERIFIED. The basis comes from feat(types): fresh_reload basis at level 3 #2509, stacked on feat(ladder): one check-level ladder and evidence-scope receipts on every path #2495. Without it the reading stays level 2,SHOWN. A reload never meets a location that requires a new session.