Load order
Before first Read: mstar-harness-core → mstar-dispatch-gates. Path symbols → mstar-conventions ({SDD_DIR}). Plan QC after SDD → mstar-review-qc. On conflict, mstar-harness-core wins.
When to use
- Plan locked; tasks mostly independent; PM orchestrates in-session
- Assignment has
Execution mode: sdd - Not for hotfix inline work (
Execution mode: inline) or leaf self-dispatch
Core principle
Default: fresh implementer per ready task + task-scoped review + plan QC on the changed diff and directly affected interfaces. Execution scope → mstar-harness-core § 定向执行与验证边界.
Optional: SDD implementer session: sticky — same implementer subagent across sequential tasks on one plan/branch; task reviewers stay fresh per task. SSOT → references/sticky-implementer-session.md.
Engine check (when available): import
implementerSessionStickyRulesfrom@mstar-harness/enginein a host hook to validate the sticky resume decision above (no CLI form yet). Onfail-> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
Narration: at most one short line between tool calls — ledger and file paths carry the record.
Continuous execution: do not check in with the human between tasks. Stop only for BLOCKED, genuine ambiguity, or all tasks complete.
Pre-flight plan scan
Before Task 1, scan plan once for:
- tasks contradicting Global Constraints
- plan-mandated items that review rubric would flag as defects
Batch all findings for the human in one message. If clean, proceed silently.
Ready-task scheduling (PM only · Decision Rules)
Dispatch independent ready tasks concurrently after L2 worktree isolation. Keep one canonical per-plan {SDD_DIR}. PM alone writes its context.json, progress.md and workflow snapshot; prepare context-dependent helper outputs serially. Each writable track has its own worktree/branch and immutable task-specific absolute brief/report/diff paths. Artifact subdirectories are namespaces inside that SDD root, never a second SDD root. Parallel leaves use the supplied paths directly and do not invoke shared-context helpers or read mutable context to choose their checkout; never share a writable session or implementer-session.json. Use fresh implementers for parallel tasks. Serialize only actual dependencies, overlapping write ownership, one sticky session, and integration merges; state the dependency when serializing. A task reviewer may run alongside an unrelated ready implementer. PM alone reconciles reports into the shared progress.md and workflow snapshot.
Rescheduling checkpoint: a running background task is never a reason to stop scheduling. Re-run this ready-task check at the Phase-2 checkpoints named in mstar-iteration/references/phase-2-worktree-lease.md §2.4 — that file is the single authoritative home for the five checkpoint names and their reason vocabulary, and they are deliberately not re-listed here — and start every authorized independent ready task before waiting for an unrelated running task or plan. Waiting is valid only when nothing useful is ready: state the wait reason once and do not re-check or remind on unchanged facts.
Scope and credential boundary: each task brief carries the inherited plan scope (plan id + absolute SDD dir / brief / report / diff paths) — a leaf never selects or prepares a plan, writes the workflow snapshot / root register / shared indexes, or releases leases. Session JSON, mstar plan --session write credentials, and --expect <revision> stay with the PM/coordinator and are never handed to an implementer or reviewer (mstar-iteration/references/plan-scoped-pm.md §8).
Dependent-task readiness: review approval alone does not make a prerequisite available. PM serially integrates the reviewed prerequisite commits, then creates or updates the idle dependent worktree from that integrated state before recording its BASE_SHA and dispatching. For each required reviewed commit, record git -C "$FEATURE_CWD" merge-base --is-ancestor <prerequisite-sha> <BASE_SHA> with exit 0; a missing commit blocks only that dependent task. Do not move an active task's base; independent ready tasks continue concurrently.
Per-task loop (PM only · Workflow)
- Record
BASE_SHA(never useHEAD~1later) mstar sdd workspace <plan-id>→SDD_DIR(iteration L1 从 feature cwd 调用时:MSTAR_CONTROL_ROOT=<main-repo-root>(= Git 派生的主 worktree 根;先完成派生验证,fail-closed 守卫在其后)或mstar sdd workspace <plan-id> <main-repo-root>;显式值必须与派生主根 canonicalize 一致,integration/外来检出被拒而非静默重定向;probe 以 v2 根status.json(workflows[])或 workflow snapshot 存在为准,linked worktree 缺文件会 fail closed)mstar sdd task-brief <plan> N→ brief file- Dispatch implementer:
- Copy the plan task's budget into the Assignment header field
Task budget (implement / ops rounds)(canonical template →mstar-roles/references/project-manager/dispatch-and-assignment.md; one-round capacity criterion →mstar-artifacts/references/plan-quality-bar.mditem 7) — header region only, before the body markers SDD implementer session: fresh(default) — new subagent; templates:references/implementer-prompt.mdSDD implementer session: sticky— first task: same as fresh + write{SDD_DIR}/implementer-session.jsonwithhost_agent_id; later tasks: host resume +references/implementer-continuation-prompt.md(seereferences/sticky-implementer-session.md)
- Copy the plan task's budget into the Assignment header field
- On
DONE:mstar sdd review-package BASE HEAD→ diff file - Dispatch fresh task reviewer — role
code-reviewer(L2; notqc-specialist*; host fallback generic + C5b →mstar-hostC5) — brief, implementer report, diff, Global Constraints, and the reviewer's own outputREPORT_FILE={SDD_DIR}/task-N-review.md—references/task-reviewer-prompt.md— never sticky resume for reviewers - Fix loop for Critical/Important; re-review until approved. Then PM reads
{SDD_DIR}/task-N-review.md— the always-on L2 report, never the implementer'stask-N-report.md— before appending step 8: the earnedTask qualityand partial findings stand for the reviewed scope, but assigned review scope left uncovered blocks task-complete and dependent release, so PM routes the remaining scope through a fresh/tightened reviewer dispatch; it never overwrites anApprovedearned for checked scope or inventsNeeds fixesbecause the budget ended - Append
progress.md; record ledger progress through the domain call (mstar plan progress --session <session.json> --file <absolute-json-path> --expect <revision>on the scoped route; direct snapshot edit only on a non-scoped legacy route where the CLI is absent) plusimplementer-session.jsonlast_taskif sticky — snapshot/revision semantics →mstar-artifactsreferences/status-and-residuals.md; scoped route →mstar-iteration/references/plan-scoped-pm.md§4/§7 - Release dependent tasks only after reviewed prerequisite commits are present in their assigned base, per Dependent-task readiness above; independent ready tasks need not wait
Never dispatch parallel writers without isolated worktrees and disjoint ownership. Merge their outputs serially before producing the plan review-package.
Detail: references/file-handoffs.md.
Engine check (when available): run
mstar sdd workspace <plan-id>/mstar sdd task-brief <plan-file> <task-number>/mstar sdd review-package <base> <head>(orimport { assertBaseSha, sddWorkspace, taskBrief, reviewPackage } from "@mstar-harness/engine"in a host hook) to drive the loop steps above. Onfail-> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
Implementer statuses
| Status | PM action |
|---|---|
| DONE | review-package → task reviewer |
| DONE_WITH_CONCERNS | read concerns; fix scope issues before review |
| NEEDS_CONTEXT | provide context; re-dispatch. Budget overrun (the declared round cannot close its Files and gates) → split the task per mstar-artifacts/references/plan-quality-bar.md item 7 and re-dispatch with a fresh budget |
| BLOCKED | more context, split task, or escalate human — never same-model blind retry. Budget overrun → split the task per mstar-artifacts/references/plan-quality-bar.md item 7 and re-dispatch with a fresh budget |
Reviewer ⚠️ items
⚠️ Cannot verify from diff does not block other findings. PM must resolve each before task complete.
After all tasks
mstar sdd review-package MERGE_BASE HEAD→ branch diff in{SDD_DIR}/review/- PM dispatches plan QC tri-review (L3) —
QC mode: full tri-review, N=3 — with branch review-package path and report paths under{SDD_DIR}/review/→mstar-review-qc·mstar-dispatch-gates. Layer SSOT →mstar-review-qc/references/review-responsibility-boundaries.md. PM writes{SDD_DIR}/review/qc-consolidated.mdand durable main-plan gate summary. Mandatory wheneverExecution mode: sdd(single-plan or iteration). - Critical/Important QC findings → fix assignments partitioned by ownership/dependency, then targeted re-review. Independent fixes run concurrently; PM retains the complete findings ledger. Fix rounds run on four mechanics — the per-task fix loop applies the same (
references/file-handoffs.md):- Unverified rounds count: a fix round without verification evidence (reviewer not confirmed / report not on disk) is not clean — re-check and count the round; never enter the convergence branch.
- Complete ledger, scoped dispatch: PM retains every open finding, including unverified items; each fix assignment carries only its owned findings and relevant fix delta. Unrelated findings do not expand a leaf task.
- Capped cross-round excerpt: from round ≥2, the fix dispatch attaches only relevant prior findings and dispositions (advisory caps: ~500 words per round, ~1500 total — suggested values, not hard limits).
- Honest non-convergence: open findings at wave close → list them in detail and state the disposition — re-feed to the next fix round or transfer to residual tracking — never silently close.
- QA gate →
mstar-harness-coreDone rules; PMmstar-roles/references/project-manager/qa-trigger-matrix.md
On dsh: the plan QC tri MAY run through the native
workflowtool instead of threesubagentdispatches — take thescript+meta(meta.name: mstar-qc-tri) from skillmstar-host→references/dsh-workflow-scripts.md(§mstar-qc-tri); the three seats stay read-only and PM persists{SDD_DIR}/review/qc1.md…qc3.mdfrom their returned envelopes. Independent ready implementers use backgroundsubagentdispatches with isolated writable tracks — theworkflowchannel is read-only fan-out only; when the tool is unmounted (ptcpreset) dispatch the three seats as backgroundsubagentcalls (skillmstar-host→references/dsh.md).
Progress ledger(Evidence)
PM at start: cat {SDD_DIR}/progress.md. Tasks marked complete are DONE — do not re-dispatch after compaction.
PM appends on clean review: Task N: complete (<base>..<head>, review clean, review: task-N-review.md) — the entry names the L2 report path the review closed on.
Minor findings → ## Minor (for plan QC) section in same file.
Engine check (when available): import
readProgressLedgerfrom@mstar-harness/enginein a host hook to read the ledger above (no CLI form yet). Onfail-> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
Red flags (NEVER)
- Parallel implementers sharing a worktree, ownership, or session
- Paste plan, diffs, or task history into dispatch prompts
- Dispatch reviewer without diff file
HEAD~1as review BASE- Pre-judge reviewer ("do not flag", "at most Minor")
- Skip task review or accept missing verdict
- Accept the L2 verdict from the message alone, or write L2 output to the implementer's
task-N-report.md(the report is{SDD_DIR}/task-N-review.md) - Mark a task complete or release dependents while the assigned L2 review scope is uncovered
- Re-dispatch tasks listed complete in ledger
- PM thread implements instead of subagent dispatch
- Sticky resume for task reviewers
- Resume implementer without
host_agent_idinimplementer-session.json
CLI
The SDD helpers are engine-backed commands under mstar sdd(引擎 CLI;原 bash 脚本已移除,行为语义不变)。Run the mstar binary from any checkout; env vars MSTAR_CONTROL_ROOT / MSTAR_HARNESS_DIR / SDD_DIR are honored exactly as before.
| Command | Usage |
|---|---|
mstar sdd workspace |
PLAN_ID [CONTROL_ROOT] → creates {SDD_DIR} under control harness when set (MSTAR_CONTROL_ROOT or 2nd arg); fail closed on linked worktree without status.json |
mstar sdd task-brief |
PLAN_FILE TASK_N [OUTFILE] |
mstar sdd review-package |
BASE HEAD [OUTFILE] |
Developer check evidence: mstar sdd evidence capture|verify — capture runs an already-authorized argv once and retains raw evidence; verify is read-only. Command shapes, exit meanings and role boundaries → references/file-handoffs.md § Verification evidence. mstar sdd exec stays PM-only.
References
references/file-handoffs.md— paths and fix-loop evidencereferences/sticky-implementer-session.md—freshvssticky, ledger, host resume, micro-batch fallbackreferences/implementer-prompt.mdreferences/implementer-continuation-prompt.mdreferences/task-reviewer-prompt.mdmstar-artifacts/references/plan-quality-bar.md— plan self-containment standard (plans must meet this before SDD dispatch)