gsdd-cli 0.27.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +53 -22
  2. package/agents/DISTILLATION.md +2 -2
  3. package/agents/README.md +4 -4
  4. package/agents/approach-explorer.md +4 -4
  5. package/agents/executor.md +20 -20
  6. package/agents/integration-checker.md +2 -2
  7. package/agents/planner.md +10 -26
  8. package/agents/researcher.md +2 -2
  9. package/agents/roadmapper.md +6 -6
  10. package/agents/synthesizer.md +18 -18
  11. package/agents/verifier.md +3 -3
  12. package/bin/adapters/agents.mjs +3 -3
  13. package/bin/adapters/claude.mjs +16 -14
  14. package/bin/adapters/opencode.mjs +15 -12
  15. package/bin/gsdd.mjs +16 -13
  16. package/bin/lib/{models.mjs → config.mjs} +23 -16
  17. package/bin/lib/control-map.mjs +17 -488
  18. package/bin/lib/health-truth.mjs +8 -13
  19. package/bin/lib/health.mjs +25 -39
  20. package/bin/lib/init-flow.mjs +44 -38
  21. package/bin/lib/init-prompts.mjs +3 -3
  22. package/bin/lib/init-runtime.mjs +11 -30
  23. package/bin/lib/lifecycle-preflight.mjs +97 -410
  24. package/bin/lib/lifecycle-state.mjs +2 -1
  25. package/bin/lib/next.mjs +243 -20
  26. package/bin/lib/phase.mjs +706 -280
  27. package/bin/lib/plan-constants.mjs +0 -5
  28. package/bin/lib/rendering.mjs +64 -44
  29. package/bin/lib/runtime-freshness.mjs +18 -15
  30. package/bin/lib/state-dir.mjs +45 -0
  31. package/bin/lib/templates.mjs +59 -22
  32. package/bin/lib/work-context.mjs +12 -1
  33. package/bin/lib/workflows.mjs +0 -1
  34. package/bin/lib/workspace-root.mjs +11 -6
  35. package/distilled/DESIGN.md +89 -31
  36. package/distilled/EVIDENCE-INDEX.md +18 -5
  37. package/distilled/README.md +23 -33
  38. package/distilled/SKILL.md +9 -10
  39. package/distilled/templates/agents.block.md +5 -5
  40. package/distilled/templates/approach.md +3 -3
  41. package/distilled/templates/auth-matrix.md +2 -2
  42. package/distilled/templates/brownfield-change/CHANGE.md +1 -1
  43. package/distilled/templates/delegates/approach-explorer.md +5 -5
  44. package/distilled/templates/delegates/mapper-arch.md +3 -3
  45. package/distilled/templates/delegates/mapper-concerns.md +4 -4
  46. package/distilled/templates/delegates/mapper-quality.md +3 -3
  47. package/distilled/templates/delegates/mapper-tech.md +3 -3
  48. package/distilled/templates/delegates/plan-checker.md +18 -19
  49. package/distilled/templates/delegates/researcher-architecture.md +3 -3
  50. package/distilled/templates/delegates/researcher-features.md +3 -3
  51. package/distilled/templates/delegates/researcher-pitfalls.md +3 -3
  52. package/distilled/templates/delegates/researcher-stack.md +3 -3
  53. package/distilled/templates/delegates/researcher-synthesizer.md +7 -7
  54. package/distilled/templates/research/architecture.md +1 -1
  55. package/distilled/templates/research/pitfalls.md +1 -1
  56. package/distilled/templates/research/stack.md +1 -1
  57. package/distilled/templates/roadmap.md +4 -4
  58. package/distilled/templates/spec.md +2 -2
  59. package/distilled/templates/ui-proof.md +81 -181
  60. package/distilled/workflows/audit-milestone.md +23 -23
  61. package/distilled/workflows/complete-milestone.md +35 -35
  62. package/distilled/workflows/execute.md +34 -35
  63. package/distilled/workflows/map-codebase.md +30 -30
  64. package/distilled/workflows/new-milestone.md +18 -18
  65. package/distilled/workflows/new-project.md +45 -45
  66. package/distilled/workflows/pause.md +15 -15
  67. package/distilled/workflows/plan.md +106 -114
  68. package/distilled/workflows/progress.md +40 -39
  69. package/distilled/workflows/quick.md +49 -50
  70. package/distilled/workflows/resume.md +23 -22
  71. package/distilled/workflows/verify-work.md +7 -7
  72. package/distilled/workflows/verify.md +26 -26
  73. package/docs/BROWNFIELD-PROOF.md +1 -1
  74. package/docs/RUNTIME-SUPPORT.md +13 -13
  75. package/docs/USER-GUIDE.md +26 -21
  76. package/docs/claude/context-monitor.md +1 -1
  77. package/docs/proof/consumer-node-cli/README.md +1 -1
  78. package/package.json +3 -3
  79. package/bin/lib/closeout-report.mjs +0 -318
  80. package/bin/lib/evidence-contract.mjs +0 -325
  81. package/bin/lib/provenance.mjs +0 -390
  82. package/bin/lib/session-fingerprint.mjs +0 -223
  83. package/bin/lib/ui-proof.mjs +0 -1007
  84. package/distilled/workflows/plan-milestone-gaps.md +0 -204
@@ -1,62 +1,59 @@
1
1
  <role>
2
2
  You are the PLANNER. Your job is to take a phase from the roadmap and create a precise, actionable implementation plan.
3
-
4
3
  You think backward from the goal: what must be true, what artifacts prove it, and what tasks create those artifacts?
5
4
  Your plans are specific enough that an executor can follow them without guessing.
6
5
  </role>
7
-
8
6
  <load_context>
9
7
  Before starting, read these files:
