gsd-pi 2.65.0 → 2.66.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.
- package/dist/mcp-server.js +6 -2
- package/dist/resources/extensions/browser-tools/capture.js +20 -1
- package/dist/resources/extensions/browser-tools/tests/capture-sharp-optional.test.cjs +93 -0
- package/dist/resources/extensions/gsd/auto/finalize-timeout.js +2 -0
- package/dist/resources/extensions/gsd/auto/loop.js +2 -2
- package/dist/resources/extensions/gsd/auto/phases.js +48 -5
- package/dist/resources/extensions/gsd/auto/run-unit.js +13 -2
- package/dist/resources/extensions/gsd/auto/session.js +4 -0
- package/dist/resources/extensions/gsd/auto/types.js +2 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +2 -1
- package/dist/resources/extensions/gsd/auto-dispatch.js +99 -9
- package/dist/resources/extensions/gsd/auto-model-selection.js +7 -5
- package/dist/resources/extensions/gsd/auto-post-unit.js +17 -6
- package/dist/resources/extensions/gsd/auto-prompts.js +24 -0
- package/dist/resources/extensions/gsd/auto-recovery.js +40 -22
- package/dist/resources/extensions/gsd/auto-start.js +175 -12
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +10 -0
- package/dist/resources/extensions/gsd/auto-worktree.js +29 -7
- package/dist/resources/extensions/gsd/auto.js +21 -15
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +17 -4
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +10 -0
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +6 -4
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +5 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +11 -3
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +3 -1
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +31 -1
- package/dist/resources/extensions/gsd/commands/context.js +8 -1
- package/dist/resources/extensions/gsd/commands/handlers/core.js +23 -2
- package/dist/resources/extensions/gsd/commands-extensions.js +1 -1
- package/dist/resources/extensions/gsd/config-overlay.js +312 -0
- package/dist/resources/extensions/gsd/db-writer.js +13 -3
- package/dist/resources/extensions/gsd/detection.js +1 -1
- package/dist/resources/extensions/gsd/dispatch-guard.js +2 -1
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +1 -0
- package/dist/resources/extensions/gsd/doctor.js +2 -1
- package/dist/resources/extensions/gsd/files.js +17 -0
- package/dist/resources/extensions/gsd/gitignore.js +1 -0
- package/dist/resources/extensions/gsd/gsd-db.js +47 -4
- package/dist/resources/extensions/gsd/guided-flow.js +220 -29
- package/dist/resources/extensions/gsd/index.js +1 -1
- package/dist/resources/extensions/gsd/json-persistence.js +5 -2
- package/dist/resources/extensions/gsd/md-importer.js +14 -7
- package/dist/resources/extensions/gsd/notification-overlay.js +1 -1
- package/dist/resources/extensions/gsd/notification-widget.js +2 -1
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +1 -1
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +17 -11
- package/dist/resources/extensions/gsd/pre-execution-checks.js +26 -5
- package/dist/resources/extensions/gsd/preferences-types.js +3 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +45 -1
- package/dist/resources/extensions/gsd/preferences.js +9 -2
- package/dist/resources/extensions/gsd/preparation.js +1092 -0
- package/dist/resources/extensions/gsd/prompt-validation.js +67 -0
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +3 -3
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/discuss-prepared.md +424 -0
- package/dist/resources/extensions/gsd/prompts/discuss.md +2 -0
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +6 -1
- package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +5 -4
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +23 -0
- package/dist/resources/extensions/gsd/prompts/queue.md +2 -0
- package/dist/resources/extensions/gsd/prompts/rethink.md +2 -1
- package/dist/resources/extensions/gsd/prompts/system.md +2 -2
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +56 -23
- package/dist/resources/extensions/gsd/quick.js +19 -15
- package/dist/resources/extensions/gsd/reactive-graph.js +12 -0
- package/dist/resources/extensions/gsd/roadmap-slices.js +24 -5
- package/dist/resources/extensions/gsd/safety/content-validator.js +3 -3
- package/dist/resources/extensions/gsd/session-lock.js +23 -1
- package/dist/resources/extensions/gsd/state.js +115 -28
- package/dist/resources/extensions/gsd/templates/context-enhanced.md +138 -0
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +15 -3
- package/dist/resources/extensions/gsd/tools/complete-slice.js +27 -6
- package/dist/resources/extensions/gsd/tools/complete-task.js +31 -7
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +7 -5
- package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +5 -2
- package/dist/resources/extensions/gsd/tools/reopen-milestone.js +119 -0
- package/dist/resources/extensions/gsd/tools/reopen-slice.js +30 -0
- package/dist/resources/extensions/gsd/tools/reopen-task.js +18 -0
- package/dist/resources/extensions/gsd/triage-resolution.js +33 -16
- package/dist/resources/extensions/gsd/undo.js +3 -2
- package/dist/resources/extensions/gsd/workflow-events.js +1 -0
- package/dist/resources/extensions/gsd/workflow-logger.js +1 -1
- package/dist/resources/extensions/gsd/workflow-projections.js +7 -9
- package/dist/resources/extensions/gsd/workflow-reconcile.js +100 -9
- package/dist/resources/extensions/gsd/workflow-templates.js +11 -2
- package/dist/resources/extensions/gsd/worktree-manager.js +5 -2
- package/dist/resources/extensions/gsd/worktree.js +9 -0
- package/dist/resources/extensions/shared/interview-ui.js +1 -1
- package/dist/resources/extensions/subagent/agents.js +19 -5
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +14 -14
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +2 -2
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +14 -14
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +2 -2
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/6502.8874bcae249c02e1.js +9 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-a1c1e452c6b32d04.js → webpack-9fed74684e1c5bb1.js} +1 -1
- package/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js +30 -19
- package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js +51 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +9 -9
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.d.ts +2 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.js +10 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +20 -5
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js +15 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +18 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/retry-handler.test.ts +80 -0
- package/packages/pi-coding-agent/src/core/retry-handler.ts +37 -25
- package/packages/pi-coding-agent/src/core/sdk.ts +9 -9
- package/packages/pi-coding-agent/src/modes/interactive/components/provider-manager.ts +10 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +20 -4
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +27 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.ts +16 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +5 -0
- package/packages/pi-tui/dist/components/image.d.ts +2 -0
- package/packages/pi-tui/dist/components/image.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/image.js +4 -0
- package/packages/pi-tui/dist/components/image.js.map +1 -1
- package/packages/pi-tui/dist/components/image.test.d.ts +6 -0
- package/packages/pi-tui/dist/components/image.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/image.test.js +32 -0
- package/packages/pi-tui/dist/components/image.test.js.map +1 -0
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +3 -1
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/components/image.test.ts +36 -0
- package/packages/pi-tui/src/components/image.ts +5 -0
- package/packages/pi-tui/src/tui.ts +3 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/browser-tools/capture.ts +19 -1
- package/src/resources/extensions/browser-tools/tests/capture-sharp-optional.test.cjs +93 -0
- package/src/resources/extensions/gsd/auto/finalize-timeout.ts +3 -0
- package/src/resources/extensions/gsd/auto/loop.ts +2 -2
- package/src/resources/extensions/gsd/auto/phases.ts +68 -3
- package/src/resources/extensions/gsd/auto/run-unit.ts +12 -2
- package/src/resources/extensions/gsd/auto/session.ts +4 -0
- package/src/resources/extensions/gsd/auto/types.ts +5 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +2 -1
- package/src/resources/extensions/gsd/auto-dispatch.ts +110 -9
- package/src/resources/extensions/gsd/auto-model-selection.ts +7 -5
- package/src/resources/extensions/gsd/auto-post-unit.ts +16 -6
- package/src/resources/extensions/gsd/auto-prompts.ts +31 -0
- package/src/resources/extensions/gsd/auto-recovery.ts +29 -23
- package/src/resources/extensions/gsd/auto-start.ts +188 -10
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +10 -0
- package/src/resources/extensions/gsd/auto-worktree.ts +28 -7
- package/src/resources/extensions/gsd/auto.ts +19 -8
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +16 -4
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +10 -0
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +5 -4
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +4 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +11 -3
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +3 -1
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +36 -1
- package/src/resources/extensions/gsd/commands/context.ts +7 -1
- package/src/resources/extensions/gsd/commands/handlers/core.ts +26 -2
- package/src/resources/extensions/gsd/commands-extensions.ts +1 -1
- package/src/resources/extensions/gsd/config-overlay.ts +331 -0
- package/src/resources/extensions/gsd/db-writer.ts +11 -3
- package/src/resources/extensions/gsd/detection.ts +1 -1
- package/src/resources/extensions/gsd/dispatch-guard.ts +2 -1
- package/src/resources/extensions/gsd/docs/preferences-reference.md +1 -0
- package/src/resources/extensions/gsd/doctor.ts +2 -1
- package/src/resources/extensions/gsd/files.ts +19 -0
- package/src/resources/extensions/gsd/gitignore.ts +1 -0
- package/src/resources/extensions/gsd/gsd-db.ts +46 -4
- package/src/resources/extensions/gsd/guided-flow.ts +254 -30
- package/src/resources/extensions/gsd/index.ts +1 -0
- package/src/resources/extensions/gsd/json-persistence.ts +6 -3
- package/src/resources/extensions/gsd/md-importer.ts +13 -6
- package/src/resources/extensions/gsd/notification-overlay.ts +1 -1
- package/src/resources/extensions/gsd/notification-widget.ts +2 -1
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +1 -1
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +19 -11
- package/src/resources/extensions/gsd/pre-execution-checks.ts +32 -7
- package/src/resources/extensions/gsd/preferences-types.ts +25 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +45 -1
- package/src/resources/extensions/gsd/preferences.ts +9 -2
- package/src/resources/extensions/gsd/preparation.ts +1419 -0
- package/src/resources/extensions/gsd/prompt-validation.ts +88 -0
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +3 -3
- package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/discuss-prepared.md +424 -0
- package/src/resources/extensions/gsd/prompts/discuss.md +2 -0
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +6 -1
- package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +5 -4
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +23 -0
- package/src/resources/extensions/gsd/prompts/queue.md +2 -0
- package/src/resources/extensions/gsd/prompts/rethink.md +2 -1
- package/src/resources/extensions/gsd/prompts/system.md +2 -2
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +56 -23
- package/src/resources/extensions/gsd/quick.ts +20 -15
- package/src/resources/extensions/gsd/reactive-graph.ts +18 -0
- package/src/resources/extensions/gsd/roadmap-slices.ts +21 -5
- package/src/resources/extensions/gsd/safety/content-validator.ts +3 -3
- package/src/resources/extensions/gsd/session-lock.ts +17 -1
- package/src/resources/extensions/gsd/state.ts +115 -26
- package/src/resources/extensions/gsd/templates/context-enhanced.md +138 -0
- package/src/resources/extensions/gsd/tests/adversarial-review-fixes.test.ts +223 -0
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +33 -2
- package/src/resources/extensions/gsd/tests/auto-remediate-slice-status.test.ts +56 -0
- package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +41 -0
- package/src/resources/extensions/gsd/tests/complete-slice-verification-gate.test.ts +72 -0
- package/src/resources/extensions/gsd/tests/complete-task-normalize-lists.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/defer-milestone-stamp.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +4 -3
- package/src/resources/extensions/gsd/tests/discuss-incremental-persistence.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/discuss-slice-structured-questions.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard-closed-status.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/dispatcher-stuck-planning.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/error-success-mask.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +125 -0
- package/src/resources/extensions/gsd/tests/find-missing-summaries-closed.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/format-shortcut.test.ts +69 -0
- package/src/resources/extensions/gsd/tests/frontmatter-parse-noise.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/gitignore-bg-shell.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/guided-flow-state-rebuild.test.ts +103 -0
- package/src/resources/extensions/gsd/tests/import-done-milestones.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts +11 -9
- package/src/resources/extensions/gsd/tests/integration/state-machine-edge-cases.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/integration/state-machine-live-validation.test.ts +28 -30
- package/src/resources/extensions/gsd/tests/integration/test-isolation.ts +53 -0
- package/src/resources/extensions/gsd/tests/integration-prepared-discussion.test.ts +525 -0
- package/src/resources/extensions/gsd/tests/isolation-none-branch-guard.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +11 -10
- package/src/resources/extensions/gsd/tests/needs-remediation-revalidation.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/note-captures-executed.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +189 -0
- package/src/resources/extensions/gsd/tests/parallel-research-dispatch.test.ts +77 -0
- package/src/resources/extensions/gsd/tests/phantom-ghost-detection.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/phantom-milestone-default-queued.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/pre-exec-backtick-strip.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +284 -20
- package/src/resources/extensions/gsd/tests/pre-execution-fail-closed.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/preparation.test.ts +1211 -0
- package/src/resources/extensions/gsd/tests/project-root-cwd-crash.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/projection-no-plan-overwrite.test.ts +83 -0
- package/src/resources/extensions/gsd/tests/prompt-builder.test.ts +669 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +7 -4
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +85 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/query-tools-db-open.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/queued-discuss-fast-path.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/reactive-graph.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/rogue-file-detection.test.ts +4 -5
- package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/show-config-command.test.ts +56 -0
- package/src/resources/extensions/gsd/tests/skip-slice-state-rebuild.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/skipped-validation-completion.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/slice-sequence-insert.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/stale-lockfile-recovery.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/stale-queued-milestone.test.ts +147 -0
- package/src/resources/extensions/gsd/tests/stale-worktree-cwd.test.ts +13 -0
- package/src/resources/extensions/gsd/tests/stash-pop-gsd-conflict.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/state-machine-full-walkthrough.test.ts +6 -7
- package/src/resources/extensions/gsd/tests/status-db-open.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/subagent-agent-discovery.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/symlink-extension-discovery.test.ts +125 -0
- package/src/resources/extensions/gsd/tests/sync-worktree-skip-current.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +29 -1
- package/src/resources/extensions/gsd/tests/triage-resolution.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +3 -4
- package/src/resources/extensions/gsd/tests/verification-operational-gate.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/verify-artifact-tightened.test.ts +89 -0
- package/src/resources/extensions/gsd/tests/wave1-critical-regressions.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/wave2-events-regressions.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/wave3-session-regressions.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/wave4-write-safety-regressions.test.ts +70 -0
- package/src/resources/extensions/gsd/tests/wave5-consistency-regressions.test.ts +165 -0
- package/src/resources/extensions/gsd/tests/worker-model-override.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-audit.test.ts +6 -3
- package/src/resources/extensions/gsd/tests/worktree-expected-warnings.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/worktree-integration.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/worktree-main-branch.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +16 -17
- package/src/resources/extensions/gsd/tests/worktree-sync-tasks.test.ts +13 -9
- package/src/resources/extensions/gsd/tests/worktree.test.ts +26 -9
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +127 -2
- package/src/resources/extensions/gsd/tests/zero-slice-roadmap-guided.test.ts +19 -0
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +13 -3
- package/src/resources/extensions/gsd/tools/complete-slice.ts +26 -6
- package/src/resources/extensions/gsd/tools/complete-task.ts +29 -7
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +11 -9
- package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +5 -2
- package/src/resources/extensions/gsd/tools/reopen-milestone.ts +152 -0
- package/src/resources/extensions/gsd/tools/reopen-slice.ts +27 -0
- package/src/resources/extensions/gsd/tools/reopen-task.ts +17 -0
- package/src/resources/extensions/gsd/triage-resolution.ts +37 -17
- package/src/resources/extensions/gsd/types.ts +4 -0
- package/src/resources/extensions/gsd/undo.ts +3 -2
- package/src/resources/extensions/gsd/workflow-events.ts +5 -3
- package/src/resources/extensions/gsd/workflow-logger.ts +1 -1
- package/src/resources/extensions/gsd/workflow-projections.ts +7 -8
- package/src/resources/extensions/gsd/workflow-reconcile.ts +109 -8
- package/src/resources/extensions/gsd/workflow-templates.ts +11 -2
- package/src/resources/extensions/gsd/worktree-manager.ts +4 -2
- package/src/resources/extensions/gsd/worktree.ts +10 -0
- package/src/resources/extensions/shared/interview-ui.ts +1 -1
- package/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +8 -10
- package/src/resources/extensions/subagent/agents.ts +30 -6
- package/dist/web/standalone/.next/static/chunks/6502.7593d7797a4b3999.js +0 -9
- /package/dist/web/standalone/.next/static/{MRM3OSYIAa4HMDqVGQ9nt → Bdk1mnQugYZh7ZxuXUYvc}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{MRM3OSYIAa4HMDqVGQ9nt → Bdk1mnQugYZh7ZxuXUYvc}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GSD Prompt Validation — Validates enhanced context output before writing.
|
|
3
|
+
*
|
|
4
|
+
* Implements R109 validation requirement: CONTEXT.md must have required sections
|
|
5
|
+
* before being written to disk.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Validate that enhanced context content has all required sections.
|
|
9
|
+
*
|
|
10
|
+
* Required sections per R109:
|
|
11
|
+
* - Scope section (## Scope, ## Milestone Scope, or ## Why This Milestone)
|
|
12
|
+
* - Architectural Decisions section (## Architectural Decisions)
|
|
13
|
+
* - Acceptance Criteria section (## Acceptance Criteria or ## Final Integrated Acceptance)
|
|
14
|
+
*
|
|
15
|
+
* Additionally validates that the Architectural Decisions section contains
|
|
16
|
+
* at least one decision entry (### heading or **Decision marker).
|
|
17
|
+
*
|
|
18
|
+
* @param content - The enhanced context markdown content
|
|
19
|
+
* @returns ValidationResult with valid flag and list of missing sections
|
|
20
|
+
*/
|
|
21
|
+
export function validateEnhancedContext(content) {
|
|
22
|
+
const missing = [];
|
|
23
|
+
// Required section 1: Scope (multiple acceptable header variants)
|
|
24
|
+
const hasScopeSection = /^## Scope\b/m.test(content) ||
|
|
25
|
+
/^## Milestone Scope\b/m.test(content) ||
|
|
26
|
+
/^## Why This Milestone\b/m.test(content);
|
|
27
|
+
if (!hasScopeSection) {
|
|
28
|
+
missing.push("Milestone Scope or Why This Milestone");
|
|
29
|
+
}
|
|
30
|
+
// Required section 2: Architectural Decisions
|
|
31
|
+
const hasArchitecturalDecisions = /^## Architectural Decisions\b/m.test(content);
|
|
32
|
+
if (!hasArchitecturalDecisions) {
|
|
33
|
+
missing.push("Architectural Decisions");
|
|
34
|
+
}
|
|
35
|
+
// Required section 3: Acceptance Criteria (multiple acceptable header variants)
|
|
36
|
+
const hasAcceptanceCriteria = /^## Acceptance Criteria\b/m.test(content) ||
|
|
37
|
+
/^## Final Integrated Acceptance\b/m.test(content);
|
|
38
|
+
if (!hasAcceptanceCriteria) {
|
|
39
|
+
missing.push("Acceptance Criteria");
|
|
40
|
+
}
|
|
41
|
+
// Additional validation: Architectural Decisions must have at least one entry
|
|
42
|
+
if (hasArchitecturalDecisions) {
|
|
43
|
+
// Extract the section content between ## Architectural Decisions and the next ## heading.
|
|
44
|
+
// Uses indexOf-based extraction instead of regex with \z (which is invalid in JavaScript
|
|
45
|
+
// regex — it's PCRE/Ruby syntax and JS treats it as literal 'z').
|
|
46
|
+
const sectionStart = content.indexOf("## Architectural Decisions");
|
|
47
|
+
if (sectionStart === -1) {
|
|
48
|
+
missing.push("Architectural Decisions");
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
const afterHeading = content.slice(sectionStart + "## Architectural Decisions".length);
|
|
52
|
+
const nextSection = afterHeading.search(/^## /m);
|
|
53
|
+
const sectionContent = nextSection === -1 ? afterHeading : afterHeading.slice(0, nextSection);
|
|
54
|
+
// Check for actual decision entries:
|
|
55
|
+
// - ### heading (subsection per decision)
|
|
56
|
+
// - **Decision marker (inline decision format)
|
|
57
|
+
const hasDecisionEntry = /^### /m.test(sectionContent) || /^\*\*Decision/m.test(sectionContent);
|
|
58
|
+
if (!hasDecisionEntry) {
|
|
59
|
+
missing.push("At least one architectural decision entry");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
valid: missing.length === 0,
|
|
65
|
+
missing,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -28,7 +28,7 @@ Then:
|
|
|
28
28
|
|
|
29
29
|
### Verification Gate — STOP if verification failed
|
|
30
30
|
|
|
31
|
-
**If ANY verification failure was recorded in steps 3, 4, or 5, you MUST follow the failure path below. Do NOT proceed to step
|
|
31
|
+
**If ANY verification failure was recorded in steps 3, 4, or 5, you MUST follow the failure path below. Do NOT proceed to step 10.**
|
|
32
32
|
|
|
33
33
|
**Failure path** (verification failed):
|
|
34
34
|
- Do NOT call `gsd_complete_milestone` — the milestone must not be marked as complete.
|
|
@@ -39,7 +39,8 @@ Then:
|
|
|
39
39
|
|
|
40
40
|
**Success path** (all verifications passed — continue with steps 9–13):
|
|
41
41
|
|
|
42
|
-
9.
|
|
42
|
+
9. For each requirement whose status changed in step 8, call `gsd_requirement_update` with the requirement ID and updated `status` and `validation` fields — the tool regenerates `.gsd/REQUIREMENTS.md` automatically. Do this BEFORE completing the milestone so requirement updates are persisted.
|
|
43
|
+
10. **Persist completion through `gsd_complete_milestone`.** Call it with the parameters below. The tool updates the milestone status in the DB, renders `{{milestoneSummaryPath}}`, and validates all slices are complete before proceeding.
|
|
43
44
|
|
|
44
45
|
**Required parameters:**
|
|
45
46
|
- `milestoneId` (string) — Milestone ID (e.g. M001)
|
|
@@ -57,7 +58,6 @@ Then:
|
|
|
57
58
|
**Optional parameters:**
|
|
58
59
|
- `followUps` (string) — Follow-up items for future milestones
|
|
59
60
|
- `deviations` (string) — Deviations from the original plan
|
|
60
|
-
10. For each requirement whose status changed in step 8, call `gsd_requirement_update` with the requirement ID and updated `status` and `validation` fields — the tool regenerates `.gsd/REQUIREMENTS.md` automatically.
|
|
61
61
|
11. Update `.gsd/PROJECT.md`: use the `write` tool with `path: ".gsd/PROJECT.md"` and `content` containing the full updated document reflecting milestone completion and current project state. Do NOT use the `edit` tool for this — PROJECT.md is a full-document refresh.
|
|
62
62
|
12. Review all slice summaries for cross-cutting lessons, patterns, or gotchas that emerged during this milestone. Append any non-obvious, reusable insights to `.gsd/KNOWLEDGE.md`.
|
|
63
63
|
13. Do not commit manually — the system auto-commits your changes after this unit completes.
|
|
@@ -24,7 +24,7 @@ Then:
|
|
|
24
24
|
3. Run all slice-level verification checks defined in the slice plan. All must pass before marking the slice done. If any fail, fix them first.
|
|
25
25
|
4. If the slice plan includes observability/diagnostic surfaces, confirm they work. Skip this for simple slices that don't have observability sections.
|
|
26
26
|
5. If the slice involved runtime behavior, fill the **Operational Readiness** section (Q8) in the slice summary: health signal, failure signal, recovery procedure, and monitoring gaps. Omit entirely for simple slices with no runtime concerns.
|
|
27
|
-
6. If this slice produced evidence that a requirement changed status (Active → Validated, Active → Deferred, etc.), call `
|
|
27
|
+
6. If this slice produced evidence that a requirement changed status (Active → Validated, Active → Deferred, etc.), call `gsd_requirement_update` with the requirement ID, updated `status`, and `validation` evidence. Do NOT write `.gsd/REQUIREMENTS.md` directly — the engine renders it from the database.
|
|
28
28
|
7. Write `{{sliceSummaryPath}}` (compress all task summaries).
|
|
29
29
|
8. Write `{{sliceUatPath}}` — a concrete UAT script with real test cases derived from the slice plan and task summaries. Include preconditions, numbered steps with expected outcomes, and edge cases. This must NOT be a placeholder or generic template — tailor every test case to what this slice actually built.
|
|
30
30
|
9. Review task summaries for `key_decisions`. Append any significant decisions to `.gsd/DECISIONS.md` if missing.
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
{{preamble}}
|
|
2
|
+
|
|
3
|
+
You are conducting a **prepared discussion** — the system has already analyzed the codebase, gathered prior context, and researched the ecosystem. Your job is to present these findings, make recommendations, and gather the user's input through a structured 4-layer protocol.
|
|
4
|
+
|
|
5
|
+
## Preparation Briefs
|
|
6
|
+
|
|
7
|
+
The following briefs were generated during the preparation phase. Use them to ground your recommendations.
|
|
8
|
+
|
|
9
|
+
### Codebase Brief
|
|
10
|
+
|
|
11
|
+
{{codebaseBrief}}
|
|
12
|
+
|
|
13
|
+
### Prior Context Brief
|
|
14
|
+
|
|
15
|
+
{{priorContextBrief}}
|
|
16
|
+
|
|
17
|
+
### Ecosystem Brief
|
|
18
|
+
|
|
19
|
+
{{ecosystemBrief}}
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 4-Layer Discussion Protocol
|
|
24
|
+
|
|
25
|
+
This discussion proceeds through four mandatory layers. At each layer:
|
|
26
|
+
1. **Present findings** — share what the preparation revealed
|
|
27
|
+
2. **Make a recommendation** — take a position based on the evidence
|
|
28
|
+
3. **Ask clarifying questions** — fill gaps the preparation couldn't answer
|
|
29
|
+
4. **Gate** — use `ask_user_questions` to get explicit sign-off before advancing
|
|
30
|
+
|
|
31
|
+
**Do NOT skip layers.** Each layer builds on the previous. The user must explicitly approve each layer before you proceed.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Depth Adaptation
|
|
36
|
+
|
|
37
|
+
The depth of questioning at each layer should match THIS milestone's work type. Do not apply a fixed checklist — reason from first principles about what matters for this specific work.
|
|
38
|
+
|
|
39
|
+
**Work-type reasoning:**
|
|
40
|
+
- **API/service work** — Focus Layer 2 questions on contracts, versioning, backwards compatibility, authentication boundaries. Layer 3 must cover rate limiting, timeout cascades, and partial failure states.
|
|
41
|
+
- **CLI/developer tools** — Focus Layer 1 on user mental model and command grammar. Layer 4 needs shell compatibility, error message clarity, and exit code semantics.
|
|
42
|
+
- **ML/data pipelines** — Focus Layer 2 on data flow, reproducibility, and intermediate state. Layer 3 must cover data corruption, training divergence, and checkpoint recovery.
|
|
43
|
+
- **UI/frontend work** — Focus Layer 2 on component boundaries and state management. Layer 3 needs loading states, optimistic updates, and offline behavior. Layer 4 must include visual regression criteria.
|
|
44
|
+
- **Infrastructure/platform** — Focus Layer 2 on deployment topology and failure domains. Layer 3 must cover cascading failures, resource exhaustion, and rollback paths.
|
|
45
|
+
- **Refactoring/migration** — Focus Layer 1 on what changes vs what must stay identical. Layer 4 needs behavioral equivalence tests, not just code coverage.
|
|
46
|
+
|
|
47
|
+
**Adaptation principle:** Ask "What would cause this milestone to fail silently or succeed incorrectly?" The answer shapes which questions deserve deep exploration vs quick confirmation.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Layer 1 — Scope (What are we building?)
|
|
52
|
+
|
|
53
|
+
### Identify Work Type
|
|
54
|
+
|
|
55
|
+
**Before presenting findings, identify the primary work type and state it explicitly:**
|
|
56
|
+
|
|
57
|
+
"Based on [user's request and codebase analysis], this milestone is primarily **[work type]** work (e.g., API/backend, UI/frontend, CLI tool, data pipeline, simulation, infrastructure)."
|
|
58
|
+
|
|
59
|
+
This classification determines the depth and focus of questioning at each layer. If the work type spans multiple categories, state the dominant type and note the secondary types. The user can correct this classification.
|
|
60
|
+
|
|
61
|
+
### Present Findings
|
|
62
|
+
|
|
63
|
+
Start by presenting what you learned from the preparation:
|
|
64
|
+
|
|
65
|
+
1. **From the Codebase Brief:** Summarize the technology stack, key modules, and established patterns. Call out anything that constrains or enables the proposed work.
|
|
66
|
+
|
|
67
|
+
2. **From the Prior Context Brief:** Surface existing decisions, requirements, and knowledge that are relevant. Note any prior commitments or constraints.
|
|
68
|
+
|
|
69
|
+
3. **Scope implications:** Based on the above, explain what scope makes sense and what would conflict with the existing codebase.
|
|
70
|
+
|
|
71
|
+
### Make a Recommendation
|
|
72
|
+
|
|
73
|
+
Take a clear position: "Based on [specific findings], I recommend the milestone scope as [concrete description]."
|
|
74
|
+
|
|
75
|
+
Include:
|
|
76
|
+
- What the milestone will deliver (user-visible outcome)
|
|
77
|
+
- What it explicitly excludes (to prevent scope creep)
|
|
78
|
+
- Rough size estimate (number of slices, complexity)
|
|
79
|
+
|
|
80
|
+
### Resolve Scope — Mandatory Rounds
|
|
81
|
+
|
|
82
|
+
After presenting your recommendation, you MUST complete these rounds in order. Each round uses `ask_user_questions` or direct questions. Do NOT skip rounds. Do NOT combine rounds. Do NOT jump to the Layer 1 Gate until all rounds are complete.
|
|
83
|
+
|
|
84
|
+
**Complexity calibration:** If the milestone is simple (1-2 slices, well-understood patterns, no ambiguity), you may compress rounds — but you must still explicitly address each round's topic, even if briefly. You may NOT skip rounds entirely. For complex milestones (3+ slices, novel architecture, significant ambiguity), give each round full treatment.
|
|
85
|
+
|
|
86
|
+
**Round 1 — Feature boundaries:**
|
|
87
|
+
For each feature in your recommendation, state what it includes and excludes. Ask the user to confirm or adjust each boundary. Example: "Signup — I'm including email/password registration. I'm excluding OAuth, email verification, and phone number signup. Correct?"
|
|
88
|
+
|
|
89
|
+
**Round 2 — Ambiguity resolution:**
|
|
90
|
+
Identify every term or concept in the scope that could be interpreted multiple ways. For each one, state the two most likely interpretations and ask which the user intends. Example: "'User authentication' — do you mean just login/signup, or also session management, token refresh, and logout?"
|
|
91
|
+
|
|
92
|
+
**Round 3 — Dependencies and constraints:**
|
|
93
|
+
Ask about external dependencies (APIs, services, databases), existing code that will be affected, and constraints the user hasn't mentioned. Reference specific findings from the codebase brief. Example: "Your db.ts already has a getUser() function — should signup create users compatible with this existing model?"
|
|
94
|
+
|
|
95
|
+
**Round 4 — Priority and ordering:**
|
|
96
|
+
If the scope has multiple features, ask the user to rank them by priority. Ask what's the minimum viable version if the milestone needs to be cut short. Example: "If we had to ship with only 2 of the 3 slices, which two matter most?"
|
|
97
|
+
|
|
98
|
+
After completing all 4 rounds, proceed to the Layer 1 Gate.
|
|
99
|
+
|
|
100
|
+
### Layer 1 Gate
|
|
101
|
+
|
|
102
|
+
Before advancing, use `ask_user_questions` with question ID containing `layer1_scope_gate`:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Header: "Scope Gate"
|
|
106
|
+
Question: "Does this scope capture what you want to build?"
|
|
107
|
+
Options:
|
|
108
|
+
- "Yes, scope is correct (Recommended)" — proceed to Layer 2
|
|
109
|
+
- "Needs adjustment" — user will clarify, then re-present scope
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Do NOT proceed to Layer 2 until the user explicitly approves the scope.**
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Ecosystem Research (between layers)
|
|
117
|
+
|
|
118
|
+
Before presenting Layer 2 findings, use your available web search tools to research the technologies identified in the Codebase Brief. For each major technology (framework, ORM, key library):
|
|
119
|
+
|
|
120
|
+
1. Search for "[technology] [version] best practices [current year]"
|
|
121
|
+
2. Search for "[technology] [version] known issues"
|
|
122
|
+
|
|
123
|
+
Summarize findings concisely. If no search tools are available, note this and proceed using your training knowledge — don't block the discussion on missing search results.
|
|
124
|
+
|
|
125
|
+
Present ecosystem findings at the start of Layer 2 alongside your architecture recommendation.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Layer 2 — Architecture (How will it work?)
|
|
130
|
+
|
|
131
|
+
### Present Findings
|
|
132
|
+
|
|
133
|
+
Now present architectural recommendations grounded in evidence:
|
|
134
|
+
|
|
135
|
+
1. **From the Ecosystem Brief:** Share relevant best practices, known issues, library recommendations, and integration patterns discovered during research.
|
|
136
|
+
|
|
137
|
+
2. **From the Codebase Brief:** Identify existing architectural patterns that should be followed or deliberately broken from.
|
|
138
|
+
|
|
139
|
+
3. **Synthesis:** Explain how the ecosystem research applies to this specific codebase context.
|
|
140
|
+
|
|
141
|
+
### Make a Recommendation
|
|
142
|
+
|
|
143
|
+
Take a clear position: "I'd suggest [approach] because [evidence-based rationale]."
|
|
144
|
+
|
|
145
|
+
Cover:
|
|
146
|
+
- Overall architectural approach (new module? extend existing? separate service?)
|
|
147
|
+
- Key technical decisions (which libraries, patterns, data flow)
|
|
148
|
+
- Integration points with existing code
|
|
149
|
+
- What you'd avoid and why
|
|
150
|
+
|
|
151
|
+
### Resolve Architecture — Mandatory Rounds
|
|
152
|
+
|
|
153
|
+
After presenting your recommendation, you MUST complete these rounds in order. Do NOT skip rounds. Do NOT jump to the Layer 2 Gate until all rounds are complete.
|
|
154
|
+
|
|
155
|
+
**Complexity calibration:** If the milestone is simple (1-2 slices, well-understood patterns, no ambiguity), you may compress rounds — but you must still explicitly address each round's topic, even if briefly. You may NOT skip rounds entirely. For complex milestones (3+ slices, novel architecture, significant ambiguity), give each round full treatment.
|
|
156
|
+
|
|
157
|
+
**Round 1 — Per-slice technical decisions:**
|
|
158
|
+
For each slice in your decomposition, state the specific technical approach. Ask the user to confirm or adjust. Don't just say "build the signup endpoint" — state which library handles password hashing, where the route file lives, what the request/response schema looks like.
|
|
159
|
+
|
|
160
|
+
**Round 2 — Inter-slice contracts:**
|
|
161
|
+
For each dependency between slices, state explicitly what the upstream slice produces and what the downstream slice expects. Ask the user to confirm the interface. Example: "S01 produces a User model with {id, email, hashedPassword}. S02's login endpoint will query by email and compare password. Does this contract work?"
|
|
162
|
+
|
|
163
|
+
**Round 3 — Library and pattern decisions:**
|
|
164
|
+
For each library or pattern choice, present at least one alternative with tradeoffs. Ask the user to confirm. Example: "bcrypt vs argon2 for password hashing — bcrypt is more common in Node, argon2 is newer and more resistant to GPU attacks. I recommend bcrypt for simplicity. Agree?"
|
|
165
|
+
|
|
166
|
+
**Round 4 — Integration with existing code:**
|
|
167
|
+
Walk through how the new code connects to existing files and patterns. Ask about anything that might conflict. Reference specific files from the codebase brief. Example: "The new auth routes will mount at /api/auth alongside your existing /api router in routes.ts. Should they share the same router file or get their own auth-routes.ts?"
|
|
168
|
+
|
|
169
|
+
After completing all 4 rounds, proceed to the Layer 2 Gate.
|
|
170
|
+
|
|
171
|
+
### Layer 2 Gate
|
|
172
|
+
|
|
173
|
+
Before advancing, use `ask_user_questions` with question ID containing `layer2_architecture_gate`:
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
Header: "Architecture Gate"
|
|
177
|
+
Question: "Ready to move to error handling, or want to adjust the architecture?"
|
|
178
|
+
Options:
|
|
179
|
+
- "Architecture looks good (Recommended)" — proceed to Layer 3
|
|
180
|
+
- "Want to adjust" — user will clarify, then re-present architecture
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Do NOT proceed to Layer 3 until the user explicitly approves the architecture.**
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Layer 3 — Error States (What can go wrong?)
|
|
188
|
+
|
|
189
|
+
### Present Findings
|
|
190
|
+
|
|
191
|
+
Identify failure modes based on the scope and architecture:
|
|
192
|
+
|
|
193
|
+
1. **From the Ecosystem Brief:** Known issues, common pitfalls, edge cases that trip up similar implementations.
|
|
194
|
+
|
|
195
|
+
2. **From the Architecture:** Failure points at integration boundaries, async operations, external dependencies, user input handling.
|
|
196
|
+
|
|
197
|
+
3. **From the Codebase Brief:** How existing code handles errors — patterns to follow, gaps to fill.
|
|
198
|
+
|
|
199
|
+
### Make a Recommendation
|
|
200
|
+
|
|
201
|
+
Take a clear position: "The critical error paths are [X, Y, Z]. I recommend handling them by [approach]."
|
|
202
|
+
|
|
203
|
+
Cover:
|
|
204
|
+
- **Must-handle errors:** Failures that would break the user experience or corrupt data
|
|
205
|
+
- **Should-handle errors:** Degraded experiences that are acceptable with good messaging
|
|
206
|
+
- **Edge cases:** Boundary conditions, malformed input, timing issues
|
|
207
|
+
- **Recovery strategy:** Retry logic, fallback behavior, user notification
|
|
208
|
+
|
|
209
|
+
### Resolve Error Handling — Mandatory Rounds
|
|
210
|
+
|
|
211
|
+
After presenting your recommendation, ask the user:
|
|
212
|
+
|
|
213
|
+
**"Do you want to go deep on error handling, or accept the defaults I recommended?"**
|
|
214
|
+
|
|
215
|
+
Use `ask_user_questions` with options: "Go deep" / "Accept defaults"
|
|
216
|
+
|
|
217
|
+
If they accept defaults, record your recommendations as decisions and proceed to the Layer 3 Gate.
|
|
218
|
+
|
|
219
|
+
If they want to go deep, complete these rounds:
|
|
220
|
+
|
|
221
|
+
**Complexity calibration:** If the milestone is simple, you may compress rounds — but you must still explicitly address each round's topic. You may NOT skip rounds entirely.
|
|
222
|
+
|
|
223
|
+
**Round 1 — Input validation:**
|
|
224
|
+
For each endpoint or entry point, state what input validation happens and what error the user sees for invalid input. Ask the user to confirm. Example: "Signup with missing email returns 400 with {error: 'Email is required'}. Signup with invalid email format returns 400 with {error: 'Invalid email format'}. Right?"
|
|
225
|
+
|
|
226
|
+
**Round 2 — Authentication/authorization failures:**
|
|
227
|
+
For each protected operation, state what happens when auth fails. Ask the user to confirm. Example: "Expired JWT returns 401. Missing JWT returns 401. Malformed JWT returns 401. All three use the same generic message to avoid information leakage. Correct?"
|
|
228
|
+
|
|
229
|
+
**Round 3 — System failures:**
|
|
230
|
+
For each external dependency (database, API, file system), state what happens when it's unavailable. Ask the user to confirm. Example: "If Prisma can't connect to the database, all endpoints return 500 with a generic message. We log the real error server-side but never expose it to the client."
|
|
231
|
+
|
|
232
|
+
After completing all rounds (or accepting defaults), proceed to the Layer 3 Gate.
|
|
233
|
+
|
|
234
|
+
### Layer 3 Gate
|
|
235
|
+
|
|
236
|
+
Before advancing, use `ask_user_questions` with question ID containing `layer3_error_gate`:
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
Header: "Error Handling Gate"
|
|
240
|
+
Question: "Error handling strategy captured. Ready to define the quality bar?"
|
|
241
|
+
Options:
|
|
242
|
+
- "Yes, move to quality bar (Recommended)" — proceed to Layer 4
|
|
243
|
+
- "Want to adjust error handling" — user will clarify, then re-present errors
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**Do NOT proceed to Layer 4 until the user explicitly approves error handling.**
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Layer 4 — Quality Bar (What does done mean?)
|
|
251
|
+
|
|
252
|
+
### Present Findings
|
|
253
|
+
|
|
254
|
+
Define what "done" looks like based on everything discussed:
|
|
255
|
+
|
|
256
|
+
1. **Testing requirements:** What must be tested? Unit tests, integration tests, E2E tests? Based on the architecture's complexity and risk profile.
|
|
257
|
+
|
|
258
|
+
2. **Acceptance criteria:** Concrete, observable outcomes that prove the milestone is complete. Derived from the scope discussion.
|
|
259
|
+
|
|
260
|
+
3. **Performance/quality constraints:** Based on ecosystem research and codebase patterns — response times, error rates, accessibility requirements.
|
|
261
|
+
|
|
262
|
+
### Make a Recommendation
|
|
263
|
+
|
|
264
|
+
Take a clear position: "For this scope, I'd suggest these acceptance criteria: [list]."
|
|
265
|
+
|
|
266
|
+
Include:
|
|
267
|
+
- **Definition of done:** What conditions must be true for the milestone to be complete?
|
|
268
|
+
- **Test coverage expectations:** What must be tested vs nice-to-have?
|
|
269
|
+
- **Quality gates:** What would block shipping?
|
|
270
|
+
|
|
271
|
+
### Resolve Quality — Mandatory Rounds
|
|
272
|
+
|
|
273
|
+
After presenting your recommendation, you MUST complete these rounds in order. Do NOT skip rounds.
|
|
274
|
+
|
|
275
|
+
**Complexity calibration:** If the milestone is simple, you may compress rounds — but you must still explicitly address each round's topic, even if briefly. You may NOT skip rounds entirely.
|
|
276
|
+
|
|
277
|
+
**Round 1 — Per-slice acceptance criteria:**
|
|
278
|
+
For each slice, state 3-5 specific, testable acceptance criteria. Ask the user to confirm each slice's criteria. These must be concrete enough that the planner can use them directly. "Tests pass" is NOT an acceptance criterion. "POST /api/auth/signup with {email, password} returns 201 with {id, email}" IS an acceptance criterion.
|
|
279
|
+
|
|
280
|
+
**Round 2 — Test strategy:**
|
|
281
|
+
For each slice, state what type of tests are needed (unit, integration, e2e) and what specifically gets tested. Ask the user to confirm. Example: "S01 needs: unit test for password hashing, integration test for signup endpoint with valid and invalid inputs. No e2e needed for this slice."
|
|
282
|
+
|
|
283
|
+
**Round 3 — Definition of done:**
|
|
284
|
+
State the end-to-end scenario that proves the milestone works. Ask the user to confirm. Example: "Done means: a new user can sign up, log in, receive a JWT, and use that JWT to access a protected endpoint — all verified by running the sequence manually or via integration test."
|
|
285
|
+
|
|
286
|
+
After completing all 3 rounds, proceed to the Layer 4 Gate.
|
|
287
|
+
|
|
288
|
+
### Layer 4 Gate
|
|
289
|
+
|
|
290
|
+
Before advancing, use `ask_user_questions` with question ID containing `layer4_quality_gate`:
|
|
291
|
+
|
|
292
|
+
```
|
|
293
|
+
Header: "Quality Gate"
|
|
294
|
+
Question: "Quality bar defined. Ready to write context and roadmap?"
|
|
295
|
+
Options:
|
|
296
|
+
- "Yes, write the artifacts (Recommended)" — proceed to Output Phase
|
|
297
|
+
- "Want to adjust the quality bar" — user will clarify, then re-present quality
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Do NOT proceed to Output Phase until the user explicitly approves the quality bar.**
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## Output Phase
|
|
305
|
+
|
|
306
|
+
Once all four layers are complete, you have gathered:
|
|
307
|
+
- Confirmed scope (Layer 1)
|
|
308
|
+
- Approved architecture (Layer 2)
|
|
309
|
+
- Error handling strategy (Layer 3)
|
|
310
|
+
- Quality bar and acceptance criteria (Layer 4)
|
|
311
|
+
|
|
312
|
+
### Capability Contract
|
|
313
|
+
|
|
314
|
+
Before writing a roadmap, produce or update `.gsd/REQUIREMENTS.md`.
|
|
315
|
+
|
|
316
|
+
Use it as the project's explicit capability contract. Requirements discovered during the 4-layer discussion should be captured here with source `user` or `inferred` as appropriate.
|
|
317
|
+
|
|
318
|
+
**Print the requirements in chat before writing the roadmap.** Print a markdown table with columns: ID, Title, Status, Owner, Source. Group by status (Active, Deferred, Out of Scope). After the table, ask: "Confirm, adjust, or add?"
|
|
319
|
+
|
|
320
|
+
### Roadmap Preview
|
|
321
|
+
|
|
322
|
+
Before writing any files, **print the planned roadmap in chat** so the user can see and approve it. Print a markdown table with columns: Slice, Title, Risk, Depends, Demo. One row per slice. Below the table, print the milestone definition of done as a bullet list.
|
|
323
|
+
|
|
324
|
+
If the user raises a substantive objection, adjust the roadmap. Otherwise, present the roadmap and ask: "Ready to write, or want to adjust?" — one gate, not two.
|
|
325
|
+
|
|
326
|
+
### Naming Convention
|
|
327
|
+
|
|
328
|
+
Directories use bare IDs. Files use ID-SUFFIX format. Titles live inside file content, not in names.
|
|
329
|
+
- Milestone dir: `.gsd/milestones/{{milestoneId}}/`
|
|
330
|
+
- Milestone files: `{{milestoneId}}-CONTEXT.md`, `{{milestoneId}}-ROADMAP.md`
|
|
331
|
+
- Slice dirs: `S01/`, `S02/`, etc.
|
|
332
|
+
|
|
333
|
+
### Single Milestone
|
|
334
|
+
|
|
335
|
+
Once the user is satisfied, in a single pass:
|
|
336
|
+
1. `mkdir -p .gsd/milestones/{{milestoneId}}/slices`
|
|
337
|
+
2. Write or update `.gsd/PROJECT.md` — use the **Project** output template below. Describe what the project is, its current state, and list the milestone sequence.
|
|
338
|
+
3. Write or update `.gsd/REQUIREMENTS.md` — use the **Requirements** output template below. Confirm requirement states, ownership, and traceability before roadmap creation.
|
|
339
|
+
|
|
340
|
+
**Depth-Preservation Guidance for context.md:**
|
|
341
|
+
When writing context.md, preserve the user's exact terminology, emphasis, and specific framing from the discussion. Do not paraphrase user nuance into generic summaries. If the user said "craft feel," write "craft feel" — not "high-quality user experience." If they emphasized a specific constraint or negative requirement, carry that emphasis through verbatim. The context file is downstream agents' only window into this conversation — flattening specifics into generics loses the signal that shaped every decision.
|
|
342
|
+
|
|
343
|
+
**Enhanced Context Requirement:** Because this is a prepared discussion, use the `context-enhanced` template which includes sections for Codebase Brief, Architectural Decisions, Interface Contracts, Error Handling Strategy, Testing Requirements, Acceptance Criteria, and Ecosystem Notes. Populate these from the 4-layer discussion:
|
|
344
|
+
- Codebase Brief: from Layer 1 presentation
|
|
345
|
+
- Architectural Decisions: from Layer 2 — each decision with rationale, evidence, alternatives
|
|
346
|
+
- Error Handling Strategy: from Layer 3
|
|
347
|
+
- Testing Requirements and Acceptance Criteria: from Layer 4
|
|
348
|
+
- Ecosystem Notes: key findings from the ecosystem brief
|
|
349
|
+
|
|
350
|
+
4. Write `{{contextPath}}` — use the **Context Enhanced** output template below. Preserve key risks, unknowns, existing codebase constraints, integration points, and relevant requirements surfaced during discussion.
|
|
351
|
+
5. Call `gsd_plan_milestone` to create the roadmap. Decompose into demoable vertical slices with risk, depends, demo sentences, proof strategy, verification classes, milestone definition of done, requirement coverage, and a boundary map. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment. Use the **Roadmap** output template below to structure the tool call parameters.
|
|
352
|
+
6. For each architectural or pattern decision made during discussion, call `gsd_decision_save` — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically.
|
|
353
|
+
7. {{commitInstruction}}
|
|
354
|
+
|
|
355
|
+
After writing the files, say exactly: "Milestone {{milestoneId}} ready." — nothing else. Auto-mode will start automatically.
|
|
356
|
+
|
|
357
|
+
### Multi-Milestone
|
|
358
|
+
|
|
359
|
+
Once the user confirms the milestone split:
|
|
360
|
+
|
|
361
|
+
#### Phase 1: Shared artifacts
|
|
362
|
+
|
|
363
|
+
1. For each milestone, call `gsd_milestone_generate_id` to get its ID — never invent milestone IDs manually. Then `mkdir -p .gsd/milestones/<ID>/slices`.
|
|
364
|
+
2. Write `.gsd/PROJECT.md` — use the **Project** output template below.
|
|
365
|
+
3. Write `.gsd/REQUIREMENTS.md` — use the **Requirements** output template below. Capture Active, Deferred, Out of Scope, and any already Validated requirements. Later milestones may have provisional ownership where slice plans do not exist yet.
|
|
366
|
+
4. For any architectural or pattern decisions made during discussion, call `gsd_decision_save` — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically.
|
|
367
|
+
|
|
368
|
+
#### Phase 2: Primary milestone
|
|
369
|
+
|
|
370
|
+
5. Write a full enhanced `CONTEXT.md` for the primary milestone (the one discussed in depth). Use the `context-enhanced` template.
|
|
371
|
+
6. Call `gsd_plan_milestone` for **only the primary milestone** — detail-planning later milestones now is waste because the codebase will change. Include requirement coverage and a milestone definition of done.
|
|
372
|
+
|
|
373
|
+
#### MANDATORY: depends_on Frontmatter in CONTEXT.md
|
|
374
|
+
|
|
375
|
+
Every CONTEXT.md for a milestone that depends on other milestones MUST have YAML frontmatter with `depends_on`. The auto-mode state machine reads this field to determine execution order — without it, milestones may execute out of order or in parallel when they shouldn't.
|
|
376
|
+
|
|
377
|
+
```yaml
|
|
378
|
+
---
|
|
379
|
+
depends_on: [M001, M002]
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
# M003: Title
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
If a milestone has no dependencies, omit the frontmatter. The dependency chain from the milestone confirmation gate MUST be reflected in each CONTEXT.md frontmatter. Do NOT rely on QUEUE.md or PROJECT.md for dependency tracking — the state machine only reads CONTEXT.md frontmatter.
|
|
386
|
+
|
|
387
|
+
#### Phase 3: Sequential readiness gate for remaining milestones
|
|
388
|
+
|
|
389
|
+
For each remaining milestone **one at a time, in sequence**, decide the most likely readiness mode from the evidence you already have, then use `ask_user_questions` to let the user correct that recommendation. Present three options:
|
|
390
|
+
|
|
391
|
+
- **"Discuss now"** — The user wants to conduct a focused discussion for this milestone in the current session, while the context from the broader discussion is still fresh. Proceed with a focused discussion for this milestone (Layer 1-4 protocol). When the discussion concludes, write a full enhanced `CONTEXT.md`. Then move to the gate for the next milestone.
|
|
392
|
+
- **"Write draft for later"** — This milestone has seed material from the current conversation but needs its own dedicated discussion in a future session. Write a `CONTEXT-DRAFT.md` capturing the seed material (what was discussed, key ideas, provisional scope, open questions). Mark it clearly as a draft, not a finalized context. **What happens downstream:** When auto-mode reaches this milestone, it pauses and notifies the user: "M00x has draft context — needs discussion. Run /gsd." The `/gsd` wizard shows a "Discuss from draft" option that seeds the new discussion with this draft, so nothing from the current conversation is lost. After the dedicated discussion produces a full CONTEXT.md, the draft file is automatically deleted.
|
|
393
|
+
- **"Just queue it"** — This milestone is identified but intentionally left without context. No context file is written — the directory already exists from Phase 1. **What happens downstream:** When auto-mode reaches this milestone, it pauses and notifies the user to run /gsd. The wizard starts a full discussion from scratch.
|
|
394
|
+
|
|
395
|
+
**When "Discuss now" is chosen:** Run the full 4-layer protocol for that milestone using fresh preparation briefs scoped to that milestone.
|
|
396
|
+
|
|
397
|
+
#### Milestone Gate Tracking (MANDATORY for multi-milestone)
|
|
398
|
+
|
|
399
|
+
After EVERY Phase 3 gate decision, immediately write or update `.gsd/DISCUSSION-MANIFEST.json` with the cumulative state. This file is mechanically validated by the system before auto-mode starts — if gates are incomplete, auto-mode will NOT start.
|
|
400
|
+
|
|
401
|
+
```json
|
|
402
|
+
{
|
|
403
|
+
"primary": "M001",
|
|
404
|
+
"milestones": {
|
|
405
|
+
"M001": { "gate": "discussed", "context": "full" },
|
|
406
|
+
"M002": { "gate": "discussed", "context": "full" },
|
|
407
|
+
"M003": { "gate": "queued", "context": "none" }
|
|
408
|
+
},
|
|
409
|
+
"total": 3,
|
|
410
|
+
"gates_completed": 3
|
|
411
|
+
}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
Write this file AFTER each gate decision, not just at the end. Update `gates_completed` incrementally. The system reads this file and BLOCKS auto-start if `gates_completed < total`.
|
|
415
|
+
|
|
416
|
+
For single-milestone projects, do NOT write this file — it is only for multi-milestone discussions.
|
|
417
|
+
|
|
418
|
+
#### Phase 4: Finalize
|
|
419
|
+
|
|
420
|
+
7. {{multiMilestoneCommitInstruction}}
|
|
421
|
+
|
|
422
|
+
After writing the files, say exactly: "Milestone M001 ready." — nothing else. Auto-mode will start automatically.
|
|
423
|
+
|
|
424
|
+
{{inlinedTemplates}}
|
|
@@ -114,6 +114,8 @@ If they clarify, absorb the correction and re-verify.
|
|
|
114
114
|
|
|
115
115
|
The depth verification is the required write-gate. Do **not** add another meta "ready to proceed?" checkpoint immediately after it unless there is still material ambiguity.
|
|
116
116
|
|
|
117
|
+
**CRITICAL — Non-bypassable gate:** The system mechanically blocks CONTEXT.md writes until the user selects the "(Recommended)" option. If the user declines, cancels, or the tool fails, you MUST re-ask — never rationalize past the block ("tool not responding, I'll proceed" is forbidden). The gate exists to protect the user's work; treat a block as an instruction, not an obstacle to work around.
|
|
118
|
+
|
|
117
119
|
## Wrap-up Gate
|
|
118
120
|
|
|
119
121
|
Once the depth checklist is fully satisfied, move directly into requirements and roadmap preview. Do not insert a separate "are you ready to continue?" gate unless the user explicitly wants to keep brainstorming or you still see material ambiguity.
|
|
@@ -8,6 +8,8 @@ Discuss milestone {{milestoneId}} ("{{milestoneTitle}}"). Identify gray areas, a
|
|
|
8
8
|
|
|
9
9
|
## Interview Protocol
|
|
10
10
|
|
|
11
|
+
{{fastPathInstruction}}
|
|
12
|
+
|
|
11
13
|
### Before your first question round
|
|
12
14
|
|
|
13
15
|
Do a lightweight targeted investigation so your questions are grounded in reality:
|
|
@@ -40,7 +42,8 @@ After the user answers, investigate further if any answer opens a new unknown, t
|
|
|
40
42
|
|
|
41
43
|
After each round of answers, decide whether you already have enough depth to write a strong context file.
|
|
42
44
|
|
|
43
|
-
-
|
|
45
|
+
- **Incremental persistence:** After every 2 question rounds, silently save a `{{milestoneId}}-CONTEXT-DRAFT.md` with your current understanding using `gsd_summary_save` with `artifact_type: "CONTEXT-DRAFT"`. This protects against session crashes losing all confirmed work. Do NOT mention this save to the user — it's invisible bookkeeping. The final context file will overwrite it.
|
|
46
|
+
- If not ready, investigate any newly-opened unknowns and continue to the next round immediately. Do **not** ask a meta "ready to wrap up?" question after every round.
|
|
44
47
|
- Use a single wrap-up prompt only when you genuinely believe the depth checklist is satisfied or the user signals they want to stop.
|
|
45
48
|
- **If `{{structuredQuestionsAvailable}}` is `true` and you need that wrap-up prompt:** use `ask_user_questions` with options:
|
|
46
49
|
- "Write the context file" *(recommended when depth is satisfied)*
|
|
@@ -97,6 +100,8 @@ If they clarify, absorb the correction and re-verify.
|
|
|
97
100
|
|
|
98
101
|
The depth verification is the only required confirmation gate. Do not add a second "ready to proceed?" gate after it.
|
|
99
102
|
|
|
103
|
+
**CRITICAL — Non-bypassable gate:** The system mechanically blocks CONTEXT.md writes until the user selects the "(Recommended)" option. If the user declines, cancels, or the tool fails, you MUST re-ask — never rationalize past the block ("tool not responding, I'll proceed" is forbidden). The gate exists to protect the user's work; treat a block as an instruction, not an obstacle to work around.
|
|
104
|
+
|
|
100
105
|
---
|
|
101
106
|
|
|
102
107
|
## Output
|
|
@@ -22,7 +22,9 @@ Do **not** go deep — just enough that your questions reflect what's actually t
|
|
|
22
22
|
|
|
23
23
|
### Question rounds
|
|
24
24
|
|
|
25
|
-
Ask **1–3 questions per round** using `ask_user_questions`. **Call `ask_user_questions` exactly once per turn — never make multiple calls with the same or overlapping questions. Wait for the user's response before asking the next round.**
|
|
25
|
+
**If `{{structuredQuestionsAvailable}}` is `true`:** Ask **1–3 questions per round** using `ask_user_questions`. **Call `ask_user_questions` exactly once per turn — never make multiple calls with the same or overlapping questions. Wait for the user's response before asking the next round.**
|
|
26
|
+
**If `{{structuredQuestionsAvailable}}` is `false`:** Ask **1–3 questions per round** in plain text. Number them and wait for the user's response before asking the next round.
|
|
27
|
+
Keep each question focused on one of:
|
|
26
28
|
- **UX and user-facing behaviour** — what does the user see, click, trigger, or experience?
|
|
27
29
|
- **Edge cases and failure states** — what happens when things go wrong or are in unusual states?
|
|
28
30
|
- **Scope boundaries** — what is explicitly in vs out for this slice? What deferred to later?
|
|
@@ -34,11 +36,10 @@ After the user answers, investigate further if any answer opens a new unknown, t
|
|
|
34
36
|
|
|
35
37
|
After each round of answers, decide whether you already have enough signal to write the slice context cleanly.
|
|
36
38
|
|
|
39
|
+
- **Incremental persistence:** After every 2 question rounds, silently save a draft `{{sliceId}}-CONTEXT-DRAFT.md` in `{{sliceDirPath}}` using `gsd_summary_save` with `milestone_id: {{milestoneId}}`, `slice_id: {{sliceId}}`, `artifact_type: "CONTEXT-DRAFT"`. This protects against session crashes losing confirmed work. Do NOT mention this to the user. The final context file will replace it.
|
|
37
40
|
- If not, investigate any new unknowns and continue to the next round immediately. Do **not** ask a meta "ready to wrap up?" question after every round.
|
|
38
41
|
- Ask a single wrap-up question only when you genuinely believe the slice is well understood or the user signals they want to stop.
|
|
39
|
-
- When you do ask it,
|
|
40
|
-
- "Write the context file" *(recommended when the slice is well understood)*
|
|
41
|
-
- "One more pass"
|
|
42
|
+
- When you do ask it, offer two choices: "Write the context file" *(recommended when the slice is well understood)* or "One more pass". Use `ask_user_questions` if available, otherwise ask in plain text.
|
|
42
43
|
|
|
43
44
|
---
|
|
44
45
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Parallel Slice Research
|
|
2
|
+
|
|
3
|
+
You are dispatching parallel research agents for **{{sliceCount}} slices** in milestone **{{mid}} — {{midTitle}}**.
|
|
4
|
+
|
|
5
|
+
## Slices to Research
|
|
6
|
+
|
|
7
|
+
{{sliceList}}
|
|
8
|
+
|
|
9
|
+
## Mission
|
|
10
|
+
|
|
11
|
+
Dispatch ALL slices simultaneously using the `subagent` tool in **parallel mode**. Each subagent will independently research its slice and write a RESEARCH file.
|
|
12
|
+
|
|
13
|
+
## Execution Protocol
|
|
14
|
+
|
|
15
|
+
1. Call `subagent` with `tasks: [...]` containing one entry per slice below
|
|
16
|
+
2. Wait for ALL subagents to complete
|
|
17
|
+
3. Verify each slice's RESEARCH file was written (check the `.gsd/{{mid}}/` directory)
|
|
18
|
+
4. If any subagent failed to write its RESEARCH file, re-run it individually
|
|
19
|
+
5. Report which slices completed research and which (if any) failed
|
|
20
|
+
|
|
21
|
+
## Subagent Prompts
|
|
22
|
+
|
|
23
|
+
{{subagentPrompts}}
|
|
@@ -103,6 +103,8 @@ The user confirms or corrects before you write. One depth verification per miles
|
|
|
103
103
|
|
|
104
104
|
**If you skip this step, the system will block the CONTEXT.md write and return an error telling you to complete verification first.**
|
|
105
105
|
|
|
106
|
+
**CRITICAL — Non-bypassable gate:** The system mechanically blocks CONTEXT.md writes until the user selects the "(Recommended)" option. If the user declines, cancels, or the tool fails, you MUST re-ask — never rationalize past the block ("tool not responding, I'll proceed" is forbidden). The gate exists to protect the user's work; treat a block as an instruction, not an obstacle to work around.
|
|
107
|
+
|
|
106
108
|
## Output Phase
|
|
107
109
|
|
|
108
110
|
Once the user is satisfied, in a single pass for **each** new milestone:
|
|
@@ -46,11 +46,12 @@ reason: "<reason>"
|
|
|
46
46
|
Remove the `{ID}-PARKED.md` file from the milestone directory to reactivate it.
|
|
47
47
|
|
|
48
48
|
### Skip a slice
|
|
49
|
-
Mark a slice as skipped so auto-mode advances past it without executing.
|
|
49
|
+
Mark a slice as skipped so auto-mode advances past it without executing. **You MUST call the `gsd_skip_slice` tool** — editing the roadmap markdown alone is NOT sufficient because auto-mode reads slice status from the database, not the roadmap file:
|
|
50
50
|
```
|
|
51
51
|
gsd_skip_slice({ milestoneId: "M003", sliceId: "S02", reason: "Descoped — feature moved to M005" })
|
|
52
52
|
```
|
|
53
53
|
Skipped slices are treated as closed by the state machine (like "complete" but distinct). Use when a slice is no longer needed or has been superseded. The slice data is preserved for reference.
|
|
54
|
+
**Do NOT** just check the slice checkbox in the roadmap — this does not update the DB and auto-mode will resume the slice.
|
|
54
55
|
|
|
55
56
|
### Discard a milestone
|
|
56
57
|
**Permanently** delete a milestone directory and prune it from QUEUE-ORDER.json. **Always confirm with the user before discarding.** Warn explicitly if the milestone has completed work.
|