@opengsd/gsd-pi 1.1.1-dev.616a1a1 → 1.1.1-dev.9bb7453
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/cli.js +3 -2
- package/dist/help-text.js +10 -6
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/browser-tools/engine/managed-gsd-browser.js +495 -0
- package/dist/resources/extensions/browser-tools/engine/selection.js +16 -0
- package/dist/resources/extensions/browser-tools/extension-manifest.json +2 -2
- package/dist/resources/extensions/browser-tools/index.js +57 -9
- package/dist/resources/extensions/browser-tools/package.json +5 -1
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +167 -16
- package/dist/resources/extensions/gsd/auto/orchestrator.js +0 -1
- package/dist/resources/extensions/gsd/auto/phases.js +4 -3
- package/dist/resources/extensions/gsd/auto-dashboard.js +92 -17
- package/dist/resources/extensions/gsd/auto-dispatch.js +44 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +134 -10
- package/dist/resources/extensions/gsd/auto-prompts.js +68 -22
- package/dist/resources/extensions/gsd/auto-recovery.js +4 -4
- package/dist/resources/extensions/gsd/auto-runtime-state.js +3 -0
- package/dist/resources/extensions/gsd/auto-start.js +94 -15
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +1 -1
- package/dist/resources/extensions/gsd/auto-unit-tool-scope.js +2 -1
- package/dist/resources/extensions/gsd/auto.js +31 -6
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +83 -4
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +43 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +39 -14
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +16 -10
- package/dist/resources/extensions/gsd/browser-evidence.js +29 -2
- package/dist/resources/extensions/gsd/commands/catalog.js +6 -1
- package/dist/resources/extensions/gsd/commands/handlers/core.js +6 -2
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +9 -5
- package/dist/resources/extensions/gsd/commands-handlers.js +76 -11
- package/dist/resources/extensions/gsd/commands-maintenance.js +172 -2
- package/dist/resources/extensions/gsd/commands-mcp-status.js +109 -60
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +3 -1
- package/dist/resources/extensions/gsd/commands-verdict.js +1 -1
- package/dist/resources/extensions/gsd/config-overlay.js +2 -1
- package/dist/resources/extensions/gsd/dashboard-overlay.js +21 -7
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +8 -0
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +2 -2
- package/dist/resources/extensions/gsd/error-classifier.js +2 -1
- package/dist/resources/extensions/gsd/escalation.js +4 -4
- package/dist/resources/extensions/gsd/exec-sandbox.js +2 -0
- package/dist/resources/extensions/gsd/forensics.js +74 -2
- package/dist/resources/extensions/gsd/gsd-db.js +42 -6
- package/dist/resources/extensions/gsd/guided-flow.js +30 -69
- package/dist/resources/extensions/gsd/mcp-filter.js +3 -0
- package/dist/resources/extensions/gsd/mcp-project-config.js +76 -84
- package/dist/resources/extensions/gsd/memory-store.js +4 -1
- package/dist/resources/extensions/gsd/migration-auto-check.js +2 -2
- package/dist/resources/extensions/gsd/post-unit-hooks.js +9 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +39 -0
- package/dist/resources/extensions/gsd/prompt-loader.js +7 -0
- package/dist/resources/extensions/gsd/prompts/forensics.md +61 -1
- package/dist/resources/extensions/gsd/prompts/gate-evaluate.md +3 -1
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +3 -1
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/reactive-execute.md +3 -1
- package/dist/resources/extensions/gsd/prompts/run-uat.md +48 -24
- package/dist/resources/extensions/gsd/prompts/system.md +3 -1
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +3 -3
- package/dist/resources/extensions/gsd/rule-registry.js +428 -52
- package/dist/resources/extensions/gsd/safety/destructive-guard.js +3 -0
- package/dist/resources/extensions/gsd/skill-activation.js +20 -3
- package/dist/resources/extensions/gsd/state-reconciliation/drift/artifact-db.js +4 -2
- package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +1 -1
- package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +18 -1
- package/dist/resources/extensions/gsd/state-reconciliation/index.js +6 -0
- package/dist/resources/extensions/gsd/state.js +17 -14
- package/dist/resources/extensions/gsd/templates/plan.md +3 -1
- package/dist/resources/extensions/gsd/tool-presentation-plan.js +120 -0
- package/dist/resources/extensions/gsd/tools/complete-slice.js +15 -1
- package/dist/resources/extensions/gsd/tools/complete-task.js +11 -1
- package/dist/resources/extensions/gsd/tools/exec-tool.js +109 -0
- package/dist/resources/extensions/gsd/tools/plan-slice.js +14 -9
- package/dist/resources/extensions/gsd/tools/reopen-milestone.js +2 -2
- package/dist/resources/extensions/gsd/tools/validate-milestone.js +46 -16
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +403 -3
- package/dist/resources/extensions/gsd/unit-context-manifest.js +8 -3
- package/dist/resources/extensions/gsd/validation-block-guard.js +2 -0
- package/dist/resources/extensions/gsd/verdict-parser.js +59 -15
- package/dist/resources/extensions/gsd/verification-gate.js +72 -1
- package/dist/resources/extensions/gsd/workflow-mcp-auto-prep.js +3 -1
- package/dist/resources/extensions/gsd/workflow-mcp.js +5 -1
- package/dist/resources/extensions/gsd/worktree-lifecycle.js +24 -0
- package/dist/resources/extensions/mcp-client/manager.js +31 -1
- package/dist/resources/extensions/shared/gsd-browser-cli.js +145 -0
- package/dist/rtk.d.ts +7 -1
- package/dist/rtk.js +27 -11
- package/dist/update-check.d.ts +15 -1
- package/dist/update-check.js +87 -12
- package/dist/update-cmd.d.ts +1 -0
- package/dist/update-cmd.js +53 -2
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +6 -6
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- 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.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/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +6 -6
- package/dist/web/standalone/.next/server/chunks/8357.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- 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/package.json +5 -3
- package/packages/cloud-mcp-gateway/package.json +2 -2
- package/packages/contracts/dist/workflow.d.ts +14 -0
- package/packages/contracts/dist/workflow.d.ts.map +1 -1
- package/packages/contracts/dist/workflow.js +16 -0
- package/packages/contracts/dist/workflow.js.map +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/daemon/package.json +4 -4
- package/packages/gsd-agent-core/dist/agent-session.d.ts +9 -0
- package/packages/gsd-agent-core/dist/agent-session.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/agent-session.js +32 -0
- package/packages/gsd-agent-core/dist/agent-session.js.map +1 -1
- package/packages/gsd-agent-core/dist/index.d.ts +1 -0
- package/packages/gsd-agent-core/dist/index.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/index.js +1 -0
- package/packages/gsd-agent-core/dist/index.js.map +1 -1
- package/packages/gsd-agent-core/dist/session/agent-session-compaction.d.ts +2 -0
- package/packages/gsd-agent-core/dist/session/agent-session-compaction.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/session/agent-session-compaction.js +8 -2
- package/packages/gsd-agent-core/dist/session/agent-session-compaction.js.map +1 -1
- package/packages/gsd-agent-core/dist/session/agent-session-host.d.ts +7 -0
- package/packages/gsd-agent-core/dist/session/agent-session-host.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/session/agent-session-host.js.map +1 -1
- package/packages/gsd-agent-core/dist/session/agent-session-prompt.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/session/agent-session-prompt.js +69 -1
- package/packages/gsd-agent-core/dist/session/agent-session-prompt.js.map +1 -1
- package/packages/gsd-agent-core/dist/turn-latency.d.ts +47 -0
- package/packages/gsd-agent-core/dist/turn-latency.d.ts.map +1 -0
- package/packages/gsd-agent-core/dist/turn-latency.js +123 -0
- package/packages/gsd-agent-core/dist/turn-latency.js.map +1 -0
- package/packages/gsd-agent-core/package.json +6 -6
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/gsd-widget-prototype.d.ts +21 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/gsd-widget-prototype.d.ts.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/gsd-widget-prototype.js +213 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/__prototype__/gsd-widget-prototype.js.map +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js +10 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +92 -31
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js +7 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-command-handlers.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-command-handlers.js +6 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-command-handlers.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-dialogs.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-dialogs.js +2 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-class-constants.d.ts +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-class-constants.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-class-constants.js +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-class-constants.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-settings.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-settings.js +5 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-settings.js.map +1 -1
- package/packages/gsd-agent-modes/package.json +7 -7
- package/packages/mcp-server/dist/remote-questions.d.ts.map +1 -1
- package/packages/mcp-server/dist/remote-questions.js +23 -9
- package/packages/mcp-server/dist/remote-questions.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +84 -2
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +3 -3
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +38 -0
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/agent.d.ts +5 -1
- 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/types.d.ts +3 -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/package.json +1 -1
- package/packages/pi-ai/dist/api-registry.d.ts +2 -0
- package/packages/pi-ai/dist/api-registry.d.ts.map +1 -1
- package/packages/pi-ai/dist/api-registry.js +23 -0
- package/packages/pi-ai/dist/api-registry.js.map +1 -1
- package/packages/pi-ai/dist/image-models.generated.d.ts +15 -0
- package/packages/pi-ai/dist/image-models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/image-models.generated.js +15 -0
- package/packages/pi-ai/dist/image-models.generated.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +406 -17
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +484 -116
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/stream.js +6 -6
- package/packages/pi-ai/dist/stream.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +2 -2
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +3 -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 +11 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/package.json +7 -7
- package/packages/pi-tui/dist/terminal.d.ts +1 -0
- package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
- package/packages/pi-tui/dist/terminal.js +8 -4
- package/packages/pi-tui/dist/terminal.js.map +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/rpc-client/package.json +2 -2
- package/pkg/package.json +1 -1
- package/src/resources/extensions/browser-tools/engine/managed-gsd-browser.ts +579 -0
- package/src/resources/extensions/browser-tools/engine/selection.ts +19 -0
- package/src/resources/extensions/browser-tools/extension-manifest.json +2 -2
- package/src/resources/extensions/browser-tools/index.ts +60 -9
- package/src/resources/extensions/browser-tools/package.json +5 -1
- package/src/resources/extensions/browser-tools/tests/browser-engine-selection.test.mjs +35 -0
- package/src/resources/extensions/browser-tools/tests/managed-gsd-browser-tools.test.mjs +33 -0
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +196 -16
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +239 -63
- package/src/resources/extensions/gsd/auto/orchestrator.ts +0 -1
- package/src/resources/extensions/gsd/auto/phases.ts +5 -3
- package/src/resources/extensions/gsd/auto-dashboard.ts +98 -18
- package/src/resources/extensions/gsd/auto-dispatch.ts +53 -0
- package/src/resources/extensions/gsd/auto-post-unit.ts +166 -9
- package/src/resources/extensions/gsd/auto-prompts.ts +102 -15
- package/src/resources/extensions/gsd/auto-recovery.ts +4 -4
- package/src/resources/extensions/gsd/auto-runtime-state.ts +4 -0
- package/src/resources/extensions/gsd/auto-start.ts +112 -17
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +1 -1
- package/src/resources/extensions/gsd/auto-unit-tool-scope.ts +2 -1
- package/src/resources/extensions/gsd/auto.ts +47 -5
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +90 -4
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +51 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +60 -19
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +21 -10
- package/src/resources/extensions/gsd/browser-evidence.ts +26 -2
- package/src/resources/extensions/gsd/commands/catalog.ts +6 -1
- package/src/resources/extensions/gsd/commands/handlers/core.ts +6 -2
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +9 -5
- package/src/resources/extensions/gsd/commands-handlers.ts +76 -11
- package/src/resources/extensions/gsd/commands-maintenance.ts +197 -2
- package/src/resources/extensions/gsd/commands-mcp-status.ts +136 -58
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +4 -1
- package/src/resources/extensions/gsd/commands-verdict.ts +1 -1
- package/src/resources/extensions/gsd/config-overlay.ts +3 -1
- package/src/resources/extensions/gsd/dashboard-overlay.ts +28 -7
- package/src/resources/extensions/gsd/docs/preferences-reference.md +8 -0
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +2 -2
- package/src/resources/extensions/gsd/error-classifier.ts +2 -1
- package/src/resources/extensions/gsd/escalation.ts +4 -4
- package/src/resources/extensions/gsd/exec-sandbox.ts +4 -0
- package/src/resources/extensions/gsd/forensics.ts +99 -5
- package/src/resources/extensions/gsd/gsd-db.ts +46 -8
- package/src/resources/extensions/gsd/guided-flow.ts +91 -83
- package/src/resources/extensions/gsd/mcp-filter.ts +3 -0
- package/src/resources/extensions/gsd/mcp-project-config.ts +105 -88
- package/src/resources/extensions/gsd/memory-store.ts +4 -1
- package/src/resources/extensions/gsd/migration-auto-check.ts +2 -2
- package/src/resources/extensions/gsd/post-unit-hooks.ts +14 -1
- package/src/resources/extensions/gsd/preferences-types.ts +1 -1
- package/src/resources/extensions/gsd/preferences-validation.ts +36 -0
- package/src/resources/extensions/gsd/prompt-loader.ts +8 -0
- package/src/resources/extensions/gsd/prompts/forensics.md +61 -1
- package/src/resources/extensions/gsd/prompts/gate-evaluate.md +3 -1
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +3 -1
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/reactive-execute.md +3 -1
- package/src/resources/extensions/gsd/prompts/run-uat.md +48 -24
- package/src/resources/extensions/gsd/prompts/system.md +3 -1
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +3 -3
- package/src/resources/extensions/gsd/rule-registry.ts +558 -58
- package/src/resources/extensions/gsd/rule-types.ts +2 -0
- package/src/resources/extensions/gsd/safety/destructive-guard.ts +3 -0
- package/src/resources/extensions/gsd/skill-activation.ts +20 -2
- package/src/resources/extensions/gsd/state-reconciliation/drift/artifact-db.ts +4 -2
- package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +1 -1
- package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +20 -0
- package/src/resources/extensions/gsd/state-reconciliation/index.ts +6 -0
- package/src/resources/extensions/gsd/state-reconciliation/types.ts +1 -0
- package/src/resources/extensions/gsd/state.ts +18 -14
- package/src/resources/extensions/gsd/templates/plan.md +3 -1
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +156 -4
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +123 -0
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +143 -2
- package/src/resources/extensions/gsd/tests/auto-start-project-milestone-reconcile.test.ts +24 -2
- package/src/resources/extensions/gsd/tests/browser-evidence.test.ts +142 -0
- package/src/resources/extensions/gsd/tests/commands-dispatcher-validation-block.test.ts +38 -3
- package/src/resources/extensions/gsd/tests/commands-verdict.test.ts +6 -2
- package/src/resources/extensions/gsd/tests/complete-milestone-excerpt.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/complete-slice-verification-gate.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/dashboard-overlay.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/deep-planning-mode-dispatch.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +50 -13
- package/src/resources/extensions/gsd/tests/discuss-milestone-structured-questions.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/dispatch-missing-task-plans.test.ts +60 -0
- package/src/resources/extensions/gsd/tests/doctor-runtime-checks.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/escalation.test.ts +16 -27
- package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/exec-tool.test.ts +69 -0
- package/src/resources/extensions/gsd/tests/forensics-issue-routing.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/forensics-prompt-rendering.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/forensics-tool-scope.test.ts +69 -0
- package/src/resources/extensions/gsd/tests/gsd-rebuild.test.ts +199 -0
- package/src/resources/extensions/gsd/tests/gsd-recover.test.ts +75 -0
- package/src/resources/extensions/gsd/tests/guided-discuss-milestone-prompt-rendering.test.ts +40 -1
- package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +86 -0
- package/src/resources/extensions/gsd/tests/guided-flow.test.ts +12 -9
- package/src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/integration/run-uat.test.ts +66 -10
- package/src/resources/extensions/gsd/tests/integration/state-machine-live-validation.test.ts +13 -6
- package/src/resources/extensions/gsd/tests/mcp-filter.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/mcp-project-config.test.ts +100 -0
- package/src/resources/extensions/gsd/tests/mcp-status.test.ts +179 -0
- package/src/resources/extensions/gsd/tests/memory-maintenance.test.ts +39 -8
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/new-milestone-discuss-routing.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +54 -7
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +39 -1
- package/src/resources/extensions/gsd/tests/post-unit-hooks.test.ts +157 -0
- package/src/resources/extensions/gsd/tests/post-unit-retry-on-orchestrator-bridge.test.ts +179 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +53 -1
- package/src/resources/extensions/gsd/tests/prompt-loader-extension-dir.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +18 -1
- package/src/resources/extensions/gsd/tests/queued-discuss-fast-path.test.ts +7 -8
- package/src/resources/extensions/gsd/tests/reactive-executor.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/rule-registry.test.ts +75 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +100 -0
- package/src/resources/extensions/gsd/tests/skill-activation.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +6 -2
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +191 -0
- package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +84 -10
- package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/tool-naming.test.ts +12 -2
- package/src/resources/extensions/gsd/tests/tool-param-optionality.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/tui-header-lifecycle.test.ts +29 -6
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +29 -6
- package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts +6 -3
- package/src/resources/extensions/gsd/tests/validate-milestone-write-order.test.ts +133 -0
- package/src/resources/extensions/gsd/tests/validation-block-guard.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp-auto-prep.test.ts +17 -2
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +213 -0
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +25 -0
- package/src/resources/extensions/gsd/tool-presentation-plan.ts +167 -0
- package/src/resources/extensions/gsd/tools/complete-slice.ts +14 -1
- package/src/resources/extensions/gsd/tools/complete-task.ts +20 -2
- package/src/resources/extensions/gsd/tools/exec-tool.ts +130 -0
- package/src/resources/extensions/gsd/tools/plan-slice.ts +14 -9
- package/src/resources/extensions/gsd/tools/reopen-milestone.ts +2 -2
- package/src/resources/extensions/gsd/tools/validate-milestone.ts +46 -15
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +489 -3
- package/src/resources/extensions/gsd/types.ts +69 -5
- package/src/resources/extensions/gsd/unit-context-manifest.ts +14 -5
- package/src/resources/extensions/gsd/validation-block-guard.ts +2 -0
- package/src/resources/extensions/gsd/verdict-parser.ts +54 -13
- package/src/resources/extensions/gsd/verification-gate.ts +87 -1
- package/src/resources/extensions/gsd/workflow-mcp-auto-prep.ts +2 -1
- package/src/resources/extensions/gsd/workflow-mcp.ts +5 -1
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +26 -0
- package/src/resources/extensions/mcp-client/manager.ts +33 -1
- package/src/resources/extensions/mcp-client/tests/manager.test.ts +35 -0
- package/src/resources/extensions/shared/gsd-browser-cli.ts +172 -0
- /package/dist/web/standalone/.next/static/{L9N5SPFi7f-Ne4u2uXzCe → jBtwT9v1u2lUA3UEOy_ZH}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{L9N5SPFi7f-Ne4u2uXzCe → jBtwT9v1u2lUA3UEOy_ZH}/_ssgManifest.js +0 -0
|
@@ -166,6 +166,6 @@ export async function handleVerdict(rawArgs, ctx, basePath) {
|
|
|
166
166
|
ctx.ui.notify(`Milestone ${milestoneId} verdict: ${prevVerdict} -> ${effectiveVerdict} (${existingValidation.source})`, "success");
|
|
167
167
|
}
|
|
168
168
|
if (effectiveVerdict === "needs-remediation") {
|
|
169
|
-
ctx.ui.notify("Follow up with
|
|
169
|
+
ctx.ui.notify("Follow up with /gsd dispatch reassess to add remediation slices, then re-run /gsd auto.", "info");
|
|
170
170
|
}
|
|
171
171
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { matchesKey, Key, truncateToWidth } from "@gsd/pi-tui";
|
|
10
10
|
import { renderDialogFrame, renderKeyHints } from "./tui/render-kit.js";
|
|
11
11
|
import { loadEffectiveGSDPreferences, loadGlobalGSDPreferences, loadProjectGSDPreferences, getGlobalGSDPreferencesPath, getProjectGSDPreferencesPath, resolveDynamicRoutingConfig, resolveEffectiveProfile, resolveModelWithFallbacksForUnit, resolveAutoSupervisorConfig, } from "./preferences.js";
|
|
12
|
+
const DEFAULT_WIDGET_MODE = "small";
|
|
12
13
|
function collectConfigSections() {
|
|
13
14
|
const sections = [];
|
|
14
15
|
const globalPrefs = loadGlobalGSDPreferences();
|
|
@@ -157,7 +158,7 @@ function collectConfigSections() {
|
|
|
157
158
|
toggleRows.push({ label: "search_provider", value: prefs.search_provider });
|
|
158
159
|
if (prefs?.context_selection)
|
|
159
160
|
toggleRows.push({ label: "context_selection", value: prefs.context_selection });
|
|
160
|
-
if (prefs?.widget_mode && prefs.widget_mode !==
|
|
161
|
+
if (prefs?.widget_mode && prefs.widget_mode !== DEFAULT_WIDGET_MODE)
|
|
161
162
|
toggleRows.push({ label: "widget_mode", value: prefs.widget_mode });
|
|
162
163
|
if (prefs?.experimental?.rtk)
|
|
163
164
|
toggleRows.push({ label: "experimental.rtk", value: "on" });
|
|
@@ -62,6 +62,8 @@ export class GSDDashboardOverlay {
|
|
|
62
62
|
refreshInFlight = null;
|
|
63
63
|
disposed = false;
|
|
64
64
|
resizeHandler = null;
|
|
65
|
+
cachedMetrics = null;
|
|
66
|
+
lastSeenUnitCount = -1;
|
|
65
67
|
constructor(tui, theme, onClose) {
|
|
66
68
|
this.tui = tui;
|
|
67
69
|
this.theme = theme;
|
|
@@ -105,7 +107,8 @@ export class GSDDashboardOverlay {
|
|
|
105
107
|
return;
|
|
106
108
|
this.dashData = getAutoDashboardData();
|
|
107
109
|
const nextIdentity = this.computeDashboardIdentity(this.dashData);
|
|
108
|
-
|
|
110
|
+
const identityChanged = initial || nextIdentity !== this.loadedDashboardIdentity;
|
|
111
|
+
if (identityChanged) {
|
|
109
112
|
const loaded = await this.loadData();
|
|
110
113
|
if (this.disposed)
|
|
111
114
|
return;
|
|
@@ -116,7 +119,9 @@ export class GSDDashboardOverlay {
|
|
|
116
119
|
if (initial) {
|
|
117
120
|
this.loading = false;
|
|
118
121
|
}
|
|
119
|
-
|
|
122
|
+
if (identityChanged) {
|
|
123
|
+
this.invalidate();
|
|
124
|
+
}
|
|
120
125
|
this.tui.requestRender();
|
|
121
126
|
}
|
|
122
127
|
async loadData() {
|
|
@@ -392,7 +397,7 @@ export class GSDDashboardOverlay {
|
|
|
392
397
|
}
|
|
393
398
|
const ledger = getLedger();
|
|
394
399
|
if (ledger && ledger.units.length > 0) {
|
|
395
|
-
const totals =
|
|
400
|
+
const { totals, promptStats, phases, slices, models } = this.ensureMetricsCache(ledger.units);
|
|
396
401
|
lines.push(blank());
|
|
397
402
|
lines.push(hr());
|
|
398
403
|
lines.push(row(th.fg("text", th.bold("Cost & Usage"))));
|
|
@@ -424,7 +429,6 @@ export class GSDDashboardOverlay {
|
|
|
424
429
|
}
|
|
425
430
|
lines.push(row(budgetParts.join(` ${th.fg("dim", "·")} `)));
|
|
426
431
|
}
|
|
427
|
-
const promptStats = getPromptSizeStats(ledger.units);
|
|
428
432
|
if (promptStats) {
|
|
429
433
|
const promptParts = [
|
|
430
434
|
`${th.fg("dim", "avg prompt:")} ${th.fg("text", formatCharCount(promptStats.averagePromptChars))}`,
|
|
@@ -435,7 +439,6 @@ export class GSDDashboardOverlay {
|
|
|
435
439
|
}
|
|
436
440
|
lines.push(row(promptParts.join(` ${th.fg("dim", "·")} `)));
|
|
437
441
|
}
|
|
438
|
-
const phases = aggregateByPhase(ledger.units);
|
|
439
442
|
if (phases.length > 0) {
|
|
440
443
|
lines.push(blank());
|
|
441
444
|
lines.push(row(th.fg("dim", "By Phase")));
|
|
@@ -446,7 +449,6 @@ export class GSDDashboardOverlay {
|
|
|
446
449
|
lines.push(row(joinColumns(left, right, contentWidth)));
|
|
447
450
|
}
|
|
448
451
|
}
|
|
449
|
-
const slices = aggregateBySlice(ledger.units);
|
|
450
452
|
if (slices.length > 0) {
|
|
451
453
|
lines.push(blank());
|
|
452
454
|
lines.push(row(th.fg("dim", "By Slice")));
|
|
@@ -475,7 +477,6 @@ export class GSDDashboardOverlay {
|
|
|
475
477
|
}
|
|
476
478
|
}
|
|
477
479
|
}
|
|
478
|
-
const models = aggregateByModel(ledger.units);
|
|
479
480
|
if (models.length >= 1) {
|
|
480
481
|
lines.push(blank());
|
|
481
482
|
lines.push(row(th.fg("dim", "By Model")));
|
|
@@ -534,6 +535,19 @@ export class GSDDashboardOverlay {
|
|
|
534
535
|
const bar = th.fg(color, "█".repeat(filled)) + th.fg("dim", "░".repeat(Math.max(0, barWidth - filled)));
|
|
535
536
|
return `${th.fg("dim", labelText)}${" ".repeat(gap)}${bar}${" ".repeat(gap)}${th.fg("dim", rightText)}`;
|
|
536
537
|
}
|
|
538
|
+
ensureMetricsCache(units) {
|
|
539
|
+
if (!this.cachedMetrics || units.length !== this.lastSeenUnitCount) {
|
|
540
|
+
this.cachedMetrics = {
|
|
541
|
+
totals: getProjectTotals(units),
|
|
542
|
+
promptStats: getPromptSizeStats(units),
|
|
543
|
+
phases: aggregateByPhase(units),
|
|
544
|
+
slices: aggregateBySlice(units),
|
|
545
|
+
models: aggregateByModel(units),
|
|
546
|
+
};
|
|
547
|
+
this.lastSeenUnitCount = units.length;
|
|
548
|
+
}
|
|
549
|
+
return this.cachedMetrics;
|
|
550
|
+
}
|
|
537
551
|
invalidate() {
|
|
538
552
|
this.cachedWidth = undefined;
|
|
539
553
|
this.cachedLines = undefined;
|
|
@@ -305,10 +305,18 @@ This config sets a parent workspace with two child repositories. The implicit `p
|
|
|
305
305
|
- `max_cycles`: number — max times this hook fires per trigger (default: 1, max: 10).
|
|
306
306
|
- `model`: string — optional model override.
|
|
307
307
|
- `artifact`: string — expected output file name (relative to task/slice dir). Hook is skipped if file already exists (idempotent).
|
|
308
|
+
- `criticality`: `"advisory"` or `"blocking"` — advisory preserves current best-effort behavior; blocking requires clean hook completion plus a valid outcome verdict before auto-mode advances. Default: `"advisory"`.
|
|
308
309
|
- `retry_on`: string — if this file is produced instead of the artifact, re-run the trigger unit then re-run hooks.
|
|
310
|
+
- `on_block`: object — optional routing for blocking findings:
|
|
311
|
+
- `action`: `"retry-unit"`, `"retry-task"`, `"queue-task"`, `"queue-slice"`, or `"pause"`.
|
|
312
|
+
- `artifact`: string — optional compatibility artifact for retry routing.
|
|
309
313
|
- `agent`: string — agent definition file to use for hook execution.
|
|
310
314
|
- `enabled`: boolean — toggle without removing (default: `true`).
|
|
311
315
|
|
|
316
|
+
Blocking hook artifacts must begin with YAML frontmatter containing either `verdict` or `outcome.verdict`.
|
|
317
|
+
Supported verdicts are `pass`, `advisory`, `needs-rework`, `needs-remediation`, and `needs-attention`.
|
|
318
|
+
`pass` and `advisory` continue; `needs-rework` retries the trigger unit when routed with `retry-unit`/`retry-task`; `needs-remediation` and `needs-attention` pause with recovery guidance.
|
|
319
|
+
|
|
312
320
|
- `pre_dispatch_hooks`: array — hooks that fire before a unit is dispatched. Each entry has:
|
|
313
321
|
- `name`: string — unique hook identifier.
|
|
314
322
|
- `before`: string[] — unit types to intercept.
|
|
@@ -258,14 +258,14 @@ export async function checkRuntimeHealth(basePath, issues, fixesApplied, shouldF
|
|
|
258
258
|
catch {
|
|
259
259
|
count = MAX_UAT_ATTEMPTS + 1;
|
|
260
260
|
}
|
|
261
|
-
if (count
|
|
261
|
+
if (count < MAX_UAT_ATTEMPTS)
|
|
262
262
|
continue;
|
|
263
263
|
issues.push({
|
|
264
264
|
severity: "warning",
|
|
265
265
|
code: "uat_retry_exhausted",
|
|
266
266
|
scope: "slice",
|
|
267
267
|
unitId: `${mid}/${sid}`,
|
|
268
|
-
message: `run-uat for ${mid}/${sid} exhausted ${count
|
|
268
|
+
message: `run-uat for ${mid}/${sid} exhausted ${count} attempt(s) without an ASSESSMENT verdict. Reset the retry counter after fixing the underlying UAT/tool issue, then rerun /gsd auto.`,
|
|
269
269
|
file: `.gsd/runtime/${fileName}`,
|
|
270
270
|
fixable: true,
|
|
271
271
|
});
|
|
@@ -21,9 +21,10 @@ export function resetRetryState(state) {
|
|
|
21
21
|
const PERMANENT_RE = /auth|unauthorized|forbidden|invalid.*key|invalid.*api|billing|quota exceeded|account/i;
|
|
22
22
|
// Include provider-specific quota-window phrasing like:
|
|
23
23
|
// - "You've hit your limit"
|
|
24
|
+
// - "You've reached your limit"
|
|
24
25
|
// - "usage limit" / "quota reached"
|
|
25
26
|
// - "out of extra usage"
|
|
26
|
-
const RATE_LIMIT_RE = /rate.?limit|too many requests|429|hit your limit|usage limit|out of extra usage|quota (?:reached|hit)|limit.*resets?/i;
|
|
27
|
+
const RATE_LIMIT_RE = /rate.?limit|too many requests|429|(?:hit|reached) your (?:\w+ )?limit|(?:usage|session|weekly|daily|monthly|quota) limit|out of extra usage|quota (?:reached|hit)|limit.*resets?/i;
|
|
27
28
|
// OpenRouter affordability-style quota errors should be treated as transient
|
|
28
29
|
// so core retry logic can lower maxTokens and continue in-session.
|
|
29
30
|
const AFFORDABILITY_RE = /requires more credits|can only afford|insufficient credits|not enough credits|fewer max_tokens/i;
|
|
@@ -140,13 +140,13 @@ export function readEscalationArtifact(path) {
|
|
|
140
140
|
}
|
|
141
141
|
// ─── Detection ────────────────────────────────────────────────────────────
|
|
142
142
|
/**
|
|
143
|
-
* Returns the task id of the first task with an
|
|
144
|
-
*
|
|
145
|
-
*
|
|
143
|
+
* Returns the task id of the first task with an unresolved escalation.
|
|
144
|
+
* `continueWithDefault=true` artifacts keep the awaiting_review flag for
|
|
145
|
+
* compatibility, but still pause dispatch until the user explicitly responds.
|
|
146
146
|
*/
|
|
147
147
|
export function detectPendingEscalation(tasks, basePath) {
|
|
148
148
|
for (const t of tasks) {
|
|
149
|
-
if (t.escalation_pending !== 1)
|
|
149
|
+
if (t.escalation_pending !== 1 && t.escalation_awaiting_review !== 1)
|
|
150
150
|
continue;
|
|
151
151
|
if (!t.escalation_artifact_path)
|
|
152
152
|
continue;
|
|
@@ -247,6 +247,7 @@ function writeMeta(path, result, request, now) {
|
|
|
247
247
|
id: result.id,
|
|
248
248
|
runtime: result.runtime,
|
|
249
249
|
purpose: request.purpose ?? null,
|
|
250
|
+
...(request.metadata ? { metadata: request.metadata } : {}),
|
|
250
251
|
script_chars: request.script.length,
|
|
251
252
|
started_at: now.toISOString(),
|
|
252
253
|
finished_at: new Date(now.getTime() + result.duration_ms).toISOString(),
|
|
@@ -260,6 +261,7 @@ function writeMeta(path, result, request, now) {
|
|
|
260
261
|
stderr_truncated: result.stderr_truncated,
|
|
261
262
|
stdout_path: result.stdout_path,
|
|
262
263
|
stderr_path: result.stderr_path,
|
|
264
|
+
...(request.metadata ? { metadata: request.metadata } : {}),
|
|
263
265
|
};
|
|
264
266
|
writeFileSync(path, `${JSON.stringify(meta, null, 2)}\n`);
|
|
265
267
|
}
|
|
@@ -32,6 +32,68 @@ import { isInteractiveCommandContext, notifyForensicsNeedsInteractiveMenu, } fro
|
|
|
32
32
|
import { ensurePreferencesFile, serializePreferencesToFrontmatter } from "./commands-prefs-wizard.js";
|
|
33
33
|
import { summarizeWorktreeTelemetry, percentile } from "./worktree-telemetry.js";
|
|
34
34
|
import { homedir } from "node:os";
|
|
35
|
+
// ─── Filing Tool Scope ───────────────────────────────────────────────────────
|
|
36
|
+
const FORENSICS_FILING_TOOLS = ["bash", "write"];
|
|
37
|
+
function uniqueAppend(base, additions) {
|
|
38
|
+
const seen = new Set(base);
|
|
39
|
+
const next = [...base];
|
|
40
|
+
for (const name of additions) {
|
|
41
|
+
if (seen.has(name))
|
|
42
|
+
continue;
|
|
43
|
+
seen.add(name);
|
|
44
|
+
next.push(name);
|
|
45
|
+
}
|
|
46
|
+
return next;
|
|
47
|
+
}
|
|
48
|
+
function sameOrderedTools(a, b) {
|
|
49
|
+
return a.length === b.length && a.every((name, index) => name === b[index]);
|
|
50
|
+
}
|
|
51
|
+
function getRegisteredToolNames(pi, fallback) {
|
|
52
|
+
if (typeof pi.getAllTools === "function") {
|
|
53
|
+
return pi.getAllTools().map((tool) => tool.name);
|
|
54
|
+
}
|
|
55
|
+
return [...fallback];
|
|
56
|
+
}
|
|
57
|
+
export function createForensicsToolScope(pi) {
|
|
58
|
+
const savedTools = [...pi.getActiveTools()];
|
|
59
|
+
const registeredTools = new Set([...getRegisteredToolNames(pi, savedTools), ...savedTools]);
|
|
60
|
+
const availableFilingTools = FORENSICS_FILING_TOOLS.filter((name) => registeredTools.has(name));
|
|
61
|
+
const missingFilingTools = FORENSICS_FILING_TOOLS.filter((name) => !registeredTools.has(name));
|
|
62
|
+
const activeToolsForTurn = uniqueAppend(savedTools, availableFilingTools);
|
|
63
|
+
return {
|
|
64
|
+
savedTools,
|
|
65
|
+
activeToolsForTurn,
|
|
66
|
+
availableFilingTools,
|
|
67
|
+
missingFilingTools,
|
|
68
|
+
toolsChanged: !sameOrderedTools(savedTools, activeToolsForTurn),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export function applyForensicsToolScope(pi, scope) {
|
|
72
|
+
if (scope.toolsChanged)
|
|
73
|
+
pi.setActiveTools(scope.activeToolsForTurn);
|
|
74
|
+
}
|
|
75
|
+
export function restoreForensicsToolScope(pi, scope) {
|
|
76
|
+
if (scope.toolsChanged)
|
|
77
|
+
pi.setActiveTools(scope.savedTools);
|
|
78
|
+
}
|
|
79
|
+
export function buildForensicsToolingSection(scope) {
|
|
80
|
+
const available = new Set(scope.availableFilingTools);
|
|
81
|
+
const requested = scope.availableFilingTools.length
|
|
82
|
+
? scope.availableFilingTools.map((name) => `\`${name}\``).join(", ")
|
|
83
|
+
: "none";
|
|
84
|
+
const statusFor = (name) => available.has(name)
|
|
85
|
+
? `- \`${name}\`: available for this queued forensics turn`
|
|
86
|
+
: `- \`${name}\`: unavailable in this host session`;
|
|
87
|
+
return `
|
|
88
|
+
## Filing Tool Availability
|
|
89
|
+
|
|
90
|
+
For this queued forensic turn, the extension requested the registered filing tools: ${requested}.
|
|
91
|
+
|
|
92
|
+
${FORENSICS_FILING_TOOLS.map(statusFor).join("\n")}
|
|
93
|
+
|
|
94
|
+
If \`bash\` is available, use the GitHub duplicate-check and issue-creation protocols below. If \`bash\` is unavailable, do not attempt duplicate-check or issue-creation tool calls with another tool; provide the paste-once shell script fallback instead.
|
|
95
|
+
`;
|
|
96
|
+
}
|
|
35
97
|
// ─── Duplicate Detection ──────────────────────────────────────────────────────
|
|
36
98
|
const DEDUP_PROMPT_SECTION = `
|
|
37
99
|
## Pre-Investigation: Duplicate Check (REQUIRED)
|
|
@@ -42,6 +104,8 @@ Before reading GSD source code or performing deep analysis, you MUST search for
|
|
|
42
104
|
|
|
43
105
|
Use keywords from the user's problem description and the anomaly summaries in the forensic report above.
|
|
44
106
|
|
|
107
|
+
If \`bash\` is unavailable in the Filing Tool Availability section, do not attempt live duplicate-search tool calls. Say the live duplicate search must be run by the user, continue the source investigation, and include the duplicate-search commands in the paste-once fallback when issue filing is accepted.
|
|
108
|
+
|
|
45
109
|
1. **Search closed issues** for similar keywords:
|
|
46
110
|
\`\`\`
|
|
47
111
|
gh issue list --repo open-gsd/gsd-pi --state closed --search "<keywords from root cause>" --limit 20
|
|
@@ -151,16 +215,24 @@ export async function handleForensics(args, ctx, pi) {
|
|
|
151
215
|
gsdSourceDir = fallback;
|
|
152
216
|
}
|
|
153
217
|
const forensicData = formatReportForPrompt(report);
|
|
218
|
+
const toolScope = createForensicsToolScope(pi);
|
|
154
219
|
const content = loadPrompt("forensics", {
|
|
155
220
|
problemDescription,
|
|
156
221
|
forensicData,
|
|
157
222
|
gsdSourceDir,
|
|
158
223
|
dedupSection,
|
|
224
|
+
toolingSection: buildForensicsToolingSection(toolScope),
|
|
159
225
|
});
|
|
160
226
|
ctx.ui.notify(`Forensic report saved: ${relative(basePath, savedPath)}`, "info");
|
|
161
227
|
ctx.ui.setStatus("gsd-forensics", "running");
|
|
162
|
-
|
|
163
|
-
|
|
228
|
+
try {
|
|
229
|
+
applyForensicsToolScope(pi, toolScope);
|
|
230
|
+
await pi.sendMessage({ customType: "gsd-forensics", content, display: false }, { triggerTurn: true });
|
|
231
|
+
}
|
|
232
|
+
finally {
|
|
233
|
+
restoreForensicsToolScope(pi, toolScope);
|
|
234
|
+
ctx.ui.setStatus("gsd-forensics", undefined);
|
|
235
|
+
}
|
|
164
236
|
// Persist forensics context so follow-up turns can re-inject it (#2941)
|
|
165
237
|
writeForensicsMarker(basePath, savedPath, content);
|
|
166
238
|
}
|
|
@@ -37,6 +37,7 @@ import { rowToActiveDecision, rowToActiveRequirement, rowToDecision, rowToRequir
|
|
|
37
37
|
import { rowToGate } from "./db-gate-rows.js";
|
|
38
38
|
import { rowToArtifact, rowToMilestone } from "./db-milestone-artifact-rows.js";
|
|
39
39
|
import { backupDatabaseBeforeMigration } from "./db-migration-backup.js";
|
|
40
|
+
import { isClosedStatus } from "./status-guards.js";
|
|
40
41
|
import { applyMigrationV2Artifacts, applyMigrationV3Memories, applyMigrationV4DecisionMadeBy, applyMigrationV5HierarchyTables, applyMigrationV6SliceSummaries, applyMigrationV7Dependencies, applyMigrationV8PlanningFields, applyMigrationV9Ordering, applyMigrationV10ReplanTrigger, applyMigrationV11TaskPlanning, applyMigrationV12QualityGates, applyMigrationV13HotPathIndexes, applyMigrationV14SliceDependencies, applyMigrationV15AuditTables, applyMigrationV16EscalationSource, applyMigrationV17TaskEscalation, applyMigrationV18MemorySources, applyMigrationV19MemoryFts, applyMigrationV20MemoryRelations, applyMigrationV21StructuredMemories, applyMigrationV22QualityGateRepair, applyMigrationV23MilestoneQueue, applyMigrationV26MilestoneCommitAttributions, applyMigrationV27ArtifactHash, applyMigrationV28MemoryLastHitAt, applyMigrationV29RepositoryTargets, } from "./db-migration-steps.js";
|
|
41
42
|
import { isMemoriesFtsAvailableSchema, tryCreateMemoriesFtsSchema } from "./db-memory-fts-schema.js";
|
|
42
43
|
import { createDbOpenState } from "./db-open-state.js";
|
|
@@ -1289,7 +1290,7 @@ export function setTaskEscalationPending(milestoneId, sliceId, taskId, artifactP
|
|
|
1289
1290
|
escalation_artifact_path = :path
|
|
1290
1291
|
WHERE milestone_id = :mid AND slice_id = :sid AND id = :tid`).run({ ":path": artifactPath, ":mid": milestoneId, ":sid": sliceId, ":tid": taskId });
|
|
1291
1292
|
}
|
|
1292
|
-
/** Set awaiting-review state (artifact exists
|
|
1293
|
+
/** Set awaiting-review state (artifact exists and requires explicit user review). Mutually exclusive with pending. */
|
|
1293
1294
|
export function setTaskEscalationAwaitingReview(milestoneId, sliceId, taskId, artifactPath) {
|
|
1294
1295
|
if (!currentDb)
|
|
1295
1296
|
throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
|
|
@@ -1419,15 +1420,47 @@ export function setMilestoneQueueOrder(order) {
|
|
|
1419
1420
|
throw err;
|
|
1420
1421
|
}
|
|
1421
1422
|
}
|
|
1423
|
+
function getMilestoneStatusForUpdate(milestoneId) {
|
|
1424
|
+
if (!currentDb)
|
|
1425
|
+
throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
|
|
1426
|
+
const row = currentDb.prepare("SELECT status FROM milestones WHERE id = :id").get({ ":id": milestoneId });
|
|
1427
|
+
return typeof row?.["status"] === "string" ? row["status"] : null;
|
|
1428
|
+
}
|
|
1429
|
+
function writeMilestoneStatus(milestoneId, status, completedAt) {
|
|
1430
|
+
if (!currentDb)
|
|
1431
|
+
throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
|
|
1432
|
+
currentDb.prepare(`UPDATE milestones SET status = :status, completed_at = :completed_at WHERE id = :id`).run({ ":status": status, ":completed_at": completedAt ?? null, ":id": milestoneId });
|
|
1433
|
+
}
|
|
1422
1434
|
/**
|
|
1423
1435
|
* Update a milestone's status in the database.
|
|
1424
|
-
*
|
|
1425
|
-
*
|
|
1436
|
+
*
|
|
1437
|
+
* Generic status updates may close milestones, park/unpark open milestones, or
|
|
1438
|
+
* advance planned milestones. They may not reopen a closed milestone; callers
|
|
1439
|
+
* must use reopenMilestoneStatus(), which is reserved for gsd_milestone_reopen.
|
|
1426
1440
|
*/
|
|
1427
1441
|
export function updateMilestoneStatus(milestoneId, status, completedAt) {
|
|
1428
1442
|
if (!currentDb)
|
|
1429
1443
|
throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
|
|
1430
|
-
|
|
1444
|
+
const currentStatus = getMilestoneStatusForUpdate(milestoneId);
|
|
1445
|
+
if (currentStatus && isClosedStatus(currentStatus) && !isClosedStatus(status)) {
|
|
1446
|
+
throw new Error(`Cannot update closed milestone ${milestoneId} from ${currentStatus} to ${status}; use gsd_milestone_reopen for an explicit reopen.`);
|
|
1447
|
+
}
|
|
1448
|
+
writeMilestoneStatus(milestoneId, status, completedAt);
|
|
1449
|
+
}
|
|
1450
|
+
/**
|
|
1451
|
+
* Explicit closed -> active transition for gsd_milestone_reopen only.
|
|
1452
|
+
*/
|
|
1453
|
+
export function reopenMilestoneStatus(milestoneId) {
|
|
1454
|
+
if (!currentDb)
|
|
1455
|
+
throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
|
|
1456
|
+
const currentStatus = getMilestoneStatusForUpdate(milestoneId);
|
|
1457
|
+
if (!currentStatus) {
|
|
1458
|
+
throw new Error(`Cannot reopen missing milestone ${milestoneId}`);
|
|
1459
|
+
}
|
|
1460
|
+
if (!isClosedStatus(currentStatus)) {
|
|
1461
|
+
throw new Error(`Cannot reopen milestone ${milestoneId} from status ${currentStatus}; milestone is not closed.`);
|
|
1462
|
+
}
|
|
1463
|
+
writeMilestoneStatus(milestoneId, "active", null);
|
|
1431
1464
|
}
|
|
1432
1465
|
export function getActiveMilestoneFromDb() {
|
|
1433
1466
|
if (!currentDb)
|
|
@@ -2240,7 +2273,7 @@ export function deleteArtifactByPath(path) {
|
|
|
2240
2273
|
}
|
|
2241
2274
|
/**
|
|
2242
2275
|
* Drop hierarchy rows in dependency order inside a transaction. Used by
|
|
2243
|
-
* `gsd recover` to rebuild engine state from markdown.
|
|
2276
|
+
* `gsd recover --confirm` to rebuild engine state from markdown.
|
|
2244
2277
|
*/
|
|
2245
2278
|
export function clearEngineHierarchy() {
|
|
2246
2279
|
if (!currentDb)
|
|
@@ -2545,7 +2578,10 @@ export function decayMemoriesBefore(cutoffTs, now) {
|
|
|
2545
2578
|
throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
|
|
2546
2579
|
currentDb.prepare(`UPDATE memories
|
|
2547
2580
|
SET confidence = MAX(0.1, confidence - 0.1), updated_at = :now
|
|
2548
|
-
WHERE superseded_by IS NULL
|
|
2581
|
+
WHERE superseded_by IS NULL
|
|
2582
|
+
AND updated_at < :cutoff
|
|
2583
|
+
AND confidence > 0.1
|
|
2584
|
+
AND (structured_fields IS NULL OR structured_fields NOT LIKE '%"sourceDecisionId"%')`).run({ ":now": now, ":cutoff": cutoffTs });
|
|
2549
2585
|
}
|
|
2550
2586
|
export function supersedeLowestRankedMemories(limit, now) {
|
|
2551
2587
|
if (!currentDb)
|
|
@@ -115,15 +115,10 @@ async function runQuickTaskChoice(ctx, pi) {
|
|
|
115
115
|
}
|
|
116
116
|
async function dispatchDiscussForNextMilestoneWithBacklog(ctx, pi, basePath, nextId) {
|
|
117
117
|
const backlogContext = buildRequirementsBacklogDiscussContext(nextId);
|
|
118
|
-
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
119
118
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
120
|
-
const basePrompt =
|
|
121
|
-
workingDirectory: basePath,
|
|
122
|
-
milestoneId: nextId,
|
|
123
|
-
milestoneTitle: `New milestone ${nextId}`,
|
|
124
|
-
inlinedTemplates: discussMilestoneTemplates,
|
|
125
|
-
structuredQuestionsAvailable,
|
|
119
|
+
const basePrompt = await buildDiscussMilestonePrompt(nextId, `New milestone ${nextId}`, basePath, structuredQuestionsAvailable, {
|
|
126
120
|
commitInstruction: buildDocsCommitInstruction(`docs(${nextId}): milestone context from discuss`),
|
|
121
|
+
includeContextMode: false,
|
|
127
122
|
fastPathInstruction: [
|
|
128
123
|
"> **Requirements backlog active.**",
|
|
129
124
|
"> Map unmapped active requirements to this milestone before finalizing context.",
|
|
@@ -1054,7 +1049,7 @@ function buildHeadlessDiscussPrompt(nextId, seedContext, _basePath) {
|
|
|
1054
1049
|
* @param basePath - Root directory of the project
|
|
1055
1050
|
* @returns The discuss prompt string
|
|
1056
1051
|
*/
|
|
1057
|
-
async function buildDiscussPreparationContext(ctx, basePath, mode = "greenfield") {
|
|
1052
|
+
async function buildDiscussPreparationContext(ctx, basePath, mode = "greenfield", skipPriorContext = false) {
|
|
1058
1053
|
const prefs = loadEffectiveGSDPreferences()?.preferences ?? {};
|
|
1059
1054
|
if (prefs.discuss_preparation === false)
|
|
1060
1055
|
return "";
|
|
@@ -1071,7 +1066,7 @@ async function buildDiscussPreparationContext(ctx, basePath, mode = "greenfield"
|
|
|
1071
1066
|
const parts = [];
|
|
1072
1067
|
if (codebaseBrief)
|
|
1073
1068
|
parts.push(`### Codebase Brief\n\n${codebaseBrief}`);
|
|
1074
|
-
if (priorContextBrief)
|
|
1069
|
+
if (priorContextBrief && !skipPriorContext)
|
|
1075
1070
|
parts.push(`### Prior Context Brief\n\n${priorContextBrief}`);
|
|
1076
1071
|
if (parts.length === 0)
|
|
1077
1072
|
return "";
|
|
@@ -1103,17 +1098,11 @@ async function dispatchNewMilestoneDiscuss(ctx, pi, basePath, nextId, stepMode,
|
|
|
1103
1098
|
await dispatchWorkflow(pi, prompt, "gsd-run", ctx, "discuss-milestone", { basePath });
|
|
1104
1099
|
return;
|
|
1105
1100
|
}
|
|
1106
|
-
const preparationContext = await buildDiscussPreparationContext(ctx, basePath, "milestone");
|
|
1107
|
-
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
1101
|
+
const preparationContext = await buildDiscussPreparationContext(ctx, basePath, "milestone", true);
|
|
1108
1102
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
1109
|
-
let prompt =
|
|
1110
|
-
workingDirectory: basePath,
|
|
1111
|
-
milestoneId: nextId,
|
|
1112
|
-
milestoneTitle: `New milestone ${nextId}`,
|
|
1113
|
-
inlinedTemplates: discussMilestoneTemplates,
|
|
1114
|
-
structuredQuestionsAvailable,
|
|
1103
|
+
let prompt = await buildDiscussMilestonePrompt(nextId, `New milestone ${nextId}`, basePath, structuredQuestionsAvailable, {
|
|
1115
1104
|
commitInstruction: buildDocsCommitInstruction(`docs(${nextId}): milestone context from discuss`),
|
|
1116
|
-
|
|
1105
|
+
includeContextMode: false,
|
|
1117
1106
|
});
|
|
1118
1107
|
if (preparationContext)
|
|
1119
1108
|
prompt += preparationContext;
|
|
@@ -1364,8 +1353,6 @@ export async function showDiscuss(ctx, pi, basePath, options) {
|
|
|
1364
1353
|
// Special case: milestone is in needs-discussion phase (has CONTEXT-DRAFT.md but no roadmap yet).
|
|
1365
1354
|
// Route to the draft discussion flow instead of erroring — the discussion IS how the roadmap gets created.
|
|
1366
1355
|
if (state.phase === "needs-discussion") {
|
|
1367
|
-
const draftFile = resolveMilestoneFile(basePath, mid, "CONTEXT-DRAFT");
|
|
1368
|
-
const draftContent = draftFile ? await loadFile(draftFile) : null;
|
|
1369
1356
|
const choice = await showNextAction(ctx, {
|
|
1370
1357
|
title: `GSD — ${mid}: ${milestoneTitle}`,
|
|
1371
1358
|
summary: ["This milestone has a draft context from a prior discussion.", "It needs a dedicated discussion before auto-planning can begin."],
|
|
@@ -1390,30 +1377,23 @@ export async function showDiscuss(ctx, pi, basePath, options) {
|
|
|
1390
1377
|
notYetMessage: "Run /gsd discuss when ready to discuss this milestone.",
|
|
1391
1378
|
});
|
|
1392
1379
|
if (choice === "discuss_draft") {
|
|
1393
|
-
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
1394
1380
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
1395
|
-
const
|
|
1396
|
-
workingDirectory: basePath,
|
|
1397
|
-
milestoneId: mid, milestoneTitle, inlinedTemplates: discussMilestoneTemplates, structuredQuestionsAvailable,
|
|
1381
|
+
const seed = await buildDiscussMilestonePrompt(mid, milestoneTitle, basePath, structuredQuestionsAvailable, {
|
|
1398
1382
|
commitInstruction: buildDocsCommitInstruction(`docs(${mid}): milestone context from discuss`),
|
|
1399
|
-
|
|
1383
|
+
includeContextMode: false,
|
|
1400
1384
|
});
|
|
1401
|
-
const seed = draftContent
|
|
1402
|
-
? `${basePrompt}\n\n## Prior Discussion (Draft Seed)\n\n${draftContent}`
|
|
1403
|
-
: basePrompt;
|
|
1404
1385
|
setPendingAutoStart(basePath, { ctx, pi, basePath, milestoneId: mid, step: true });
|
|
1405
1386
|
await dispatchWorkflow(pi, seed, "gsd-discuss", ctx, "discuss-milestone", { basePath });
|
|
1406
1387
|
}
|
|
1407
1388
|
else if (choice === "discuss_fresh") {
|
|
1408
|
-
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
1409
1389
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
1410
|
-
|
|
1411
|
-
await dispatchWorkflow(pi, loadPrompt("guided-discuss-milestone", {
|
|
1412
|
-
workingDirectory: basePath,
|
|
1413
|
-
milestoneId: mid, milestoneTitle, inlinedTemplates: discussMilestoneTemplates, structuredQuestionsAvailable,
|
|
1390
|
+
const prompt = await buildDiscussMilestonePrompt(mid, milestoneTitle, basePath, structuredQuestionsAvailable, {
|
|
1414
1391
|
commitInstruction: buildDocsCommitInstruction(`docs(${mid}): milestone context from discuss`),
|
|
1415
|
-
|
|
1416
|
-
|
|
1392
|
+
includeContextMode: false,
|
|
1393
|
+
includeDraftSeed: false,
|
|
1394
|
+
});
|
|
1395
|
+
setPendingAutoStart(basePath, { ctx, pi, basePath, milestoneId: mid, step: true });
|
|
1396
|
+
await dispatchWorkflow(pi, prompt, "gsd-discuss", ctx, "discuss-milestone", { basePath });
|
|
1417
1397
|
}
|
|
1418
1398
|
else if (choice === "skip_milestone") {
|
|
1419
1399
|
const { ensureDbOpen } = await import("./bootstrap/dynamic-tools.js");
|
|
@@ -1631,20 +1611,12 @@ async function dispatchDiscussForMilestone(ctx, pi, basePath, mid, milestoneTitl
|
|
|
1631
1611
|
"> Ask only questions where the answer would materially change scope.",
|
|
1632
1612
|
].join("\n")
|
|
1633
1613
|
: "";
|
|
1634
|
-
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
1635
1614
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
1636
|
-
const
|
|
1637
|
-
workingDirectory: basePath,
|
|
1638
|
-
milestoneId: mid,
|
|
1639
|
-
milestoneTitle,
|
|
1640
|
-
inlinedTemplates: discussMilestoneTemplates,
|
|
1641
|
-
structuredQuestionsAvailable,
|
|
1615
|
+
const prompt = await buildDiscussMilestonePrompt(mid, milestoneTitle, basePath, structuredQuestionsAvailable, {
|
|
1642
1616
|
commitInstruction: buildDocsCommitInstruction(`docs(${mid}): milestone context from discuss`),
|
|
1617
|
+
includeContextMode: false,
|
|
1643
1618
|
fastPathInstruction,
|
|
1644
1619
|
});
|
|
1645
|
-
const prompt = draftContent
|
|
1646
|
-
? `${basePrompt}\n\n## Prior Discussion (Draft Seed)\n\n${draftContent}`
|
|
1647
|
-
: basePrompt;
|
|
1648
1620
|
await dispatchWorkflow(pi, prompt, "gsd-discuss", ctx, "discuss-milestone", { basePath });
|
|
1649
1621
|
}
|
|
1650
1622
|
// ─── Smart Entry Point ────────────────────────────────────────────────────────
|
|
@@ -1908,7 +1880,7 @@ export async function showSmartEntry(ctx, pi, basePath, options) {
|
|
|
1908
1880
|
const result = await checkMarkdownHierarchyAgainstDb(basePath);
|
|
1909
1881
|
if (result.action === "recovery-required") {
|
|
1910
1882
|
ctx.ui.notify(result.message ??
|
|
1911
|
-
`Markdown planning artifacts do not match the authoritative DB. Run \`${result.recoveryCommand ?? "/gsd recover"}\` to import markdown explicitly.`, "warning");
|
|
1883
|
+
`Markdown planning artifacts do not match the authoritative DB. Run \`${result.recoveryCommand ?? "/gsd recover --confirm"}\` to import markdown explicitly.`, "warning");
|
|
1912
1884
|
}
|
|
1913
1885
|
}
|
|
1914
1886
|
catch (err) {
|
|
@@ -2122,8 +2094,6 @@ export async function showSmartEntry(ctx, pi, basePath, options) {
|
|
|
2122
2094
|
}
|
|
2123
2095
|
// ── Draft milestone — needs discussion before planning ────────────────
|
|
2124
2096
|
if (state.phase === "needs-discussion") {
|
|
2125
|
-
const draftFile = resolveMilestoneFile(basePath, milestoneId, "CONTEXT-DRAFT");
|
|
2126
|
-
const draftContent = draftFile ? await loadFile(draftFile) : null;
|
|
2127
2097
|
const choice = await showNextAction(ctx, {
|
|
2128
2098
|
title: `GSD — ${milestoneId}: ${milestoneTitle}`,
|
|
2129
2099
|
summary: ["This milestone has a draft context from a prior discussion.", "It needs a dedicated discussion before auto-planning can begin."],
|
|
@@ -2148,30 +2118,23 @@ export async function showSmartEntry(ctx, pi, basePath, options) {
|
|
|
2148
2118
|
notYetMessage: "Run /gsd when ready to discuss this milestone.",
|
|
2149
2119
|
});
|
|
2150
2120
|
if (choice === "discuss_draft") {
|
|
2151
|
-
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
2152
2121
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
2153
|
-
const
|
|
2154
|
-
workingDirectory: basePath,
|
|
2155
|
-
milestoneId, milestoneTitle, inlinedTemplates: discussMilestoneTemplates, structuredQuestionsAvailable,
|
|
2122
|
+
const seed = await buildDiscussMilestonePrompt(milestoneId, milestoneTitle, basePath, structuredQuestionsAvailable, {
|
|
2156
2123
|
commitInstruction: buildDocsCommitInstruction(`docs(${milestoneId}): milestone context from discuss`),
|
|
2157
|
-
|
|
2124
|
+
includeContextMode: false,
|
|
2158
2125
|
});
|
|
2159
|
-
const seed = draftContent
|
|
2160
|
-
? `${basePrompt}\n\n## Prior Discussion (Draft Seed)\n\n${draftContent}`
|
|
2161
|
-
: basePrompt;
|
|
2162
2126
|
setPendingAutoStart(basePath, { ctx, pi, basePath, milestoneId, step: stepMode });
|
|
2163
2127
|
await dispatchWorkflow(pi, seed, "gsd-discuss", ctx, "discuss-milestone", { basePath });
|
|
2164
2128
|
}
|
|
2165
2129
|
else if (choice === "discuss_fresh") {
|
|
2166
|
-
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
2167
2130
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
2168
|
-
|
|
2169
|
-
await dispatchWorkflow(pi, loadPrompt("guided-discuss-milestone", {
|
|
2170
|
-
workingDirectory: basePath,
|
|
2171
|
-
milestoneId, milestoneTitle, inlinedTemplates: discussMilestoneTemplates, structuredQuestionsAvailable,
|
|
2131
|
+
const prompt = await buildDiscussMilestonePrompt(milestoneId, milestoneTitle, basePath, structuredQuestionsAvailable, {
|
|
2172
2132
|
commitInstruction: buildDocsCommitInstruction(`docs(${milestoneId}): milestone context from discuss`),
|
|
2173
|
-
|
|
2174
|
-
|
|
2133
|
+
includeContextMode: false,
|
|
2134
|
+
includeDraftSeed: false,
|
|
2135
|
+
});
|
|
2136
|
+
setPendingAutoStart(basePath, { ctx, pi, basePath, milestoneId, step: stepMode });
|
|
2137
|
+
await dispatchWorkflow(pi, prompt, "gsd-discuss", ctx, "discuss-milestone", { basePath });
|
|
2175
2138
|
}
|
|
2176
2139
|
else if (choice === "skip_milestone") {
|
|
2177
2140
|
const milestoneIds = findMilestoneIds(basePath);
|
|
@@ -2279,14 +2242,12 @@ export async function showSmartEntry(ctx, pi, basePath, options) {
|
|
|
2279
2242
|
await dispatchWorkflow(pi, await buildPlanMilestonePrompt(milestoneId, milestoneTitle, basePath), "gsd-run", ctx, "plan-milestone", { basePath });
|
|
2280
2243
|
}
|
|
2281
2244
|
else if (choice === "discuss") {
|
|
2282
|
-
const discussMilestoneTemplates = inlineTemplate("context", "Context");
|
|
2283
2245
|
const structuredQuestionsAvailable = getStructuredQuestionsAvailability(pi, ctx);
|
|
2284
|
-
await
|
|
2285
|
-
workingDirectory: basePath,
|
|
2286
|
-
milestoneId, milestoneTitle, inlinedTemplates: discussMilestoneTemplates, structuredQuestionsAvailable,
|
|
2246
|
+
const prompt = await buildDiscussMilestonePrompt(milestoneId, milestoneTitle, basePath, structuredQuestionsAvailable, {
|
|
2287
2247
|
commitInstruction: buildDocsCommitInstruction(`docs(${milestoneId}): milestone context from discuss`),
|
|
2288
|
-
|
|
2289
|
-
})
|
|
2248
|
+
includeContextMode: false,
|
|
2249
|
+
});
|
|
2250
|
+
await dispatchWorkflow(pi, prompt, "gsd-run", ctx, "discuss-milestone", { basePath });
|
|
2290
2251
|
}
|
|
2291
2252
|
else if (choice === "skip_milestone") {
|
|
2292
2253
|
const milestoneIds = findMilestoneIds(basePath);
|
|
@@ -24,14 +24,17 @@ function collectServerEntries(servers) {
|
|
|
24
24
|
export function discoverMcpServers(projectDir) {
|
|
25
25
|
const mcpJsonPath = resolve(projectDir, ".mcp.json");
|
|
26
26
|
const settingsPath = resolve(projectDir, ".claude", "settings.json");
|
|
27
|
+
const localSettingsPath = resolve(projectDir, ".claude", "settings.local.json");
|
|
27
28
|
const mcpJson = readJsonFile(mcpJsonPath);
|
|
28
29
|
const settings = readJsonFile(settingsPath, true);
|
|
30
|
+
const localSettings = readJsonFile(localSettingsPath, true);
|
|
29
31
|
const seen = new Set();
|
|
30
32
|
const discovered = [];
|
|
31
33
|
for (const entry of [
|
|
32
34
|
...collectServerEntries(mcpJson?.mcpServers),
|
|
33
35
|
...collectServerEntries(mcpJson?.servers),
|
|
34
36
|
...collectServerEntries(settings?.mcpServers),
|
|
37
|
+
...collectServerEntries(localSettings?.mcpServers),
|
|
35
38
|
]) {
|
|
36
39
|
if (seen.has(entry.name))
|
|
37
40
|
continue;
|