fix(gateway): possibilities-matrix fast-path hardening + collision-context guards

The W7 fast path now rejects empty/trivial notes (its sole compensating
control for the skipped journal gates), pushes the branch before the
behind-base check, and pairs the local-gate fallback with the toolchain
guard; the WORK_ALREADY_DONE prompt no longer promises a fast path to
verifying tasks the gate routes elsewhere. build_collision_context now
degrades gracefully at all three call sites instead of breaking the
gate review, PM briefing, or collision-map route.
This commit is contained in:
Renn F
2026-07-15 08:25:06 +02:00
parent 3c1064e7d1
commit 85ac6422ff
8 changed files with 310 additions and 46 deletions
@@ -80,12 +80,16 @@ async def test_armed_claimed_with_pr_and_commits_is_work_already_done(
@pytest.mark.asyncio
async def test_armed_verifying_with_pr_and_commits_is_work_already_done(
async def test_armed_verifying_with_pr_and_commits_is_not_work_already_done(
monkeypatch: pytest.MonkeyPatch,
) -> None:
# verifying is excluded from the proxy's trigger set: _i_am_done_pre_gate_dispatch
# routes an owned `verifying` task to the resume path before the fast path is
# ever reachable, so steering the prompt there would be a dead-end promise.
monkeypatch.setattr(settings, "possibilities_matrix_enabled", True)
prompt = await _orch()._build_dev_prompt(_task(status="verifying"))
assert "WORK ALREADY DONE" in prompt
assert "WORK ALREADY DONE" not in prompt
assert "WORKFLOW STATE: VERIFYING" in prompt
@pytest.mark.asyncio