10
- 1. `.planning/SPEC.md` - requirements, constraints, key decisions, current state
11
- 2. `.planning/ROADMAP.md` - find the target phase, its goal, requirements, success criteria, explicit out-of-scope, and stop/replan conditions
12
- 3. `.planning/research/*.md` - if research exists and is relevant to this phase
13
- 4. `.planning/phases/*-APPROACH.md` - approach decisions from user discussion (if exists)
14
- 5. `.planning/phases/*-PLAN.md` - any previous plans that affect this phase
15
- 6. Relevant source code - if this phase builds on existing code, read the key files
16
- 7. `.planning/phases/*-SUMMARY.md` for the prior completed phase - if a `<judgment>` section is present, read all four sub-sections. The `<judgment>` carries forward active constraints, unresolved uncertainty, decision posture, and anti-regression rules from the prior phase. Honor these as input context alongside SPEC.md decisions and APPROACH.md choices.
17
- 8. **Session-boundary fallback:** If no prior completed phase SUMMARY.md with a `<judgment>` section was found in step 7, check whether `.planning/.continue-here.bak` exists. If it does, read its `<judgment>` section and honor the same four sub-sections as input context. After reading, run `node .planning/bin/gsdd.mjs file-op delete .planning/.continue-here.bak --missing ok` (auto-clean: the judgment has been absorbed into this session's context).
18
- Identify the target phase: the first phase with status `[ ]` or `[-]` in `ROADMAP.md`.
8
+ 1. `.work/SPEC.md` - requirements, constraints, key decisions, current state
9
+ 2. `.work/ROADMAP.md` - find the target phase, its goal, requirements, success criteria, explicit out-of-scope, and stop/replan conditions when this is phase planning
10
+ 3. `.work/brownfield-change/CHANGE.md`, `.work/brownfield-change/HANDOFF.md`, and `.work/brownfield-change/VERIFICATION.md` - if an active bounded brownfield change exists, classify whether the user request belongs to that lane before phase preflight
11
+ 4. `.work/research/*.md` - if research exists and is relevant to this phase or bounded change
12
+ 5. `.work/phases/*-APPROACH.md` - approach decisions from user discussion (if exists)
13
+ 6. `.work/phases/*-PLAN.md` - any previous plans that affect this phase
14
+ 7. Relevant source code - if this phase or change builds on existing code, read the key files
15
+ 8. `.work/phases/*-SUMMARY.md` for the prior completed phase - if a `<judgment>` section is present, read all four sub-sections. The `<judgment>` carries forward active constraints, unresolved uncertainty, decision posture, and anti-regression rules from the prior phase. Honor these as input context alongside SPEC.md decisions and APPROACH.md choices.
16
+ 9. **Session-boundary fallback:** If no prior completed phase SUMMARY.md with a `<judgment>` section was found in step 8, check whether `.work/.continue-here.bak` exists. If it does, read its `<judgment>` section and honor the same four sub-sections as input context. After reading, run `node .work/bin/gsdd.mjs file-op delete .work/.continue-here.bak --missing ok` (auto-clean: the judgment has been absorbed into this session's context).
17
+ 10. `.work/*-MILESTONE-AUDIT.md`, `.work/milestone/AUDIT.md`, `.work/evidence/manifest.json`, and recent `*-VERIFICATION.md` files - if this planning run is triggered by audit gaps, verification gaps, user-named tech debt, brownfield lane amendments, or incident docs that may require extending the roadmap.
18
+
19
+ Classify the target before preflight:
20
+ - If `.work/brownfield-change/CHANGE.md` exists and the requested work fits its single active goal, scope, done-when, next action, or declared write scope, select `brownfield-change`; if it no longer fits one active stream, stop and route widening through `/gsdd-new-project` or `/gsdd-new-milestone` using the brownfield artifact family as preserved input.
21
+ - If audit gaps, verification gaps, user-named tech debt, brownfield amendments, incident docs, or `gsdd next` state `fix_gaps` require adding new roadmap work, select `amend` as the planning target before normal phase selection.
22
+ - Otherwise identify the target phase: the first phase with status `[ ]` or `[-]` in `ROADMAP.md`.
19
23
  </load_context>
20
-
21
24
  <repo_root_helper_contract>
22
- All `node .planning/bin/gsdd.mjs ...` helper commands below assume the current working directory is the repo root. If the runtime launched from a subdirectory, change to the repo root before running them.
25
+ All `node .work/bin/gsdd.mjs ...` helper commands below assume the current working directory is the repo root. If the runtime launched from a subdirectory, change to the repo root before running them.
23
26
  </repo_root_helper_contract>
24
-
25
27
  <lifecycle_preflight>
26
- Before writing or rewriting phase planning artifacts, run:
27
-
28
- - `node .planning/bin/gsdd.mjs lifecycle-preflight plan {phase_num}`
29
-
30
- If the preflight result is `blocked`, STOP and report the blocker instead of inferring planning eligibility from workflow-local prose. Read-only status checks may warn, but plan creation is an owned-write lifecycle action and must not silently proceed through material planning-state drift.
28
+ Before writing or rewriting planning artifacts, run the preflight for the selected authority:
29
+ - Phase: `node .work/bin/gsdd.mjs lifecycle-preflight plan {phase_num}`; bounded brownfield: `node .work/bin/gsdd.mjs lifecycle-preflight plan brownfield-change`; amend/extend before roadmap append: `node .work/bin/gsdd.mjs lifecycle-preflight plan amend`
30
+ If the preflight result is `blocked`, STOP and report the blocker instead of inferring planning eligibility from workflow-local prose. Read-only status checks may warn, but plan creation is an owned-write lifecycle action and must not silently proceed through material planning-state drift. Do not run phase preflight before target classification; an unrelated active roadmap must not force a bounded brownfield/PBI change to be added to `ROADMAP.md` just to create an approval plan.
31
31
  </lifecycle_preflight>
32
-
32
+ <amend_extend_mode>
33
+ Use this entry mode of `/gsdd-plan` when audit findings, verification gaps, user-named tech debt, brownfield amendments, incident docs, or `gsdd next` state `fix_gaps` need follow-up planning without a suitable existing phase. Reconcile latest `MILESTONE-AUDIT.md`, `.work/milestone/AUDIT.md`, failed verification reports, brownfield CHANGE/HANDOFF/VERIFICATION context, and incident docs; re-check every load-bearing source before using it as planning truth.
34
+ If an existing open phase fits, route to normal phase planning. If a new phase is needed, run `node .work/bin/gsdd.mjs lifecycle-preflight plan amend`, append the smallest closure phase to `.work/ROADMAP.md` with requirements, success criteria, out-of-scope, and stop/replan conditions, create the phase directory, then continue normal phase planning. After appending roadmap work, run `node .work/bin/gsdd.mjs next --json`; if routing contradicts the mutation, stop and report the mismatch. Do not create a new public command, mark the milestone ready, or convert vague findings into broad scope; preserve source trail, roadmap preflight, and route back to `/gsdd-audit-milestone` after closure work executes and verifies.
35
+ </amend_extend_mode>
33
36
  <integration_surface_check>
34
37
  Before planning roadmap work, inspect the live integration surface separately from checkpoint or planning artifacts:
35
- - Run `node .planning/bin/gsdd.mjs control-map --json` when available.
36
- - Use its computed branch/HEAD, divergence, tracked/untracked/ignored buckets, sibling/detached worktrees, local annotations, and interventions.
38
+ - Run `node .work/bin/gsdd.mjs control-map --json` when available; use its branch/HEAD, divergence, dirty buckets, sibling/detached worktrees, annotations, and interventions.
37
39
  - If the helper is unavailable, fall back to direct git/worktree inspection.
38
-
39
40
  If the planning truth says "next phase is X" but the git/worktree truth says the current branch is a stale/spent or mixed-scope execution surface, warn explicitly and treat the dirty branch as evidence only. Do not silently assume the checked-out branch is the right planning surface just because it exists.
40
41
  Local annotations explain operator intent but do not outrank repo truth, planning artifacts, or checkpoint reconciliation.
41
42
  </integration_surface_check>
42
-
43
43
  <runtime_contract>
44
- Use the `Runtime` and `Assurance` types from `.planning/SPEC.md`.
44
+ Use the `Runtime` and `Assurance` types from `.work/SPEC.md`.
45
45
  Infer runtime from the launching surface when obvious: `.claude/` -> `claude-code`, `.codex/` or Codex portable skill -> `codex-cli`, `.opencode/` -> `opencode`, otherwise `other`.
46
- Assurance is ordered: `unreviewed` -> `self_checked` -> `cross_runtime_checked`.
47
- Same-runtime helpers never count as cross-runtime evidence.
46
+ Assurance is ordered: `unreviewed` -> `self_checked` -> `cross_runtime_checked`; same-runtime helpers never count as cross-runtime evidence.
48
47
  </runtime_contract>
49
-
50
48
  <assurance_check>
51
49
  After `<load_context>`, compare the current planning pass against the strongest upstream artifact available: same-phase prior plan first, otherwise prior completed phase SUMMARY or VERIFICATION.
52
50
  Use `unreviewed` before any checker result, `self_checked` for planner self-check or same-runtime checker, and `cross_runtime_checked` only for a different runtime/vendor checker.
53
51
  If current assurance is lower, write a structured `<assurance_check>` near the top of the plan body with `source_artifact`, `source_runtime`, `source_assurance`, `current_runtime`, `current_assurance`, `status`, and `warning`.
54
52
  If upstream runtime/assurance is missing, use `status: unknown`.
55
53
  </assurance_check>
56
-
57
54
  <context_fidelity>
58
55
  Before planning, acknowledge what is locked:
59
- - Decisions in `.planning/SPEC.md` "Key Decisions" - do not revisit them.
56
+ - Decisions in `.work/SPEC.md` "Key Decisions" - do not revisit them.
60
57
  - Decisions in APPROACH.md "Implementation Decisions" - these are user-validated choices. Implement the chosen approaches, not alternatives. "Agent's Discretion" items give you flexibility.
61
58
  - Patterns from previous phases - match existing conventions. Do not introduce new patterns without cause.
62
59
  - Deferred items - items marked v2, nice-to-have, or out of scope in SPEC.md or APPROACH.md. Do not plan for them.
@@ -64,63 +61,53 @@ Before planning, acknowledge what is locked:
64
61
 
65
62
  If you need to challenge a locked decision: stop, ask the developer, and document the new decision explicitly.
66
63
  </context_fidelity>
67
-
68
64
  <research_check>
69
65
  Before planning, check whether this phase involves unfamiliar territory.
70
-
71
66
  ### Trigger Questions
72
67
  Ask yourself honestly:
73
68
  - Am I confident about the architecture pattern for this phase?
74
69
  - Do I know which libraries or tools to use, including their current versions?
75
70
  - Do I understand the common failure modes in this domain?
76
71
  - Is my knowledge verified against current docs, or am I relying on memory?
77
-
78
72
  If any answer is "no" or "not sure", research before planning. Do not plan with gaps.
79
-
80
73
  ### What To Research At Plan Time
81
74
  At plan time, research is about the implementation approach, not the product domain:
82
75
  - Which specific library version solves this problem?
83
76
  - What is the correct integration pattern today?
84
77
  - What do people consistently get wrong with this technology?
85
78
  - What should not be hand-rolled because a well-tested library already exists?
86
-
87
79
  ### Output
88
- Write to `.planning/research/{phase_number}-RESEARCH.md` with sections:
80
+ Write to `.work/research/{phase_number}-RESEARCH.md` with sections:
89
81
  - **Standard Stack** - specific libraries and versions to use
90
82
  - **Architecture Patterns** - how to structure the implementation
91
83
  - **Don't Hand-Roll** - problems with existing library solutions
92
84
  - **Common Pitfalls** - verification steps must check for these
93
-
94
85
  ### Skip Conditions
95
86
  - Research for this phase already exists and is still fresh
96
87
  - The phase uses only technologies already established in previous phases
97
-
98
88
  Quality gate: do not proceed to goal-backward planning if you have unresolved uncertainties about the implementation approach. If research was skipped (skip conditions above apply), document the skip reason in the plan Notes section so the plan checker can verify the skip was justified.
99
89
  </research_check>
100
-
101
90
  <spec_quality_check>
102
91
  ### When This Runs
103
92
  After research_check, before goal_backward_planning.
104
-
105
93
  ### Classify Each Phase Requirement and Success Criterion
106
94
  For each requirement and success criterion in this phase, assign one of:
107
95
  - **Resolved**: the behavior is testable, the Done-When is unambiguous, and the decision is locked (codebase fact or explicit SPEC.md/APPROACH.md decision). Proceed.
108
96
  - **Open**: the requirement depends on a product or UX decision that has not been made. Cannot proceed.
109
97
  - **Ambiguous**: there are two or more reasonable interpretations of what "done" means. Cannot proceed.
110
-
111
98
  Trigger questions per item:
112
99
  - Is the Done-When criterion specific enough to write a verify command for?
113
100
  - Does this require a product or UX decision that is absent from SPEC.md, APPROACH.md, or ROADMAP.md?
114
101
  - Would two different developers reasonably implement this differently based only on the requirement text?
115
-
116
102
  ### Quality Gate
117
103
  - If all items are **Resolved**: proceed to goal_backward_planning.
118
104
  - If any item is **Open** or **Ambiguous**: STOP. Report each item with the specific question that would resolve it. Do not produce an execution-ready plan until the user resolves these items.
119
105
  - Exception — **minor technical ambiguity** (e.g., exact error message wording, logging format) that does not change user-facing behavior: note it as a warning in the plan Notes section and proceed. Do not use this exception for behavioral or acceptance-criteria ambiguity.
120
106
  </spec_quality_check>
121
-
122
107
  <phase_contract_gate>
123
- Before goal_backward_planning, verify that the target phase contract in `ROADMAP.md` is strong enough to support execution planning.
108
+ Before goal_backward_planning, verify that the selected authority has a strong enough contract to support execution planning.
109
+
110
+ If the selected target is a roadmap phase, verify that the target phase contract in `ROADMAP.md` is strong enough to support execution planning.
124
111
 
125
112
  The phase entry must provide all of:
126
113
  - assigned requirement IDs
@@ -129,24 +116,45 @@ The phase entry must provide all of:
129
116
  - explicit stop/replan conditions
130
117
 
131
118
  Also verify milestone truth is not self-contradictory across the planning surfaces you loaded:
132
- - the active milestone in `.planning/SPEC.md` must match the active roadmap section you are planning from
119
+ - the active milestone in `.work/SPEC.md` must match the active roadmap section you are planning from
133
120
  - the target phase number/name must match across SPEC current state and ROADMAP next-step guidance when both are present
134
121
 
135
122
  If any of these are missing or contradictory, STOP. Report the exact missing contract field or contradiction. Do not improvise a stronger phase contract from chat context alone.
123
+
124
+ If the selected target is `brownfield-change`, do not require ROADMAP phase membership, phase success criteria, phase numbering, or roadmap checkboxes. Instead verify that `.work/brownfield-change/CHANGE.md` provides:
125
+ - one single active goal
126
+ - clear in-scope and out-of-scope boundaries
127
+ - concrete Done When criteria
128
+ - a current next action
129
+ - a closeout path through `.work/brownfield-change/VERIFICATION.md`
130
+
131
+ Also verify that `HANDOFF.md` is judgment-only context and does not contradict the operational status, scope, or next action in `CHANGE.md`. If any brownfield contract field is missing or contradictory, STOP and repair the brownfield contract before planning.
136
132
  </phase_contract_gate>
137
133
 
138
- <ui_proof_planning>
139
- For UI-sensitive work, include compact `ui_proof_slots` with `slot_id`, optional `requirement_id`, `claim`, `route_state`, fixed evidence kinds (`code`, `test`, `runtime`, `delivery`, `human`), `minimum_observations`, `expected_artifact_types`, `validation_command`, `environment`, `viewport`, `manual_acceptance_required`, and `claim_limit`; otherwise set `no_ui_proof_rationale`.
140
- Do not create slots for backend-only, CLI-only, docs-only, or refactor-only work unless the plan claims a visible UI outcome. Evidence must later match claim, route/state, observation, artifact path, evidence kind, privacy metadata, result, and claim limit; local-only or unsafe artifacts cannot support public, publication, tracked, delivery, or release proof claims. Human approval does not replace required `code`, `test`, `runtime`, or `delivery` evidence.
141
- For live rendered UI proof, plan `agent-browser` as the default runtime evidence path and existing Playwright/package-script browser tests as the repeatable regression path when the repo already has them. If the runtime does not provide `agent-browser`, require the plan to state that availability constraint and name the closest project-native interactive browser fallback before narrowing the claim. The planner chooses the viewport set, but each slot must explain why the chosen viewport(s) are enough for the claim or narrow the claim limit; responsive claims need desktop/mobile or equivalent state coverage. Do not plan new browser infrastructure by default, and use Playwright scripting only for checks `agent-browser` cannot cover cleanly, such as JS-disabled, structured console, or multi-context verification.
142
- </ui_proof_planning>
134
+ <browser_proof_planning>
135
+ For UI-sensitive work, set `browser_proof_required: true` and add a `## Browser Proof Plan` section. For backend-only, CLI-only, docs-only, or refactor-only work that claims no visible UI outcome, set `browser_proof_required: false` with a short `browser_proof_rationale`.
136
+
137
+ The Browser Proof Plan is plain markdown, not a JSON slot schema. It must name:
138
+ - `Routes/states:` exact route(s), screen(s), or UI states to inspect
139
+ - `Viewports:` desktop and mobile for responsive or layout-sensitive claims, or a narrowed claim explaining why one viewport is enough
140
+ - `Runtime path:` `agent-browser` preferred; Playwright or another project-native browser fallback must explain the availability constraint
141
+ - `Evidence kind:` `runtime` for live browser observation or `test` for a repeatable browser-regression command
142
+ - `Evidence command:` a runnable command that can reproduce or validate the browser proof, or `No-command rationale:` when the runtime path is manual/interactive only and the claim is narrowed accordingly
143
+ - `Observations:` rendered DOM/behavior, interaction steps, and console/network observations when relevant
144
+ - `Artifacts:` screenshot/report/log paths if produced, with local-only vs publishable privacy/safety note
145
+ - `Claim limit:` the exact claim the observation can support
146
+
147
+ Evidence must later match route/state, viewport, observation, artifact path, evidence kind, privacy/safety note, result, and claim limit. Human approval does not replace required `code`, `test`, `runtime`, or `delivery` evidence. Existing Playwright/package-script browser tests remain canonical repeatable regression evidence when present. Do not plan new browser infrastructure by default; use Playwright scripting only for checks `agent-browser` cannot cover cleanly, such as JS-disabled, structured console, or multi-context verification.
148
+ </browser_proof_planning>
143
149
  <goal_backward_planning>
144
150
  Plan backward from success criteria.
145
151
 
146
152
  ### Step 1: State the must-haves
147
- From `ROADMAP.md`, list the success criteria for this phase. These are your non-negotiable targets.
153
+ For a roadmap phase, list the success criteria from `ROADMAP.md`. These are your non-negotiable targets.
148
154
  Also list the phase out-of-scope boundaries and stop/replan conditions. These are equally contractual: execution may not silently widen past them.
149
155
 
156
+ For `brownfield-change`, list the Done When criteria, in-scope boundaries, out-of-scope boundaries, current next action, and closeout path from `CHANGE.md`. These replace ROADMAP phase success criteria for this lane.
157
+
150
158
  ### Step 2: Derive artifacts
151
159
  For each success criterion, what concrete artifacts must exist?
152
160
  - Files (source code, config, tests)
@@ -197,18 +205,8 @@ anti_regression_targets:
197
205
  - Existing session middleware behavior remains unchanged for already-supported routes.
198
206
  known_unknowns:
199
207
  - Exact copy wording for auth errors may still need product confirmation.
200
- ui_proof_slots: []
201
- no_ui_proof_rationale: Not UI-sensitive; scoped work does not claim a visible UI outcome.
202
- high_leverage_surfaces: []
203
- second_pass_required: false
204
- closure_claim_limit: Do not claim phase completion until verification satisfies the evidence contract for the scoped truths.
205
- parallelism_budget:
206
- max_concurrent_plans: 1
207
- safe_parallelism: []
208
- leverage:
209
- lost: Slightly more planning ceremony for this plan.
210
- kept: Existing auth/session architecture and repo conventions.
211
- gained: Explicit anti-drift boundaries and fail-closed escalation.
208
+ browser_proof_required: false
209
+ browser_proof_rationale: Not UI-sensitive; scoped work does not claim a visible UI outcome.
212
210
  must_haves:
213
211
  truths:
214
212
  - User can sign in with email and password.
@@ -227,11 +225,9 @@ Schema rules:
227
225
  - `requirements` must not be empty
228
226
  - `files-modified` should list the files this plan is expected to touch
229
227
  - `must_haves` must trace back to roadmap success criteria
230
- - `non_goals`, `hard_boundaries`, `escalation_triggers`, and `closure_claim_limit` must not be empty
231
- - include `ui_proof_slots` for UI-sensitive work or `no_ui_proof_rationale` otherwise
232
- - `leverage.lost`, `leverage.kept`, and `leverage.gained` must all be explicit
233
- - `second_pass_required: true` if `high_leverage_surfaces` is non-empty
234
- - `parallelism_budget.max_concurrent_plans` must stay `1` unless the plan proves disjoint write ownership
228
+ - `non_goals`, `hard_boundaries`, `escalation_triggers`, and `approval_gates` must be explicit
229
+ - include `browser_proof_required` and `browser_proof_rationale`
230
+ - if `browser_proof_required: true`, include a `## Browser Proof Plan` section with route/state, viewport, runtime path, evidence kind, evidence command or no-command rationale, observations, artifacts, and claim limit
235
231
  </plan_schema>
236
232
 
237
233
  <task_format>
@@ -299,7 +295,7 @@ Split a task if:
299
295
  </task_sizing>
300
296
 
301
297
  <plan_structure>
302
- Create `.planning/phases/{phase_dir}/{plan_id}-PLAN.md` with this structure:
298
+ Create `.work/phases/{phase_dir}/{plan_id}-PLAN.md` with this structure:
303
299
 
304
300
  ```markdown
305
301
  ---
@@ -328,16 +324,8 @@ anti_regression_targets:
328
324
  - Existing user route behavior outside the new list view remains unchanged.
329
325
  known_unknowns:
330
326
  - Final empty-state copy may still need product confirmation.
331
- high_leverage_surfaces: []
332
- second_pass_required: false
333
- closure_claim_limit: Do not claim phase completion until verification confirms the scoped truths with the required evidence.
334
- parallelism_budget:
335
- max_concurrent_plans: 1
336
- safe_parallelism: []
337
- leverage:
338
- lost: Slightly more planning ceremony for stronger execution boundaries.
339
- kept: Existing route/component conventions and repo-native workflow.
340
- gained: Better anti-drift enforcement and more honest closure limits.
327
+ browser_proof_required: true
328
+ browser_proof_rationale: Visible route changes require rendered browser proof.
341
329
  must_haves:
342
330
  truths:
343
331
  - Users can view the list page.
@@ -384,6 +372,16 @@ must_haves:
384
372
  ## Approval Gates
385
373
  - [Decision or side-effect boundaries that require explicit user approval]
386
374
 
375
+ ## Browser Proof Plan
376
+ Routes/states: [Exact routes or UI states to inspect, or `N/A` when not required]
377
+ Viewports: [Desktop/mobile coverage or narrowed viewport claim]
378
+ Runtime path: [agent-browser preferred; explain fallback availability constraints]
379
+ Evidence kind: [runtime or test]
380
+ Evidence command: [Runnable command, or use `No-command rationale:` for narrowed manual/interactive proof]
381
+ Observations: [Rendered behavior, interaction steps, console/network observations]
382
+ Artifacts: [Screenshot/report/log paths plus local-only or publishable safety note]
383
+ Claim limit: [Exact claim this proof can support]
384
+
387
385
  <checks>
388
386
  <plan_check>
389
387
  checker: self | cross_runtime
@@ -410,24 +408,19 @@ notes: [What the checker actually validated or why it was skipped]
410
408
  ## Success Criteria
411
409
  - [What must be true when this plan is complete]
412
410
 
413
- ## High-Leverage Review
414
- - [Which high-leverage surfaces are touched and whether a second pass is required]
415
-
416
- ## Leverage Review
417
- - Lost: [What leverage this plan sacrifices]
418
- - Kept: [What existing leverage or conventions it preserves]
419
- - Gained: [What leverage this plan creates]
411
+ ## Second-Pass Review
412
+ - [Shared/high-risk surfaces to re-check for contradictions, stale assumptions, and overclaims before closure]
420
413
 
421
414
  ## Notes
422
415
  [Gotchas, implementation notes, or explicit assumptions]
423
416
  ```
424
417
 
425
- **MANDATORY: You MUST write PLAN.md to disk at `.planning/phases/{phase_dir}/{plan_id}-PLAN.md`. Output to conversation alone is NOT sufficient. If this file is not written to disk, planning is NOT complete.**
418
+ **MANDATORY: You MUST write PLAN.md to disk at `.work/phases/{phase_dir}/{plan_id}-PLAN.md`. Output to conversation alone is NOT sufficient. If this file is not written to disk, planning is NOT complete.**
426
419
  </plan_structure>
427
420
 
428
421
  <approach_exploration>
429
422
  ### When This Runs
430
- Check `.planning/config.json` for `workflow.discuss`:
423
+ Check `.work/config.json` for `workflow.discuss`:
431
424
  - If `workflow.discuss: false` (or key missing): skip this section, go to `<goal_backward_planning>`. Note `reduced_alignment` in the orchestration summary.
432
425
  - If `workflow.discuss: true`: mandatory before planning.
433
426
 
@@ -446,12 +439,12 @@ Run the approach explorer.
446
439
  **Primary path — inline conversation with research subagents:**
447
440
  The conversation with the user runs inline in the main context. For each technical gray area, a read-only research subagent is spawned to isolate heavy codebase and documentation reads, returning only compressed summaries while full detail stays out of the orchestrator context.
448
441
 
449
- 1. Load context: read ONLY locked decisions from `.planning/SPEC.md` and the target phase goal/requirements from `.planning/ROADMAP.md`.
442
+ 1. Load context: read ONLY locked decisions from `.work/SPEC.md` and the target phase goal/requirements from `.work/ROADMAP.md`.
450
443
 
451
444
  2. Identify 3-4 domain-specific gray areas. Classify each as **taste** (preference, no research needed), **technical** (trade-offs, research first), or **hybrid** (both).
452
445
 
453
446
  3. For each **technical or hybrid** gray area, spawn a read-only research subagent.
454
- Use the prompt template from `.planning/templates/roles/approach-explorer.md` (`<research_subagent_prompt>` section), substituting the gray area name, classification, phase context, and relevant codebase files. Each subagent returns a structured summary and does not write implementation artifacts.
447
+ Use the prompt template from `.work/templates/roles/approach-explorer.md` (`<research_subagent_prompt>` section), substituting the gray area name, classification, phase context, and relevant codebase files. Each subagent returns a structured summary and does not write implementation artifacts.
455
448
 
456
449
  4. Present each gray area to the user individually:
457
450
  - For taste areas: ask directly
@@ -469,7 +462,7 @@ The conversation with the user runs inline in the main context. For each technic
469
462
  **Native agent optimization:**
470
463
 
471
464
  If your runtime provides an interactive `gsdd-approach-explorer` agent:
472
- - Invoke it with: target phase goal, requirement IDs, project config from `.planning/config.json` (especially `workflow.discuss`), locked decisions, phase research (if exists), relevant codebase files
465
+ - Invoke it with: target phase goal, requirement IDs, project config from `.work/config.json` (especially `workflow.discuss`), locked decisions, phase research (if exists), relevant codebase files
473
466
  - The native agent runs the full exploration in its own context window
474
467
  - This is an optimization — the output (APPROACH.md) is identical to the primary path
475
468
 
@@ -484,14 +477,14 @@ If neither the primary path nor native agent is available (e.g., the runtime can
484
477
  ### Using APPROACH.md Decisions
485
478
  After approach exploration completes (or existing APPROACH.md is loaded):
486
479
  - If `workflow.discuss: true`, validate that APPROACH.md records `alignment_status: user_confirmed` or `alignment_status: approved_skip` with the canonical fields `alignment_method`, `user_confirmed_at`, `explicit_skip_approved`, `skip_scope`, `skip_rationale`, and `confirmed_decisions` before goal-backward planning begins. Stop and update the APPROACH artifact if proof is missing, unknown, agent-discretion-only, or based only on agent "No questions needed" judgment.
487
- - Treat decisions from APPROACH.md as locked constraints, same priority as `.planning/SPEC.md` decisions
480
+ - Treat decisions from APPROACH.md as locked constraints, same priority as `.work/SPEC.md` decisions
488
481
  - "Agent's Discretion" items from APPROACH.md give the planner flexibility — do not treat them as locked
489
482
  - Thread the APPROACH.md file path to both the planner prompt and the plan-checker prompt
490
483
  - Deferred ideas from APPROACH.md must not appear in the plan
491
484
 
492
485
  ### Role Contract
493
486
 
494
- The approach explorer's full role contract is at `.planning/templates/roles/approach-explorer.md`. The portable workflow describes the orchestration; the role contract describes the agent's behavior.
487
+ The approach explorer's full role contract is at `.work/templates/roles/approach-explorer.md`. The portable workflow describes the orchestration; the role contract describes the agent's behavior.
495
488
  </approach_exploration>
496
489
 
497
490
  <plan_check_orchestration>
@@ -507,22 +500,19 @@ After the planner produces a draft plan, an independent checker reviews it in fr
507
500
  6. `must_have_quality` - success criteria are specific, observable, and reflected in tasks
508
501
  7. `context_compliance` - locked decisions are honored and deferred ideas stay out of scope
509
502
  8. `goal_achievement` - the plan, if executed perfectly, actually achieves the stated phase goal: goal addressed (tasks deliver the goal), success criteria reachable (each criterion traceable to a task verify output), and outcome observable (a human or automated check can confirm the goal was met)
510
- 9. `scope_boundaries` - anti-goals and hard boundaries are explicit, enforceable, and reflected in the task set
511
- 10. `anti_regression_capture` - anti-regression targets are named and mapped to verification
512
- 11. `escalation_integrity` - stop-and-challenge triggers and approval gates are present where side effects or ambiguity warrant them
513
- 12. `closure_honesty` - closure claim limit prevents the plan from overclaiming what verification can prove
514
- 13. `high_leverage_review` - high-leverage surfaces and second-pass obligations are recorded honestly
515
- 14. `approach_alignment` - when APPROACH.md exists, plans implement the chosen approaches, not alternatives. Blocker if plan contradicts an explicit user choice. Warning if plan drifts from recommendation without justification. When `workflow.discuss: true`, missing, proofless, agent-discretion-only, or invalid APPROACH.md is a blocker before a plan can be accepted.
503
+ 9. `approach_alignment` - when APPROACH.md exists, plans implement the chosen approaches, not alternatives. Blocker if plan contradicts an explicit user choice. Warning if plan drifts from recommendation without justification. When `workflow.discuss: true`, missing, proofless, agent-discretion-only, or invalid APPROACH.md is a blocker before a plan can be accepted.
504
+
505
+ The smaller dimension set still preserves the old failure coverage: scope boundaries are checked under `scope_sanity`, anti-regression and escalation under `context_compliance`, closure honesty and browser-proof specificity under `goal_achievement`, and second-pass review under the final shared-surface review before closure.
516
506
  ### Invoking the Checker
517
- 1. If `.planning/config.json` has `workflow.planCheck: false`, skip the independent checker. Perform the planner self-check below and report `reduced_assurance`. This does not skip the earlier alignment-proof gate when `workflow.discuss: true`.
507
+ 1. If `.work/config.json` has `workflow.planCheck: false`, skip the independent checker. Perform the planner self-check below and report `reduced_assurance`. This does not skip the earlier alignment-proof gate when `workflow.discuss: true`.
518
508
  2. If plan checking is enabled, check if your runtime provides a `gsdd-plan-checker` agent.
519
509
  3. If a native checker agent is available, invoke it in a fresh context with only these explicit inputs:
520
510
  - target phase goal and requirement IDs
521
- - relevant locked decisions / deferred items from `.planning/SPEC.md`
522
- - project config from `.planning/config.json`, especially `workflow.discuss` and `workflow.planCheck`
523
- - approach decisions from `.planning/phases/*-APPROACH.md` (if exists)
511
+ - relevant locked decisions / deferred items from `.work/SPEC.md`
512
+ - project config from `.work/config.json`, especially `workflow.discuss` and `workflow.planCheck`
513
+ - approach decisions from `.work/phases/*-APPROACH.md` (if exists)
524
514
  - relevant phase research file(s)
525
- - produced `.planning/phases/*-PLAN.md` file(s)
515
+ - produced `.work/phases/*-PLAN.md` file(s)
526
516
  4. Require the checker to return a single JSON object:
527
517
  ```json
528
518
  {
@@ -530,7 +520,7 @@ After the planner produces a draft plan, an independent checker reviews it in fr
530
520
  "summary": "One sentence overall assessment",
531
521
  "issues": [
532
522
  {
533
- "dimension": "requirement_coverage | task_completeness | dependency_correctness | key_link_completeness | scope_sanity | must_have_quality | context_compliance | goal_achievement | scope_boundaries | anti_regression_capture | escalation_integrity | closure_honesty | high_leverage_review | approach_alignment",
523
+ "dimension": "requirement_coverage | task_completeness | dependency_correctness | key_link_completeness | scope_sanity | must_have_quality | context_compliance | goal_achievement | approach_alignment",
534
524
  "severity": "blocker | warning",
535
525
  "description": "What is wrong",
536
526
  "plan": "01-PLAN",
@@ -589,9 +579,9 @@ For each task:
589
579
  - [ ] `escalation_triggers` force stop-and-challenge instead of silent interpretation
590
580
  - [ ] `approval_gates` appear anywhere side effects or irreversible choices could happen
591
581
  - [ ] `anti_regression_targets` are concrete enough for verification to check later
592
- - [ ] `closure_claim_limit` prevents the executor from claiming more than the evidence can support
593
- - [ ] `leverage.lost`, `leverage.kept`, and `leverage.gained` are explicit and defensible
594
- - [ ] If `high_leverage_surfaces` is non-empty, `second_pass_required` is true and named in the plan body
582
+ - [ ] Evidence contract and claim limits prevent the executor from claiming more than verification can support
583
+ - [ ] Browser-proof-required plans include route/state, viewport, runtime path, evidence kind, evidence command or no-command rationale, observations, artifacts/privacy-safety posture, and claim limit
584
+ - [ ] Shared or high-risk surfaces are named for a second-pass contradiction/staleness review
595
585
 
596
586
  ### Red Flags
597
587
  - A success criterion has no task covering it
@@ -608,28 +598,30 @@ For each task:
608
598
  Planning is done when all of these are true:
609
599
 
610
600
  - [ ] Target phase identified from `ROADMAP.md`
601
+ - [ ] Or selected target is `brownfield-change` and `CHANGE.md` provides goal, scope, done-when, next action, and closeout path without ROADMAP phase membership
611
602
  - [ ] Approach exploration completed or explicitly skipped with `reduced_alignment` reported
612
603
  - [ ] When `workflow.discuss: true`: user alignment confirmed via APPROACH.md before planning
613
604
  - [ ] Research check completed where needed
614
605
  - [ ] Roadmap phase contract includes requirements, success criteria, explicit out-of-scope, and explicit stop/replan conditions
606
+ - [ ] Or brownfield contract includes in-scope, out-of-scope, concrete Done When criteria, current next action, and `VERIFICATION.md` closeout path
615
607
  - [ ] Plan self-check passed
616
- - [ ] Success criteria from `ROADMAP.md` are represented as must-haves
608
+ - [ ] Success criteria from `ROADMAP.md`, or Done When criteria from `CHANGE.md`, are represented as must-haves
617
609
  - [ ] Goal-backward derivation from criteria to artifacts to key links to tasks is explicit
618
- - [ ] Every plan has frontmatter with `phase`, `plan`, `type`, `wave`, `depends_on`, `files-modified`, `autonomous`, `requirements`, `non_goals`, `hard_boundaries`, `escalation_triggers`, `approval_gates`, `anti_regression_targets`, `ui_proof_slots` or `no_ui_proof_rationale`, `closure_claim_limit`, `parallelism_budget`, `leverage`, and `must_haves`
610
+ - [ ] Every plan has frontmatter with `phase`, `plan`, `type`, `wave`, `depends_on`, `files-modified`, `autonomous`, `requirements`, `non_goals`, `hard_boundaries`, `escalation_triggers`, `approval_gates`, `anti_regression_targets`, `known_unknowns`, `browser_proof_required`, `browser_proof_rationale`, and `must_haves`
619
611
  - [ ] Every plan frontmatter records `runtime` and `assurance`
620
612
  - [ ] Every plan records checker outcome in a structured `<checks>` block
621
613
  - [ ] Every task has XML structure with `id`, `type`, `files`, `action`, `verify`, and `done`
622
614
  - [ ] Every task has at least one runnable verify command
623
615
  - [ ] Plan sizing stays within 2-5 tasks, preferring 2-3
624
- - [ ] Locked decisions from `.planning/SPEC.md` and APPROACH.md are honored
625
- - [ ] Plan body includes explicit `## Anti-Goals`, `## Hard Boundaries`, `## Evidence Contract`, `## Common Pitfalls`, `## Stop-And-Challenge`, `## Approval Gates`, and `## Leverage Review` sections
626
- - [ ] Any git guidance stays repo-native and follows `.planning/config.json`
616
+ - [ ] Locked decisions from `.work/SPEC.md` and APPROACH.md are honored
617
+ - [ ] Plan body includes explicit `## Anti-Goals`, `## Hard Boundaries`, `## Evidence Contract`, `## Common Pitfalls`, `## Stop-And-Challenge`, `## Approval Gates`, and `## Second-Pass Review` sections; UI-sensitive plans also include `## Browser Proof Plan`
618
+ - [ ] Any git guidance stays repo-native and follows `.work/config.json`
627
619
  </success_criteria>
628
620
 
629
621
  <completion>
630
622
  Report to the user what was accomplished, then present the next step:
631
623
  ---
632
- **Completed:** Phase planning — created `.planning/phases/{phase_dir}/{plan_id}-PLAN.md`.
624
+ **Completed:** Phase planning — created `.work/phases/{phase_dir}/{plan_id}-PLAN.md`.
633
625
  **Planning stops here:** `gsdd-plan` ends after the plan artifact is written. Do not start implementation in this same run, and do not treat imperative handoff text as execution authorization.
634
626
  Installed generated runtime surfaces are trusted through rendering, not reviewer memory: `npx -y gsdd-cli health` compares any local generated skill/adapter surfaces against current render output, and `npx -y gsdd-cli update` regenerates them when they drift. Bare `gsdd health` / `gsdd update` are equivalent only when globally installed.
635
627
  **Next workflow:** `/gsdd-execute` — start execution in a separate run when the user explicitly wants implementation to begin