gsd-pi 2.80.0-dev.3065f7bfa → 2.80.0-dev.488219eb6
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/claude-cli-check.d.ts +30 -0
- package/dist/claude-cli-check.js +18 -7
- package/dist/cli.js +0 -19
- package/dist/headless-query.d.ts +10 -0
- package/dist/headless-query.js +6 -4
- package/dist/loader-entrypoint.d.ts +8 -0
- package/dist/loader-entrypoint.js +27 -0
- package/dist/loader.js +2 -11
- package/dist/mcp-server.d.ts +1 -0
- package/dist/mcp-server.js +6 -3
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/claude-code-cli/readiness.js +18 -7
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +29 -0
- package/dist/resources/extensions/github-sync/sync.js +4 -1
- package/dist/resources/extensions/gsd/auto/loop.js +71 -8
- package/dist/resources/extensions/gsd/auto/phases.js +32 -8
- package/dist/resources/extensions/gsd/auto/resolve.js +12 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +3 -1
- package/dist/resources/extensions/gsd/auto/workflow-dispatch-claim.js +33 -1
- package/dist/resources/extensions/gsd/auto/workflow-worker-heartbeat.js +9 -1
- package/dist/resources/extensions/gsd/auto-post-unit.js +81 -76
- package/dist/resources/extensions/gsd/auto-start.js +41 -6
- package/dist/resources/extensions/gsd/auto-worktree.js +98 -80
- package/dist/resources/extensions/gsd/auto.js +84 -29
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +62 -13
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +20 -26
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +29 -12
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +6 -9
- package/dist/resources/extensions/gsd/bootstrap/journal-tools.js +4 -7
- package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +6 -10
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +5 -9
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +1 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +60 -26
- package/dist/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.js +4 -0
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +2 -2
- package/dist/resources/extensions/gsd/commands-config.js +1 -1
- package/dist/resources/extensions/gsd/commands-eval-review.js +2 -2
- package/dist/resources/extensions/gsd/dashboard-overlay.js +1 -1
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +53 -0
- package/dist/resources/extensions/gsd/git-service.js +37 -1
- package/dist/resources/extensions/gsd/guided-flow.js +14 -4
- package/dist/resources/extensions/gsd/init-wizard.js +4 -1
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +6 -4
- package/dist/resources/extensions/gsd/slice-cadence.js +45 -2
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +15 -9
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +6 -7
- package/dist/resources/extensions/gsd/tools/complete-task.js +1 -1
- package/dist/resources/extensions/gsd/worktree-resolver.js +22 -1
- package/dist/resources/skills/web-quality-audit/scripts/analyze.sh +0 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +17 -17
- 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 +2 -2
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- 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/page_client-reference-manifest.js +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 +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
- 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/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +17 -17
- 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/middleware.js +3 -3
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/8359.e059d86b255fce1c.js +10 -0
- package/dist/web/standalone/.next/static/chunks/app/{page-fab3ebb85b006001.js → page-752f1e2ebdaa3e45.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/{webpack-0481f1221120a7c6.js → webpack-de742b64187e13fe.js} +1 -1
- package/dist/welcome-screen.d.ts +2 -0
- package/dist/welcome-screen.js +9 -7
- package/package.json +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +35 -13
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js +21 -11
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +7 -0
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +9 -7
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js +23 -14
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +48 -21
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js +22 -21
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js +22 -21
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js.map +1 -1
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +39 -25
- package/packages/pi-ai/src/providers/anthropic-bearer-auth.test.ts +26 -22
- package/packages/pi-ai/src/providers/anthropic.ts +22 -9
- package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +34 -21
- package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +56 -22
- package/packages/pi-ai/src/utils/oauth/google-antigravity.test.ts +24 -28
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.test.ts +24 -28
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +3 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +2 -2
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash-spawn-windows.test.js +22 -56
- package/packages/pi-coding-agent/dist/core/tools/bash-spawn-windows.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.js +12 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.js +14 -6
- package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/grep.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/grep.js +12 -3
- package/packages/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts +2 -1
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.js +1 -0
- package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/ls.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/ls.js +10 -3
- package/packages/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/read.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/read.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js +7 -62
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.js +115 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.d.ts +19 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.js +20 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/write.d.ts +4 -0
- package/packages/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/write.js +9 -1
- package/packages/pi-coding-agent/dist/core/tools/write.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +89 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +25 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +5 -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 +153 -8
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +18 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +23 -5
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -0
- 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 +19 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js +23 -5
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js.map +1 -1
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +3 -1
- package/packages/pi-coding-agent/src/core/extensions/types.ts +2 -1
- package/packages/pi-coding-agent/src/core/tools/bash-spawn-windows.test.ts +22 -66
- package/packages/pi-coding-agent/src/core/tools/bash.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/edit.ts +13 -1
- package/packages/pi-coding-agent/src/core/tools/find.ts +15 -6
- package/packages/pi-coding-agent/src/core/tools/grep.ts +13 -3
- package/packages/pi-coding-agent/src/core/tools/hashline-read.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/index.ts +8 -0
- package/packages/pi-coding-agent/src/core/tools/ls.ts +11 -3
- package/packages/pi-coding-agent/src/core/tools/read.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/spawn-shell-windows.test.ts +11 -72
- package/packages/pi-coding-agent/src/core/tools/tool-target-metadata.test.ts +127 -0
- package/packages/pi-coding-agent/src/core/tools/tool-target.ts +48 -0
- package/packages/pi-coding-agent/src/core/tools/write.ts +14 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +119 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +31 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +177 -8
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +24 -5
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +17 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +21 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage-safety-guard.test.ts +25 -8
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/src/resources/extensions/claude-code-cli/readiness.ts +25 -7
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +30 -0
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +26 -0
- package/src/resources/extensions/github-sync/sync.ts +8 -1
- package/src/resources/extensions/github-sync/tests/sync-source.test.ts +6 -18
- package/src/resources/extensions/gsd/auto/loop.ts +84 -8
- package/src/resources/extensions/gsd/auto/phases.ts +43 -8
- package/src/resources/extensions/gsd/auto/resolve.ts +19 -0
- package/src/resources/extensions/gsd/auto/run-unit.ts +3 -0
- package/src/resources/extensions/gsd/auto/workflow-dispatch-claim.ts +63 -1
- package/src/resources/extensions/gsd/auto/workflow-worker-heartbeat.ts +14 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +93 -78
- package/src/resources/extensions/gsd/auto-start.ts +56 -6
- package/src/resources/extensions/gsd/auto-worktree.ts +118 -72
- package/src/resources/extensions/gsd/auto.ts +121 -29
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +76 -12
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +20 -26
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +27 -12
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +7 -9
- package/src/resources/extensions/gsd/bootstrap/journal-tools.ts +4 -7
- package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +6 -10
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +5 -9
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +1 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +64 -26
- package/src/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.ts +4 -0
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +4 -2
- package/src/resources/extensions/gsd/commands-config.ts +1 -1
- package/src/resources/extensions/gsd/commands-eval-review.ts +2 -2
- package/src/resources/extensions/gsd/dashboard-overlay.ts +1 -1
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +66 -0
- package/src/resources/extensions/gsd/git-service.ts +41 -2
- package/src/resources/extensions/gsd/guided-flow.ts +19 -4
- package/src/resources/extensions/gsd/init-wizard.ts +5 -1
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +6 -4
- package/src/resources/extensions/gsd/slice-cadence.ts +49 -2
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +23 -9
- package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +59 -89
- package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +47 -172
- package/src/resources/extensions/gsd/tests/artifacts-table-preserved-on-cache-invalidate.test.ts +0 -35
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +35 -9
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +80 -59
- package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +3 -47
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +76 -18
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +106 -0
- package/src/resources/extensions/gsd/tests/auto-pr-bugs.test.ts +54 -95
- package/src/resources/extensions/gsd/tests/auto-project-root-env.test.ts +67 -26
- package/src/resources/extensions/gsd/tests/auto-remediate-slice-status.test.ts +32 -30
- package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +32 -128
- package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +20 -54
- package/src/resources/extensions/gsd/tests/auto-start-cold-db-bootstrap.test.ts +20 -30
- package/src/resources/extensions/gsd/tests/auto-start-index-lock.test.ts +17 -29
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +138 -0
- package/src/resources/extensions/gsd/tests/auto-start-time-persistence.test.ts +21 -39
- package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +15 -24
- package/src/resources/extensions/gsd/tests/auto-thinking-restore.test.ts +44 -29
- package/src/resources/extensions/gsd/tests/auto-warning-noise-regression.test.ts +39 -51
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +1 -217
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +15 -32
- package/src/resources/extensions/gsd/tests/browser-teardown.test.ts +0 -41
- package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +34 -27
- package/src/resources/extensions/gsd/tests/cmux.test.ts +51 -53
- package/src/resources/extensions/gsd/tests/cold-resume-db-reopen.test.ts +39 -61
- package/src/resources/extensions/gsd/tests/commands-config.test.ts +26 -19
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/complete-task-normalize-lists.test.ts +29 -33
- package/src/resources/extensions/gsd/tests/completed-units-metrics-sync.test.ts +45 -108
- package/src/resources/extensions/gsd/tests/crash-handler-secondary.test.ts +35 -31
- package/src/resources/extensions/gsd/tests/cwd-fallback-hardening.test.ts +138 -0
- package/src/resources/extensions/gsd/tests/dashboard-custom-engine.test.ts +4 -68
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +4 -9
- package/src/resources/extensions/gsd/tests/deferred-milestone-dir-4996.test.ts +14 -65
- package/src/resources/extensions/gsd/tests/discuss-tool-scoping.test.ts +44 -37
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +58 -40
- package/src/resources/extensions/gsd/tests/dispatch-guard-closed-status.test.ts +25 -15
- package/src/resources/extensions/gsd/tests/dispatcher-stuck-planning.test.ts +35 -17
- package/src/resources/extensions/gsd/tests/error-success-mask.test.ts +16 -21
- package/src/resources/extensions/gsd/tests/est-annotation-timeout.test.ts +15 -82
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +2 -20
- package/src/resources/extensions/gsd/tests/frontmatter-parse-noise.test.ts +18 -26
- package/src/resources/extensions/gsd/tests/init-skip-git.test.ts +9 -12
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/integration/commands-eval-review.integration.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/integration/git-locale.test.ts +31 -20
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/integration/milestone-transition-worktree.test.ts +0 -47
- package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +60 -202
- package/src/resources/extensions/gsd/tests/isolation-none-branch-guard.test.ts +13 -59
- package/src/resources/extensions/gsd/tests/lazy-pi-tui-import.test.ts +44 -6
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +21 -35
- package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +79 -98
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +70 -278
- package/src/resources/extensions/gsd/tests/needs-remediation-revalidation.test.ts +37 -30
- package/src/resources/extensions/gsd/tests/note-captures-executed.test.ts +32 -28
- package/src/resources/extensions/gsd/tests/phantom-ghost-detection.test.ts +24 -37
- package/src/resources/extensions/gsd/tests/phantom-milestone-default-queued.test.ts +9 -24
- package/src/resources/extensions/gsd/tests/phases-merge-error-stops-auto.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +36 -22
- package/src/resources/extensions/gsd/tests/pre-exec-backtick-strip.test.ts +36 -30
- package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +74 -4
- package/src/resources/extensions/gsd/tests/preferences-worktree-sync.test.ts +20 -22
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +130 -32
- package/src/resources/extensions/gsd/tests/project-root-cwd-crash.test.ts +18 -36
- package/src/resources/extensions/gsd/tests/projection-no-plan-overwrite.test.ts +35 -73
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +76 -138
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +70 -125
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +59 -161
- package/src/resources/extensions/gsd/tests/query-tools-db-open.test.ts +33 -29
- package/src/resources/extensions/gsd/tests/queue-auto-guard.test.ts +22 -196
- package/src/resources/extensions/gsd/tests/quick-auto-guard.test.ts +23 -93
- package/src/resources/extensions/gsd/tests/quick-turn-end-cleanup.test.ts +50 -79
- package/src/resources/extensions/gsd/tests/reassess-default-optin.test.ts +27 -13
- package/src/resources/extensions/gsd/tests/remote-questions.test.ts +151 -251
- package/src/resources/extensions/gsd/tests/resource-loader-import-path.test.ts +41 -29
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +58 -90
- package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +32 -164
- package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +57 -41
- package/src/resources/extensions/gsd/tests/session-model-override.test.ts +14 -9
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +77 -0
- package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +61 -1
- package/src/resources/extensions/gsd/tests/show-config-command.test.ts +44 -42
- package/src/resources/extensions/gsd/tests/skip-slice-state-rebuild.test.ts +56 -24
- package/src/resources/extensions/gsd/tests/skipped-validation-db-atomicity.test.ts +51 -11
- package/src/resources/extensions/gsd/tests/slice-cadence.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +66 -50
- package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +68 -107
- package/src/resources/extensions/gsd/tests/slice-sequence-insert.test.ts +115 -42
- package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +21 -97
- package/src/resources/extensions/gsd/tests/smart-entry-draft.test.ts +25 -116
- package/src/resources/extensions/gsd/tests/sqlite-unavailable-gate.test.ts +21 -57
- package/src/resources/extensions/gsd/tests/stale-dirlistcache-4648.test.ts +29 -76
- package/src/resources/extensions/gsd/tests/stale-lockfile-recovery.test.ts +33 -24
- package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +39 -30
- package/src/resources/extensions/gsd/tests/status-db-open.test.ts +33 -47
- package/src/resources/extensions/gsd/tests/stop-auto-merge-back.test.ts +48 -46
- package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +14 -102
- package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +78 -232
- package/src/resources/extensions/gsd/tests/sync-worktree-skip-current.test.ts +32 -35
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +84 -309
- package/src/resources/extensions/gsd/tests/triage-dispatch.test.ts +134 -341
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +8 -25
- package/src/resources/extensions/gsd/tests/unit-dispatches.test.ts +50 -1
- package/src/resources/extensions/gsd/tests/unstructured-continue-context-injection.test.ts +6 -101
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +43 -36
- package/src/resources/extensions/gsd/tests/visualizer-data.test.ts +84 -444
- package/src/resources/extensions/gsd/tests/workflow-dispatch-claim.test.ts +142 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +44 -189
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -57
- package/src/resources/extensions/gsd/tests/workflow-worker-heartbeat.test.ts +32 -1
- package/src/resources/extensions/gsd/tests/worktree-db-same-file.test.ts +21 -44
- package/src/resources/extensions/gsd/tests/worktree-expected-warnings.test.ts +27 -26
- package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +14 -13
- package/src/resources/extensions/gsd/tests/worktree-main-branch.test.ts +20 -18
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/zero-slice-roadmap-guided.test.ts +19 -13
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +14 -15
- package/src/resources/extensions/gsd/tools/complete-task.ts +1 -1
- package/src/resources/extensions/gsd/worktree-resolver.ts +34 -1
- package/src/resources/skills/create-gsd-extension/templates/templates.test.ts +86 -40
- package/src/resources/skills/web-quality-audit/scripts/analyze.sh +0 -0
- package/dist/web/standalone/.next/static/chunks/8336.631939fb583761fa.js +0 -10
- /package/dist/web/standalone/.next/static/{O2WvnXROue6l7nAp_4dhC → G68KoLv5claox_Dyd4pZn}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{O2WvnXROue6l7nAp_4dhC → G68KoLv5claox_Dyd4pZn}/_ssgManifest.js +0 -0
|
@@ -11,203 +11,29 @@
|
|
|
11
11
|
|
|
12
12
|
import { describe, it } from "node:test";
|
|
13
13
|
import assert from "node:assert/strict";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
// ─── Structural test: verify the guard exists in source ──────────────────────
|
|
14
|
+
import { _setAutoActiveForTest } from "../auto.ts";
|
|
15
|
+
import { handleWorkflowCommand } from "../commands/handlers/workflow.ts";
|
|
18
16
|
|
|
19
17
|
describe("/gsd queue auto-mode guard (#4704)", () => {
|
|
20
|
-
it("
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// Verify auto-mode guard comes BEFORE showQueue call. Accepts either the
|
|
41
|
-
// inline isAutoActive() check (Tier 1) or the shared requireNotAutoActive()
|
|
42
|
-
// helper (Tier 2 / #4712).
|
|
43
|
-
const guardIndex = Math.max(
|
|
44
|
-
queueBlock.indexOf("isAutoActive()"),
|
|
45
|
-
queueBlock.indexOf("requireNotAutoActive("),
|
|
46
|
-
);
|
|
47
|
-
const showQueueIndex = queueBlock.indexOf("showQueue(");
|
|
48
|
-
|
|
49
|
-
assert.ok(guardIndex !== -1, "auto-mode guard exists in queue command block");
|
|
50
|
-
assert.ok(showQueueIndex !== -1, "showQueue() call exists in queue command block");
|
|
51
|
-
assert.ok(
|
|
52
|
-
guardIndex < showQueueIndex,
|
|
53
|
-
"auto-mode guard appears before showQueue() call",
|
|
54
|
-
);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("guard shows error message mentioning /gsd stop", () => {
|
|
58
|
-
const src = readFileSync(
|
|
59
|
-
join(
|
|
60
|
-
import.meta.dirname,
|
|
61
|
-
"..",
|
|
62
|
-
"commands",
|
|
63
|
-
"handlers",
|
|
64
|
-
"workflow.ts",
|
|
65
|
-
),
|
|
66
|
-
"utf-8",
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
assert.ok(
|
|
70
|
-
src.includes("cannot run while auto-mode is active"),
|
|
71
|
-
"error message explains that the command cannot run during auto-mode",
|
|
72
|
-
);
|
|
73
|
-
assert.ok(
|
|
74
|
-
src.includes("/gsd stop"),
|
|
75
|
-
"error message mentions /gsd stop as the resolution",
|
|
76
|
-
);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it("guard returns true (handled) to prevent falling through", () => {
|
|
80
|
-
const src = readFileSync(
|
|
81
|
-
join(
|
|
82
|
-
import.meta.dirname,
|
|
83
|
-
"..",
|
|
84
|
-
"commands",
|
|
85
|
-
"handlers",
|
|
86
|
-
"workflow.ts",
|
|
87
|
-
),
|
|
88
|
-
"utf-8",
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
const queueBlockMatch = src.match(
|
|
92
|
-
/if\s*\(\s*trimmed\s*===\s*"queue"\s*\)\s*\{([\s\S]*?)\n \}/,
|
|
93
|
-
);
|
|
94
|
-
assert.ok(queueBlockMatch);
|
|
95
|
-
const queueBlock = queueBlockMatch[1];
|
|
96
|
-
|
|
97
|
-
// The guard block should have its own return true before showQueue
|
|
98
|
-
const guardBlock = queueBlock.slice(0, queueBlock.indexOf("showQueue("));
|
|
99
|
-
assert.ok(
|
|
100
|
-
guardBlock.includes("return true"),
|
|
101
|
-
"guard block returns true before showQueue is reached",
|
|
102
|
-
);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
// ─── .gsd/audit/ runtime classification regression ──────────────────────────
|
|
107
|
-
|
|
108
|
-
describe(".gsd/audit/ runtime classification (#4704)", () => {
|
|
109
|
-
it("GSD_RUNTIME_PATTERNS in gitignore.ts includes .gsd/audit/", () => {
|
|
110
|
-
const src = readFileSync(
|
|
111
|
-
join(import.meta.dirname, "..", "gitignore.ts"),
|
|
112
|
-
"utf-8",
|
|
113
|
-
);
|
|
114
|
-
assert.ok(
|
|
115
|
-
src.includes('".gsd/audit/"'),
|
|
116
|
-
".gsd/audit/ listed in GSD_RUNTIME_PATTERNS",
|
|
117
|
-
);
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
it("RUNTIME_EXCLUSION_PATHS in git-service.ts includes .gsd/audit/", () => {
|
|
121
|
-
const src = readFileSync(
|
|
122
|
-
join(import.meta.dirname, "..", "git-service.ts"),
|
|
123
|
-
"utf-8",
|
|
124
|
-
);
|
|
125
|
-
assert.ok(
|
|
126
|
-
src.includes('".gsd/audit/"'),
|
|
127
|
-
".gsd/audit/ listed in RUNTIME_EXCLUSION_PATHS",
|
|
128
|
-
);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
it("SKIP_PATHS in worktree-manager.ts includes .gsd/audit/", () => {
|
|
132
|
-
const src = readFileSync(
|
|
133
|
-
join(import.meta.dirname, "..", "worktree-manager.ts"),
|
|
134
|
-
"utf-8",
|
|
135
|
-
);
|
|
136
|
-
assert.ok(
|
|
137
|
-
src.includes('".gsd/audit/"'),
|
|
138
|
-
".gsd/audit/ listed in SKIP_PATHS",
|
|
139
|
-
);
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
// ─── Windows gsd.db close+reopen around pre-merge stash ─────────────────────
|
|
144
|
-
|
|
145
|
-
describe("Windows pre-merge DB release (#4704)", () => {
|
|
146
|
-
it("mergeMilestoneToMain closes gsd.db on win32 before git stash", () => {
|
|
147
|
-
const src = readFileSync(
|
|
148
|
-
join(import.meta.dirname, "..", "auto-worktree.ts"),
|
|
149
|
-
"utf-8",
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
// Locate the stash push line and ensure a win32-gated closeDatabase()
|
|
153
|
-
// call precedes it in the same function scope.
|
|
154
|
-
const stashIndex = src.indexOf('"stash", "push", "--include-untracked"');
|
|
155
|
-
assert.ok(stashIndex !== -1, "pre-merge stash push exists");
|
|
156
|
-
|
|
157
|
-
const beforeStash = src.slice(0, stashIndex);
|
|
158
|
-
const win32Index = beforeStash.lastIndexOf('process.platform === "win32"');
|
|
159
|
-
const closeIndex = beforeStash.lastIndexOf("closeDatabase()");
|
|
160
|
-
|
|
161
|
-
assert.ok(win32Index !== -1, "win32 platform guard appears before stash");
|
|
162
|
-
assert.ok(closeIndex !== -1, "closeDatabase() invoked before stash");
|
|
163
|
-
assert.ok(
|
|
164
|
-
win32Index < closeIndex && closeIndex < stashIndex,
|
|
165
|
-
"platform guard wraps the closeDatabase() call before the stash",
|
|
166
|
-
);
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
it("openDatabase is called after the stash to reopen the connection", () => {
|
|
170
|
-
const src = readFileSync(
|
|
171
|
-
join(import.meta.dirname, "..", "auto-worktree.ts"),
|
|
172
|
-
"utf-8",
|
|
173
|
-
);
|
|
174
|
-
const stashIndex = src.indexOf('"stash", "push", "--include-untracked"');
|
|
175
|
-
const afterStash = src.slice(stashIndex);
|
|
176
|
-
assert.ok(
|
|
177
|
-
afterStash.includes("openDatabase("),
|
|
178
|
-
"openDatabase() called after the pre-merge stash",
|
|
179
|
-
);
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
it("pre-merge stash targets entries by marker instead of refs/stash or stash@{0}", () => {
|
|
183
|
-
const src = readFileSync(
|
|
184
|
-
join(import.meta.dirname, "..", "auto-worktree.ts"),
|
|
185
|
-
"utf-8",
|
|
186
|
-
);
|
|
187
|
-
|
|
188
|
-
assert.ok(src.includes("stashMarker"), "stash marker is tracked");
|
|
189
|
-
assert.ok(
|
|
190
|
-
src.includes('"stash", "list", "--format=%gd%x00%s"'),
|
|
191
|
-
"stash lookup reads ref and message together",
|
|
192
|
-
);
|
|
193
|
-
assert.ok(!src.includes('"rev-parse", "refs/stash"'), "refs/stash is not used for identity");
|
|
194
|
-
assert.ok(!src.includes('["stash", "pop"]'), "stash pop is never unqualified");
|
|
195
|
-
assert.ok(!src.includes('["stash", "drop"]'), "stash drop is never unqualified");
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
it("stash drop after pop failure requires auto-resolved .gsd conflicts", () => {
|
|
199
|
-
const src = readFileSync(
|
|
200
|
-
join(import.meta.dirname, "..", "auto-worktree.ts"),
|
|
201
|
-
"utf-8",
|
|
202
|
-
);
|
|
203
|
-
|
|
204
|
-
assert.ok(
|
|
205
|
-
src.includes("gsdUU.length > 0 && nonGsdUU.length === 0"),
|
|
206
|
-
"stash drop must only run after detected .gsd conflicts were auto-resolved",
|
|
207
|
-
);
|
|
208
|
-
assert.ok(
|
|
209
|
-
src.includes("git stash pop failed without resolvable conflict files; leaving stash for manual recovery"),
|
|
210
|
-
"non-conflict stash pop failures must leave the stash for manual recovery",
|
|
211
|
-
);
|
|
18
|
+
it("returns handled and notifies when auto-mode is active", async () => {
|
|
19
|
+
const notifications: Array<{ message: string; level?: string }> = [];
|
|
20
|
+
_setAutoActiveForTest(true);
|
|
21
|
+
try {
|
|
22
|
+
const handled = await handleWorkflowCommand("queue", {
|
|
23
|
+
ui: {
|
|
24
|
+
notify(message: string, level?: string) {
|
|
25
|
+
notifications.push({ message, level });
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
} as any, {} as any);
|
|
29
|
+
|
|
30
|
+
assert.equal(handled, true);
|
|
31
|
+
assert.deepEqual(notifications, [{
|
|
32
|
+
message: "/gsd queue cannot run while auto-mode is active.\nStop auto-mode first with /gsd stop, then run /gsd queue.",
|
|
33
|
+
level: "error",
|
|
34
|
+
}]);
|
|
35
|
+
} finally {
|
|
36
|
+
_setAutoActiveForTest(false);
|
|
37
|
+
}
|
|
212
38
|
});
|
|
213
39
|
});
|
|
@@ -6,101 +6,31 @@
|
|
|
6
6
|
* delegating to handleQuick.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { describe, it
|
|
9
|
+
import { describe, it } from "node:test";
|
|
10
10
|
import assert from "node:assert/strict";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
// ─── Structural test: verify the guard exists in source ──────────────────────
|
|
11
|
+
import { _setAutoActiveForTest } from "../auto.ts";
|
|
12
|
+
import { handleWorkflowCommand } from "../commands/handlers/workflow.ts";
|
|
15
13
|
|
|
16
14
|
describe("/gsd quick auto-mode guard (#2417)", () => {
|
|
17
|
-
it("
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// Verify the shared auto-mode guard comes BEFORE handleQuick call.
|
|
39
|
-
// Accepts either the inline isAutoActive() check (legacy) or the shared
|
|
40
|
-
// requireNotAutoActive() helper (#4712).
|
|
41
|
-
const guardIndex = Math.max(
|
|
42
|
-
quickBlock.indexOf("isAutoActive()"),
|
|
43
|
-
quickBlock.indexOf("requireNotAutoActive("),
|
|
44
|
-
);
|
|
45
|
-
const handleQuickIndex = quickBlock.indexOf("handleQuick(");
|
|
46
|
-
|
|
47
|
-
assert.ok(guardIndex !== -1, "auto-mode guard exists in quick command block");
|
|
48
|
-
assert.ok(handleQuickIndex !== -1, "handleQuick() call exists in quick command block");
|
|
49
|
-
assert.ok(
|
|
50
|
-
guardIndex < handleQuickIndex,
|
|
51
|
-
"auto-mode guard appears before handleQuick() call",
|
|
52
|
-
);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it("guard shows error message mentioning /gsd stop", () => {
|
|
56
|
-
const src = readFileSync(
|
|
57
|
-
join(
|
|
58
|
-
import.meta.dirname,
|
|
59
|
-
"..",
|
|
60
|
-
"commands",
|
|
61
|
-
"handlers",
|
|
62
|
-
"workflow.ts",
|
|
63
|
-
),
|
|
64
|
-
"utf-8",
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
// The shared helper assembles the message dynamically from the command name,
|
|
68
|
-
// so assert on the message fragment and the /gsd stop instruction.
|
|
69
|
-
assert.ok(
|
|
70
|
-
src.includes("cannot run while auto-mode is active"),
|
|
71
|
-
"error message explains that the command cannot run during auto-mode",
|
|
72
|
-
);
|
|
73
|
-
assert.ok(
|
|
74
|
-
src.includes("/gsd stop"),
|
|
75
|
-
"error message mentions /gsd stop as the resolution",
|
|
76
|
-
);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it("guard returns true (handled) to prevent falling through", () => {
|
|
80
|
-
const src = readFileSync(
|
|
81
|
-
join(
|
|
82
|
-
import.meta.dirname,
|
|
83
|
-
"..",
|
|
84
|
-
"commands",
|
|
85
|
-
"handlers",
|
|
86
|
-
"workflow.ts",
|
|
87
|
-
),
|
|
88
|
-
"utf-8",
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
// After the isAutoActive() check and notify, there should be a `return true`
|
|
92
|
-
// before the handleQuick call
|
|
93
|
-
const quickBlockMatch = src.match(
|
|
94
|
-
/if\s*\(\s*trimmed\s*===\s*"quick"\s*\|\|\s*trimmed\.startsWith\("quick "\)\s*\)\s*\{([\s\S]*?)\n \}/,
|
|
95
|
-
);
|
|
96
|
-
assert.ok(quickBlockMatch);
|
|
97
|
-
const quickBlock = quickBlockMatch[1];
|
|
98
|
-
|
|
99
|
-
// The guard block should have its own return true before handleQuick
|
|
100
|
-
const guardBlock = quickBlock.slice(0, quickBlock.indexOf("handleQuick("));
|
|
101
|
-
assert.ok(
|
|
102
|
-
guardBlock.includes("return true"),
|
|
103
|
-
"guard block returns true before handleQuick is reached",
|
|
104
|
-
);
|
|
15
|
+
it("returns handled and notifies when auto-mode is active", async () => {
|
|
16
|
+
const notifications: Array<{ message: string; level?: string }> = [];
|
|
17
|
+
_setAutoActiveForTest(true);
|
|
18
|
+
try {
|
|
19
|
+
const handled = await handleWorkflowCommand("quick fix the docs", {
|
|
20
|
+
ui: {
|
|
21
|
+
notify(message: string, level?: string) {
|
|
22
|
+
notifications.push({ message, level });
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
} as any, {} as any);
|
|
26
|
+
|
|
27
|
+
assert.equal(handled, true);
|
|
28
|
+
assert.deepEqual(notifications, [{
|
|
29
|
+
message: "/gsd quick cannot run while auto-mode is active.\nStop auto-mode first with /gsd stop, then run /gsd quick.",
|
|
30
|
+
level: "error",
|
|
31
|
+
}]);
|
|
32
|
+
} finally {
|
|
33
|
+
_setAutoActiveForTest(false);
|
|
34
|
+
}
|
|
105
35
|
});
|
|
106
36
|
});
|
|
@@ -1,90 +1,61 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tests that cleanupQuickBranch is
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Relates to #2668: /gsd quick does not squash-merge branch back after agent
|
|
6
|
-
* completes task. cleanupQuickBranch() exists but is never invoked.
|
|
7
|
-
*
|
|
8
|
-
* The fix registers a turn_end hook in register-hooks.ts that calls
|
|
9
|
-
* cleanupQuickBranch() after each turn, which is a no-op when no quick-task
|
|
10
|
-
* state is pending.
|
|
2
|
+
* Tests that cleanupQuickBranch is wired to turn_end by exercising the
|
|
3
|
+
* registered hook against a real temporary git repository.
|
|
11
4
|
*/
|
|
12
5
|
|
|
13
6
|
import { describe, it } from "node:test";
|
|
14
7
|
import assert from "node:assert/strict";
|
|
15
|
-
import {
|
|
8
|
+
import { execFileSync } from "node:child_process";
|
|
9
|
+
import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
16
10
|
import { join } from "node:path";
|
|
11
|
+
import { tmpdir } from "node:os";
|
|
17
12
|
|
|
18
|
-
|
|
13
|
+
import { registerHooks } from "../bootstrap/register-hooks.ts";
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"utf-8",
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
it("register-hooks.ts loads cleanupQuickBranch from quick.ts", () => {
|
|
27
|
-
assert.ok(
|
|
28
|
-
hooksSource.includes("cleanupQuickBranch"),
|
|
29
|
-
"register-hooks.ts must reference cleanupQuickBranch",
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
// Verify it is loaded from quick.ts (static or lazy), not just mentioned in a comment.
|
|
33
|
-
const importMatch =
|
|
34
|
-
hooksSource.match(/import\s*\{[^}]*cleanupQuickBranch[^}]*\}\s*from\s*["'][^"']*quick/) ||
|
|
35
|
-
hooksSource.match(/const\s+\{\s*cleanupQuickBranch\s*\}\s*=\s*await\s+import\(["'][^"']*quick\.js["']\)/);
|
|
36
|
-
assert.ok(
|
|
37
|
-
importMatch,
|
|
38
|
-
"cleanupQuickBranch must be loaded from quick module",
|
|
39
|
-
);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it("registers a turn_end handler that calls cleanupQuickBranch", () => {
|
|
43
|
-
// Find the turn_end registration
|
|
44
|
-
const turnEndMatch = hooksSource.match(
|
|
45
|
-
/pi\.on\(\s*["']turn_end["']/,
|
|
46
|
-
);
|
|
47
|
-
assert.ok(
|
|
48
|
-
turnEndMatch,
|
|
49
|
-
"register-hooks.ts must register a turn_end handler",
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
// Extract the turn_end handler body — find everything from the pi.on("turn_end"
|
|
53
|
-
// to the matching closing });
|
|
54
|
-
const turnEndIdx = hooksSource.indexOf(turnEndMatch[0]);
|
|
55
|
-
assert.ok(turnEndIdx !== -1);
|
|
56
|
-
|
|
57
|
-
// Get the rest of the source from that point
|
|
58
|
-
const rest = hooksSource.slice(turnEndIdx);
|
|
15
|
+
function git(cwd: string, args: string[]): string {
|
|
16
|
+
return execFileSync("git", args, { cwd, encoding: "utf-8" }).trim();
|
|
17
|
+
}
|
|
59
18
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
19
|
+
describe("quick task turn_end cleanup (#2668)", () => {
|
|
20
|
+
it("turn_end handler runs cleanupQuickBranch and removes quick-return state", async () => {
|
|
21
|
+
const repo = mkdtempSync(join(tmpdir(), "gsd-quick-cleanup-"));
|
|
22
|
+
const oldCwd = process.cwd();
|
|
23
|
+
try {
|
|
24
|
+
git(repo, ["init", "-b", "main"]);
|
|
25
|
+
git(repo, ["config", "user.email", "test@example.com"]);
|
|
26
|
+
git(repo, ["config", "user.name", "Test User"]);
|
|
27
|
+
writeFileSync(join(repo, "README.md"), "base\n");
|
|
28
|
+
git(repo, ["add", "README.md"]);
|
|
29
|
+
git(repo, ["commit", "-m", "chore: initial"]);
|
|
30
|
+
git(repo, ["checkout", "-b", "quick/Q1-test"]);
|
|
31
|
+
writeFileSync(join(repo, "quick.txt"), "quick work\n");
|
|
32
|
+
git(repo, ["add", "quick.txt"]);
|
|
33
|
+
git(repo, ["commit", "-m", "test: quick work"]);
|
|
34
|
+
|
|
35
|
+
mkdirSync(join(repo, ".gsd", "runtime"), { recursive: true });
|
|
36
|
+
writeFileSync(join(repo, ".gsd", "runtime", "quick-return.json"), JSON.stringify({
|
|
37
|
+
basePath: repo,
|
|
38
|
+
originalBranch: "main",
|
|
39
|
+
quickBranch: "quick/Q1-test",
|
|
40
|
+
taskNum: 1,
|
|
41
|
+
slug: "test",
|
|
42
|
+
description: "test",
|
|
43
|
+
}) + "\n");
|
|
44
|
+
|
|
45
|
+
const handlers = new Map<string, Function>();
|
|
46
|
+
registerHooks({ on(event: string, handler: Function) { handlers.set(event, handler); } } as any, []);
|
|
47
|
+
const turnEnd = handlers.get("turn_end");
|
|
48
|
+
assert.ok(turnEnd, "turn_end hook should be registered");
|
|
49
|
+
|
|
50
|
+
process.chdir(repo);
|
|
51
|
+
await turnEnd();
|
|
52
|
+
|
|
53
|
+
assert.equal(git(repo, ["branch", "--show-current"]), "main");
|
|
54
|
+
assert.throws(() => git(repo, ["rev-parse", "--verify", "quick/Q1-test"]));
|
|
55
|
+
assert.equal(existsSync(join(repo, ".gsd", "runtime", "quick-return.json")), false);
|
|
56
|
+
} finally {
|
|
57
|
+
process.chdir(oldCwd);
|
|
58
|
+
rmSync(repo, { recursive: true, force: true });
|
|
59
|
+
}
|
|
89
60
|
});
|
|
90
61
|
});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import test from "node:test";
|
|
7
7
|
import assert from "node:assert/strict";
|
|
8
|
-
import { mkdirSync,
|
|
8
|
+
import { mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { tmpdir } from "node:os";
|
|
10
10
|
import { join } from "node:path";
|
|
11
11
|
import { randomUUID } from "node:crypto";
|
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
type DispatchAction,
|
|
17
17
|
type DispatchContext,
|
|
18
18
|
} from "../auto-dispatch.ts";
|
|
19
|
+
import { buildPlanSlicePrompt } from "../auto-prompts.ts";
|
|
20
|
+
import { registerDbTools } from "../bootstrap/db-tools.ts";
|
|
19
21
|
import { resolveProfileDefaults } from "../preferences-models.ts";
|
|
20
22
|
import type { GSDState } from "../types.ts";
|
|
21
23
|
import type { GSDPreferences } from "../preferences.ts";
|
|
@@ -117,16 +119,28 @@ test("ADR-003 §4: burn-max profile opts into dedicated reassess-roadmap dispatc
|
|
|
117
119
|
});
|
|
118
120
|
|
|
119
121
|
test("ADR-003 §4: plan-slice prompt and MCP tool agree on reassess sliceChanges shape", () => {
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
assert.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
assert.
|
|
128
|
-
assert.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
122
|
+
const tools: Record<string, any> = {};
|
|
123
|
+
registerDbTools({ registerTool(tool: any) { tools[tool.name] = tool; } } as any);
|
|
124
|
+
|
|
125
|
+
const reassessTool = tools.gsd_reassess_roadmap;
|
|
126
|
+
assert.ok(reassessTool, "gsd_reassess_roadmap should be registered");
|
|
127
|
+
const sliceChanges = reassessTool.parameters.properties.sliceChanges.properties;
|
|
128
|
+
assert.ok(sliceChanges.modified, "tool schema exposes sliceChanges.modified");
|
|
129
|
+
assert.ok(sliceChanges.added, "tool schema exposes sliceChanges.added");
|
|
130
|
+
assert.ok(sliceChanges.removed, "tool schema exposes sliceChanges.removed");
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test("ADR-003 §4: rendered plan-slice prompt documents reassess sliceChanges shape", async () => {
|
|
134
|
+
const base = makeIsolatedBase();
|
|
135
|
+
try {
|
|
136
|
+
const msDir = join(base, ".gsd", "milestones", "M001");
|
|
137
|
+
writeFileSync(join(msDir, "M001-ROADMAP.md"), "# Roadmap\n\n## Slices\n\n- [ ] **S01: First** `risk:low` `depends:[]`\n");
|
|
138
|
+
const prompt = await buildPlanSlicePrompt("M001", "Test", "S01", "First", base, "minimal");
|
|
139
|
+
assert.match(prompt, /gsd_reassess_roadmap/);
|
|
140
|
+
assert.match(prompt, /sliceChanges\.modified/);
|
|
141
|
+
assert.match(prompt, /sliceChanges\.added/);
|
|
142
|
+
assert.match(prompt, /sliceChanges\.removed/);
|
|
143
|
+
} finally {
|
|
144
|
+
rmSync(base, { recursive: true, force: true });
|
|
145
|
+
}
|
|
132
146
|
});
|