Skip to content

Required-vision contrast blocks delivery in the actual-default-model scenario, but the spec expects a match #7403

Open

Description

@hhyykk

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:

  1. Change the synthetic required-vision replan source so the peer-owned P0 Todo does not block delivery, keeping the spec as written.
  2. Change the contrast spec so it does not require delivery_allowed to 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

  1. AronSwan commented on Nov 6, 2026

    @AronSwan
    Collaborator

    Sorry for the slow first response on this thread.

    TL;DR: The selected_work_vs_required_vision_replan contrast no longer raises on main — 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_allowed moved to must_differ), and the unmerged #7537 (source-side option) appears superseded. Maintainers may close this if they agree.

    Evidence
    • LIHUA919's clean-main rerun (2026-10-30, base 225698b313; comment on #7433): "The selected_work_vs_required_vision_replan source-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.
    • Our rerun (2026-11-07 UTC+8, Windows host, 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 tip 22b0f6c25 (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 to 98ca82923, 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 (making delivery_allowed match) 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's delivery_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_result fails on our Windows host with provider_read_unavailable — "SQLite authority store could not be read", reproducibly at both faab5f5c and at the all-green baseline 225698b313 (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.

  2. LIHUA919 commented on Nov 22, 2026

    @LIHUA919
    Contributor

    TL;DR: Re-verified on the current main tip — the selected_work_vs_required_vision_replan contrast is fixed via the spec-side decision (delivery_allowed moved to must_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):

    • Fix: test: align release fixtures with canonical authority and replan contracts #7459 (commit 60dc26eb0, merged 2026-10-27) moved delivery_allowed from must_match_fields to must_differ_fields for this contrast in loopx/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.
    • Runtime rerun on a clean checkout of the main 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).
    • No xfail marker 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 reported expected_match:delivery_allowed failure mode cannot occur under the merged must_differ contract.
    • Consistent with LIHUA919's 2026-10-30 clean-main run and AronSwan's 2026-11-07 rerun; this extends the same result through the 2026-11-22 tip (~1 month of subsequent merges).
    • Housekeeping: fix(control_plane_composition_scenarios): Remove peer-owned P0 Todo blocking delivery in required-vision replan source #7537 implements the source-side option — its goal (making delivery_allowed match) contradicts the merged must_differ contract, so it reads as superseded and closeable.

    Leaving the close to a maintainer.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions