Coding-delegate suites (development graph)

Goal

Make MechaHarness a reliable handoff surface for expensive coding: Cursor (or another driver) answers short guidance; a local guided_coding / project_coding graph owns the token-heavy edits under stable contracts, verify/repair, and resumable sequential arcs.

Live Completer is the gate. Static coding_writes / cassette greens are provisional mirrors until the same suite passes under MECHA_STORY_BACKEND=live + MECHA_BASE_URL, or MECHA_LIVE_OPENAI=1 with a cloud key and no local base URL (see OpenAI setup).

Suite map (minimize suites)

Three sequential coding-delegate suites — no more for the current roadmap:

Suite

Stories

What it proves

calc_cli

fangore_calc_* (6)

Single-file CLI growth, evaluate/main, ban eval, resume/snapshots

counter_pkg

fangore_counter_* (4)

Multi-file package + pytest verify + CLI

delegate_pkg

fangore_delegate_* (6)

List-mode coding, guidance, red-green, refactoring, MCP replay and verified reopening

Mechanism / transport stay in existing parallel suites (not new coding suites):

Gap

Where it lives

Plan classify / list mode (no coding)

fangore_guided_coding → fangore_instruction_todo_plan

Guidance yield smoke (NoOp local work)

fangore_guided_coding → fangore_guided_coding_recipe

MCP generator_start / resume

Same guided_coding graph via MECHA_MCP_HOST=project_coding; session semantics in fangore_insp_driver_session_resume. Dogfood: live MCP against delegate_pkg goals — no fourth suite.

CI diagnose → repair → local verify

fangore_guided_coding → fangore_coding_ci_diagnose (ci_checks / ci_job_log) → fangore_coding_static_checks (ruff/mypy verify_runs) → fangore_coding_ci_repair

Gastronomic late-stage offline e2e

fangore_gastronomic_offline_e2e (verify→diagnose→revise→accept→trial)

Gastronomic calc arm B

fangore_gastronomic_calc (six stages mirroring calc_cli; Completer propose → apply on shared calc.py; not a fourth coding-delegate suite)

Live comparison recording

Arm A from calc_cli; arm B from fangore_gastronomic_calc via scripts/record_gastronomic_comparison_trial.py — gastronomic-comparison

StopContract / graph budgets

Soft point max_iterations on every coding stage; mechanism stories under fangore_graph_executor / fangore_recipes_tiling

Workspace grants / escape

fangore_access_authority (+ ProjectCodingConfig grants)

delegate_pkg stages (concrete stories)

  1. fangore_delegate_list_bootstrap — instruction_mode: list with two todos (package + test); assert mode=list and pytest green.

  2. fangore_delegate_guidance_thorough — answer soft point thorough; must write inc() and README.md with Usage.

  3. fangore_delegate_red_green — add test_double + implement double() until pytest green under verify/repair.

  4. fangore_delegate_refactor — rename Widget → Gadget across package, tests, README; forbid leftover class Widget.

  5. fangore_delegate_mcp_repair reproduces a label bug in the refactored package, resumes through a rebuilt MCP server and replays the answer. The story applies the resulting Git diff to a fresh copy of the starting tree and reruns pytest there.

  6. fangore_delegate_verified_noop reopens that checkpoint, reruns the label and Gadget checks and requires an empty change list.

Coding stories can declare environment.filesystem.seed for the starting files. The host materializes this tree in both static and live runs. For project coding, filesystem.contents supplies the static Completer’s scripted edits. Stage 050 keeps the failing test in the seed and the proposed fix in the scripted answer.

Release-contract stories are grouped by the behavior they exercise. The fangore_guided_coding stages beginning at 170 cover rollback, overlapping runs, path and tool permissions, completion evidence, and bounded repair. The fangore_gastronomic_offline_e2e stages beginning at 090 cover matched budgets and trial accounting. Stage 260 also drives the production MCP host against a dirty Git checkout and replays a concurrent resume.

Authoring: suites/delegate_pkg/suite.yaml + stages/*.yaml (+ optional sources/ / materialize-stage-files).

# Static (provisional)
pytest -s -q tests/stories/test_user_story_suites.py -k delegate_pkg

# Live gate (required before trusting stubs)
MECHA_STORY_BACKEND=live MECHA_BASE_URL=<openai-compat-base-url> \
  MECHA_MODEL=<served-model-id> \
  pytest -s -q tests/stories/test_user_story_suites.py -k delegate_pkg

What earlier suites already cover

Capability

Suite

Sequential shared workspace + stage order

calc_cli, counter_pkg

Live Completer (ignore coding stubs)

both

verify_runs + repair (shape + stdout / pytest)

both

Suite run id / snapshot / MECHA_SUITE_FROM

both

Single-file API contract

calc_cli

Multi-file package + pytest

counter_pkg

Driver graph (product)

Cursor / MCP client
  → generator_start(guided_coding, goal|instructions, verify_runs, …)
  → advice_requested (external_guidance)
  → generator_resume(choice)   # minimal | thorough
  → ProjectCodingLocalWork (tools + Completer + verify_repair*)
  → completed | failed(verify_runs_failed)

Story suites keep that graph honest whether pytest or MCP drives them.

Non-goals (yet)

  • Replacing Cursor’s agent with MechaHarness for all edits

  • Hosting Comfy / media lanes inside coding suites

  • Auto-promoting live suites into default CI (live stays opt-in)

  • A dedicated MCP-only story suite (transport parity, not a new arc)