gsd-pi 2.80.0-dev.710c06e97 → 2.80.0-dev.7582bf37a
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/README.md +4 -2
- 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/GSD-WORKFLOW.md +2 -2
- package/dist/resources/extensions/claude-code-cli/readiness.js +18 -7
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +40 -3
- package/dist/resources/extensions/github-sync/sync.js +4 -1
- package/dist/resources/extensions/gsd/auto/loop.js +103 -9
- package/dist/resources/extensions/gsd/auto/phases.js +240 -139
- package/dist/resources/extensions/gsd/auto/resolve.js +29 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +22 -30
- package/dist/resources/extensions/gsd/auto/session.js +8 -0
- 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-direct-dispatch.js +5 -32
- package/dist/resources/extensions/gsd/auto-dispatch.js +26 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +104 -86
- package/dist/resources/extensions/gsd/auto-prompts.js +214 -17
- package/dist/resources/extensions/gsd/auto-recovery.js +174 -10
- package/dist/resources/extensions/gsd/auto-start.js +240 -15
- package/dist/resources/extensions/gsd/auto-supervisor.js +8 -1
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +2 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +209 -81
- package/dist/resources/extensions/gsd/auto.js +168 -45
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +99 -10
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +44 -37
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +37 -10
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +30 -20
- package/dist/resources/extensions/gsd/bootstrap/journal-tools.js +4 -1
- package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +6 -4
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +5 -3
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +1 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +319 -54
- package/dist/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.js +4 -0
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +82 -23
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +19 -2
- package/dist/resources/extensions/gsd/clean-root-preflight.js +65 -9
- package/dist/resources/extensions/gsd/commands/dispatcher.js +5 -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/commands-extract-learnings.js +17 -12
- package/dist/resources/extensions/gsd/commands-handlers.js +23 -9
- package/dist/resources/extensions/gsd/context-budget.js +37 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +56 -10
- package/dist/resources/extensions/gsd/dashboard-overlay.js +1 -1
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +92 -0
- package/dist/resources/extensions/gsd/db-base-schema.js +18 -2
- package/dist/resources/extensions/gsd/db-migration-steps.js +22 -0
- package/dist/resources/extensions/gsd/detection.js +106 -0
- package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +2 -0
- package/dist/resources/extensions/gsd/git-service.js +73 -5
- package/dist/resources/extensions/gsd/gsd-db.js +146 -13
- package/dist/resources/extensions/gsd/guided-flow.js +143 -48
- package/dist/resources/extensions/gsd/init-wizard.js +4 -1
- package/dist/resources/extensions/gsd/memory-store.js +69 -12
- package/dist/resources/extensions/gsd/migrate/command.js +40 -1
- package/dist/resources/extensions/gsd/migration-auto-check.js +87 -0
- package/dist/resources/extensions/gsd/native-git-bridge.js +32 -8
- package/dist/resources/extensions/gsd/orphan-stash-audit.js +101 -0
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +13 -3
- package/dist/resources/extensions/gsd/planning-path-scope.js +26 -0
- package/dist/resources/extensions/gsd/pre-execution-checks.js +22 -0
- package/dist/resources/extensions/gsd/prompt-loader.js +28 -2
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +27 -23
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/execute-task.md +4 -2
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/quick-task.md +1 -5
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
- package/dist/resources/extensions/gsd/quick.js +34 -2
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +10 -2
- 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/tools/context-mode-tool-result.js +15 -0
- package/dist/resources/extensions/gsd/tools/exec-search-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/exec-tool.js +3 -15
- package/dist/resources/extensions/gsd/tools/memory-tools.js +1 -0
- package/dist/resources/extensions/gsd/tools/plan-slice.js +9 -0
- package/dist/resources/extensions/gsd/tools/plan-task.js +9 -0
- package/dist/resources/extensions/gsd/tools/resume-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +1 -1
- package/dist/resources/extensions/gsd/unit-context-composer.js +12 -3
- package/dist/resources/extensions/gsd/unit-runtime.js +22 -0
- package/dist/resources/extensions/gsd/workflow-protocol.js +131 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +16 -14
- package/dist/resources/extensions/gsd/worktree-resolver.js +90 -22
- 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 +16 -16
- 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/required-server-files.json +1 -1
- 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 +16 -16
- 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/web/standalone/server.js +1 -1
- package/dist/welcome-screen.d.ts +2 -0
- package/dist/welcome-screen.js +9 -7
- package/package.json +6 -4
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +22 -17
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +75 -2
- package/packages/mcp-server/src/workflow-tools.ts +30 -16
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +4 -1
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/agent.d.ts +5 -0
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent.js +2 -0
- package/packages/pi-agent-core/dist/agent.js.map +1 -1
- package/packages/pi-agent-core/dist/index.d.ts +1 -0
- package/packages/pi-agent-core/dist/index.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/index.js +2 -0
- package/packages/pi-agent-core/dist/index.js.map +1 -1
- package/packages/pi-agent-core/dist/token-audit.d.ts +47 -0
- package/packages/pi-agent-core/dist/token-audit.d.ts.map +1 -0
- package/packages/pi-agent-core/dist/token-audit.js +221 -0
- package/packages/pi-agent-core/dist/token-audit.js.map +1 -0
- package/packages/pi-agent-core/dist/types.d.ts +9 -0
- package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/types.js.map +1 -1
- package/packages/pi-agent-core/src/agent-loop.test.ts +128 -0
- package/packages/pi-agent-core/src/agent-loop.ts +4 -1
- package/packages/pi-agent-core/src/agent.ts +8 -0
- package/packages/pi-agent-core/src/index.ts +2 -0
- package/packages/pi-agent-core/src/token-audit.test.ts +189 -0
- package/packages/pi-agent-core/src/token-audit.ts +287 -0
- package/packages/pi-agent-core/src/types.ts +14 -0
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +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/types.d.ts +2 -0
- package/packages/pi-ai/dist/types.d.ts.map +1 -1
- package/packages/pi-ai/dist/types.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/types.ts +3 -0
- 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/agent-session-abort-order.test.js +32 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js +30 -1
- package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +17 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +52 -7
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +78 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +9 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js +103 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts +15 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.js +66 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.js +24 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +8 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +5 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +20 -7
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js +102 -3
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +41 -3
- 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/hooks-runner.test.js +2 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.js +46 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +10 -2
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +81 -4
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +20 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +25 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js +22 -0
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +6 -7
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +2 -3
- package/packages/pi-coding-agent/dist/core/system-prompt.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__/chat-frame-compaction-tone.test.js +6 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +137 -19
- 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/adaptive-layout.js +2 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +2 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +32 -7
- 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 +18 -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 +225 -16
- 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 +85 -2
- 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 +71 -0
- 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 +22 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +36 -27
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +21 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js +28 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js +3 -2
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +36 -0
- package/packages/pi-coding-agent/src/core/agent-session-tool-refresh.test.ts +40 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +59 -7
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +91 -0
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +18 -0
- package/packages/pi-coding-agent/src/core/compaction-threshold.test.ts +121 -0
- package/packages/pi-coding-agent/src/core/db-snapshot.test.ts +32 -0
- package/packages/pi-coding-agent/src/core/db-snapshot.ts +66 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +10 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.test.ts +113 -3
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +24 -6
- package/packages/pi-coding-agent/src/core/extensions/types.ts +44 -2
- package/packages/pi-coding-agent/src/core/hooks-runner.test.ts +2 -0
- package/packages/pi-coding-agent/src/core/sdk-tool-filter.test.ts +60 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +92 -4
- package/packages/pi-coding-agent/src/core/settings-manager.ts +39 -1
- package/packages/pi-coding-agent/src/core/skill-tool.test.ts +28 -0
- package/packages/pi-coding-agent/src/core/system-prompt.ts +8 -10
- 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__/chat-frame-compaction-tone.test.ts +7 -5
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +185 -19
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +2 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +2 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +41 -10
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +260 -16
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +75 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +107 -3
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +24 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +36 -27
- package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +25 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage-safety-guard.test.ts +31 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage.ts +3 -2
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +18 -8
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/tui.ts +20 -8
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js +36 -27
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/src/resources/GSD-WORKFLOW.md +2 -2
- package/src/resources/extensions/claude-code-cli/readiness.ts +25 -7
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +42 -3
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +67 -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-deps.ts +3 -2
- package/src/resources/extensions/gsd/auto/loop.ts +134 -16
- package/src/resources/extensions/gsd/auto/phases.ts +328 -200
- package/src/resources/extensions/gsd/auto/resolve.ts +42 -1
- package/src/resources/extensions/gsd/auto/run-unit.ts +28 -30
- package/src/resources/extensions/gsd/auto/session.ts +8 -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-direct-dispatch.ts +8 -34
- package/src/resources/extensions/gsd/auto-dispatch.ts +33 -0
- package/src/resources/extensions/gsd/auto-post-unit.ts +117 -88
- package/src/resources/extensions/gsd/auto-prompts.ts +228 -16
- package/src/resources/extensions/gsd/auto-recovery.ts +185 -7
- package/src/resources/extensions/gsd/auto-start.ts +293 -21
- package/src/resources/extensions/gsd/auto-supervisor.ts +7 -0
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +2 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +241 -72
- package/src/resources/extensions/gsd/auto.ts +220 -40
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +120 -8
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +45 -37
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +36 -10
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +32 -19
- package/src/resources/extensions/gsd/bootstrap/journal-tools.ts +5 -1
- package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +7 -4
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +6 -3
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +1 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +369 -54
- package/src/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.ts +4 -0
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +90 -22
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +19 -2
- package/src/resources/extensions/gsd/clean-root-preflight.ts +72 -9
- package/src/resources/extensions/gsd/commands/dispatcher.ts +6 -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/commands-extract-learnings.ts +17 -12
- package/src/resources/extensions/gsd/commands-handlers.ts +34 -15
- package/src/resources/extensions/gsd/context-budget.ts +44 -2
- package/src/resources/extensions/gsd/crash-recovery.ts +67 -10
- package/src/resources/extensions/gsd/dashboard-overlay.ts +1 -1
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +107 -0
- package/src/resources/extensions/gsd/db-base-schema.ts +19 -2
- package/src/resources/extensions/gsd/db-migration-steps.ts +25 -0
- package/src/resources/extensions/gsd/detection.ts +128 -0
- package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +3 -0
- package/src/resources/extensions/gsd/git-service.ts +87 -10
- package/src/resources/extensions/gsd/gsd-db.ts +168 -13
- package/src/resources/extensions/gsd/guided-flow.ts +169 -55
- package/src/resources/extensions/gsd/init-wizard.ts +5 -1
- package/src/resources/extensions/gsd/memory-store.ts +77 -12
- package/src/resources/extensions/gsd/migrate/command.ts +47 -1
- package/src/resources/extensions/gsd/migration-auto-check.ts +129 -0
- package/src/resources/extensions/gsd/native-git-bridge.ts +39 -6
- package/src/resources/extensions/gsd/orphan-stash-audit.ts +117 -0
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +13 -3
- package/src/resources/extensions/gsd/planning-path-scope.ts +35 -0
- package/src/resources/extensions/gsd/pre-execution-checks.ts +23 -0
- package/src/resources/extensions/gsd/preferences-types.ts +1 -1
- package/src/resources/extensions/gsd/prompt-loader.ts +27 -2
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +27 -23
- package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/execute-task.md +4 -2
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/quick-task.md +1 -5
- package/src/resources/extensions/gsd/prompts/replan-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
- package/src/resources/extensions/gsd/quick.ts +37 -2
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +11 -2
- 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 +433 -11
- 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 +160 -11
- 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-recovery.test.ts +139 -2
- 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 +159 -213
- 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/clean-root-preflight.test.ts +97 -2
- 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/commands-extract-learnings.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/compaction-snapshot.test.ts +14 -1
- package/src/resources/extensions/gsd/tests/complete-milestone-excerpt.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/complete-slice-composer.test.ts +3 -2
- 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/context-budget.test.ts +10 -1
- package/src/resources/extensions/gsd/tests/context-store.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/crash-handler-secondary.test.ts +90 -31
- package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +5 -1
- 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/db-schema-metadata.test.ts +2 -2
- 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/detection.test.ts +140 -0
- 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/dispatch-rule-coverage.test.ts +313 -0
- 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/exec-history.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/execute-task-rendering.test.ts +5 -2
- package/src/resources/extensions/gsd/tests/fast-forward-reused-milestone-branch.test.ts +219 -0
- package/src/resources/extensions/gsd/tests/finalize-survivor-branch.test.ts +132 -0
- 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/gsd-db.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/has-pending-deep-stage.test.ts +33 -1
- 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 +66 -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 -56
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +239 -1
- package/src/resources/extensions/gsd/tests/journal-query-tool.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/knowledge.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/lazy-pi-tui-import.test.ts +44 -6
- package/src/resources/extensions/gsd/tests/memory-decay-factor.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +21 -35
- package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/milestone-merge-stash-restore.test.ts +242 -0
- 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/native-git-bridge-exec-fallback.test.ts +34 -2
- 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/originalbase-path-comparison.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/orphan-merge-bootstrap.test.ts +133 -0
- package/src/resources/extensions/gsd/tests/orphan-stash-audit.test.ts +201 -0
- package/src/resources/extensions/gsd/tests/parallel-orchestrator-fast-forward.test.ts +113 -0
- 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 +91 -75
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +21 -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-checks.test.ts +45 -5
- 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-duplication-cuts.test.ts +230 -0
- package/src/resources/extensions/gsd/tests/prompt-path-audit.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +70 -106
- 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-external-gsd.test.ts +40 -0
- 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 -69
- package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +32 -164
- package/src/resources/extensions/gsd/tests/right-sized-workflow-prompts.test.ts +192 -0
- package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +57 -41
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/schema-v27-v28-sequence.test.ts +156 -0
- package/src/resources/extensions/gsd/tests/select-resumable-milestone.test.ts +96 -0
- 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 +166 -0
- package/src/resources/extensions/gsd/tests/show-config-command.test.ts +44 -42
- package/src/resources/extensions/gsd/tests/signal-handlers.test.ts +27 -0
- 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 -59
- 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/stalled-tool-recovery.test.ts +49 -1
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +101 -2
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/status-db-open.test.ts +35 -40
- 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/system-context-memory.test.ts +112 -0
- package/src/resources/extensions/gsd/tests/system-context-message-routing.test.ts +7 -9
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +84 -309
- package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +291 -0
- package/src/resources/extensions/gsd/tests/triage-dispatch.test.ts +134 -341
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +136 -4
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +8 -25
- package/src/resources/extensions/gsd/tests/unit-dispatches.test.ts +80 -1
- package/src/resources/extensions/gsd/tests/unit-runtime.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/unstructured-continue-context-injection.test.ts +5 -99
- 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-protocol-excerpt.test.ts +99 -0
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +3 -0
- 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 +38 -6
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/worktree-main-branch.test.ts +20 -18
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/worktree-nested-git-safety.test.ts +9 -2
- package/src/resources/extensions/gsd/tests/worktree-path-injection.test.ts +22 -19
- package/src/resources/extensions/gsd/tests/worktree-project-root-degrade.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +203 -4
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +40 -1
- 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/tools/context-mode-tool-result.ts +25 -0
- package/src/resources/extensions/gsd/tools/exec-search-tool.ts +7 -7
- package/src/resources/extensions/gsd/tools/exec-tool.ts +4 -23
- package/src/resources/extensions/gsd/tools/memory-tools.ts +1 -0
- package/src/resources/extensions/gsd/tools/plan-slice.ts +13 -0
- package/src/resources/extensions/gsd/tools/plan-task.ts +10 -0
- package/src/resources/extensions/gsd/tools/resume-tool.ts +7 -7
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +1 -1
- package/src/resources/extensions/gsd/unit-context-composer.ts +19 -4
- package/src/resources/extensions/gsd/unit-runtime.ts +25 -0
- package/src/resources/extensions/gsd/workflow-protocol.ts +160 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +15 -4
- package/src/resources/extensions/gsd/worktree-resolver.ts +119 -20
- 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/{CaMwumvGbBPZrJicfsCzV → Y9yOOsO4ZA5BPTOS8ixvP}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{CaMwumvGbBPZrJicfsCzV → Y9yOOsO4ZA5BPTOS8ixvP}/_ssgManifest.js +0 -0
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
// excluded from this invariant.
|
|
24
24
|
|
|
25
25
|
import { createRequire } from "node:module";
|
|
26
|
+
import { createHash } from "node:crypto";
|
|
26
27
|
import { existsSync, copyFileSync, mkdirSync, realpathSync } from "node:fs";
|
|
27
28
|
import { dirname } from "node:path";
|
|
28
29
|
import type { Decision, Requirement, GateRow, GateId, GateScope, GateStatus, GateVerdict } from "./types.js";
|
|
@@ -77,6 +78,9 @@ import {
|
|
|
77
78
|
applyMigrationV21StructuredMemories,
|
|
78
79
|
applyMigrationV22QualityGateRepair,
|
|
79
80
|
applyMigrationV23MilestoneQueue,
|
|
81
|
+
applyMigrationV26MilestoneCommitAttributions,
|
|
82
|
+
applyMigrationV27ArtifactHash,
|
|
83
|
+
applyMigrationV28MemoryLastHitAt,
|
|
80
84
|
} from "./db-migration-steps.js";
|
|
81
85
|
import { isMemoriesFtsAvailableSchema, tryCreateMemoriesFtsSchema } from "./db-memory-fts-schema.js";
|
|
82
86
|
import { createDbOpenState, type DbOpenPhase } from "./db-open-state.js";
|
|
@@ -105,7 +109,7 @@ const providerLoader = createSqliteProviderLoader({
|
|
|
105
109
|
writeStderr: (message: string) => process.stderr.write(message),
|
|
106
110
|
});
|
|
107
111
|
|
|
108
|
-
export const SCHEMA_VERSION =
|
|
112
|
+
export const SCHEMA_VERSION = 28;
|
|
109
113
|
|
|
110
114
|
function initSchema(db: DbAdapter, fileBacked: boolean): void {
|
|
111
115
|
if (fileBacked) db.exec("PRAGMA journal_mode=WAL");
|
|
@@ -329,6 +333,21 @@ function migrateSchema(db: DbAdapter): void {
|
|
|
329
333
|
recordSchemaVersion(db, 25);
|
|
330
334
|
}
|
|
331
335
|
|
|
336
|
+
if (currentVersion < 26) {
|
|
337
|
+
applyMigrationV26MilestoneCommitAttributions(db);
|
|
338
|
+
recordSchemaVersion(db, 26);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (currentVersion < 27) {
|
|
342
|
+
applyMigrationV27ArtifactHash(db);
|
|
343
|
+
recordSchemaVersion(db, 27);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
if (currentVersion < 28) {
|
|
347
|
+
applyMigrationV28MemoryLastHitAt(db);
|
|
348
|
+
recordSchemaVersion(db, 28);
|
|
349
|
+
}
|
|
350
|
+
|
|
332
351
|
db.exec("COMMIT");
|
|
333
352
|
} catch (err) {
|
|
334
353
|
db.exec("ROLLBACK");
|
|
@@ -907,9 +926,10 @@ export function insertArtifact(a: {
|
|
|
907
926
|
full_content: string;
|
|
908
927
|
}): void {
|
|
909
928
|
if (!currentDb) throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
|
|
929
|
+
const contentHash = createHash("sha256").update(a.full_content).digest("hex");
|
|
910
930
|
currentDb.prepare(
|
|
911
|
-
`INSERT OR REPLACE INTO artifacts (path, artifact_type, milestone_id, slice_id, task_id, full_content, imported_at)
|
|
912
|
-
VALUES (:path, :artifact_type, :milestone_id, :slice_id, :task_id, :full_content, :imported_at)`,
|
|
931
|
+
`INSERT OR REPLACE INTO artifacts (path, artifact_type, milestone_id, slice_id, task_id, full_content, imported_at, content_hash)
|
|
932
|
+
VALUES (:path, :artifact_type, :milestone_id, :slice_id, :task_id, :full_content, :imported_at, :content_hash)`,
|
|
913
933
|
).run({
|
|
914
934
|
":path": a.path,
|
|
915
935
|
":artifact_type": a.artifact_type,
|
|
@@ -918,6 +938,7 @@ export function insertArtifact(a: {
|
|
|
918
938
|
":task_id": a.task_id,
|
|
919
939
|
":full_content": a.full_content,
|
|
920
940
|
":imported_at": new Date().toISOString(),
|
|
941
|
+
":content_hash": contentHash,
|
|
921
942
|
});
|
|
922
943
|
}
|
|
923
944
|
|
|
@@ -1349,6 +1370,45 @@ export function getSliceTasks(milestoneId: string, sliceId: string): TaskRow[] {
|
|
|
1349
1370
|
return rows.map(rowToTask);
|
|
1350
1371
|
}
|
|
1351
1372
|
|
|
1373
|
+
export function getCompletedMilestoneTaskFileHints(milestoneId: string): string[] {
|
|
1374
|
+
if (!currentDb) return [];
|
|
1375
|
+
const rows = currentDb.prepare(
|
|
1376
|
+
`SELECT files, key_files
|
|
1377
|
+
FROM tasks
|
|
1378
|
+
WHERE milestone_id = :mid AND status IN ('complete', 'done')`,
|
|
1379
|
+
).all({ ":mid": milestoneId }) as Array<Record<string, unknown>>;
|
|
1380
|
+
|
|
1381
|
+
const hints = new Set<string>();
|
|
1382
|
+
for (const row of rows) {
|
|
1383
|
+
for (const raw of [row["files"], row["key_files"]]) {
|
|
1384
|
+
for (const file of parseStringArrayColumn(raw)) {
|
|
1385
|
+
const normalized = normalizeRepoPath(file);
|
|
1386
|
+
if (normalized) hints.add(normalized);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
return [...hints];
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
function parseStringArrayColumn(raw: unknown): string[] {
|
|
1394
|
+
if (Array.isArray(raw)) return raw.filter((entry): entry is string => typeof entry === "string");
|
|
1395
|
+
if (typeof raw !== "string") return [];
|
|
1396
|
+
const trimmed = raw.trim();
|
|
1397
|
+
if (!trimmed) return [];
|
|
1398
|
+
try {
|
|
1399
|
+
const parsed = JSON.parse(trimmed);
|
|
1400
|
+
if (Array.isArray(parsed)) return parsed.filter((entry): entry is string => typeof entry === "string");
|
|
1401
|
+
if (typeof parsed === "string") return [parsed];
|
|
1402
|
+
} catch {
|
|
1403
|
+
return trimmed.split(",");
|
|
1404
|
+
}
|
|
1405
|
+
return [];
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
function normalizeRepoPath(file: string): string {
|
|
1409
|
+
return file.trim().replace(/\\/g, "/").replace(/^\.\/+/, "");
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1352
1412
|
// ─── ADR-011 Phase 2 escalation helpers ──────────────────────────────────
|
|
1353
1413
|
|
|
1354
1414
|
/** Set pause-on-escalation state on a completed task. Mutually exclusive with awaiting_review. */
|
|
@@ -1750,6 +1810,13 @@ export function reconcileWorktreeDb(
|
|
|
1750
1810
|
const hasEscalationAwaiting = wtTaskInfo.some((col) => col["name"] === "escalation_awaiting_review");
|
|
1751
1811
|
const hasEscalationArtifact = wtTaskInfo.some((col) => col["name"] === "escalation_artifact_path");
|
|
1752
1812
|
const hasEscalationOverride = wtTaskInfo.some((col) => col["name"] === "escalation_override_applied_at");
|
|
1813
|
+
const wtArtifactInfo = adapter.prepare("PRAGMA wt.table_info('artifacts')").all();
|
|
1814
|
+
const hasArtifactContentHash = wtArtifactInfo.some((col) => col["name"] === "content_hash");
|
|
1815
|
+
const wtMemoryInfo = adapter.prepare("PRAGMA wt.table_info('memories')").all();
|
|
1816
|
+
const hasMemoryScope = wtMemoryInfo.some((col) => col["name"] === "scope");
|
|
1817
|
+
const hasMemoryTags = wtMemoryInfo.some((col) => col["name"] === "tags");
|
|
1818
|
+
const hasMemoryStructuredFields = wtMemoryInfo.some((col) => col["name"] === "structured_fields");
|
|
1819
|
+
const hasMemoryLastHitAt = wtMemoryInfo.some((col) => col["name"] === "last_hit_at");
|
|
1753
1820
|
|
|
1754
1821
|
const decConf = adapter.prepare(
|
|
1755
1822
|
`SELECT m.id FROM decisions m INNER JOIN wt.decisions w ON m.id = w.id WHERE m.decision != w.decision OR m.choice != w.choice OR m.rationale != w.rationale OR ${
|
|
@@ -1797,12 +1864,17 @@ export function reconcileWorktreeDb(
|
|
|
1797
1864
|
FROM wt.requirements
|
|
1798
1865
|
`).run());
|
|
1799
1866
|
|
|
1867
|
+
// V27: preserve content_hash. If the worktree predates V27 (no column),
|
|
1868
|
+
// fall back to the main DB's existing hash so reconcile doesn't null
|
|
1869
|
+
// out integrity fingerprints on artifacts that were unchanged in wt.
|
|
1800
1870
|
merged.artifacts = countChanges(adapter.prepare(`
|
|
1801
1871
|
INSERT OR REPLACE INTO artifacts (
|
|
1802
|
-
path, artifact_type, milestone_id, slice_id, task_id, full_content, imported_at
|
|
1872
|
+
path, artifact_type, milestone_id, slice_id, task_id, full_content, imported_at, content_hash
|
|
1803
1873
|
)
|
|
1804
|
-
SELECT path, artifact_type, milestone_id, slice_id, task_id, full_content, imported_at
|
|
1805
|
-
|
|
1874
|
+
SELECT w.path, w.artifact_type, w.milestone_id, w.slice_id, w.task_id, w.full_content, w.imported_at,
|
|
1875
|
+
${hasArtifactContentHash ? "w.content_hash" : "m.content_hash"}
|
|
1876
|
+
FROM wt.artifacts w
|
|
1877
|
+
LEFT JOIN artifacts m ON m.path = w.path
|
|
1806
1878
|
`).run());
|
|
1807
1879
|
|
|
1808
1880
|
// Merge milestones — worktree may have updated status/planning fields.
|
|
@@ -1904,15 +1976,25 @@ export function reconcileWorktreeDb(
|
|
|
1904
1976
|
LEFT JOIN tasks m ON m.milestone_id = w.milestone_id AND m.slice_id = w.slice_id AND m.id = w.id
|
|
1905
1977
|
`).run());
|
|
1906
1978
|
|
|
1907
|
-
// Merge memories — keep worktree-learned insights
|
|
1979
|
+
// Merge memories — keep worktree-learned insights.
|
|
1980
|
+
// V18 (scope, tags), V21 (structured_fields), V28 (last_hit_at): for each
|
|
1981
|
+
// column the wt may not yet have (older worktree DB), fall back to the
|
|
1982
|
+
// main DB's existing value via LEFT JOIN so reconcile never silently
|
|
1983
|
+
// resets these fields to defaults on rows that already had them.
|
|
1908
1984
|
merged.memories = countChanges(adapter.prepare(`
|
|
1909
1985
|
INSERT OR REPLACE INTO memories (
|
|
1910
1986
|
seq, id, category, content, confidence, source_unit_type, source_unit_id,
|
|
1911
|
-
created_at, updated_at, superseded_by, hit_count
|
|
1987
|
+
created_at, updated_at, superseded_by, hit_count,
|
|
1988
|
+
scope, tags, structured_fields, last_hit_at
|
|
1912
1989
|
)
|
|
1913
|
-
SELECT seq, id, category, content, confidence, source_unit_type, source_unit_id,
|
|
1914
|
-
created_at, updated_at, superseded_by, hit_count
|
|
1915
|
-
|
|
1990
|
+
SELECT w.seq, w.id, w.category, w.content, w.confidence, w.source_unit_type, w.source_unit_id,
|
|
1991
|
+
w.created_at, w.updated_at, w.superseded_by, w.hit_count,
|
|
1992
|
+
${hasMemoryScope ? "w.scope" : "COALESCE(m.scope, 'project')"},
|
|
1993
|
+
${hasMemoryTags ? "w.tags" : "COALESCE(m.tags, '[]')"},
|
|
1994
|
+
${hasMemoryStructuredFields ? "w.structured_fields" : "m.structured_fields"},
|
|
1995
|
+
${hasMemoryLastHitAt ? "w.last_hit_at" : "m.last_hit_at"}
|
|
1996
|
+
FROM wt.memories w
|
|
1997
|
+
LEFT JOIN memories m ON m.id = w.id
|
|
1916
1998
|
`).run());
|
|
1917
1999
|
|
|
1918
2000
|
// Merge verification evidence — append-only, use INSERT OR IGNORE to avoid duplicates
|
|
@@ -2073,6 +2155,9 @@ export function deleteMilestone(milestoneId: string): void {
|
|
|
2073
2155
|
currentDb!.prepare(
|
|
2074
2156
|
`DELETE FROM artifacts WHERE milestone_id = :mid`,
|
|
2075
2157
|
).run({ ":mid": milestoneId });
|
|
2158
|
+
currentDb!.prepare(
|
|
2159
|
+
`DELETE FROM milestone_commit_attributions WHERE milestone_id = :mid`,
|
|
2160
|
+
).run({ ":mid": milestoneId });
|
|
2076
2161
|
currentDb!.prepare(
|
|
2077
2162
|
`DELETE FROM milestone_leases WHERE milestone_id = :mid`,
|
|
2078
2163
|
).run({ ":mid": milestoneId });
|
|
@@ -2391,6 +2476,75 @@ export function upsertTurnGitTransaction(entry: {
|
|
|
2391
2476
|
});
|
|
2392
2477
|
}
|
|
2393
2478
|
|
|
2479
|
+
export function getMilestoneCommitAttributionShas(milestoneId: string): string[] {
|
|
2480
|
+
if (!currentDb) return [];
|
|
2481
|
+
const rows = currentDb.prepare(
|
|
2482
|
+
`SELECT commit_sha
|
|
2483
|
+
FROM milestone_commit_attributions
|
|
2484
|
+
WHERE milestone_id = :mid
|
|
2485
|
+
ORDER BY created_at, commit_sha`,
|
|
2486
|
+
).all({ ":mid": milestoneId }) as Array<Record<string, unknown>>;
|
|
2487
|
+
return rows
|
|
2488
|
+
.map((row) => typeof row["commit_sha"] === "string" ? row["commit_sha"] : "")
|
|
2489
|
+
.filter(Boolean);
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
export function recordMilestoneCommitAttribution(entry: {
|
|
2493
|
+
commitSha: string;
|
|
2494
|
+
milestoneId: string;
|
|
2495
|
+
sliceId?: string;
|
|
2496
|
+
taskId?: string;
|
|
2497
|
+
source: "recorded" | "backfill";
|
|
2498
|
+
confidence: number;
|
|
2499
|
+
files: string[];
|
|
2500
|
+
createdAt: string;
|
|
2501
|
+
}): void {
|
|
2502
|
+
if (!currentDb) return;
|
|
2503
|
+
transaction(() => {
|
|
2504
|
+
currentDb!.prepare(
|
|
2505
|
+
`INSERT OR REPLACE INTO milestone_commit_attributions (
|
|
2506
|
+
commit_sha, milestone_id, slice_id, task_id, source, confidence, files_json, created_at
|
|
2507
|
+
) VALUES (
|
|
2508
|
+
:commit_sha, :milestone_id, :slice_id, :task_id, :source, :confidence, :files_json, :created_at
|
|
2509
|
+
)`,
|
|
2510
|
+
).run({
|
|
2511
|
+
":commit_sha": entry.commitSha,
|
|
2512
|
+
":milestone_id": entry.milestoneId,
|
|
2513
|
+
":slice_id": entry.sliceId ?? null,
|
|
2514
|
+
":task_id": entry.taskId ?? null,
|
|
2515
|
+
":source": entry.source,
|
|
2516
|
+
":confidence": entry.confidence,
|
|
2517
|
+
":files_json": JSON.stringify(entry.files),
|
|
2518
|
+
":created_at": entry.createdAt,
|
|
2519
|
+
});
|
|
2520
|
+
|
|
2521
|
+
currentDb!.prepare(
|
|
2522
|
+
`INSERT OR IGNORE INTO audit_events (
|
|
2523
|
+
event_id, trace_id, turn_id, caused_by, category, type, ts, payload_json
|
|
2524
|
+
) VALUES (
|
|
2525
|
+
:event_id, :trace_id, :turn_id, :caused_by, :category, :type, :ts, :payload_json
|
|
2526
|
+
)`,
|
|
2527
|
+
).run({
|
|
2528
|
+
":event_id": `milestone-commit-attribution:${entry.milestoneId}:${entry.commitSha}`,
|
|
2529
|
+
":trace_id": "milestone-commit-attribution",
|
|
2530
|
+
":turn_id": null,
|
|
2531
|
+
":caused_by": null,
|
|
2532
|
+
":category": "git",
|
|
2533
|
+
":type": "milestone-commit-attribution-recorded",
|
|
2534
|
+
":ts": entry.createdAt,
|
|
2535
|
+
":payload_json": JSON.stringify({
|
|
2536
|
+
commitSha: entry.commitSha,
|
|
2537
|
+
milestoneId: entry.milestoneId,
|
|
2538
|
+
sliceId: entry.sliceId ?? null,
|
|
2539
|
+
taskId: entry.taskId ?? null,
|
|
2540
|
+
source: entry.source,
|
|
2541
|
+
confidence: entry.confidence,
|
|
2542
|
+
files: entry.files,
|
|
2543
|
+
}),
|
|
2544
|
+
});
|
|
2545
|
+
});
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2394
2548
|
export function insertAuditEvent(entry: {
|
|
2395
2549
|
eventId: string;
|
|
2396
2550
|
traceId: string;
|
|
@@ -2494,6 +2648,7 @@ export function clearEngineHierarchy(): void {
|
|
|
2494
2648
|
currentDb!.exec("DELETE FROM slice_dependencies");
|
|
2495
2649
|
currentDb!.exec("DELETE FROM assessments");
|
|
2496
2650
|
currentDb!.exec("DELETE FROM replan_history");
|
|
2651
|
+
currentDb!.exec("DELETE FROM milestone_commit_attributions");
|
|
2497
2652
|
currentDb!.exec("DELETE FROM tasks");
|
|
2498
2653
|
currentDb!.exec("DELETE FROM slices");
|
|
2499
2654
|
currentDb!.exec("DELETE FROM milestone_leases");
|
|
@@ -2944,8 +3099,8 @@ export function updateMemoryContentRow(
|
|
|
2944
3099
|
export function incrementMemoryHitCount(id: string, updatedAt: string): void {
|
|
2945
3100
|
if (!currentDb) throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
|
|
2946
3101
|
currentDb.prepare(
|
|
2947
|
-
"UPDATE memories SET hit_count = hit_count + 1, updated_at = :updated_at WHERE id = :id",
|
|
2948
|
-
).run({ ":updated_at": updatedAt, ":id": id });
|
|
3102
|
+
"UPDATE memories SET hit_count = hit_count + 1, updated_at = :updated_at, last_hit_at = :last_hit_at WHERE id = :id",
|
|
3103
|
+
).run({ ":updated_at": updatedAt, ":last_hit_at": updatedAt, ":id": id });
|
|
2949
3104
|
}
|
|
2950
3105
|
|
|
2951
3106
|
export function supersedeMemoryRow(oldId: string, newId: string, updatedAt: string): void {
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
formatInterruptedSessionRunningMessage,
|
|
31
31
|
formatInterruptedSessionSummary,
|
|
32
32
|
} from "./interrupted-session.js";
|
|
33
|
-
import { listUnitRuntimeRecords, clearUnitRuntimeRecord } from "./unit-runtime.js";
|
|
33
|
+
import { listUnitRuntimeRecords, clearUnitRuntimeRecord, isInFlightRuntimePhase } from "./unit-runtime.js";
|
|
34
34
|
import { resolveExpectedArtifactPath } from "./auto.js";
|
|
35
35
|
import { gsdHome } from "./gsd-home.js";
|
|
36
36
|
import {
|
|
@@ -72,6 +72,10 @@ import { verifyExpectedArtifact } from "./auto-recovery.js";
|
|
|
72
72
|
import { createWorkspace, scopeMilestone, type MilestoneScope } from "./workspace.js";
|
|
73
73
|
import { getPendingGate, extractDepthVerificationMilestoneId } from "./bootstrap/write-gate.js";
|
|
74
74
|
|
|
75
|
+
export function shouldSkipGitBootstrapAfterInit(result: { gitEnabled?: boolean }): boolean {
|
|
76
|
+
return result.gitEnabled === false;
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
// ─── Re-exports (preserve public API for existing importers) ────────────────
|
|
76
80
|
export {
|
|
77
81
|
MILESTONE_ID_RE, generateMilestoneSuffix, nextMilestoneId,
|
|
@@ -86,6 +90,36 @@ export {
|
|
|
86
90
|
import { logWarning } from "./workflow-logger.js";
|
|
87
91
|
import { deleteRuntimeKv } from "./db/runtime-kv.js";
|
|
88
92
|
import { PAUSED_SESSION_KV_KEY } from "./interrupted-session.js";
|
|
93
|
+
import { buildWorkflowDispatchContent } from "./workflow-protocol.js";
|
|
94
|
+
import { isFullGsdToolSurfaceRequested, restoreGsdWorkflowTools, scopeGsdWorkflowToolsForDispatch } from "./bootstrap/register-hooks.js";
|
|
95
|
+
|
|
96
|
+
type AutoStartOptions = Parameters<typeof startAutoDetached>[4];
|
|
97
|
+
type AutoStartLauncher = typeof startAutoDetached;
|
|
98
|
+
|
|
99
|
+
function scheduleAutoStartAfterIdle(
|
|
100
|
+
ctx: ExtensionCommandContext,
|
|
101
|
+
pi: ExtensionAPI,
|
|
102
|
+
basePath: string,
|
|
103
|
+
verboseMode: boolean,
|
|
104
|
+
options?: AutoStartOptions,
|
|
105
|
+
launch: AutoStartLauncher = startAutoDetached,
|
|
106
|
+
): void {
|
|
107
|
+
const waitForIdle =
|
|
108
|
+
typeof (ctx as { waitForIdle?: unknown }).waitForIdle === "function"
|
|
109
|
+
? ctx.waitForIdle.bind(ctx)
|
|
110
|
+
: async () => {};
|
|
111
|
+
void waitForIdle()
|
|
112
|
+
.then(() => {
|
|
113
|
+
setTimeout(() => launch(ctx, pi, basePath, verboseMode, options), 0);
|
|
114
|
+
})
|
|
115
|
+
.catch((err) => {
|
|
116
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
117
|
+
ctx.ui.notify(`Auto-start failed while waiting for the prior turn to settle: ${message}`, "error");
|
|
118
|
+
logWarning("guided", `auto-start idle wait failed: ${message}`);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const _scheduleAutoStartAfterIdleForTest = scheduleAutoStartAfterIdle;
|
|
89
123
|
|
|
90
124
|
// ─── Scope-based validator wrappers ──────────────────────────────────────────
|
|
91
125
|
// These thin wrappers accept a MilestoneScope so callers that already hold a
|
|
@@ -118,6 +152,22 @@ export function resolveExpectedArtifactPathForScope(
|
|
|
118
152
|
return resolveExpectedArtifactPath(unitType, unitId, scope.workspace.projectRoot);
|
|
119
153
|
}
|
|
120
154
|
|
|
155
|
+
async function runQuickTaskChoice(ctx: ExtensionCommandContext, pi: ExtensionAPI): Promise<void> {
|
|
156
|
+
if (!ctx.hasUI) {
|
|
157
|
+
ctx.ui.notify("Run /gsd quick <task> for small bounded work, or /gsd do <task> for natural-language routing.", "info");
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const task = (await ctx.ui.input("Quick task", "Describe the small task to run with /gsd quick"))?.trim();
|
|
162
|
+
if (!task) {
|
|
163
|
+
ctx.ui.notify("Quick task cancelled.", "info");
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const { handleQuick } = await import("./quick.js");
|
|
168
|
+
await handleQuick(task, ctx, pi);
|
|
169
|
+
}
|
|
170
|
+
|
|
121
171
|
/**
|
|
122
172
|
* Scope-based overload of isGhostMilestone.
|
|
123
173
|
* Binds basePath and milestoneId from the scope, ensuring path resolution
|
|
@@ -159,6 +209,16 @@ function runPlanV2Gate(
|
|
|
159
209
|
return "pass";
|
|
160
210
|
}
|
|
161
211
|
|
|
212
|
+
export const _needsPlanV2GateForTest = needsPlanV2Gate;
|
|
213
|
+
export const _runPlanV2GateForTest = runPlanV2Gate;
|
|
214
|
+
|
|
215
|
+
export function _roadmapHasParseableSlicesForTest(
|
|
216
|
+
roadmapContent: string | null | undefined,
|
|
217
|
+
): boolean {
|
|
218
|
+
if (!roadmapContent) return false;
|
|
219
|
+
return parseRoadmapSlices(roadmapContent).length > 0;
|
|
220
|
+
}
|
|
221
|
+
|
|
162
222
|
// ─── Commit Instruction Helpers ──────────────────────────────────────────────
|
|
163
223
|
|
|
164
224
|
/** Build commit instruction for planning prompts. .gsd/ is managed externally and always gitignored. */
|
|
@@ -220,7 +280,7 @@ const USER_DRIVEN_DEEP_SETUP_UNITS = new Set([
|
|
|
220
280
|
"discuss-requirements",
|
|
221
281
|
"research-decision",
|
|
222
282
|
]);
|
|
223
|
-
const FOREGROUND_DEEP_SETUP_RULE_NAMES = new Set([
|
|
283
|
+
export const FOREGROUND_DEEP_SETUP_RULE_NAMES = new Set([
|
|
224
284
|
"deep: pre-planning (no workflow prefs) → workflow-preferences",
|
|
225
285
|
"deep: pre-planning (no PROJECT) → discuss-project",
|
|
226
286
|
"deep: pre-planning (no REQUIREMENTS) → discuss-requirements",
|
|
@@ -430,7 +490,7 @@ async function dispatchNextDeepProjectSetupStage(entry: PendingDeepProjectSetupE
|
|
|
430
490
|
|
|
431
491
|
if (!hasPendingDeepStage(prefs, entry.basePath)) {
|
|
432
492
|
pendingDeepProjectSetupMap.delete(entry.basePath);
|
|
433
|
-
|
|
493
|
+
scheduleAutoStartAfterIdle(entry.ctx, entry.pi, entry.basePath, false, { step: entry.step });
|
|
434
494
|
return true;
|
|
435
495
|
}
|
|
436
496
|
|
|
@@ -463,7 +523,7 @@ async function dispatchNextDeepProjectSetupStage(entry: PendingDeepProjectSetupE
|
|
|
463
523
|
entry.ctx.ui.notify(result.reason, result.level);
|
|
464
524
|
} else if (hasPendingDeepStage(prefs, entry.basePath)) {
|
|
465
525
|
pendingDeepProjectSetupMap.delete(entry.basePath);
|
|
466
|
-
|
|
526
|
+
scheduleAutoStartAfterIdle(entry.ctx, entry.pi, entry.basePath, false, { step: entry.step });
|
|
467
527
|
return true;
|
|
468
528
|
}
|
|
469
529
|
return false;
|
|
@@ -471,7 +531,7 @@ async function dispatchNextDeepProjectSetupStage(entry: PendingDeepProjectSetupE
|
|
|
471
531
|
|
|
472
532
|
if (!USER_DRIVEN_DEEP_SETUP_UNITS.has(result.unitType)) {
|
|
473
533
|
pendingDeepProjectSetupMap.delete(entry.basePath);
|
|
474
|
-
|
|
534
|
+
scheduleAutoStartAfterIdle(entry.ctx, entry.pi, entry.basePath, false, { step: entry.step });
|
|
475
535
|
return true;
|
|
476
536
|
}
|
|
477
537
|
|
|
@@ -677,7 +737,7 @@ export function checkAutoStartAfterDiscuss(): boolean {
|
|
|
677
737
|
|
|
678
738
|
pendingAutoStartMap.delete(basePath);
|
|
679
739
|
ctx.ui.notify(`Milestone ${milestoneId} ready.`, "success");
|
|
680
|
-
|
|
740
|
+
scheduleAutoStartAfterIdle(ctx, pi, basePath, false, { step });
|
|
681
741
|
return true;
|
|
682
742
|
}
|
|
683
743
|
|
|
@@ -1018,49 +1078,66 @@ async function dispatchWorkflow(
|
|
|
1018
1078
|
}
|
|
1019
1079
|
}
|
|
1020
1080
|
|
|
1021
|
-
// Scope tools for
|
|
1081
|
+
// Scope tools for guided workflow turns (#2949, token-consumption savings).
|
|
1022
1082
|
// Providers with grammar-based constrained decoding (xAI/Grok) return
|
|
1023
1083
|
// "Grammar is too complex" when the combined tool schema is too large.
|
|
1024
|
-
//
|
|
1025
|
-
//
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
const currentTools = pi.getActiveTools();
|
|
1029
|
-
savedTools = currentTools;
|
|
1030
|
-
// Keep all non-GSD tools (builtins, other extensions) and only the
|
|
1031
|
-
// GSD tools on the discuss allowlist.
|
|
1032
|
-
const scopedTools = currentTools.filter(
|
|
1033
|
-
(t) => !t.startsWith("gsd_") || DISCUSS_TOOLS_ALLOWLIST.includes(t),
|
|
1034
|
-
);
|
|
1035
|
-
pi.setActiveTools(scopedTools);
|
|
1036
|
-
debugLog("discuss-tool-scoping", {
|
|
1037
|
-
unitType,
|
|
1038
|
-
before: currentTools.length,
|
|
1039
|
-
after: scopedTools.length,
|
|
1040
|
-
removed: currentTools.length - scopedTools.length,
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1084
|
+
// Guided workflow turns only need the active unit's tool surface; strip
|
|
1085
|
+
// unrelated GSD tools and broad non-GSD tools for this queued turn, then
|
|
1086
|
+
// restore so the narrowed surface does not leak into future dispatches.
|
|
1087
|
+
let savedTools: ReturnType<typeof scopeGsdWorkflowToolsForDispatch> = null;
|
|
1043
1088
|
|
|
1044
|
-
|
|
1045
|
-
|
|
1089
|
+
try {
|
|
1090
|
+
const currentTools = pi.getActiveTools();
|
|
1091
|
+
savedTools = {
|
|
1092
|
+
tools: currentTools,
|
|
1093
|
+
visibleSkills: typeof pi.getVisibleSkills === "function" ? pi.getVisibleSkills() : undefined,
|
|
1094
|
+
restoreVisibleSkills: typeof pi.setVisibleSkills === "function",
|
|
1095
|
+
};
|
|
1096
|
+
if (unitType?.startsWith("discuss-") && !isFullGsdToolSurfaceRequested()) {
|
|
1097
|
+
// Keep all non-GSD tools (builtins, other extensions) and only the
|
|
1098
|
+
// GSD tools on the discuss allowlist.
|
|
1099
|
+
const scopedTools = currentTools.filter(
|
|
1100
|
+
(t) => !t.startsWith("gsd_") || DISCUSS_TOOLS_ALLOWLIST.includes(t),
|
|
1101
|
+
);
|
|
1102
|
+
pi.setActiveTools(scopedTools);
|
|
1103
|
+
const scopedState = scopeGsdWorkflowToolsForDispatch(pi, unitType);
|
|
1104
|
+
savedTools = {
|
|
1105
|
+
tools: currentTools,
|
|
1106
|
+
visibleSkills: scopedState?.visibleSkills ?? savedTools.visibleSkills,
|
|
1107
|
+
restoreVisibleSkills: scopedState?.restoreVisibleSkills ?? savedTools.restoreVisibleSkills,
|
|
1108
|
+
};
|
|
1109
|
+
debugLog("discuss-tool-scoping", {
|
|
1110
|
+
unitType,
|
|
1111
|
+
before: currentTools.length,
|
|
1112
|
+
after: pi.getActiveTools().length,
|
|
1113
|
+
removed: currentTools.length - pi.getActiveTools().length,
|
|
1114
|
+
});
|
|
1115
|
+
} else {
|
|
1116
|
+
savedTools = scopeGsdWorkflowToolsForDispatch(pi, unitType) ?? savedTools;
|
|
1117
|
+
}
|
|
1046
1118
|
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
customType,
|
|
1050
|
-
content: `Read the following GSD workflow protocol and execute exactly.\n\n${workflow}\n\n## Your Task\n\n${note}`,
|
|
1051
|
-
display: false,
|
|
1052
|
-
},
|
|
1053
|
-
{ triggerTurn: true },
|
|
1054
|
-
);
|
|
1119
|
+
const workflowPath = process.env.GSD_WORKFLOW_PATH ?? join(gsdHome(), "agent", "GSD-WORKFLOW.md");
|
|
1120
|
+
const workflow = readFileSync(workflowPath, "utf-8");
|
|
1055
1121
|
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1122
|
+
pi.sendMessage(
|
|
1123
|
+
{
|
|
1124
|
+
customType,
|
|
1125
|
+
content: buildWorkflowDispatchContent({ workflow, workflowPath, task: note }),
|
|
1126
|
+
display: false,
|
|
1127
|
+
},
|
|
1128
|
+
{ triggerTurn: true },
|
|
1129
|
+
);
|
|
1130
|
+
} finally {
|
|
1131
|
+
// Restore full tool set after the message is queued. The LLM turn has
|
|
1132
|
+
// already captured the scoped set — restoring prevents the narrowed
|
|
1133
|
+
// tools from leaking into subsequent dispatches (#3628). The finally
|
|
1134
|
+
// block ensures restoration even if sendMessage throws.
|
|
1135
|
+
restoreGsdWorkflowTools(pi, savedTools);
|
|
1061
1136
|
}
|
|
1062
1137
|
}
|
|
1063
1138
|
|
|
1139
|
+
export const _dispatchWorkflowForTest = dispatchWorkflow;
|
|
1140
|
+
|
|
1064
1141
|
function getStructuredQuestionsAvailability(
|
|
1065
1142
|
pi: ExtensionAPI,
|
|
1066
1143
|
ctx: ExtensionContext | undefined,
|
|
@@ -1786,8 +1863,8 @@ function selfHealRuntimeRecords(basePath: string, ctx: ExtensionContext): { clea
|
|
|
1786
1863
|
cleared++;
|
|
1787
1864
|
continue;
|
|
1788
1865
|
}
|
|
1789
|
-
// Clear records stuck in
|
|
1790
|
-
if (phase
|
|
1866
|
+
// Clear records stuck in an in-flight phase (process died mid-unit).
|
|
1867
|
+
if (isInFlightRuntimePhase(phase)) {
|
|
1791
1868
|
clearUnitRuntimeRecord(basePath, unitType, unitId);
|
|
1792
1869
|
cleared++;
|
|
1793
1870
|
}
|
|
@@ -1961,7 +2038,7 @@ export async function showSmartEntry(
|
|
|
1961
2038
|
// No .gsd/ or zombie .gsd/ — run the project init wizard
|
|
1962
2039
|
const result = await showProjectInit(ctx, pi, basePath, detection);
|
|
1963
2040
|
if (!result.completed) return; // User cancelled
|
|
1964
|
-
skipGitBootstrap = result
|
|
2041
|
+
skipGitBootstrap = shouldSkipGitBootstrapAfterInit(result);
|
|
1965
2042
|
|
|
1966
2043
|
// Init wizard bootstrapped .gsd/ — fall through to the normal flow below
|
|
1967
2044
|
// which will detect "no milestones" and start the discuss prompt
|
|
@@ -2042,6 +2119,23 @@ export async function showSmartEntry(
|
|
|
2042
2119
|
}
|
|
2043
2120
|
}
|
|
2044
2121
|
|
|
2122
|
+
if (interrupted.classification !== "recoverable") {
|
|
2123
|
+
try {
|
|
2124
|
+
const { autoImportMarkdownHierarchyIfDbMismatch } = await import("./migration-auto-check.js");
|
|
2125
|
+
const result = await autoImportMarkdownHierarchyIfDbMismatch(basePath);
|
|
2126
|
+
if (result.action === "imported") {
|
|
2127
|
+
ctx.ui.notify(
|
|
2128
|
+
`Recovered migrated planning state into gsd.db (${result.reason}): ${result.afterDb.milestones} milestone(s), ${result.afterDb.slices} slice(s), ${result.afterDb.tasks} task(s).`,
|
|
2129
|
+
"info",
|
|
2130
|
+
);
|
|
2131
|
+
}
|
|
2132
|
+
} catch (err) {
|
|
2133
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2134
|
+
ctx.ui.notify(`GSD could not auto-import existing planning state into gsd.db: ${message}`, "warning");
|
|
2135
|
+
logWarning("guided", `planning state auto-import failed: ${message}`, { file: "guided-flow.ts" });
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2045
2139
|
// Always derive from the project root — the assessment may have derived
|
|
2046
2140
|
// state from a worktree path that was cleaned up in the stale branch above.
|
|
2047
2141
|
const state = await deriveState(basePath);
|
|
@@ -2064,8 +2158,8 @@ export async function showSmartEntry(
|
|
|
2064
2158
|
// standard wizard below.
|
|
2065
2159
|
{
|
|
2066
2160
|
const prefs = loadEffectiveGSDPreferences(basePath)?.preferences;
|
|
2067
|
-
const {
|
|
2068
|
-
if (
|
|
2161
|
+
const { shouldRunDeepProjectSetup } = await import("./auto-dispatch.js");
|
|
2162
|
+
if (shouldRunDeepProjectSetup(state, prefs, basePath)) {
|
|
2069
2163
|
await startDeepProjectSetupForeground(ctx, pi, basePath, stepMode);
|
|
2070
2164
|
return;
|
|
2071
2165
|
}
|
|
@@ -2134,17 +2228,24 @@ export async function showSmartEntry(
|
|
|
2134
2228
|
title: "GSD — Get Shit Done",
|
|
2135
2229
|
summary: ["No active milestone."],
|
|
2136
2230
|
actions: [
|
|
2231
|
+
{
|
|
2232
|
+
id: "quick_task",
|
|
2233
|
+
label: "Quick task",
|
|
2234
|
+
description: "For small bounded work, run /gsd quick <task> or /gsd do <task>.",
|
|
2235
|
+
recommended: true,
|
|
2236
|
+
},
|
|
2137
2237
|
{
|
|
2138
2238
|
id: "new_milestone",
|
|
2139
2239
|
label: "Create next milestone",
|
|
2140
|
-
description: "Define
|
|
2141
|
-
recommended: true,
|
|
2240
|
+
description: "Define a larger body of work with planning artifacts.",
|
|
2142
2241
|
},
|
|
2143
2242
|
],
|
|
2144
2243
|
notYetMessage: "Run /gsd when ready.",
|
|
2145
2244
|
});
|
|
2146
2245
|
|
|
2147
|
-
if (choice === "
|
|
2246
|
+
if (choice === "quick_task") {
|
|
2247
|
+
await runQuickTaskChoice(ctx, pi);
|
|
2248
|
+
} else if (choice === "new_milestone") {
|
|
2148
2249
|
setPendingAutoStart(basePath, { ctx, pi, basePath, milestoneId: nextId, step: stepMode });
|
|
2149
2250
|
await dispatchWorkflow(pi, await prepareAndBuildDiscussPrompt(ctx, pi, nextId,
|
|
2150
2251
|
`New milestone ${nextId}.`,
|
|
@@ -2181,11 +2282,16 @@ export async function showSmartEntry(
|
|
|
2181
2282
|
title: `GSD — ${milestoneId}: ${milestoneTitle}`,
|
|
2182
2283
|
summary: ["All milestones complete."],
|
|
2183
2284
|
actions: [
|
|
2285
|
+
{
|
|
2286
|
+
id: "quick_task",
|
|
2287
|
+
label: "Quick task",
|
|
2288
|
+
description: "Do a small bounded task without opening a milestone.",
|
|
2289
|
+
recommended: true,
|
|
2290
|
+
},
|
|
2184
2291
|
{
|
|
2185
2292
|
id: "new_milestone",
|
|
2186
2293
|
label: "Start new milestone",
|
|
2187
2294
|
description: "Define and plan the next milestone.",
|
|
2188
|
-
recommended: true,
|
|
2189
2295
|
},
|
|
2190
2296
|
{
|
|
2191
2297
|
id: "status",
|
|
@@ -2196,7 +2302,9 @@ export async function showSmartEntry(
|
|
|
2196
2302
|
notYetMessage: "Run /gsd when ready.",
|
|
2197
2303
|
});
|
|
2198
2304
|
|
|
2199
|
-
if (choice === "
|
|
2305
|
+
if (choice === "quick_task") {
|
|
2306
|
+
await runQuickTaskChoice(ctx, pi);
|
|
2307
|
+
} else if (choice === "new_milestone") {
|
|
2200
2308
|
const milestoneIds = findMilestoneIds(basePath);
|
|
2201
2309
|
const uniqueMilestoneIds = !!loadEffectiveGSDPreferences()?.preferences?.unique_milestone_ids;
|
|
2202
2310
|
const nextId = nextMilestoneIdReserved(milestoneIds, uniqueMilestoneIds, basePath);
|
|
@@ -2289,8 +2397,7 @@ export async function showSmartEntry(
|
|
|
2289
2397
|
if (hasRoadmap) {
|
|
2290
2398
|
const roadmapContent = await loadFile(roadmapFile!);
|
|
2291
2399
|
if (roadmapContent) {
|
|
2292
|
-
|
|
2293
|
-
roadmapHasSlices = parsed.length > 0;
|
|
2400
|
+
roadmapHasSlices = _roadmapHasParseableSlicesForTest(roadmapContent);
|
|
2294
2401
|
}
|
|
2295
2402
|
}
|
|
2296
2403
|
|
|
@@ -2300,13 +2407,18 @@ export async function showSmartEntry(
|
|
|
2300
2407
|
const hasContext = !!(contextFile && await loadFile(contextFile));
|
|
2301
2408
|
|
|
2302
2409
|
const actions = [
|
|
2410
|
+
{
|
|
2411
|
+
id: "quick_task",
|
|
2412
|
+
label: "Quick task instead",
|
|
2413
|
+
description: "Use this when the work is small and should not become a milestone.",
|
|
2414
|
+
recommended: true,
|
|
2415
|
+
},
|
|
2303
2416
|
{
|
|
2304
2417
|
id: "plan",
|
|
2305
2418
|
label: "Create roadmap",
|
|
2306
2419
|
description: hasContext
|
|
2307
2420
|
? "Context captured. Decompose into slices with a boundary map."
|
|
2308
2421
|
: "Decompose the milestone into slices with a boundary map.",
|
|
2309
|
-
recommended: true,
|
|
2310
2422
|
},
|
|
2311
2423
|
...(!hasContext ? [{
|
|
2312
2424
|
id: "discuss",
|
|
@@ -2332,7 +2444,9 @@ export async function showSmartEntry(
|
|
|
2332
2444
|
notYetMessage: "Run /gsd when ready.",
|
|
2333
2445
|
});
|
|
2334
2446
|
|
|
2335
|
-
if (choice === "
|
|
2447
|
+
if (choice === "quick_task") {
|
|
2448
|
+
await runQuickTaskChoice(ctx, pi);
|
|
2449
|
+
} else if (choice === "plan") {
|
|
2336
2450
|
setPendingAutoStart(basePath, { ctx, pi, basePath, milestoneId, step: stepMode });
|
|
2337
2451
|
await dispatchWorkflow(
|
|
2338
2452
|
pi,
|