@opengsd/gsd-pi 1.1.1-dev.3ea310e → 1.1.1-dev.595401e
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/resources/.managed-resources-content-hash +1 -1
- 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 +5 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +132 -8
- package/dist/resources/extensions/gsd/auto-prompts.js +68 -22
- package/dist/resources/extensions/gsd/auto-start.js +41 -12
- package/dist/resources/extensions/gsd/auto-unit-tool-scope.js +2 -1
- package/dist/resources/extensions/gsd/auto.js +12 -5
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +82 -3
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +43 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +30 -9
- 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/handlers/core.js +1 -1
- 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 +5 -2
- package/dist/resources/extensions/gsd/guided-flow.js +29 -68
- package/dist/resources/extensions/gsd/memory-store.js +4 -1
- 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/roadmap.js +18 -1
- package/dist/resources/extensions/gsd/state-reconciliation/index.js +6 -0
- package/dist/resources/extensions/gsd/state.js +3 -3
- package/dist/resources/extensions/gsd/templates/plan.md +3 -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/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 +1 -1
- package/dist/resources/extensions/gsd/workflow-mcp.js +5 -1
- package/dist/rtk.d.ts +7 -1
- package/dist/rtk.js +27 -11
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +7 -7
- 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/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 +7 -7
- 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 +3 -2
- 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 +89 -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-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 +86 -18
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +108 -40
- 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/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 +5 -0
- package/src/resources/extensions/gsd/auto-post-unit.ts +164 -7
- package/src/resources/extensions/gsd/auto-prompts.ts +102 -15
- package/src/resources/extensions/gsd/auto-start.ts +54 -14
- package/src/resources/extensions/gsd/auto-unit-tool-scope.ts +2 -1
- package/src/resources/extensions/gsd/auto.ts +15 -4
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +89 -3
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +51 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +51 -14
- 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/handlers/core.ts +1 -1
- 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 +5 -2
- package/src/resources/extensions/gsd/guided-flow.ts +90 -82
- package/src/resources/extensions/gsd/memory-store.ts +4 -1
- 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/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 +3 -3
- 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 +37 -0
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +16 -3
- 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/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 +8 -0
- package/src/resources/extensions/gsd/tests/discuss-milestone-structured-questions.test.ts +31 -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/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/memory-maintenance.test.ts +39 -8
- 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/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/skill-activation.test.ts +55 -0
- 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-naming.test.ts +12 -2
- 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 +2 -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/tools/complete-task.ts +20 -2
- package/src/resources/extensions/gsd/tools/exec-tool.ts +130 -0
- 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 +67 -4
- 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 +1 -1
- package/src/resources/extensions/gsd/workflow-mcp.ts +5 -1
- /package/dist/web/standalone/.next/static/{xACmObbrDjwLriepRgaa9 → IDKjyRHLIaumjgonPcYiX}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{xACmObbrDjwLriepRgaa9 → IDKjyRHLIaumjgonPcYiX}/_ssgManifest.js +0 -0
|
@@ -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
|
}
|
|
@@ -1290,7 +1290,7 @@ export function setTaskEscalationPending(milestoneId, sliceId, taskId, artifactP
|
|
|
1290
1290
|
escalation_artifact_path = :path
|
|
1291
1291
|
WHERE milestone_id = :mid AND slice_id = :sid AND id = :tid`).run({ ":path": artifactPath, ":mid": milestoneId, ":sid": sliceId, ":tid": taskId });
|
|
1292
1292
|
}
|
|
1293
|
-
/** Set awaiting-review state (artifact exists
|
|
1293
|
+
/** Set awaiting-review state (artifact exists and requires explicit user review). Mutually exclusive with pending. */
|
|
1294
1294
|
export function setTaskEscalationAwaitingReview(milestoneId, sliceId, taskId, artifactPath) {
|
|
1295
1295
|
if (!currentDb)
|
|
1296
1296
|
throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
|
|
@@ -2578,7 +2578,10 @@ export function decayMemoriesBefore(cutoffTs, now) {
|
|
|
2578
2578
|
throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
|
|
2579
2579
|
currentDb.prepare(`UPDATE memories
|
|
2580
2580
|
SET confidence = MAX(0.1, confidence - 0.1), updated_at = :now
|
|
2581
|
-
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 });
|
|
2582
2585
|
}
|
|
2583
2586
|
export function supersedeLowestRankedMemories(limit, now) {
|
|
2584
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 ────────────────────────────────────────────────────────
|
|
@@ -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);
|
|
@@ -614,7 +614,10 @@ export function decayStaleMemories(thresholdUnits = 20) {
|
|
|
614
614
|
return []; // not enough processed units yet
|
|
615
615
|
const cutoff = row['processed_at'];
|
|
616
616
|
const affected = adapter.prepare(`SELECT id FROM memories
|
|
617
|
-
WHERE superseded_by IS NULL
|
|
617
|
+
WHERE superseded_by IS NULL
|
|
618
|
+
AND updated_at < :cutoff
|
|
619
|
+
AND confidence > 0.1
|
|
620
|
+
AND (structured_fields IS NULL OR structured_fields NOT LIKE '%"sourceDecisionId"%')`).all({ ':cutoff': cutoff }).map((r) => r['id']);
|
|
618
621
|
decayMemoriesBefore(cutoff, new Date().toISOString());
|
|
619
622
|
return affected;
|
|
620
623
|
}
|
|
@@ -19,6 +19,15 @@ export function isRetryPending() {
|
|
|
19
19
|
export function consumeRetryTrigger() {
|
|
20
20
|
return getOrCreateRegistry().consumeRetryTrigger();
|
|
21
21
|
}
|
|
22
|
+
export function consumeHookFailure() {
|
|
23
|
+
return getOrCreateRegistry().consumeHookFailure();
|
|
24
|
+
}
|
|
25
|
+
export function isGateBlockPending() {
|
|
26
|
+
return getOrCreateRegistry().isGateBlockPending();
|
|
27
|
+
}
|
|
28
|
+
export function consumeGateBlock() {
|
|
29
|
+
return getOrCreateRegistry().consumeGateBlock();
|
|
30
|
+
}
|
|
22
31
|
export function resetHookState() {
|
|
23
32
|
getOrCreateRegistry().resetState();
|
|
24
33
|
}
|
|
@@ -15,6 +15,14 @@ const VALID_UOK_TURN_ACTIONS = new Set([
|
|
|
15
15
|
"snapshot",
|
|
16
16
|
"status-only",
|
|
17
17
|
]);
|
|
18
|
+
const VALID_POST_UNIT_HOOK_CRITICALITIES = new Set(["advisory", "blocking"]);
|
|
19
|
+
const VALID_POST_UNIT_HOOK_ON_BLOCK_ACTIONS = new Set([
|
|
20
|
+
"retry-unit",
|
|
21
|
+
"retry-task",
|
|
22
|
+
"queue-task",
|
|
23
|
+
"queue-slice",
|
|
24
|
+
"pause",
|
|
25
|
+
]);
|
|
18
26
|
export function validatePreferences(preferences) {
|
|
19
27
|
const errors = [];
|
|
20
28
|
const warnings = [];
|
|
@@ -474,9 +482,40 @@ export function validatePreferences(preferences) {
|
|
|
474
482
|
if (typeof hook.artifact === "string" && hook.artifact.trim()) {
|
|
475
483
|
validHook.artifact = hook.artifact.trim();
|
|
476
484
|
}
|
|
485
|
+
if (hook.criticality !== undefined) {
|
|
486
|
+
const criticality = typeof hook.criticality === "string" ? hook.criticality.trim() : "";
|
|
487
|
+
if (VALID_POST_UNIT_HOOK_CRITICALITIES.has(criticality)) {
|
|
488
|
+
validHook.criticality = criticality;
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
errors.push(`post_unit_hooks "${name}" invalid criticality: ${String(hook.criticality)}`);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
477
494
|
if (typeof hook.retry_on === "string" && hook.retry_on.trim()) {
|
|
478
495
|
validHook.retry_on = hook.retry_on.trim();
|
|
479
496
|
}
|
|
497
|
+
if (hook.on_block !== undefined) {
|
|
498
|
+
if (!hook.on_block || typeof hook.on_block !== "object") {
|
|
499
|
+
errors.push(`post_unit_hooks "${name}" on_block must be an object`);
|
|
500
|
+
}
|
|
501
|
+
else {
|
|
502
|
+
const onBlock = hook.on_block;
|
|
503
|
+
const action = typeof onBlock.action === "string" ? onBlock.action.trim() : "";
|
|
504
|
+
if (!VALID_POST_UNIT_HOOK_ON_BLOCK_ACTIONS.has(action)) {
|
|
505
|
+
errors.push(`post_unit_hooks "${name}" invalid on_block action: ${String(onBlock.action)}`);
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
validHook.on_block = { action: action };
|
|
509
|
+
if (typeof onBlock.artifact === "string" && onBlock.artifact.trim()) {
|
|
510
|
+
validHook.on_block.artifact = onBlock.artifact.trim();
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
if (validHook.criticality === "blocking" && !validHook.artifact) {
|
|
516
|
+
errors.push(`post_unit_hooks "${name}" criticality blocking requires artifact`);
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
480
519
|
if (typeof hook.agent === "string" && hook.agent.trim()) {
|
|
481
520
|
validHook.agent = hook.agent.trim();
|
|
482
521
|
}
|
|
@@ -26,9 +26,16 @@ function hasRequiredExtensionAssets(rootDir, exists = existsSync) {
|
|
|
26
26
|
return (exists(join(rootDir, "prompts")) &&
|
|
27
27
|
exists(join(rootDir, "templates", "task-summary.md")));
|
|
28
28
|
}
|
|
29
|
+
function isSourceExtensionDir(moduleDir) {
|
|
30
|
+
return moduleDir.replaceAll("\\", "/").endsWith("/src/resources/extensions/gsd");
|
|
31
|
+
}
|
|
29
32
|
export function resolveExtensionDirFromCandidates(moduleDir, agentGsdDir, exists = existsSync) {
|
|
30
33
|
const moduleUsable = hasRequiredExtensionAssets(moduleDir, exists);
|
|
31
34
|
const agentUsable = hasRequiredExtensionAssets(agentGsdDir, exists);
|
|
35
|
+
// Source checkouts must use their own prompt tree. Otherwise local tests and
|
|
36
|
+
// dev runs can silently render stale prompts from ~/.gsd/agent/extensions/gsd.
|
|
37
|
+
if (moduleUsable && isSourceExtensionDir(moduleDir))
|
|
38
|
+
return moduleDir;
|
|
32
39
|
// Prefer the user-local extension tree when both are valid. This avoids
|
|
33
40
|
// leaking npm/global-install paths into prompts on Windows.
|
|
34
41
|
if (agentUsable)
|