gsd-pi 2.65.0-dev.5c8557b → 2.65.0-dev.d0517ff
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/run-unit.js +13 -2
- package/dist/resources/extensions/gsd/auto/session.js +4 -0
- 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 +42 -11
- 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/write-gate.js +31 -1
- package/dist/resources/extensions/gsd/commands/context.js +8 -1
- package/dist/resources/extensions/gsd/commands/handlers/core.js +20 -0
- 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/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/parallel-orchestrator.js +17 -11
- package/dist/resources/extensions/gsd/pre-execution-checks.js +12 -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/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/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +15 -15
- 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 +15 -15
- 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/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/src/components/image.test.ts +36 -0
- package/packages/pi-tui/src/components/image.ts +5 -0
- 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/run-unit.ts +12 -2
- package/src/resources/extensions/gsd/auto/session.ts +4 -0
- 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 +45 -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/write-gate.ts +36 -1
- package/src/resources/extensions/gsd/commands/context.ts +7 -1
- package/src/resources/extensions/gsd/commands/handlers/core.ts +23 -0
- 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/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/parallel-orchestrator.ts +19 -11
- package/src/resources/extensions/gsd/pre-execution-checks.ts +15 -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/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/find-missing-summaries-closed.test.ts +48 -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/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/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 +218 -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/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/dist/web/standalone/.next/static/chunks/6502.7593d7797a4b3999.js +0 -9
- /package/dist/web/standalone/.next/static/{qq3YfHPfyqvh3DIMVmsRH → JwdBI3y1H8vtBKiYvWfEK}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{qq3YfHPfyqvh3DIMVmsRH → JwdBI3y1H8vtBKiYvWfEK}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression test for discuss phase incremental persistence (#2152).
|
|
3
|
+
* Verifies both milestone and slice discuss prompts instruct agents to
|
|
4
|
+
* save CONTEXT-DRAFT incrementally during question rounds.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { describe, test } from "node:test";
|
|
8
|
+
import assert from "node:assert/strict";
|
|
9
|
+
import { readFileSync } from "node:fs";
|
|
10
|
+
import { join, dirname } from "node:path";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
|
|
13
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const promptsDir = join(__dirname, "..", "prompts");
|
|
15
|
+
|
|
16
|
+
describe("discuss incremental persistence (#2152)", () => {
|
|
17
|
+
test("milestone discuss prompt includes CONTEXT-DRAFT save instruction", () => {
|
|
18
|
+
const content = readFileSync(join(promptsDir, "guided-discuss-milestone.md"), "utf-8");
|
|
19
|
+
assert.match(content, /CONTEXT-DRAFT/, "should mention CONTEXT-DRAFT");
|
|
20
|
+
assert.match(content, /Incremental persistence/, "should have incremental persistence section");
|
|
21
|
+
assert.match(content, /gsd_summary_save/, "should use gsd_summary_save tool");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test("slice discuss prompt includes CONTEXT-DRAFT save instruction", () => {
|
|
25
|
+
const content = readFileSync(join(promptsDir, "guided-discuss-slice.md"), "utf-8");
|
|
26
|
+
assert.match(content, /CONTEXT-DRAFT/, "should mention CONTEXT-DRAFT");
|
|
27
|
+
assert.match(content, /Incremental persistence/, "should have incremental persistence section");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test("drafts are saved silently without user notification", () => {
|
|
31
|
+
const milestone = readFileSync(join(promptsDir, "guided-discuss-milestone.md"), "utf-8");
|
|
32
|
+
const slice = readFileSync(join(promptsDir, "guided-discuss-slice.md"), "utf-8");
|
|
33
|
+
assert.match(milestone, /Do NOT mention this save to the user/);
|
|
34
|
+
assert.match(slice, /Do NOT mention this to the user/);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression test for discuss-slice structured questions availability
|
|
3
|
+
*
|
|
4
|
+
* The guided-discuss-slice.md template must use the structuredQuestionsAvailable
|
|
5
|
+
* template variable to conditionally switch between ask_user_questions tool
|
|
6
|
+
* calls and plain-text questions, so the prompt works correctly when the
|
|
7
|
+
* structured questions tool is not available.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { describe, it } from 'node:test'
|
|
11
|
+
import assert from 'node:assert/strict'
|
|
12
|
+
import { readFileSync } from 'node:fs'
|
|
13
|
+
import { resolve } from 'node:path'
|
|
14
|
+
|
|
15
|
+
const template = readFileSync(
|
|
16
|
+
resolve(process.cwd(), 'src', 'resources', 'extensions', 'gsd', 'prompts', 'guided-discuss-slice.md'),
|
|
17
|
+
'utf-8',
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
describe('discuss-slice structuredQuestionsAvailable template variable', () => {
|
|
21
|
+
it('template references structuredQuestionsAvailable variable', () => {
|
|
22
|
+
assert.ok(
|
|
23
|
+
template.includes('{{structuredQuestionsAvailable}}'),
|
|
24
|
+
'guided-discuss-slice.md must use {{structuredQuestionsAvailable}} template variable',
|
|
25
|
+
)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('template handles both true and false cases', () => {
|
|
29
|
+
const trueCase = template.includes('`{{structuredQuestionsAvailable}}` is `true`')
|
|
30
|
+
const falseCase = template.includes('`{{structuredQuestionsAvailable}}` is `false`')
|
|
31
|
+
|
|
32
|
+
assert.ok(trueCase, 'template must have a branch for structuredQuestionsAvailable=true')
|
|
33
|
+
assert.ok(falseCase, 'template must have a branch for structuredQuestionsAvailable=false')
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('false case instructs plain text questions', () => {
|
|
37
|
+
const falseIdx = template.indexOf('`{{structuredQuestionsAvailable}}` is `false`')
|
|
38
|
+
assert.ok(falseIdx !== -1)
|
|
39
|
+
|
|
40
|
+
const afterFalse = template.slice(falseIdx, falseIdx + 300)
|
|
41
|
+
assert.ok(
|
|
42
|
+
afterFalse.includes('plain text'),
|
|
43
|
+
'when structuredQuestionsAvailable is false, questions should be in plain text',
|
|
44
|
+
)
|
|
45
|
+
})
|
|
46
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dispatch-guard-closed-status.test.ts — #3653
|
|
3
|
+
*
|
|
4
|
+
* Verify that the dispatch guard uses isClosedStatus() instead of a raw
|
|
5
|
+
* `status === "complete"` check when determining whether a slice is done.
|
|
6
|
+
* Reconciled slices may carry statuses like "skipped" or "cancelled" which
|
|
7
|
+
* are also closed — the raw check caused false dispatch blocks.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { describe, test } from "node:test";
|
|
11
|
+
import assert from "node:assert/strict";
|
|
12
|
+
import { readFileSync } from "node:fs";
|
|
13
|
+
import { join, dirname } from "node:path";
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
|
+
|
|
16
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const sourceFile = join(__dirname, "..", "dispatch-guard.ts");
|
|
18
|
+
|
|
19
|
+
describe("dispatch-guard isClosedStatus migration (#3653)", () => {
|
|
20
|
+
const source = readFileSync(sourceFile, "utf-8");
|
|
21
|
+
|
|
22
|
+
test("imports isClosedStatus from status-guards", () => {
|
|
23
|
+
assert.match(source, /import\s*\{[^}]*isClosedStatus[^}]*\}\s*from\s*["']\.\/status-guards/);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test("uses isClosedStatus() for slice done check instead of raw comparison", () => {
|
|
27
|
+
assert.match(source, /done:\s*isClosedStatus\(r\.status\)/);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test("does not use raw status === 'complete' for DB slice rows", () => {
|
|
31
|
+
assert.doesNotMatch(source, /done:\s*r\.status\s*===\s*["']complete["']/);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dispatcher-stuck-planning.test.ts — #3656
|
|
3
|
+
*
|
|
4
|
+
* Verify that state.ts contains the disk-to-DB task reconciliation logic
|
|
5
|
+
* that prevents the dispatcher from getting stuck in an infinite planning
|
|
6
|
+
* loop when the planner writes a PLAN.md but never calls the persistence
|
|
7
|
+
* tool, leaving the DB with zero task rows.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { describe, test } from "node:test";
|
|
11
|
+
import assert from "node:assert/strict";
|
|
12
|
+
import { readFileSync } from "node:fs";
|
|
13
|
+
import { join, dirname } from "node:path";
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
|
+
|
|
16
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const sourceFile = join(__dirname, "..", "state.ts");
|
|
18
|
+
|
|
19
|
+
describe("dispatcher stuck-planning reconciliation (#3656)", () => {
|
|
20
|
+
const source = readFileSync(sourceFile, "utf-8");
|
|
21
|
+
|
|
22
|
+
test("imports insertTask from gsd-db", () => {
|
|
23
|
+
assert.match(source, /import\s*\{[^}]*insertTask[^}]*\}\s*from/);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test("contains plan-file task reconciliation block", () => {
|
|
27
|
+
assert.match(source, /tasks\.length\s*===\s*0\s*&&\s*planFile/);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test("calls insertTask for each disk plan task", () => {
|
|
31
|
+
assert.match(source, /insertTask\(\{/);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test("references issue #3600 in reconciliation comment", () => {
|
|
35
|
+
assert.match(source, /#3600/);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* error-success-mask.test.ts — #3664
|
|
3
|
+
*
|
|
4
|
+
* Verify that the agent-end-recovery error handler detects when errorMessage
|
|
5
|
+
* is uninformative (e.g. "success", "ok", "unknown") and falls back to
|
|
6
|
+
* extracting the real error from the assistant message text content.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { describe, test } from "node:test";
|
|
10
|
+
import assert from "node:assert/strict";
|
|
11
|
+
import { readFileSync } from "node:fs";
|
|
12
|
+
import { join, dirname } from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
|
|
15
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const sourceFile = join(__dirname, "..", "bootstrap", "agent-end-recovery.ts");
|
|
17
|
+
|
|
18
|
+
describe("error-success mask detection (#3664)", () => {
|
|
19
|
+
const source = readFileSync(sourceFile, "utf-8");
|
|
20
|
+
|
|
21
|
+
test("detects useless errorMessage values with regex", () => {
|
|
22
|
+
assert.match(source, /success\|ok\|true\|error\|unknown/i);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("extracts display message from content text block", () => {
|
|
26
|
+
assert.match(source, /textBlock/);
|
|
27
|
+
assert.match(source, /\.text\.slice\(0,\s*300\)/);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test("classifies using rawErrorMsg, not displayMsg", () => {
|
|
31
|
+
assert.match(source, /classifyError\(rawErrorMsg/);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test("references issue #3588 in comments", () => {
|
|
35
|
+
assert.match(source, /#3588/);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression test for #3669 — findMissingSummaries skips closed slices
|
|
3
|
+
*
|
|
4
|
+
* When a slice has status "skipped", "complete", or "done", it should be
|
|
5
|
+
* excluded from the missing-summary check because closed slices intentionally
|
|
6
|
+
* lack SUMMARY files (or their DB status is authoritative).
|
|
7
|
+
*
|
|
8
|
+
* This is a structural verification test — it reads the source to confirm the
|
|
9
|
+
* CLOSED_STATUSES guard exists at the filter site.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { describe, test } from 'node:test';
|
|
13
|
+
import assert from 'node:assert/strict';
|
|
14
|
+
import { readFileSync } from 'node:fs';
|
|
15
|
+
import { fileURLToPath } from 'node:url';
|
|
16
|
+
import { dirname, join } from 'node:path';
|
|
17
|
+
|
|
18
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
19
|
+
const __dirname = dirname(__filename);
|
|
20
|
+
|
|
21
|
+
const source = readFileSync(join(__dirname, '..', 'auto-dispatch.ts'), 'utf-8');
|
|
22
|
+
|
|
23
|
+
describe('findMissingSummaries closed-status exclusion (#3669)', () => {
|
|
24
|
+
test('CLOSED_STATUSES set includes skipped, complete, and done', () => {
|
|
25
|
+
// The source must define a CLOSED_STATUSES set with all three statuses
|
|
26
|
+
assert.match(source, /CLOSED_STATUSES.*=.*new Set\(/,
|
|
27
|
+
'CLOSED_STATUSES set should be defined');
|
|
28
|
+
assert.match(source, /"skipped"/, 'CLOSED_STATUSES should include "skipped"');
|
|
29
|
+
assert.match(source, /"complete"/, 'CLOSED_STATUSES should include "complete"');
|
|
30
|
+
assert.match(source, /"done"/, 'CLOSED_STATUSES should include "done"');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('filter uses CLOSED_STATUSES.has() to exclude closed slices', () => {
|
|
34
|
+
assert.match(source, /CLOSED_STATUSES\.has\(s\.status\)/,
|
|
35
|
+
'filter should call CLOSED_STATUSES.has(s.status)');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('findMissingSummaries function exists', () => {
|
|
39
|
+
assert.match(source, /function findMissingSummaries\(/,
|
|
40
|
+
'findMissingSummaries function should be defined');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('filter is negated (excludes closed, keeps open)', () => {
|
|
44
|
+
// The filter should use !CLOSED_STATUSES.has() to exclude closed slices
|
|
45
|
+
assert.match(source, /!CLOSED_STATUSES\.has\(s\.status\)/,
|
|
46
|
+
'filter should negate CLOSED_STATUSES.has() to exclude closed slices');
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression test for #3693 — suppress repeated frontmatter parse warnings
|
|
3
|
+
*
|
|
4
|
+
* parseFrontmatterBlock was logging a YAML parse warning on every call.
|
|
5
|
+
* The fix adds a _warnedFrontmatterParse flag so the warning only fires once.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { describe, test } from 'node:test';
|
|
9
|
+
import assert from 'node:assert/strict';
|
|
10
|
+
import { readFileSync } from 'node:fs';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
import { dirname, join } from 'node:path';
|
|
13
|
+
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = dirname(__filename);
|
|
16
|
+
|
|
17
|
+
const prefsSrc = readFileSync(
|
|
18
|
+
join(__dirname, '..', 'preferences.ts'),
|
|
19
|
+
'utf-8',
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
describe('frontmatter parse noise suppression (#3693)', () => {
|
|
23
|
+
test('_warnedFrontmatterParse flag is defined', () => {
|
|
24
|
+
assert.match(prefsSrc, /_warnedFrontmatterParse/,
|
|
25
|
+
'_warnedFrontmatterParse flag should exist in preferences.ts');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('parseFrontmatterBlock function exists', () => {
|
|
29
|
+
assert.match(prefsSrc, /function parseFrontmatterBlock\(/,
|
|
30
|
+
'parseFrontmatterBlock function should be defined');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('flag is checked before warning', () => {
|
|
34
|
+
assert.match(prefsSrc, /if\s*\(\s*!_warnedFrontmatterParse\s*\)/,
|
|
35
|
+
'should check !_warnedFrontmatterParse before logging');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('flag is set to true after first warning', () => {
|
|
39
|
+
assert.match(prefsSrc, /_warnedFrontmatterParse\s*=\s*true/,
|
|
40
|
+
'should set _warnedFrontmatterParse = true after warning');
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression test — .bg-shell/ added to BASELINE_PATTERNS in gitignore.ts
|
|
3
|
+
*
|
|
4
|
+
* The bg-shell background process directory was not included in the
|
|
5
|
+
* baseline gitignore patterns, causing it to appear as untracked in
|
|
6
|
+
* git status and potentially be committed.
|
|
7
|
+
*
|
|
8
|
+
* Structural verification test — reads source to confirm .bg-shell/
|
|
9
|
+
* is in BASELINE_PATTERNS.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { describe, test } from 'node:test';
|
|
13
|
+
import assert from 'node:assert/strict';
|
|
14
|
+
import { readFileSync } from 'node:fs';
|
|
15
|
+
import { fileURLToPath } from 'node:url';
|
|
16
|
+
import { dirname, join } from 'node:path';
|
|
17
|
+
|
|
18
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
19
|
+
const __dirname = dirname(__filename);
|
|
20
|
+
|
|
21
|
+
const source = readFileSync(join(__dirname, '..', 'gitignore.ts'), 'utf-8');
|
|
22
|
+
|
|
23
|
+
describe('.bg-shell/ in BASELINE_PATTERNS', () => {
|
|
24
|
+
test('BASELINE_PATTERNS array is defined', () => {
|
|
25
|
+
assert.match(source, /const BASELINE_PATTERNS\s*=/,
|
|
26
|
+
'BASELINE_PATTERNS should be defined');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test('.bg-shell/ is included in BASELINE_PATTERNS', () => {
|
|
30
|
+
// Extract the BASELINE_PATTERNS array content
|
|
31
|
+
const patternsStart = source.indexOf('BASELINE_PATTERNS');
|
|
32
|
+
const arrayStart = source.indexOf('[', patternsStart);
|
|
33
|
+
const arrayEnd = source.indexOf('] as const', arrayStart);
|
|
34
|
+
const patternsContent = source.slice(arrayStart, arrayEnd);
|
|
35
|
+
assert.match(patternsContent, /\.bg-shell\//,
|
|
36
|
+
'.bg-shell/ should be in BASELINE_PATTERNS');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression test for #3475: guided-flow must rebuild STATE.md from derived
|
|
3
|
+
* state before dispatching workflows.
|
|
4
|
+
*
|
|
5
|
+
* Verifies that buildStateMarkdown() produces content matching the derived
|
|
6
|
+
* state (not a stale on-disk cache), and that the rebuild helper is wired
|
|
7
|
+
* correctly from doctor.ts.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { describe, test, afterEach } from "node:test";
|
|
11
|
+
import assert from "node:assert/strict";
|
|
12
|
+
import { mkdtempSync, mkdirSync, rmSync, writeFileSync, readFileSync } from "node:fs";
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
import { tmpdir } from "node:os";
|
|
15
|
+
|
|
16
|
+
import { deriveState, invalidateStateCache } from "../state.ts";
|
|
17
|
+
import { buildStateMarkdown, rebuildState } from "../doctor.ts";
|
|
18
|
+
import { resolveGsdRootFile } from "../paths.ts";
|
|
19
|
+
import {
|
|
20
|
+
openDatabase,
|
|
21
|
+
closeDatabase,
|
|
22
|
+
insertMilestone,
|
|
23
|
+
insertSlice,
|
|
24
|
+
insertTask,
|
|
25
|
+
} from "../gsd-db.ts";
|
|
26
|
+
|
|
27
|
+
function createFixtureBase(): string {
|
|
28
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-guided-state-"));
|
|
29
|
+
mkdirSync(join(base, ".gsd", "milestones"), { recursive: true });
|
|
30
|
+
return base;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function writeFile(base: string, relativePath: string, content: string): void {
|
|
34
|
+
const full = join(base, ".gsd", relativePath);
|
|
35
|
+
mkdirSync(join(full, ".."), { recursive: true });
|
|
36
|
+
writeFileSync(full, content);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
describe("guided-flow STATE.md rebuild (#3475)", () => {
|
|
40
|
+
let base: string;
|
|
41
|
+
|
|
42
|
+
afterEach(() => {
|
|
43
|
+
closeDatabase();
|
|
44
|
+
if (base) rmSync(base, { recursive: true, force: true });
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test("rebuildState writes STATE.md matching derived state, not stale cache", async () => {
|
|
48
|
+
base = createFixtureBase();
|
|
49
|
+
openDatabase(":memory:");
|
|
50
|
+
|
|
51
|
+
// Set up real active milestone M010
|
|
52
|
+
insertMilestone({ id: "M010", title: "Real Active", status: "active" });
|
|
53
|
+
insertSlice({ id: "S03", milestoneId: "M010", title: "Slice Three", status: "active", risk: "low", depends: [] });
|
|
54
|
+
insertTask({ id: "T05", sliceId: "S03", milestoneId: "M010", title: "Task Five", status: "pending" });
|
|
55
|
+
writeFile(base, "milestones/M010/M010-CONTEXT.md", "# M010: Real Active\n\nReal work here.");
|
|
56
|
+
writeFile(base, "milestones/M010/M010-ROADMAP.md", "# M010\n\n## Slices\n\n- [ ] **S03: Slice Three**");
|
|
57
|
+
|
|
58
|
+
// Write a STALE STATE.md pointing to wrong milestone
|
|
59
|
+
writeFile(base, "STATE.md", [
|
|
60
|
+
"# GSD State",
|
|
61
|
+
"",
|
|
62
|
+
"**Active Milestone:** M008: Old Queued",
|
|
63
|
+
"**Active Slice:** None",
|
|
64
|
+
"**Phase:** pre-planning",
|
|
65
|
+
"",
|
|
66
|
+
"## Next Action",
|
|
67
|
+
"Milestone M008 has a roadmap but no slices defined.",
|
|
68
|
+
].join("\n"));
|
|
69
|
+
|
|
70
|
+
// Derive state — should return M010
|
|
71
|
+
invalidateStateCache();
|
|
72
|
+
const state = await deriveState(base);
|
|
73
|
+
assert.equal(state.activeMilestone?.id, "M010", "Derived state should be M010");
|
|
74
|
+
|
|
75
|
+
// Rebuild STATE.md
|
|
76
|
+
await rebuildState(base);
|
|
77
|
+
|
|
78
|
+
// Read the rebuilt STATE.md
|
|
79
|
+
const statePath = resolveGsdRootFile(base, "STATE");
|
|
80
|
+
const rebuilt = readFileSync(statePath, "utf-8");
|
|
81
|
+
|
|
82
|
+
// Should contain M010, NOT M008
|
|
83
|
+
assert.ok(rebuilt.includes("M010"), "Rebuilt STATE.md should reference M010");
|
|
84
|
+
assert.ok(!rebuilt.includes("M008"), "Rebuilt STATE.md should NOT reference stale M008");
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test("buildStateMarkdown produces correct active milestone from GSDState", async () => {
|
|
88
|
+
base = createFixtureBase();
|
|
89
|
+
openDatabase(":memory:");
|
|
90
|
+
|
|
91
|
+
insertMilestone({ id: "M070", title: "Current Work", status: "active" });
|
|
92
|
+
insertSlice({ id: "S01", milestoneId: "M070", title: "First Slice", status: "active", risk: "low", depends: [] });
|
|
93
|
+
writeFile(base, "milestones/M070/M070-CONTEXT.md", "# M070: Current Work");
|
|
94
|
+
writeFile(base, "milestones/M070/M070-ROADMAP.md", "# M070\n\n## Slices\n\n- [ ] **S01: First Slice**");
|
|
95
|
+
|
|
96
|
+
invalidateStateCache();
|
|
97
|
+
const state = await deriveState(base);
|
|
98
|
+
const md = buildStateMarkdown(state);
|
|
99
|
+
|
|
100
|
+
assert.ok(md.includes("M070"), "State markdown should include active milestone M070");
|
|
101
|
+
assert.ok(md.includes("Current Work") || md.includes("M070"), "State markdown should include milestone title or ID");
|
|
102
|
+
});
|
|
103
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression test for #3699 — import milestones with all-done slices as complete
|
|
3
|
+
*
|
|
4
|
+
* During DB migration, milestones whose roadmap slices are all marked done
|
|
5
|
+
* should be imported with status "complete" instead of "active".
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { describe, test } from 'node:test';
|
|
9
|
+
import assert from 'node:assert/strict';
|
|
10
|
+
import { readFileSync } from 'node:fs';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
import { dirname, join } from 'node:path';
|
|
13
|
+
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = dirname(__filename);
|
|
16
|
+
|
|
17
|
+
const importerSrc = readFileSync(
|
|
18
|
+
join(__dirname, '..', 'md-importer.ts'),
|
|
19
|
+
'utf-8',
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
describe('import done milestones as complete (#3699)', () => {
|
|
23
|
+
test('all-slices-done check sets milestoneStatus to complete', () => {
|
|
24
|
+
// The importer should check if all roadmap slices are done
|
|
25
|
+
assert.match(importerSrc, /roadmap\.slices\.every\(s\s*=>\s*s\.done\)/,
|
|
26
|
+
'should check roadmap.slices.every(s => s.done)');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test('milestoneStatus is set to complete when all slices done', () => {
|
|
30
|
+
// Find the all-done guard and verify it sets 'complete'
|
|
31
|
+
const everyIdx = importerSrc.indexOf('roadmap.slices.every(s => s.done)');
|
|
32
|
+
assert.ok(everyIdx > -1, 'all-slices-done check should exist');
|
|
33
|
+
const afterCheck = importerSrc.slice(everyIdx, everyIdx + 200);
|
|
34
|
+
assert.match(afterCheck, /milestoneStatus\s*=\s*'complete'/,
|
|
35
|
+
'should set milestoneStatus to complete when all slices are done');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('roadmap.slices.length > 0 guard prevents false positives', () => {
|
|
39
|
+
assert.match(importerSrc, /roadmap\.slices\.length\s*>\s*0/,
|
|
40
|
+
'should guard against empty slices array');
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -454,7 +454,7 @@ test("verifyExpectedArtifact accepts plan-slice with colon-style heading tasks (
|
|
|
454
454
|
);
|
|
455
455
|
});
|
|
456
456
|
|
|
457
|
-
test("verifyExpectedArtifact execute-task
|
|
457
|
+
test("verifyExpectedArtifact execute-task rejects heading-style plan without checked checkbox (#3607)", (t) => {
|
|
458
458
|
const base = makeTmpBase();
|
|
459
459
|
t.after(() => cleanup(base));
|
|
460
460
|
|
|
@@ -471,10 +471,12 @@ test("verifyExpectedArtifact execute-task passes for heading-style plan entry (#
|
|
|
471
471
|
"Feature description.",
|
|
472
472
|
].join("\n"));
|
|
473
473
|
writeFileSync(join(tasksDir, "T01-SUMMARY.md"), "# T01 Summary\n\nDone.");
|
|
474
|
+
// Heading-style entries no longer count as verified — only checked
|
|
475
|
+
// checkboxes prove gsd_complete_task ran (#3607).
|
|
474
476
|
assert.strictEqual(
|
|
475
477
|
verifyExpectedArtifact("execute-task", "M001/S01/T01", base),
|
|
476
|
-
|
|
477
|
-
"
|
|
478
|
+
false,
|
|
479
|
+
"heading-style without checked checkbox should NOT pass verification",
|
|
478
480
|
);
|
|
479
481
|
});
|
|
480
482
|
|
|
@@ -682,7 +684,7 @@ function makeGitBase(): string {
|
|
|
682
684
|
return base;
|
|
683
685
|
}
|
|
684
686
|
|
|
685
|
-
test("hasImplementationArtifacts returns
|
|
687
|
+
test("hasImplementationArtifacts returns 'absent' when only .gsd/ files committed (#1703)", (t) => {
|
|
686
688
|
const base = makeGitBase();
|
|
687
689
|
t.after(() => cleanup(base));
|
|
688
690
|
|
|
@@ -695,10 +697,10 @@ test("hasImplementationArtifacts returns false when only .gsd/ files committed (
|
|
|
695
697
|
execFileSync("git", ["commit", "-m", "chore: add plan files"], { cwd: base, stdio: "ignore" });
|
|
696
698
|
|
|
697
699
|
const result = hasImplementationArtifacts(base);
|
|
698
|
-
assert.equal(result,
|
|
700
|
+
assert.equal(result, "absent", "should return 'absent' when only .gsd/ files were committed");
|
|
699
701
|
});
|
|
700
702
|
|
|
701
|
-
test("hasImplementationArtifacts returns
|
|
703
|
+
test("hasImplementationArtifacts returns 'present' when implementation files committed (#1703)", (t) => {
|
|
702
704
|
const base = makeGitBase();
|
|
703
705
|
t.after(() => cleanup(base));
|
|
704
706
|
|
|
@@ -712,16 +714,16 @@ test("hasImplementationArtifacts returns true when implementation files committe
|
|
|
712
714
|
execFileSync("git", ["commit", "-m", "feat: add feature"], { cwd: base, stdio: "ignore" });
|
|
713
715
|
|
|
714
716
|
const result = hasImplementationArtifacts(base);
|
|
715
|
-
assert.equal(result,
|
|
717
|
+
assert.equal(result, "present", "should return 'present' when implementation files are present");
|
|
716
718
|
});
|
|
717
719
|
|
|
718
|
-
test("hasImplementationArtifacts returns
|
|
720
|
+
test("hasImplementationArtifacts returns 'unknown' on non-git directory (fail-open)", (t) => {
|
|
719
721
|
const base = join(tmpdir(), `gsd-test-nogit-${randomUUID()}`);
|
|
720
722
|
mkdirSync(base, { recursive: true });
|
|
721
723
|
t.after(() => cleanup(base));
|
|
722
724
|
|
|
723
725
|
const result = hasImplementationArtifacts(base);
|
|
724
|
-
assert.equal(result,
|
|
726
|
+
assert.equal(result, "unknown", "should return 'unknown' (fail-open) in non-git directory");
|
|
725
727
|
});
|
|
726
728
|
|
|
727
729
|
// ─── verifyExpectedArtifact: complete-milestone requires impl artifacts (#1703) ──
|
|
@@ -920,8 +920,10 @@ describe("completion and verification failures", () => {
|
|
|
920
920
|
base = createFullFixture();
|
|
921
921
|
openDatabase(join(base, ".gsd", "gsd.db"));
|
|
922
922
|
insertMilestone({ id: "M001", title: "Active", status: "active" });
|
|
923
|
-
|
|
924
|
-
|
|
923
|
+
// Use "pending" status — closed slices (complete/done/skipped) are
|
|
924
|
+
// excluded from SUMMARY checks per #3620.
|
|
925
|
+
insertSlice({ id: "S01", milestoneId: "M001", title: "First", status: "pending" });
|
|
926
|
+
insertSlice({ id: "S02", milestoneId: "M001", title: "Second", status: "pending" });
|
|
925
927
|
// No S01-SUMMARY.md or S02-SUMMARY.md on disk
|
|
926
928
|
|
|
927
929
|
const ctx = buildDispatchCtx(base, "M001", {
|