Scenarios outside the portfolio refuse the run 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-07 12:06:02 +00:00
parent e9eb068be9
commit ca799cc5e5

View file

@ -131,6 +131,22 @@ def test_trigger_run_rejects_filters_that_match_no_properties(api: Api) -> None:
assert api.subtasks_for(task) == []
def test_trigger_run_rejects_scenarios_outside_the_portfolio(api: Api) -> None:
# arrange — one valid scenario, one belonging to a different portfolio
task = api.seed_task()
ours = api.seed_scenario()
theirs = api.seed_scenario(portfolio_id=999)
api.seed_property()
# act
response = _trigger(api, task, [ours, theirs])
# assert — refused outright; nothing partially distributed
assert response.status_code == 400
assert api.sent_bodies == []
assert api.subtasks_for(task) == []
def test_trigger_run_fans_out_one_subtask_and_message_per_scenario_batch(
api: Api,
) -> None: