This commit is contained in:
@@ -33,6 +33,8 @@ No Pass/Fail buttons. No severity questions. Just: "Here's what should happen. D
|
||||
|
||||
<process>
|
||||
|
||||
**Compact Content Gate.** Read and follow `gsd-core/references/compact-content-gate.md` now — it states the `workflow.compact_content` check and the resolution rule this spine defers to. When it directs a Read, read `gsd-core/workflows/verify-work/detail/elaboration.md` in full before continuing past this point; its content elaborates on the resume/reconcile steps and the full gap-closure sub-flow below.
|
||||
|
||||
<step name="initialize" priority="first">
|
||||
If $ARGUMENTS contains a phase number, load context:
|
||||
|
||||
@@ -489,50 +491,20 @@ If no more tests → Go to `complete_session`
|
||||
</step>
|
||||
|
||||
<step name="reconcile_gaps">
|
||||
**Reconcile diagnosed gaps against completed gap-closure plans (#1921):**
|
||||
**Reconcile diagnosed gaps against completed gap-closure plans (#1921):** when verify-work resumes after `/gsd:execute-phase --gaps-only`, UAT `## Gaps` entries still read `status: failed` even though their fix plans already executed — without reconciliation they'd be re-diagnosed as fresh blockers. For each `status: failed` gap with a `*-PLAN.md` whose `gap_ids` names it AND a matching `*-SUMMARY.md`, mark it `resolved` (with `resolved_by`/`resolved_at`) in place; otherwise leave it `failed`. Resolved gaps are never re-diagnosed or re-planned; a later regression gets a fresh `gap_id`, not a reopened old one.
|
||||
|
||||
When verify-work resumes after `/gsd:execute-phase --gaps-only`, the UAT `## Gaps` entries still read `status: failed` even though their fix plans have executed. Without reconciliation verify-work re-diagnoses them as fresh blockers and spawns new gap plans — losing the verification state. This step closes the loop.
|
||||
|
||||
Read the UAT `## Gaps` section and the phase dir `*-PLAN.md` frontmatter. For each gap with `status: failed`:
|
||||
1. Find a `*-PLAN.md` whose frontmatter `gap_ids` includes the gap's `gap_id` (`G-{phase}-{N}`).
|
||||
2. If such a plan exists AND has a matching `*-SUMMARY.md` in the phase dir (the plan was executed by `--gaps-only`), the gap is **resolved** — update its YAML in place:
|
||||
```yaml
|
||||
- gap_id: G-{phase}-{N}
|
||||
status: resolved # was: failed
|
||||
resolved_by: {plan basename}
|
||||
resolved_at: {today}
|
||||
```
|
||||
3. If no plan references the `gap_id`, or the plan has no SUMMARY, leave the gap `status: failed` (still open).
|
||||
|
||||
Read plan frontmatter directly in-context — do not pipe it through a shell parser. After reconciliation, announce:
|
||||
```
|
||||
Reconciled gap-closure state: {resolved_count} gap(s) resolved by executed plans, {open_count} still open.
|
||||
```
|
||||
|
||||
Resolved gaps are NOT re-diagnosed and do NOT spawn new gap plans. If the user later reports the same behavior as still broken, treat it as a new issue (a regression) with a fresh `gap_id`.
|
||||
Exact YAML shape and the announcement line: `gsd-core/workflows/verify-work/detail/elaboration.md` § 1.
|
||||
</step>
|
||||
|
||||
<step name="resume_from_file">
|
||||
**Resume testing from UAT file:**
|
||||
|
||||
**First run `reconcile_gaps`** (above) so gaps already fixed by `/gsd:execute-phase --gaps-only` are marked `resolved` before testing resumes (#1921).
|
||||
|
||||
Read the full UAT file.
|
||||
**Resume testing from UAT file:** first run `reconcile_gaps` (above), then read the full UAT file.
|
||||
|
||||
Find first test with `result: [pending]`.
|
||||
If no `[pending]` test found → go to `complete_session`.
|
||||
|
||||
Announce:
|
||||
```
|
||||
Resuming: Phase {phase} UAT
|
||||
Progress: {passed + issues + skipped}/{total}
|
||||
Issues found so far: {issues count}
|
||||
Otherwise announce progress and continue from that test at `present_test`.
|
||||
|
||||
Continuing from Test {N}...
|
||||
```
|
||||
|
||||
Update Current Test section with the pending test.
|
||||
Proceed to `present_test`.
|
||||
Exact resume-announcement wording: `gsd-core/workflows/verify-work/detail/elaboration.md` § 2.
|
||||
</step>
|
||||
|
||||
<step name="complete_session">
|
||||
@@ -726,138 +698,29 @@ SECURITY: File paths in output are constructed from validated path components on
|
||||
</step>
|
||||
|
||||
<step name="diagnose_issues">
|
||||
**Diagnose root causes before planning fixes:**
|
||||
|
||||
```
|
||||
---
|
||||
|
||||
{N} issues found. Diagnosing root causes...
|
||||
|
||||
Spawning parallel debug agents to investigate each issue.
|
||||
```
|
||||
|
||||
- Load diagnose-issues workflow
|
||||
- Follow @~/.claude/gsd-core/workflows/diagnose-issues.md
|
||||
- Spawn parallel debug agents for each issue
|
||||
- Collect root causes
|
||||
- Update UAT.md with root causes
|
||||
- Proceed to `plan_gap_closure`
|
||||
|
||||
Diagnosis runs automatically - no user prompt. Parallel agents investigate simultaneously, so overhead is minimal and fixes are more accurate.
|
||||
When UAT testing found issues, this sub-flow (diagnose_issues -> plan_gap_closure -> verify_gap_plans -> revision_loop) runs before present_ready; a session with zero issues never reaches it. Spawn parallel debug agents (one per issue, via diagnose-issues.md) to find root causes with no user prompt, then update UAT.md and proceed to plan_gap_closure.
|
||||
</step>
|
||||
|
||||
<step name="plan_gap_closure">
|
||||
**Auto-plan fixes from diagnosed gaps:**
|
||||
|
||||
Display:
|
||||
```
|
||||
### GSD ► PLANNING FIXES
|
||||
|
||||
◆ Spawning planner for gap closure... (runs in a subagent — no output until it returns, ~1–5 min; expected, not a freeze)
|
||||
```
|
||||
|
||||
Spawn gsd-planner in --gaps mode:
|
||||
|
||||
<!-- #2517 model-omit-on-inherit -->
|
||||
|
||||
> **Model omission (#2517).** Omit the `model` parameter entirely when the value it would carry (`planner_model`, `checker_model`) is `"inherit"` or empty. An empty value 404s on runtimes without native tier aliases — the default on non-Claude runtimes. Omitting it inherits the orchestrator's model. See @gsd-core/references/model-profile-resolution.md.
|
||||
|
||||
````
|
||||
Agent(
|
||||
prompt="""
|
||||
<planning_context>
|
||||
|
||||
**Phase:** {phase_number}
|
||||
**Mode:** gap_closure
|
||||
|
||||
<required_reading>
|
||||
- {phase_dir}/{phase_num}-UAT.md (UAT with diagnoses)
|
||||
- {state_path} (Project State)
|
||||
- {roadmap_path} (Roadmap)
|
||||
</required_reading>
|
||||
|
||||
${AGENT_SKILLS_PLANNER}
|
||||
|
||||
</planning_context>
|
||||
|
||||
<downstream_consumer>
|
||||
Output consumed by /gsd:execute-phase
|
||||
Plans must be executable prompts.
|
||||
|
||||
<!-- #2508 runtime-aware-dispatch -->
|
||||
|
||||
> **Runtime-aware dispatch (#2508 Phase 4).** GSD workflows dispatch specialized subagents by role. Before dispatching on a built-in-only runtime (kimi-code — three built-ins only), resolve the role to a built-in via `gsd_run query resolve-dispatch-type --requested <role> --raw`. On named-dispatch runtimes (Claude/OpenCode/…) the role is returned unchanged; on kimi-code it maps to `coder`/`explore`/`plan` by role-suffix. The persona rides `${AGENT_SKILLS_<ROLE>}` (Phase 3) regardless. See @gsd-core/references/runtime-aware-dispatch.md.
|
||||
|
||||
**Gap linkage (#1921):** each created `*-PLAN.md` MUST list the UAT gap ids it addresses in its frontmatter:
|
||||
```yaml
|
||||
---
|
||||
gap_closure: true
|
||||
gap_ids: [G-{phase}-{N}, ...] # the ## Gaps gap_id values this plan fixes
|
||||
---
|
||||
```
|
||||
This lets `/gsd:verify-work` reconcile resolved gaps on resume (a gap whose plan has a matching `*-SUMMARY.md` is marked `status: resolved`, not re-diagnosed as a fresh blocker).
|
||||
</downstream_consumer>
|
||||
""",
|
||||
subagent_type="gsd-planner",
|
||||
model="{planner_model}",
|
||||
description="Plan gap fixes for Phase {phase}"
|
||||
)
|
||||
````
|
||||
Spawn gsd-planner in --gaps mode against the UAT (with diagnoses), `{state_path}` (Project State), and `{roadmap_path}` (Roadmap). Each created PLAN.md MUST carry `gap_closure: true` and `gap_ids: [...]` in its frontmatter (#1921) so a later verify-work resume can reconcile it.
|
||||
|
||||
<!-- gsd:protected -->
|
||||
> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available.
|
||||
|
||||
On return:
|
||||
- **PLANNING COMPLETE:** Proceed to `verify_gap_plans`
|
||||
- **PLANNING INCONCLUSIVE:** Report and offer manual intervention
|
||||
PLANNING COMPLETE proceeds to verify_gap_plans; PLANNING INCONCLUSIVE reports and offers manual intervention.
|
||||
</step>
|
||||
|
||||
<step name="verify_gap_plans">
|
||||
**Verify fix plans with checker:**
|
||||
|
||||
Display:
|
||||
```
|
||||
### GSD ► VERIFYING FIX PLANS
|
||||
|
||||
◆ Spawning plan checker... (runs in a subagent — no output until it returns, ~1–5 min; expected, not a freeze)
|
||||
```
|
||||
|
||||
Initialize: `iteration_count = 1`
|
||||
|
||||
Spawn gsd-plan-checker:
|
||||
|
||||
```
|
||||
Agent(
|
||||
prompt="""
|
||||
<verification_context>
|
||||
|
||||
**Phase:** {phase_number}
|
||||
**Phase Goal:** Close diagnosed gaps from UAT
|
||||
|
||||
<required_reading>
|
||||
- {phase_dir}/*-PLAN.md (Plans to verify)
|
||||
</required_reading>
|
||||
|
||||
${AGENT_SKILLS_CHECKER}
|
||||
|
||||
</verification_context>
|
||||
|
||||
<expected_output>
|
||||
Return one of:
|
||||
- ## VERIFICATION PASSED — all checks pass
|
||||
- ## ISSUES FOUND — structured issue list
|
||||
</expected_output>
|
||||
""",
|
||||
subagent_type="gsd-plan-checker",
|
||||
model="{checker_model}",
|
||||
description="Verify Phase {phase} fix plans"
|
||||
)
|
||||
```
|
||||
Spawn gsd-plan-checker against the fix plans (iteration_count starts at 1), model="{checker_model}" (omit on inherit/empty, #2517).
|
||||
|
||||
<!-- gsd:protected -->
|
||||
> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available.
|
||||
|
||||
On return:
|
||||
- **VERIFICATION PASSED:** Proceed to `present_ready`
|
||||
- **ISSUES FOUND:** Count BLOCKER + WARNING entries in the YAML issues block; an entry whose severity is missing or unrecognized counts as a BLOCKER (fail closed). If zero — every entry is explicitly INFO — display `ℹ advisory — {dimension}: {description}` per entry and proceed to `present_ready`; INFO is advisory and never enters the loop (#3724). Otherwise proceed to `revision_loop`
|
||||
|
||||
Exact Agent() prompt fields: `gsd-core/workflows/verify-work/detail/elaboration.md` § 2.
|
||||
</step>
|
||||
|
||||
<step name="revision_loop">
|
||||
@@ -869,26 +732,6 @@ Display: `Sending back to planner for revision... (iteration {N}/3)`
|
||||
|
||||
Spawn gsd-planner with revision context:
|
||||
|
||||
```
|
||||
Agent(
|
||||
prompt="""
|
||||
<revision_context>
|
||||
|
||||
**Phase:** {phase_number}
|
||||
**Mode:** revision
|
||||
|
||||
<required_reading>
|
||||
- {phase_dir}/*-PLAN.md (Existing plans)
|
||||
</required_reading>
|
||||
|
||||
${AGENT_SKILLS_PLANNER}
|
||||
|
||||
**Checker issues:**
|
||||
{structured_issues_from_checker}
|
||||
|
||||
</revision_context>
|
||||
|
||||
<instructions>
|
||||
Read existing PLAN.md files. Make targeted updates to address checker issues.
|
||||
|
||||
`required_property` + evidence + severity BIND. `fix_hint` is ONE non-binding example route: a
|
||||
@@ -900,14 +743,8 @@ the alternatives rather than applying or working around it. Full contract:
|
||||
`gsd-core/references/planner-revision.md`, which you load in revision mode.
|
||||
|
||||
Do NOT replan from scratch unless issues are fundamental.
|
||||
</instructions>
|
||||
""",
|
||||
subagent_type="gsd-planner",
|
||||
model="{planner_model}",
|
||||
description="Revise Phase {phase} plans"
|
||||
)
|
||||
```
|
||||
|
||||
<!-- gsd:protected -->
|
||||
> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available.
|
||||
|
||||
**If the planner returns `## REVISION_CONFLICT`:** do NOT increment `iteration_count` and do NOT
|
||||
@@ -938,9 +775,12 @@ Offer options:
|
||||
2. Provide guidance (user gives direction, retry)
|
||||
3. Abandon (exit, user runs /gsd:plan-phase manually)
|
||||
|
||||
Wait for user response.
|
||||
Then wait for the user to pick one.
|
||||
|
||||
Exact Agent() prompt fields (revision_context, required_reading): `gsd-core/workflows/verify-work/detail/elaboration.md` § 3.
|
||||
</step>
|
||||
|
||||
|
||||
<step name="present_ready">
|
||||
**Present completion and next steps:**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user