Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/flow/openadapt_flow/validation/identity_ladder.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ class ProbeFaithfulVLM:
same-value pairs -> "same". Under the VETO-ONLY contract a "same" answer no
longer grants a pass (verify_vlm_identity folds it to abstain)."""

# In process, like the MLXIdentityVLM it stands in for: it sends nothing
# off the box. Unmarked, the Replayer refuses it without the egress opt-in
# (#2497), and the opt-in would not help here: outside ``run`` no egress
# ledger is bound, so every call would be refused as "different" and the
# stub's answers would never reach the identity ladder.
MAY_EGRESS = False

def __init__(self, is_same: bool) -> None:
self._is_same = is_same

Expand Down
51 changes: 42 additions & 9 deletions packages/flow/tests/test_choice_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,15 +1044,41 @@ def prepare(page: Any) -> None:
def test_recovered_readback_must_restart_its_stability_window(
server: Server, browser: Any, kind: str
) -> None:
from openadapt_flow.backends import choice

# The committed value drifts to WRONG, then recovers to CARD. WRONG holds
# until a read of the field has seen it: a fixed WRONG window can fall
# between two readback polls on a loaded machine, and then the backend
# never sees the drift at all and the test proves nothing. The page
# stamps when CARD came back, so the wait below is measured from the
# recovery on one clock, against the backend's own stable interval.
def prepare(page: Any) -> None:
page.evaluate(
"""kind => {
const field = document.querySelector('[name=department]');
const own = Object.getOwnPropertyDescriptor(
Object.getPrototypeOf(field), 'value');
let drifted = null;
window.sawWrong = false;
window.recoveredAt = null;
Object.defineProperty(field, 'value', {
configurable: true,
get() {
const value = own.get.call(this);
if (value === 'WRONG' && !window.sawWrong) {
window.sawWrong = true;
setTimeout(() => {
drifted.value = 'CARD';
window.recoveredAt = performance.now();
}, 60);
}
return value;
},
set(value) { own.set.call(this, value); },
});
const drift = () => {
window.commitAt = performance.now();
const target = kind === 'native' ? field.selectedOptions[0] : field;
setTimeout(() => target.value = 'WRONG', 60);
setTimeout(() => target.value = 'CARD', 180);
drifted = kind === 'native' ? field.selectedOptions[0] : field;
setTimeout(() => drifted.value = 'WRONG', 60);
};
if (kind === 'native') field.addEventListener('change', drift);
else document.addEventListener('mousedown', event => {
Expand All @@ -1062,21 +1088,28 @@ def prepare(page: Any) -> None:
kind,
)

elapsed: list[float] = []
seen: list[Any] = []
outcome, value, confirmed = _choose(
server,
browser,
kind,
"Cardiology",
prepare=prepare,
check=lambda page: elapsed.append(page.evaluate("performance.now()-commitAt")),
check=lambda page: seen.append(
page.evaluate(
"({sawWrong: window.sawWrong, since: window.recoveredAt === null"
" ? null : performance.now() - window.recoveredAt})"
)
),
)
assert isinstance(outcome, dict), outcome
assert value == "CARD"
assert confirmed
# _choose includes its existing300ms final confirm delay; the choice
# itself must wait beyond the recovered state's full stable interval.
assert elapsed[0] >= 800
assert seen[0]["sawWrong"], "the backend never read the drifted value"
# The choice returns no sooner than the stable interval after the first
# read of the recovered state, and _choose then waits 300 ms to confirm.
assert seen[0]["since"] is not None
assert seen[0]["since"] >= choice._STABLE_S * 1000 + 300


@pytest.mark.parametrize("prior", [None, False, True])
Expand Down
7 changes: 4 additions & 3 deletions packages/types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

0.24.1 was stamped on main but never published. 0.24.2 is the first
published release with this content, and the version to install. Its first
main push runs failed on unrelated Flow jobs that #2423 broke, which
[#2589](https://github.com/OpenAdaptAI/OpenAdapt/pull/2589) and
[#2600](https://github.com/OpenAdaptAI/OpenAdapt/pull/2600) fixed, so it
main push runs failed on unrelated Flow jobs, which
[#2589](https://github.com/OpenAdaptAI/OpenAdapt/pull/2589),
[#2600](https://github.com/OpenAdaptAI/OpenAdapt/pull/2600) and
[#2616](https://github.com/OpenAdaptAI/OpenAdapt/pull/2616) fixed, so it
publishes from the run after those fixes.

openadapt-flow 3.4.0 imports `openadapt_types.receipt`, which 0.24.0 does not
Expand Down
7 changes: 4 additions & 3 deletions packages/verify/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

## v0.2.1 (2026-11-23)

Published after [#2589](https://github.com/OpenAdaptAI/OpenAdapt/pull/2589)
and [#2600](https://github.com/OpenAdaptAI/OpenAdapt/pull/2600): its first
main push runs failed on unrelated Flow jobs.
Published after [#2589](https://github.com/OpenAdaptAI/OpenAdapt/pull/2589),
[#2600](https://github.com/OpenAdaptAI/OpenAdapt/pull/2600) and
[#2616](https://github.com/OpenAdaptAI/OpenAdapt/pull/2616): its first main
push runs failed on unrelated Flow jobs.

- Accept openadapt-flow 4: the openadapt-flow requirement and the `openai`,
`claude` and `mcp` extras now allow `<5` (was `<4`), so openadapt-verify
Expand Down
Loading