Repository navigation
Description
Summary
In the actual-default-model behavior portfolio, the contrast selected_work_vs_required_vision_replan fails source-relation validation. The left scenario (turn_selected_todo) allows delivery, while the right scenario (turn_required_vision_replan) blocks delivery because of a peer-owned P0 Todo. The contrast spec requires delivery_allowed to match, so the portfolio raises before any scenario result is produced.
This is a product-side contract question, not a test-only fixture problem. The test fixtures can be fixed independently, but the 23 affected tests cannot pass until one of the decisions below is made.
Error
ValueError: contrast selected_work_vs_required_vision_replan source relation is invalid: expected_match:delivery_allowed
Raised from _validate_contrast_source_contracts in loopx/control_plane/testing/actual_default_model_behavior_portfolio.py at approximately line 1154. The check itself starts at approximately line 1129.
Observed values
| Side | Scenario | delivery_allowed |
selected_todo_id |
|---|---|---|---|
| Left | turn_selected_todo |
true |
todo_portfolio001 |
| Right | turn_required_vision_replan |
false |
null |
The right-side source is built by _required_vision_replan_source in loopx/control_plane/testing/control_plane_composition_scenarios.py. It is a synthetic quota payload whose peer-owned P0 Todo blocks delivery.
Spec
loopx/control_plane/testing/actual_default_model_behavior_portfolio.py, approximately lines 330-344, defines this contrast as a sensitivity contrast. Its must_match_fields include delivery_allowed, while must_differ_fields is selected_todo_id.
Why this was not caught earlier
Canonical-authority initialization was missing from the Python test fixtures. On main, the portfolio scenario build fails earlier (37 tests), so this contrast check is never reached. After the authority fixture is initialized for the scenario Goal in the test file, 23 tests reach this check and fail with the error above.
Decision needed
Pick one:
- Change the synthetic required-vision replan source so the peer-owned P0 Todo does not block delivery, keeping the spec as written.
- Change the contrast spec so it does not require
delivery_allowedto match for this pair (for example, expect a different relation), if a blocked delivery is the intended behavior for a required-vision replan.
Until this is decided, the affected tests are marked as strict xfail and link to this issue. The fixtures PR references this issue.
Affected tests
23 tests in tests/control_plane/test_actual_default_model_behavior_portfolio.py, all failing with the same ValueError.
Code owners for loopx/control_plane/testing/ (per .github/CODEOWNERS, /loopx/control_plane/ rule): @huangruiteng @songoow @loopx-agent
Activity
AronSwan commentedon Nov 6, 2026
Sorry for the slow first response on this thread.
TL;DR: The
selected_work_vs_required_vision_replancontrast no longer raises onmain— the contrast tests now pass unmarked, verified at runtime both in LIHUA919's clean-main run and in ours. The blocking contract decision was made in #7459 (spec side:delivery_allowedmoved to must_differ), and the unmerged #7537 (source-side option) appears superseded. Maintainers may close this if they agree.Evidence
225698b313; comment on #7433): "Theselected_work_vs_required_vision_replansource-relation failure from Required-vision contrast blocks delivery in the actual-default-model scenario, but the spec expects a match #7403 no longer reproduces through this complete portfolio module on this source." — all 50 portfolio tests passed with no xfail/skip.main@faab5f5c291c):python -m pytest -q tests/control_plane/test_actual_default_model_behavior_portfolio.py tests/test_quota_bound_wait_recovery.py→ 53 passed, 1 unrelated failure (disclosed below), 5452s (this Windows host is much slower than the ~130s run above). The required-vision / contrast family passes by name, e.g.test_portfolio_oracle_rejects_quiet_wait_for_required_vision_replan; the contrast contract is unchanged at the current main tip22b0f6c25(checked 2026-11-07 UTC+8).#7459"test: align release fixtures with canonical authority and replan contracts" (merged 2026-10-27) is in main history and implements the spec-side decision; LIHUA919's comment also points to98ca82923, a later complete-context qualification repair. fix(control_plane_composition_scenarios): Remove peer-owned P0 Todo blocking delivery in required-vision replan source #7537 was written against the old must_match contract — its goal (makingdelivery_allowedmatch) is moot under the merged must_differ contract, and its deletion appears inert on current main (in our probe, removing the peer-owned P0 Todo does not flip the right side'sdelivery_allowed, which is governed by the required-vision semantics) — hence it reads as superseded.Disclosure — the one failure in our run:
test_portfolio_real_tool_scenarios_choose_from_latest_quota_resultfails on our Windows host withprovider_read_unavailable — "SQLite authority store could not be read", reproducibly at bothfaab5f5cand at the all-green baseline225698b313(single-test rerun:python -m pytest -q "tests/control_plane/test_actual_default_model_behavior_portfolio.py::test_portfolio_real_tool_scenarios_choose_from_latest_quota_result") — so it looks host-specific rather than a post-10-30 regression; it fails while importing fixture authority for a scenario — after the contrast validation has already passed — and it is unrelated to this issue. We are isolating it further and plan to file a separate report.Next steps: @hhyykk — if you still see the contrast failure on a current main, a comment with the head SHA would help; otherwise maintainers may close this (and possibly reconcile the superseded-looking #7537) — your call.
LIHUA919 commentedon Nov 22, 2026
TL;DR: Re-verified on the current main tip — the
selected_work_vs_required_vision_replancontrast is fixed via the spec-side decision (delivery_allowedmoved tomust_differ_fields), the full portfolio module passes with no xfail, and the contract is unchanged since the 10-27 fix. Maintainers may close; #7537 (the superseded source-side option) is worth reconciling.Evidence (main @
dc90f1f4c467214fa5660191529c81ac0e05fdea, checked 2026-11-22):60dc26eb0, merged 2026-10-27) moveddelivery_allowedfrommust_match_fieldstomust_differ_fieldsfor this contrast inloopx/control_plane/testing/actual_default_model_behavior_portfolio.py(contrast spec now at ~lines 332-347, with the comment "The Host must attempt the replan, without ordinary delivery authority.") — i.e. option 2 of the issue's decision. The commit is an ancestor of the current tip.LOOPX_TEST_PYTHON=python3 PYTHONPATH=. uv run --extra test pytest tests/control_plane/test_actual_default_model_behavior_portfolio.py -q→ 51 passed in 88.81s, no xfail/skip. The contrast validation family passes by name (test_portfolio_preflight_rejects_invalid_contrast_before_actor_spend,test_portfolio_contrast_rejects_noisy_gate_semantic_collapse,test_portfolio_oracle_rejects_quiet_wait_for_required_vision_replan).xfailmarker referencing Required-vision contrast blocks delivery in the actual-default-model scenario, but the spec expects a match #7403 remains in the test file, and the reportedexpected_match:delivery_allowedfailure mode cannot occur under the merged must_differ contract.delivery_allowedmatch) contradicts the merged must_differ contract, so it reads as superseded and closeable.Leaving the close to a maintainer.