feat(gateway): substantive-plan gate — approach >=150 + real sub_task descriptions (#171)

Plans were vague because the gate accepted the bare minimum: PM
approach >=20 chars and title-only sub_tasks. minimax wrote exactly
the minimum.

- IWillPlanRequest.approach min_length 20 -> 150 (kept in sync with
  _PM_APPROACH_MIN_LEN; the gate enforces it at the choreographer
  layer too so direct/MCP callers can't bypass the HTTP boundary).
- New _thin_subtask_hint: every PM sub_task must have a title and a
  description >= _PM_SUBTASK_DESC_MIN_LEN (60) saying what the step
  does — each sub_task is both a delegate target AND a
  progress-checklist item, so a title alone is not a plan.
- cell_pm/main_pm role prompts: explicit "the gate REJECTS thin plans"
  framing + concrete sub_task example + the new minimums.
- Updated all affected test fixtures across the suite to use
  substantive approaches/descriptions; added thin-sub_task rejection
  coverage.

Commit 1 of 3 for the plan/progress quality work (#171/#172/#173).
This commit is contained in:
Renn F
2026-05-16 10:14:45 +02:00
parent e94159dce8
commit ed828a719b
14 changed files with 415 additions and 82 deletions
@@ -397,11 +397,20 @@ async def test_cell_pm_can_plan_code_typed_parent_via_i_will_plan() -> None:
plan="Decompose into 2 dev subtasks.",
rich_plan={
"approach": (
"Split code-typed parent into two developer-claimable subtasks: "
"one for API implementation, one for test coverage."
"Split the code-typed parent into two developer-claimable "
"subtasks: one for API implementation, one for test coverage. "
"Sequenced so the API lands first; QA reviews each PR after "
"it opens, documentation follows, then complete and submit "
"up. No cross-cell dependencies for this slice."
),
"sub_tasks": [
{"title": "API subtask", "description": "Implement endpoint"},
{
"title": "API subtask",
"description": (
"be-dev-1 implements the endpoint with tests, commits "
"with the task-id prefix, opens the leaf PR for QA."
),
},
],
},
)
@@ -450,10 +459,19 @@ async def test_pm_can_plan_non_code_parent() -> None:
rich_plan={
"approach": (
"Single-cell decomposition: backend handles the full scope; "
"no frontend or ux work required for this planning task."
"no frontend or ux work required for this planning task. "
"be-dev-1 owns the change end to end; QA reviews after the "
"PR opens, documentation follows, then be-pm completes and "
"submits up. Strict sequencing, no cross-cell dependencies."
),
"sub_tasks": [
{"title": "Backend planning slice", "description": "Scope and assign"}
{
"title": "Backend planning slice",
"description": (
"scope the change, assign be-dev-1, who implements "
"with tests and opens the leaf PR for QA review."
),
}
],
},
)