Skip to content

fix(flow): green main after #2594 and re-trigger the types and verify publish - #2616

Merged
abrichr merged 2 commits into
mainfrom
claude/fix-main-red-after-2594
Nov 24, 2026
Merged

abrichr merged 2 commits into
mainfrom
claude/fix-main-red-after-2594

Conversation

@abrichr

@abrichr abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member

Main went red on the Packages push run for #2594 (run 45317984630, 3c9f389). That blocks the openadapt-types 0.24.2 and openadapt-verify 0.2.1 publish. This PR covers each of the four failures.

Failures and fixes

  1. flow core unit (1/2): test_identity_ladder.py::test_harness_zero_false_accept_bounded_configs raised EgressNotPermitted for identity_vlm.

    • Cause: fix(flow): fail closed on remote model calls, egress counting and transport #2497 made a model component without a MAY_EGRESS marker count as egress. The harness stub ProbeFaithfulVLM (in openadapt_flow/validation/identity_ladder.py) had no marker.
    • Fix: the stub runs in process, like the MLXIdentityVLM it stands in for, so it now carries MAY_EGRESS = False. The runtime guard is unchanged.
    • Why not allow_model_grounding=True: the harness drives the Replayer outside run, where no egress ledger is bound. With the opt-in, the wrapper's admit() refuses every call and answers "different", so the stub's answers would never reach the identity ladder. The test would pass without testing the VLM path. With the marker, an instrumented run of the bounded harness calls the stub 20 times.
  2. flow core unit (2/2) and flow default at rest (2/2): test_verdict_folds_check.py::test_main_is_within_the_baseline. No change in this PR.

    • The test already passes on current main: chore(flow): sync verdict_folds_baseline.json after concurrent merges (#2457, #2407, #2476) #2603 raised verdict_folds_baseline.json for the files the failure lists (runtime/effects/row_versions.py from feat(flow): row versions held from the baseline count who saved the target #2457, replay/effects.py, verify_run.py, tx/induce.py, wrap/cli.py).
    • So main went green on this check by a baseline raise, not by removing the folds.
    • The new says_success folds are in row_versions.py:
      • judge_row_versions starts from VersionVerdict("held") (line 407) and overrides it. That is a real hand-written fold.
      • baseline_detail returns {"held": ...} (line 487). That is a checker false positive: the key says whether a baseline read was kept open, not that a check held.
    • Moving judge_row_versions onto verdict.settle is safety code that these tests cannot validate, so it is left for a follow-up.
  3. flow default at rest (2/2): test_choice_backend.py::test_recovered_readback_must_restart_its_stability_window[aria_listbox] failed 786.8 >= 800. It is a real wall-clock flake.

    • The page held WRONG for a fixed 120 ms (60 to 180 ms after the commit).
    • The readback loop sleeps _POLL_S (100 ms) between reads, and an aria read makes three page evaluations. Under load one poll interval is longer than 120 ms, so the backend never read WRONG. It then saw CARD as stable from its first read and returned about 350 ms later. 786.8 ms is that path; any run that saw WRONG takes at least 180 + 350 + 300 = 830 ms.
    • Fix: WRONG now holds until a read of the field sees it, then CARD comes back 60 ms later and the page records when. The test asserts that the backend read WRONG, and that the time since the recovery is at least choice._STABLE_S * 1000 + 300 (the 300 ms is _choose's confirm delay). There is no literal threshold and no change to _POLL_S.
    • Note: the backend cannot see a transient state that is shorter than one poll interval. That is how polling works, not a regression.
  4. capture (windows, py3.12) is an infrastructure failure. choco install ffmpeg could not reach https://community.chocolatey.org/api/v2/, so no tests ran. It is not caused by the 3.11 floor or by pillow 13, and there is no code fix.

  5. Publish trigger. The late-publish notes in packages/types/CHANGELOG.md and packages/verify/CHANGELOG.md now also cite this PR. That makes this PR's commit the newest one that changed each package. No version changes.

Tests run

These ran single process (-p no:xdist) on Python 3.12, with PYTHONPATH set to packages/flow and packages/types:

  • tests/test_choice_backend.py::test_recovered_readback_must_restart_its_stability_window (native and aria_listbox)
  • tests/test_identity_ladder.py::test_harness_zero_false_accept_bounded_configs
  • tests/test_verdict_folds_check.py::test_main_is_within_the_baseline
  • scripts/check_verdict_folds.py

All four tests passed, and the folds check reported OK. ruff check and ruff format --check pass on the changed files.

…e drift test deterministic

The identity-ladder harness stub is in process, like the MLXIdentityVLM it
stands in for. Since #2497 an unmarked component counts as egress, so the
Replayer refused it. It now carries MAY_EGRESS = False. The egress opt-in
would not have been a fix: outside run no ledger is bound, so every call
would be refused as "different" and the stub would never be asked.

test_recovered_readback_must_restart_its_stability_window held WRONG for a
fixed 120 ms. Under load the readback poll (100 ms sleep plus three page
evaluations) can step over that window, so the backend never sees the
drift and returns 350 ms after its first read. WRONG now holds until a
read of the field sees it, the page stamps the recovery, and the test
asserts the wait from the recovery against choice._STABLE_S plus the
300 ms confirm delay.
@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

From: Claude
Reviewed-Head: 59772d7

@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: 59772d7

The two code changes fix real main failures without weakening a gate. The new test still catches the regression it exists for, and it held under CPU load.

What I checked

  1. ProbeFaithfulVLM.MAY_EGRESS = False (validation/identity_ladder.py). The stub is a pure in-process function: same_or_different returns a constant, with no I/O or network. Only the validation harness uses it (identity_ladder.py:515-560). The marker is accurate, and the runtime egress guard (runtime/grounder.py, seal_batch.py) is unchanged. At the merge base bb0eb99e, tests/test_identity_ladder.py::test_harness_zero_false_accept_bounded_configs fails. At this head it passes.
  2. test_recovered_readback_must_restart_its_stability_window. WRONG now holds until a read has seen it, and the timing is measured from the page's own recovery stamp against choice._STABLE_S (0.35 s) + 300 ms, so the assertion no longer depends on poll luck.
    • Mutation test: I made _await_readback stop resetting stable_since on a non-ok read, which is the bug this test guards. Both parametrizations then fail (505.5 >= 650). With the change reverted, they pass.
    • Stress: 9 consecutive runs of both parametrizations passed with 5 busy-loop CPU hogs running.
    • The new sawWrong assertion also closes the old blind spot, where the backend could skip the drift entirely and the test would still pass.
  3. CHANGELOGs: they only add this PR to the publish notes. No version changes.

Tests I ran at this exact head (Linux, Python 3.12, worktree of the PR head)

  • tests/test_identity_ladder.py + tests/test_verdict_folds_check.py: 68 passed, 1 skipped. At the base: 1 failed (the ladder harness), 67 passed, 1 skipped.
  • tests/test_choice_backend.py, full: 104 passed, 1 skipped.
  • ruff check / ruff format --check on the changed Python files: pass. check_engine_generality.py: OK. check_verdict_folds.py: OK.

Generality gate

Pass. There are no app, site or workflow names. The test uses the existing synthetic choice fixture, and the egress marker is a generic component-classification change.

CI at this head

Every check was still pending when I checked: gitleaks, dependency-review, validate-platform-manifest, and the native and Windows replay jobs. The package jobs haven't reported yet. Merge only after the required contexts are green. The capture (windows) Chocolatey/ffmpeg failure is infrastructure and this PR doesn't change it, so it may need a rerun.

Release decision still required

Per the PR description, the openadapt-types 0.24.2 and openadapt-verify 0.2.1 publishes run from this PR's merge run. Whoever merges is triggering those releases. I didn't merge, rerun or push anything.

Limits

I didn't run the full Flow suite or the Windows, native or RDP jobs locally. I relied on CI for those. I ran the stress check on one Linux box only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant