gsd-pi 2.82.0-dev.ed17d078d → 3.0.0-dev.04f5ccf82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -18
- package/dist/cli.js +20 -9
- package/dist/headless-ui.js +13 -6
- package/dist/headless.js +9 -2
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +10 -1
- package/dist/resources/extensions/claude-code-cli/partial-builder.js +2 -1
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +44 -6
- package/dist/resources/extensions/cmux/index.js +5 -0
- package/dist/resources/extensions/gsd/auto/detect-stuck.js +1 -1
- package/dist/resources/extensions/gsd/auto/infra-errors.js +9 -3
- package/dist/resources/extensions/gsd/auto/loop.js +122 -40
- package/dist/resources/extensions/gsd/auto/orchestrator.js +15 -4
- package/dist/resources/extensions/gsd/auto/phases.js +146 -49
- package/dist/resources/extensions/gsd/auto/session.js +6 -0
- package/dist/resources/extensions/gsd/auto/unit-runner-events.js +7 -1
- package/dist/resources/extensions/gsd/auto/workflow-kernel.js +3 -0
- package/dist/resources/extensions/gsd/auto/workflow-memory-pressure.js +12 -0
- package/dist/resources/extensions/gsd/auto-budget.js +9 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +72 -5
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +1 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +185 -30
- package/dist/resources/extensions/gsd/auto-model-selection.js +2 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +329 -137
- package/dist/resources/extensions/gsd/auto-prompts.js +36 -10
- package/dist/resources/extensions/gsd/auto-recovery.js +82 -16
- package/dist/resources/extensions/gsd/auto-start.js +99 -16
- package/dist/resources/extensions/gsd/auto-timers.js +11 -3
- package/dist/resources/extensions/gsd/auto-verification.js +146 -34
- package/dist/resources/extensions/gsd/auto-worktree.js +185 -26
- package/dist/resources/extensions/gsd/auto.js +135 -74
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +65 -10
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +13 -10
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +14 -4
- package/dist/resources/extensions/gsd/bootstrap/subagent-input.js +21 -9
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +24 -9
- package/dist/resources/extensions/gsd/clean-root-preflight.js +267 -8
- package/dist/resources/extensions/gsd/commands/catalog.js +10 -1
- package/dist/resources/extensions/gsd/commands/handlers/core.js +38 -0
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +20 -0
- package/dist/resources/extensions/gsd/commands-bootstrap.js +5 -0
- package/dist/resources/extensions/gsd/commands-handlers.js +2 -0
- package/dist/resources/extensions/gsd/commands-mcp-status.js +9 -0
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +16 -4
- package/dist/resources/extensions/gsd/commands-verdict.js +139 -0
- package/dist/resources/extensions/gsd/crash-recovery.js +55 -7
- package/dist/resources/extensions/gsd/db/auto-workers.js +30 -0
- package/dist/resources/extensions/gsd/db/milestone-leases.js +24 -0
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +3 -2
- package/dist/resources/extensions/gsd/db-base-schema.js +2 -0
- package/dist/resources/extensions/gsd/db-migration-steps.js +4 -0
- package/dist/resources/extensions/gsd/db-task-slice-rows.js +2 -0
- package/dist/resources/extensions/gsd/dispatch-guard.js +46 -2
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +10 -0
- package/dist/resources/extensions/gsd/doctor-git-checks.js +74 -3
- package/dist/resources/extensions/gsd/doctor-proactive.js +14 -2
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +28 -11
- package/dist/resources/extensions/gsd/doctor.js +2 -28
- package/dist/resources/extensions/gsd/export-html.js +27 -425
- package/dist/resources/extensions/gsd/forensics.js +10 -3
- package/dist/resources/extensions/gsd/git-conflict-state.js +21 -0
- package/dist/resources/extensions/gsd/git-service.js +152 -15
- package/dist/resources/extensions/gsd/gsd-db.js +76 -33
- package/dist/resources/extensions/gsd/guided-flow-queue.js +4 -3
- package/dist/resources/extensions/gsd/guided-flow.js +110 -117
- package/dist/resources/extensions/gsd/guided-unit-context.js +23 -0
- package/dist/resources/extensions/gsd/init-wizard.js +17 -2
- package/dist/resources/extensions/gsd/markdown-renderer.js +14 -11
- package/dist/resources/extensions/gsd/mcp-filter.js +58 -0
- package/dist/resources/extensions/gsd/migrate/parsers.js +121 -2
- package/dist/resources/extensions/gsd/migration-auto-check.js +12 -17
- package/dist/resources/extensions/gsd/milestone-actions.js +11 -4
- package/dist/resources/extensions/gsd/native-git-bridge.js +57 -14
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +3 -0
- package/dist/resources/extensions/gsd/paths.js +4 -0
- package/dist/resources/extensions/gsd/pending-auto-start.js +52 -0
- package/dist/resources/extensions/gsd/planning-path-scope.js +9 -3
- package/dist/resources/extensions/gsd/post-execution-checks.js +73 -9
- package/dist/resources/extensions/gsd/pre-execution-checks.js +54 -19
- package/dist/resources/extensions/gsd/preferences-mcp.js +19 -0
- package/dist/resources/extensions/gsd/preferences-models.js +6 -4
- package/dist/resources/extensions/gsd/preferences-types.js +3 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +147 -0
- package/dist/resources/extensions/gsd/preferences.js +35 -0
- package/dist/resources/extensions/gsd/prompt-loader.js +1 -1
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +8 -8
- package/dist/resources/extensions/gsd/prompts/discuss.md +9 -9
- package/dist/resources/extensions/gsd/prompts/forensics.md +3 -3
- package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
- package/dist/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +4 -4
- package/dist/resources/extensions/gsd/prompts/queue.md +4 -4
- package/dist/resources/extensions/gsd/prompts/reactive-execute.md +1 -1
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/dist/resources/extensions/gsd/queue-reorder-ui.js +30 -13
- package/dist/resources/extensions/gsd/repo-identity.js +39 -22
- package/dist/resources/extensions/gsd/repository-registry.js +44 -0
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +2 -0
- package/dist/resources/extensions/gsd/safety/evidence-cross-ref.js +42 -18
- package/dist/resources/extensions/gsd/session-lock.js +15 -2
- package/dist/resources/extensions/gsd/slice-parallel-conflict.js +2 -2
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +84 -5
- package/dist/resources/extensions/gsd/smart-entry-routing.js +36 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/merge-state.js +6 -1
- package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +9 -14
- package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +19 -24
- package/dist/resources/extensions/gsd/state.js +28 -7
- package/dist/resources/extensions/gsd/status-guards.js +14 -2
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +1 -0
- package/dist/resources/extensions/gsd/templates/plan.md +9 -5
- package/dist/resources/extensions/gsd/templates/task-plan.md +10 -2
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +15 -9
- package/dist/resources/extensions/gsd/tools/complete-slice.js +56 -10
- package/dist/resources/extensions/gsd/tools/exec-tool.js +87 -5
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +7 -1
- package/dist/resources/extensions/gsd/tools/plan-slice.js +151 -15
- package/dist/resources/extensions/gsd/tools/validate-milestone.js +32 -1
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +185 -40
- package/dist/resources/extensions/gsd/tui/render-kit.js +33 -0
- package/dist/resources/extensions/gsd/unit-context-composer.js +2 -0
- package/dist/resources/extensions/gsd/unit-context-manifest.js +69 -17
- package/dist/resources/extensions/gsd/validation.js +23 -1
- package/dist/resources/extensions/gsd/verification-gate.js +142 -7
- package/dist/resources/extensions/gsd/verification-verdict.js +26 -0
- package/dist/resources/extensions/gsd/watch/header-renderer.js +34 -25
- package/dist/resources/extensions/gsd/workflow-manifest.js +2 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +17 -1
- package/dist/resources/extensions/gsd/workflow-projections.js +6 -8
- package/dist/resources/extensions/gsd/worktree-lifecycle.js +86 -19
- package/dist/resources/extensions/gsd/worktree-manager.js +11 -2
- package/dist/resources/extensions/gsd/worktree-safety.js +43 -4
- package/dist/resources/extensions/gsd/worktree-state-projection.js +31 -0
- package/dist/resources/extensions/gsd/worktree-telemetry.js +32 -0
- package/dist/resources/extensions/shared/html-shell.js +388 -0
- package/dist/resources/extensions/shared/interview-ui.js +6 -4
- package/dist/resources/extensions/shared/next-action-ui.js +13 -5
- package/dist/resources/extensions/subagent/index.js +448 -78
- package/dist/resources/extensions/subagent/launch.js +77 -0
- package/dist/resources/extensions/subagent/run-store.js +148 -0
- package/dist/resources/extensions/ttsr/ttsr-manager.js +3 -1
- package/dist/resources/extensions/visual-brief/artifact-policy.js +29 -0
- package/dist/resources/extensions/visual-brief/extension-manifest.json +8 -0
- package/dist/resources/extensions/visual-brief/index.js +5 -0
- package/dist/resources/extensions/visual-brief/page-contract.js +124 -0
- package/dist/resources/extensions/visual-brief/prompts.js +140 -0
- package/dist/resources/skills/forensics/SKILL.md +1 -1
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +8 -8
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +5 -5
- package/dist/web/standalone/.next/required-server-files.json +1 -1
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +4 -7
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -7
- 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 +4 -5
- 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 +2 -5
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +4 -7
- 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 +4 -7
- 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 +4 -5
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -5
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +8 -8
- package/dist/web/standalone/.next/server/chunks/4266.js +2 -0
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.json +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/dist/web/standalone/.next/static/chunks/2973.33f26573894b6153.js +2 -0
- package/dist/web/standalone/.next/static/chunks/8359.65b24fac92188a6b.js +10 -0
- package/dist/web/standalone/.next/static/chunks/9441.ff70bb53f6835771.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/layout-8c10ec293ae0f1d5.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-de742b64187e13fe.js → webpack-855d616060cb6e59.js} +1 -1
- package/dist/web/standalone/.next/static/css/746ee28c929d1880.css +1 -0
- package/dist/web/standalone/server.js +1 -1
- package/dist/welcome-screen.js +7 -8
- package/package.json +4 -4
- package/packages/contracts/dist/rpc.test.js +7 -0
- package/packages/contracts/dist/rpc.test.js.map +1 -1
- package/packages/contracts/dist/workflow.d.ts +21 -0
- package/packages/contracts/dist/workflow.d.ts.map +1 -1
- package/packages/contracts/dist/workflow.js +24 -0
- package/packages/contracts/dist/workflow.js.map +1 -1
- package/packages/contracts/src/rpc.test.ts +8 -0
- package/packages/contracts/src/workflow.ts +24 -0
- package/packages/daemon/package.json +2 -2
- package/packages/mcp-server/README.md +13 -4
- package/packages/mcp-server/dist/workflow-tools.d.ts +0 -3
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +80 -0
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +2 -2
- package/packages/mcp-server/src/workflow-tools.test.ts +23 -1
- package/packages/mcp-server/src/workflow-tools.ts +168 -0
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/package.json +1 -1
- package/packages/native/src/__tests__/stream-process.test.mjs +32 -12
- package/packages/native/tsconfig.json +2 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.js +5 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.js +41 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js +82 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.test.js +52 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/simple-options.d.ts +2 -4
- package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.js +5 -6
- package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/simple-options.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/simple-options.test.js +50 -0
- package/packages/pi-ai/dist/providers/simple-options.test.js.map +1 -0
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/src/providers/google-gemini-cli.test.ts +49 -0
- package/packages/pi-ai/src/providers/google-gemini-cli.ts +7 -0
- package/packages/pi-ai/src/providers/openai-codex-responses.test.ts +63 -0
- package/packages/pi-ai/src/providers/openai-codex-responses.ts +91 -1
- package/packages/pi-ai/src/providers/simple-options.test.ts +60 -0
- package/packages/pi-ai/src/providers/simple-options.ts +5 -6
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.js +66 -0
- package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session.js +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +44 -3
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +6 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +7 -2
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js +14 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +8 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +3 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.js +16 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +24 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +82 -97
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js +7 -7
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js +25 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +24 -10
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-thinking-level.test.ts +79 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +1 -1
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +53 -3
- package/packages/pi-coding-agent/src/core/compaction/compaction.test.ts +23 -1
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +7 -2
- package/packages/pi-coding-agent/src/core/sdk.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +17 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.test.ts +20 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.ts +3 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +23 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +91 -102
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +15 -1
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.ts +9 -9
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-ordering.test.ts +30 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +29 -10
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/loader.test.d.ts +2 -0
- package/packages/pi-tui/dist/__tests__/loader.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/__tests__/loader.test.js +24 -0
- package/packages/pi-tui/dist/__tests__/loader.test.js.map +1 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.d.ts +2 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.js +103 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.js.map +1 -0
- package/packages/pi-tui/dist/__tests__/tui.test.js +72 -4
- package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
- package/packages/pi-tui/dist/components/loader.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/loader.js +3 -0
- package/packages/pi-tui/dist/components/loader.js.map +1 -1
- package/packages/pi-tui/dist/terminal.d.ts +2 -0
- package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
- package/packages/pi-tui/dist/terminal.js +12 -0
- package/packages/pi-tui/dist/terminal.js.map +1 -1
- package/packages/pi-tui/dist/tui.d.ts +1 -0
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +117 -33
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/pi-tui/src/__tests__/loader.test.ts +30 -0
- package/packages/pi-tui/src/__tests__/terminal.test.ts +121 -0
- package/packages/pi-tui/src/__tests__/tui.test.ts +90 -4
- package/packages/pi-tui/src/components/loader.ts +3 -0
- package/packages/pi-tui/src/terminal.ts +11 -0
- package/packages/pi-tui/src/tui.ts +116 -33
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/package.json +1 -1
- package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/GSD-WORKFLOW.md +10 -1
- package/src/resources/extensions/claude-code-cli/partial-builder.ts +2 -1
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +52 -6
- package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +19 -2
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +49 -2
- package/src/resources/extensions/cmux/index.ts +6 -0
- package/src/resources/extensions/gsd/auto/contracts.ts +19 -6
- package/src/resources/extensions/gsd/auto/detect-stuck.ts +1 -0
- package/src/resources/extensions/gsd/auto/infra-errors.ts +9 -3
- package/src/resources/extensions/gsd/auto/loop.ts +123 -40
- package/src/resources/extensions/gsd/auto/orchestrator.ts +15 -4
- package/src/resources/extensions/gsd/auto/phases.ts +172 -60
- package/src/resources/extensions/gsd/auto/session.ts +16 -0
- package/src/resources/extensions/gsd/auto/types.ts +3 -0
- package/src/resources/extensions/gsd/auto/unit-runner-events.ts +6 -2
- package/src/resources/extensions/gsd/auto/workflow-kernel.ts +5 -1
- package/src/resources/extensions/gsd/auto/workflow-memory-pressure.ts +13 -0
- package/src/resources/extensions/gsd/auto-budget.ts +11 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +78 -5
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +1 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +208 -29
- package/src/resources/extensions/gsd/auto-model-selection.ts +2 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +369 -148
- package/src/resources/extensions/gsd/auto-prompts.ts +36 -13
- package/src/resources/extensions/gsd/auto-recovery.ts +86 -13
- package/src/resources/extensions/gsd/auto-start.ts +109 -14
- package/src/resources/extensions/gsd/auto-timers.ts +10 -3
- package/src/resources/extensions/gsd/auto-verification.ts +174 -42
- package/src/resources/extensions/gsd/auto-worktree.ts +202 -30
- package/src/resources/extensions/gsd/auto.ts +172 -81
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +66 -10
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +13 -10
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +13 -4
- package/src/resources/extensions/gsd/bootstrap/subagent-input.ts +19 -7
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +27 -10
- package/src/resources/extensions/gsd/clean-root-preflight.ts +284 -8
- package/src/resources/extensions/gsd/commands/catalog.ts +10 -1
- package/src/resources/extensions/gsd/commands/handlers/core.ts +41 -0
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +21 -0
- package/src/resources/extensions/gsd/commands-bootstrap.ts +10 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +2 -0
- package/src/resources/extensions/gsd/commands-mcp-status.ts +8 -0
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +17 -4
- package/src/resources/extensions/gsd/commands-verdict.ts +202 -0
- package/src/resources/extensions/gsd/crash-recovery.ts +55 -6
- package/src/resources/extensions/gsd/db/auto-workers.ts +37 -0
- package/src/resources/extensions/gsd/db/milestone-leases.ts +26 -0
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +4 -3
- package/src/resources/extensions/gsd/db-base-schema.ts +2 -0
- package/src/resources/extensions/gsd/db-migration-steps.ts +5 -0
- package/src/resources/extensions/gsd/db-task-slice-rows.ts +4 -0
- package/src/resources/extensions/gsd/dispatch-guard.ts +60 -2
- package/src/resources/extensions/gsd/docs/preferences-reference.md +10 -0
- package/src/resources/extensions/gsd/doctor-git-checks.ts +73 -3
- package/src/resources/extensions/gsd/doctor-proactive.ts +18 -2
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +25 -13
- package/src/resources/extensions/gsd/doctor-types.ts +2 -0
- package/src/resources/extensions/gsd/doctor.ts +2 -27
- package/src/resources/extensions/gsd/export-html.ts +27 -427
- package/src/resources/extensions/gsd/forensics.ts +9 -3
- package/src/resources/extensions/gsd/git-conflict-state.ts +23 -0
- package/src/resources/extensions/gsd/git-service.ts +182 -16
- package/src/resources/extensions/gsd/gsd-db.ts +80 -31
- package/src/resources/extensions/gsd/guided-flow-queue.ts +4 -3
- package/src/resources/extensions/gsd/guided-flow.ts +142 -134
- package/src/resources/extensions/gsd/guided-unit-context.ts +30 -0
- package/src/resources/extensions/gsd/init-wizard.ts +17 -2
- package/src/resources/extensions/gsd/journal.ts +8 -1
- package/src/resources/extensions/gsd/markdown-renderer.ts +14 -11
- package/src/resources/extensions/gsd/mcp-filter.ts +80 -0
- package/src/resources/extensions/gsd/migrate/parsers.ts +139 -2
- package/src/resources/extensions/gsd/migration-auto-check.ts +15 -23
- package/src/resources/extensions/gsd/milestone-actions.ts +10 -4
- package/src/resources/extensions/gsd/native-git-bridge.ts +63 -14
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +3 -0
- package/src/resources/extensions/gsd/paths.ts +5 -0
- package/src/resources/extensions/gsd/pending-auto-start.ts +79 -0
- package/src/resources/extensions/gsd/planning-path-scope.ts +10 -2
- package/src/resources/extensions/gsd/post-execution-checks.ts +87 -12
- package/src/resources/extensions/gsd/pre-execution-checks.ts +67 -19
- package/src/resources/extensions/gsd/preferences-mcp.ts +27 -0
- package/src/resources/extensions/gsd/preferences-models.ts +6 -4
- package/src/resources/extensions/gsd/preferences-types.ts +35 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +154 -0
- package/src/resources/extensions/gsd/preferences.ts +39 -0
- package/src/resources/extensions/gsd/prompt-loader.ts +1 -1
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +8 -8
- package/src/resources/extensions/gsd/prompts/discuss.md +9 -9
- package/src/resources/extensions/gsd/prompts/forensics.md +3 -3
- package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
- package/src/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
- package/src/resources/extensions/gsd/prompts/plan-slice.md +4 -4
- package/src/resources/extensions/gsd/prompts/queue.md +4 -4
- package/src/resources/extensions/gsd/prompts/reactive-execute.md +1 -1
- package/src/resources/extensions/gsd/prompts/refine-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/src/resources/extensions/gsd/queue-reorder-ui.ts +31 -13
- package/src/resources/extensions/gsd/repo-identity.ts +45 -25
- package/src/resources/extensions/gsd/repository-registry.ts +77 -0
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +2 -0
- package/src/resources/extensions/gsd/safety/evidence-cross-ref.ts +54 -19
- package/src/resources/extensions/gsd/session-lock.ts +15 -2
- package/src/resources/extensions/gsd/slice-parallel-conflict.ts +2 -2
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +75 -3
- package/src/resources/extensions/gsd/smart-entry-routing.ts +77 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/merge-state.ts +8 -1
- package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +12 -15
- package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +17 -25
- package/src/resources/extensions/gsd/state.ts +33 -7
- package/src/resources/extensions/gsd/status-guards.ts +16 -2
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +1 -0
- package/src/resources/extensions/gsd/templates/plan.md +9 -5
- package/src/resources/extensions/gsd/templates/task-plan.md +10 -2
- package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-abort-pause-regression.test.ts +10 -1
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +71 -0
- package/src/resources/extensions/gsd/tests/auto-deterministic-error-classification-4973.test.ts +116 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +775 -34
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +245 -28
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +151 -12
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +53 -2
- package/src/resources/extensions/gsd/tests/auto-post-unit-step-message.test.ts +18 -6
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +136 -13
- package/src/resources/extensions/gsd/tests/auto-remote-session-lock-cleanup.test.ts +64 -0
- package/src/resources/extensions/gsd/tests/auto-retry-mcp-churn-fixes.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/auto-stop-notification.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/auto-workers.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-registry.test.ts +69 -1
- package/src/resources/extensions/gsd/tests/autocomplete-regressions-1675.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/brief-command.test.ts +89 -0
- package/src/resources/extensions/gsd/tests/checkout-branch-stash-guard.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +170 -3
- package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +32 -4
- package/src/resources/extensions/gsd/tests/closeout-git-deferral.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/commands-verdict.test.ts +378 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +55 -2
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +60 -9
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +3 -1
- package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +104 -2
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/db-authority-regression.test.ts +208 -0
- package/src/resources/extensions/gsd/tests/db-task-slice-rows.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +61 -2
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +139 -1
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +68 -1
- package/src/resources/extensions/gsd/tests/dispatch-missing-task-plans.test.ts +140 -1
- package/src/resources/extensions/gsd/tests/doctor-empty-worktree.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/doctor-forensics-db-open-regression.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/evidence-cross-ref.test.ts +97 -0
- package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +99 -1
- package/src/resources/extensions/gsd/tests/execution-entry-missing-context-4671.test.ts +15 -1
- package/src/resources/extensions/gsd/tests/export-html-enhancements.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +28 -0
- package/src/resources/extensions/gsd/tests/gsdroot-worktree-detection.test.ts +5 -2
- package/src/resources/extensions/gsd/tests/guided-discuss-project-prompt-rendering.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +106 -0
- package/src/resources/extensions/gsd/tests/guided-flow-session-isolation.test.ts +59 -11
- package/src/resources/extensions/gsd/tests/guided-flow.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/guided-tool-contract.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +7 -7
- package/src/resources/extensions/gsd/tests/hook-model-resolution.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/infra-error.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/init-prefs-routing.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +36 -1
- package/src/resources/extensions/gsd/tests/integration/doctor-proactive.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/integration/doctor-runtime.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +226 -2
- package/src/resources/extensions/gsd/tests/integration/state-machine-edge-cases.test.ts +5 -21
- package/src/resources/extensions/gsd/tests/integration/state-machine-live-validation.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/integration/state-machine-runtime-failures.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/interrupted-session-auto.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +49 -3
- package/src/resources/extensions/gsd/tests/journal.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/mcp-filter.test.ts +287 -0
- package/src/resources/extensions/gsd/tests/mcp-status.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/merge-db-cycle.test.ts +179 -0
- package/src/resources/extensions/gsd/tests/merge-self-branch-guard.test.ts +21 -40
- package/src/resources/extensions/gsd/tests/migrate-validator-parsers.test.ts +59 -1
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +26 -18
- package/src/resources/extensions/gsd/tests/milestone-merge-stash-restore.test.ts +60 -0
- package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +80 -2
- package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +121 -1
- package/src/resources/extensions/gsd/tests/parallel-orchestrator-zombie-cleanup.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +55 -1
- package/src/resources/extensions/gsd/tests/pending-autostart-scope.test.ts +29 -5
- package/src/resources/extensions/gsd/tests/pipeline-variant-dispatch.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +343 -3
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +18 -1
- package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +79 -1
- package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +105 -3
- package/src/resources/extensions/gsd/tests/post-unit-git-failure.test.ts +8 -1
- package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +84 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +147 -0
- package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/preferences-mcp.test.ts +128 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +75 -0
- package/src/resources/extensions/gsd/tests/prefs-missing-models-crash.test.ts +148 -0
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +79 -0
- package/src/resources/extensions/gsd/tests/progressive-planning.test.ts +42 -1
- package/src/resources/extensions/gsd/tests/prompt-loader.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +37 -1
- package/src/resources/extensions/gsd/tests/quality-gates.test.ts +6 -0
- package/src/resources/extensions/gsd/tests/queue-reorder-ui.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/remediation-completion-guard.test.ts +89 -2
- package/src/resources/extensions/gsd/tests/repo-identity-worktree.test.ts +28 -1
- package/src/resources/extensions/gsd/tests/repository-registry.test.ts +52 -0
- package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +2 -3
- package/src/resources/extensions/gsd/tests/session-lock-regression.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +59 -1
- package/src/resources/extensions/gsd/tests/slice-parallel-conflict.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +112 -1
- package/src/resources/extensions/gsd/tests/smart-entry-routing.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +94 -2
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +6 -0
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +119 -23
- package/src/resources/extensions/gsd/tests/status-guards.test.ts +17 -1
- package/src/resources/extensions/gsd/tests/stuck-state-via-db.test.ts +64 -1
- package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +7 -3
- package/src/resources/extensions/gsd/tests/tui-render-kit.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +131 -9
- package/src/resources/extensions/gsd/tests/uok-gitops-turn-action.test.ts +111 -1
- package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +29 -2
- package/src/resources/extensions/gsd/tests/validate-milestone-write-order.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +42 -1
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +188 -1
- package/src/resources/extensions/gsd/tests/verification-verdict.test.ts +78 -0
- package/src/resources/extensions/gsd/tests/workflow-kernel.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +19 -1
- package/src/resources/extensions/gsd/tests/workflow-memory-pressure.test.ts +21 -1
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +153 -1
- package/src/resources/extensions/gsd/tests/worktree-git-pathspec.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +64 -12
- package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +73 -2
- package/src/resources/extensions/gsd/tests/worktree-preferences-sync.test.ts +25 -0
- package/src/resources/extensions/gsd/tests/worktree-safety.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +95 -0
- package/src/resources/extensions/gsd/tests/worktree-telemetry.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/worktree-write-gate.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +59 -0
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +18 -10
- package/src/resources/extensions/gsd/tools/complete-slice.ts +57 -10
- package/src/resources/extensions/gsd/tools/exec-tool.ts +98 -5
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +5 -1
- package/src/resources/extensions/gsd/tools/plan-slice.ts +172 -12
- package/src/resources/extensions/gsd/tools/validate-milestone.ts +31 -0
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +166 -17
- package/src/resources/extensions/gsd/tui/render-kit.ts +44 -0
- package/src/resources/extensions/gsd/types.ts +1 -1
- package/src/resources/extensions/gsd/unit-context-composer.ts +3 -0
- package/src/resources/extensions/gsd/unit-context-manifest.ts +86 -19
- package/src/resources/extensions/gsd/validation.ts +23 -1
- package/src/resources/extensions/gsd/verification-gate.ts +170 -6
- package/src/resources/extensions/gsd/verification-verdict.ts +47 -0
- package/src/resources/extensions/gsd/watch/header-renderer.ts +35 -24
- package/src/resources/extensions/gsd/workflow-manifest.ts +2 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +18 -1
- package/src/resources/extensions/gsd/workflow-projections.ts +6 -8
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +98 -20
- package/src/resources/extensions/gsd/worktree-manager.ts +14 -2
- package/src/resources/extensions/gsd/worktree-safety.ts +57 -10
- package/src/resources/extensions/gsd/worktree-state-projection.ts +43 -0
- package/src/resources/extensions/gsd/worktree-telemetry.ts +39 -0
- package/src/resources/extensions/shared/html-shell.ts +412 -0
- package/src/resources/extensions/shared/interview-ui.ts +6 -4
- package/src/resources/extensions/shared/next-action-ui.ts +11 -5
- package/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +15 -0
- package/src/resources/extensions/shared/tests/next-action-ui-hasui.test.ts +32 -0
- package/src/resources/extensions/subagent/index.ts +567 -103
- package/src/resources/extensions/subagent/launch.ts +131 -0
- package/src/resources/extensions/subagent/run-store.ts +218 -0
- package/src/resources/extensions/subagent/tests/launch.test.ts +115 -0
- package/src/resources/extensions/subagent/tests/run-store.test.ts +111 -0
- package/src/resources/extensions/ttsr/ttsr-manager.ts +5 -1
- package/src/resources/extensions/visual-brief/artifact-policy.ts +41 -0
- package/src/resources/extensions/visual-brief/extension-manifest.json +8 -0
- package/src/resources/extensions/visual-brief/index.ts +8 -0
- package/src/resources/extensions/visual-brief/page-contract.ts +136 -0
- package/src/resources/extensions/visual-brief/prompts.ts +183 -0
- package/src/resources/extensions/visual-brief/tests/visual-brief.test.ts +212 -0
- package/src/resources/skills/forensics/SKILL.md +1 -1
- package/dist/web/standalone/.next/server/chunks/5822.js +0 -2
- package/dist/web/standalone/.next/static/chunks/2556.0527fea66e123b7f.js +0 -1
- package/dist/web/standalone/.next/static/chunks/8359.e059d86b255fce1c.js +0 -10
- package/dist/web/standalone/.next/static/chunks/9441.1081da1125d1764f.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/layout-a16c7a7ecdf0c2cf.js +0 -1
- package/dist/web/standalone/.next/static/css/54ec2745c1da488b.css +0 -1
- package/dist/web/standalone/.next/static/css/de70bee13400563f.css +0 -1
- package/dist/web/standalone/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/747892c23ea88013-s.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/8d697b304b401681-s.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/9610d9e46709d722-s.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
- /package/dist/web/standalone/.next/static/{YEvjuT-fsFfYQhDSWtueS → w_ikFkx_-OHxisG9xjz4u}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{YEvjuT-fsFfYQhDSWtueS → w_ikFkx_-OHxisG9xjz4u}/_ssgManifest.js +0 -0
|
@@ -468,17 +468,18 @@ export function registerDbTools(pi) {
|
|
|
468
468
|
promptGuidelines: [
|
|
469
469
|
"Use gsd_plan_milestone for milestone planning instead of writing ROADMAP.md directly.",
|
|
470
470
|
"Keep parameters flat and provide the full milestone planning payload, including slices.",
|
|
471
|
+
"Milestone and slice titles must not contain forward slash (/), en dash, or em dash characters.",
|
|
471
472
|
"The tool validates input, writes milestone and slice planning data transactionally, renders ROADMAP.md from DB, and clears both state and parse caches after success.",
|
|
472
473
|
"Use the canonical name gsd_plan_milestone; gsd_milestone_plan is only an alias.",
|
|
473
474
|
],
|
|
474
475
|
parameters: Type.Object({
|
|
475
476
|
// ── Core identification + content (required) ──────────────────────
|
|
476
477
|
milestoneId: Type.String({ description: "Milestone ID (e.g. M001)" }),
|
|
477
|
-
title: Type.String({ description: "Milestone title" }),
|
|
478
|
+
title: Type.String({ description: "Milestone title; must not contain forward slash (/), en dash, or em dash characters" }),
|
|
478
479
|
vision: Type.String({ description: "Milestone vision" }),
|
|
479
480
|
slices: Type.Array(Type.Object({
|
|
480
481
|
sliceId: Type.String({ description: "Slice ID (e.g. S01)" }),
|
|
481
|
-
title: Type.String({ description: "Slice title" }),
|
|
482
|
+
title: Type.String({ description: "Slice title; must not contain forward slash (/), en dash, or em dash characters" }),
|
|
482
483
|
risk: Type.String({ description: "Slice risk" }),
|
|
483
484
|
depends: Type.Array(Type.String(), { description: "Slice dependency IDs" }),
|
|
484
485
|
demo: Type.String({ description: "Roadmap demo text / After this" }),
|
|
@@ -546,10 +547,10 @@ export function registerDbTools(pi) {
|
|
|
546
547
|
title: Type.String({ description: "Task title" }),
|
|
547
548
|
description: Type.String({ description: "Task description / steps block" }),
|
|
548
549
|
estimate: Type.String({ description: "Task estimate string" }),
|
|
549
|
-
files: Type.Array(Type.String(), { description: "
|
|
550
|
+
files: Type.Array(Type.String(), { description: "Array<string> of files likely touched; pass [\"path\"] or [], never a single string" }),
|
|
550
551
|
verify: Type.String({ description: "Verification command or block" }),
|
|
551
|
-
inputs: Type.Array(Type.String(), { description: "
|
|
552
|
-
expectedOutput: Type.Array(Type.String(), { description: "
|
|
552
|
+
inputs: Type.Array(Type.String(), { description: "Array<string> of input files or references; pass [\"path\"] or [], never a single string" }),
|
|
553
|
+
expectedOutput: Type.Array(Type.String(), { description: "Array<string> of expected output files or artifacts; pass [\"path\"] or [], never a single string" }),
|
|
553
554
|
observabilityImpact: Type.Optional(Type.String({ description: "Task observability impact" })),
|
|
554
555
|
}), { description: "Planned tasks for the slice" }),
|
|
555
556
|
// ── Enrichment metadata (optional — defaults to empty) ────────────
|
|
@@ -622,10 +623,10 @@ export function registerDbTools(pi) {
|
|
|
622
623
|
title: Type.String({ description: "Task title" }),
|
|
623
624
|
description: Type.String({ description: "Task description / steps block" }),
|
|
624
625
|
estimate: Type.String({ description: "Task estimate string" }),
|
|
625
|
-
files: Type.Array(Type.String(), { description: "
|
|
626
|
+
files: Type.Array(Type.String(), { description: "Array<string> of files likely touched; pass [\"path\"] or [], never a single string" }),
|
|
626
627
|
verify: Type.String({ description: "Verification command or block" }),
|
|
627
|
-
inputs: Type.Array(Type.String(), { description: "
|
|
628
|
-
expectedOutput: Type.Array(Type.String(), { description: "
|
|
628
|
+
inputs: Type.Array(Type.String(), { description: "Array<string> of input files or references; pass [\"path\"] or [], never a single string" }),
|
|
629
|
+
expectedOutput: Type.Array(Type.String(), { description: "Array<string> of expected output files or artifacts; pass [\"path\"] or [], never a single string" }),
|
|
629
630
|
observabilityImpact: Type.Optional(Type.String({ description: "Task observability impact" })),
|
|
630
631
|
// Single-writer v3 audit trail (Stream 2): caller-provided actor identity + causation.
|
|
631
632
|
actorName: Type.Optional(Type.String({ description: "Caller-provided actor identity for the audit trail (e.g. 'executor-01', 'gsd-orchestrator')" })),
|
|
@@ -847,7 +848,7 @@ export function registerDbTools(pi) {
|
|
|
847
848
|
name: "gsd_skip_slice",
|
|
848
849
|
label: "Skip Slice",
|
|
849
850
|
description: "Mark a slice as skipped so auto-mode advances past it without executing. " +
|
|
850
|
-
"Non-closed tasks within the slice are cascaded to skipped so milestone completion is not blocked by leftover pending tasks
|
|
851
|
+
"Non-closed tasks within the slice are cascaded to skipped so milestone completion is not blocked by leftover pending tasks. " +
|
|
851
852
|
"The slice data is preserved for reference. The state machine treats skipped slices like completed ones for dependency satisfaction.",
|
|
852
853
|
promptSnippet: "Skip a GSD slice (mark as skipped, auto-mode will advance past it)",
|
|
853
854
|
promptGuidelines: [
|
|
@@ -918,6 +919,8 @@ export function registerDbTools(pi) {
|
|
|
918
919
|
promptGuidelines: [
|
|
919
920
|
"Use gsd_validate_milestone when all slices are done and the milestone needs validation before completion.",
|
|
920
921
|
"Parameters: milestoneId, verdict, remediationRound, successCriteriaChecklist, sliceDeliveryAudit, crossSliceIntegration, requirementCoverage, verificationClasses (optional), verdictRationale, remediationPlan (optional).",
|
|
922
|
+
"If verification classes were planned, verificationClasses must include canonical class rows using the exact class names Contract, Integration, Operational, and UAT when present in planning.",
|
|
923
|
+
"Planned verification text marked as none/not required/not applicable/N/A (including suffixed variants such as 'not required - backend-only') is treated as not applicable and does not require a class row.",
|
|
921
924
|
"If verdict is 'needs-remediation', also provide remediationPlan and use gsd_reassess_roadmap to add remediation slices to the roadmap.",
|
|
922
925
|
"On success, returns validationPath where VALIDATION.md was written.",
|
|
923
926
|
],
|
|
@@ -929,7 +932,7 @@ export function registerDbTools(pi) {
|
|
|
929
932
|
sliceDeliveryAudit: Type.String({ description: "Markdown table auditing each slice's claimed vs delivered output" }),
|
|
930
933
|
crossSliceIntegration: Type.String({ description: "Markdown describing any cross-slice boundary mismatches" }),
|
|
931
934
|
requirementCoverage: Type.String({ description: "Markdown describing any unaddressed requirements" }),
|
|
932
|
-
verificationClasses: Type.Optional(Type.String({ description: "Markdown describing verification class compliance and gaps" })),
|
|
935
|
+
verificationClasses: Type.Optional(Type.String({ description: "Markdown describing verification class compliance and gaps using canonical class names (Contract, Integration, Operational, UAT) for each applicable planned class" })),
|
|
933
936
|
verdictRationale: Type.String({ description: "Why this verdict was chosen" }),
|
|
934
937
|
remediationPlan: Type.Optional(Type.String({ description: "Remediation plan (required if verdict is needs-remediation)" })),
|
|
935
938
|
}),
|
|
@@ -24,6 +24,7 @@ import { resolveWorktreeProjectRoot } from "../worktree-root.js";
|
|
|
24
24
|
import { extractSubagentAgentClasses } from "./subagent-input.js";
|
|
25
25
|
import { approvalGateIdForUnit, isExplicitApprovalResponse, shouldPauseForUserApprovalQuestion } from "../user-input-boundary.js";
|
|
26
26
|
import { resolveSkillManifest } from "../skill-manifest.js";
|
|
27
|
+
import { getGuidedUnitContext } from "../guided-unit-context.js";
|
|
27
28
|
let approvalQuestionAbortInFlight = false;
|
|
28
29
|
async function loadWelcomeScreenModule() {
|
|
29
30
|
const candidates = [];
|
|
@@ -436,6 +437,13 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
436
437
|
if (milestoneId)
|
|
437
438
|
markDepthVerified(milestoneId, beforeAgentBasePath);
|
|
438
439
|
clearPendingGate(beforeAgentBasePath);
|
|
440
|
+
if (isAutoPaused() && !isAutoActive()) {
|
|
441
|
+
const { resumeAutoAfterProviderDelay } = await import("./provider-error-resume.js");
|
|
442
|
+
void resumeAutoAfterProviderDelay(pi, ctx).catch((err) => {
|
|
443
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
444
|
+
ctx.ui.notify(`Failed to resume auto-mode after approval: ${message}`, "warning");
|
|
445
|
+
});
|
|
446
|
+
}
|
|
439
447
|
}
|
|
440
448
|
clearDeferredApprovalGate(beforeAgentBasePath);
|
|
441
449
|
// GSD's own context injection (existing behavior — unchanged).
|
|
@@ -560,6 +568,8 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
560
568
|
if (approvalQuestionAbortInFlight)
|
|
561
569
|
return;
|
|
562
570
|
const dash = getAutoRuntimeSnapshot();
|
|
571
|
+
if (dash.active)
|
|
572
|
+
return;
|
|
563
573
|
let unitType = dash.currentUnit?.type;
|
|
564
574
|
let unitId = dash.currentUnit?.id;
|
|
565
575
|
if (!unitType) {
|
|
@@ -675,7 +685,8 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
675
685
|
// subagent dispatch. Closes the b23 bug class where a discuss-milestone
|
|
676
686
|
// turn used the host Edit tool to modify user source files.
|
|
677
687
|
const dash = getAutoRuntimeSnapshot();
|
|
678
|
-
const
|
|
688
|
+
const guidedUnit = getGuidedUnitContext(discussionBasePath);
|
|
689
|
+
const activeUnitType = dash.currentUnit?.type ?? guidedUnit?.unitType;
|
|
679
690
|
if (activeUnitType) {
|
|
680
691
|
const manifest = resolveManifest(activeUnitType);
|
|
681
692
|
if (manifest) {
|
|
@@ -694,7 +705,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
694
705
|
// Subagent inputs use { agent }, { tasks: [{ agent }] }, or { chain: [{ agent }] }.
|
|
695
706
|
agentClasses = extractSubagentAgentClasses(event.input);
|
|
696
707
|
}
|
|
697
|
-
const planningGuard = shouldBlockPlanningUnit(event.toolName, planningInput, dash.basePath || discussionBasePath, activeUnitType, manifest.tools, agentClasses);
|
|
708
|
+
const planningGuard = shouldBlockPlanningUnit(event.toolName, planningInput, dash.basePath || guidedUnit?.basePath || discussionBasePath, activeUnitType, manifest.tools, agentClasses);
|
|
698
709
|
if (planningGuard.block)
|
|
699
710
|
return planningGuard;
|
|
700
711
|
}
|
|
@@ -704,8 +715,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
704
715
|
// git.isolation=worktree but auto-mode hasn't created the milestone
|
|
705
716
|
// worktree yet. Without this, writes silently orphan outside git history.
|
|
706
717
|
if (isToolCallEventType("write", event) || isToolCallEventType("edit", event)) {
|
|
707
|
-
const
|
|
708
|
-
const wtGuard = shouldBlockWorktreeWrite(event.toolName, event.input.path, wtBasePath, isAutoActive(), dash.currentUnit?.type);
|
|
718
|
+
const wtGuard = shouldBlockWorktreeWrite(event.toolName, event.input.path, dash.basePath ?? discussionBasePath, isAutoActive(), dash.currentUnit?.type);
|
|
709
719
|
if (wtGuard.block)
|
|
710
720
|
return wtGuard;
|
|
711
721
|
}
|
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
export function extractSubagentAgentClasses(input) {
|
|
2
2
|
if (!input || typeof input !== "object")
|
|
3
3
|
return [];
|
|
4
|
-
const record = input;
|
|
5
4
|
const agentClasses = [];
|
|
5
|
+
const visited = new WeakSet();
|
|
6
6
|
const addAgentClass = (value) => {
|
|
7
|
-
if (typeof value
|
|
8
|
-
|
|
7
|
+
if (typeof value !== "string")
|
|
8
|
+
return;
|
|
9
|
+
const normalized = value.trim().replace(/\.md$/i, "");
|
|
10
|
+
if (normalized.length > 0)
|
|
11
|
+
agentClasses.push(normalized);
|
|
9
12
|
};
|
|
10
|
-
const
|
|
13
|
+
const visitItems = (value) => {
|
|
11
14
|
if (!Array.isArray(value))
|
|
12
15
|
return;
|
|
13
16
|
for (const item of value) {
|
|
14
|
-
|
|
15
|
-
addAgentClass(item.agent);
|
|
17
|
+
visit(item);
|
|
16
18
|
}
|
|
17
19
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const visit = (value) => {
|
|
21
|
+
if (!value || typeof value !== "object")
|
|
22
|
+
return;
|
|
23
|
+
if (visited.has(value))
|
|
24
|
+
return;
|
|
25
|
+
visited.add(value);
|
|
26
|
+
const record = value;
|
|
27
|
+
addAgentClass(record.agent);
|
|
28
|
+
visitItems(record.tasks);
|
|
29
|
+
visitItems(record.chain);
|
|
30
|
+
visitItems(record.parallel);
|
|
31
|
+
};
|
|
32
|
+
visit(input);
|
|
21
33
|
return agentClasses;
|
|
22
34
|
}
|
|
@@ -3,6 +3,7 @@ import { copyFileSync, existsSync, lstatSync, mkdirSync, readFileSync, readlinkS
|
|
|
3
3
|
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { minimatch } from "minimatch";
|
|
5
5
|
import { getIsolationMode } from "../preferences.js";
|
|
6
|
+
import { compileSubagentPermissionContract } from "../unit-context-manifest.js";
|
|
6
7
|
import { logWarning } from "../workflow-logger.js";
|
|
7
8
|
import { isGsdWorktreePath, resolveWorktreeProjectRoot } from "../worktree-root.js";
|
|
8
9
|
/**
|
|
@@ -57,7 +58,8 @@ const QUEUE_SAFE_TOOLS = new Set([
|
|
|
57
58
|
* env / printenv — print environment variables
|
|
58
59
|
* true / false — shell no-ops / test exit codes
|
|
59
60
|
*/
|
|
60
|
-
const BASH_READ_ONLY_RE = /^\s*(cat|head|tail|less|more|wc|file|stat|du|df|which|type|echo|printf|ls|find|grep|rg|awk|sed\b(?!.*-i)|sort|uniq|diff|comm|tr|cut|tee\s+-a\s+\/dev\/null|git\s+(log|show|diff|status|branch|tag|remote|rev-parse|ls-files|blame|shortlog|describe|stash\s+list|config\s+--get|cat-file)|gh\s+(issue|pr|api|repo|release)\s+(view|list|diff|status|checks)|mkdir\s+-p\s+\.gsd|rtk\s|npm\s+run\s+(test|test:\w+|lint|lint:\w+|typecheck|type-check|type-check:\w+|check|verify|audit|outdated|format:check|ci|validate)\b|npm\s+(ls|list|info|view|show|outdated|audit|explain|doctor|ping|--version|-v)\b|npx\s|tsx\s|node\s+(--print|--version|-v\b)|python[23]?\s+(-c\s+'[^']*'|--version|-V\b|-m\s+(pip\s+show|pip\s+list|site))|pip[23]?\s+(show|list|freeze|check|index\s+versions)\b|jq\s|yq\s|curl\s+(-s\b|--silent\b)(?!\s+[^|>]*\s-[oO]\b)(?!\s+[^|>]*\s--output\b)[^|>]*$|openssl\s+(version|x509|s_client)|env\b|printenv\b|true\b|false\b)/;
|
|
61
|
+
const BASH_READ_ONLY_RE = /^\s*((?:cd|pushd|popd)(?:\s|$)|cat|head|tail|less|more|wc|file|stat|du|df|which|type|echo|printf|ls|find|grep|rg|awk|sed\b(?!.*-i)|sort|uniq|diff|comm|tr|cut|tee\s+-a\s+\/dev\/null|git\s+(log|show|diff|status|branch|tag|remote|rev-parse|ls-files|blame|shortlog|describe|stash\s+list|config\s+--get|cat-file)|gh\s+(issue|pr|api|repo|release)\s+(view|list|diff|status|checks)|mkdir\s+-p\s+\.gsd|rtk\s|npm\s+run\s+(test|test:\w+|lint|lint:\w+|typecheck|type-check|type-check:\w+|check|verify|audit|outdated|format:check|ci|validate)\b|npm\s+(ls|list|info|view|show|outdated|audit|explain|doctor|ping|--version|-v)\b|npx\s|tsx\s|node\s+(--print|--version|-v\b)|python[23]?\s+(-c\s+'[^']*'|--version|-V\b|-m\s+(pip\s+show|pip\s+list|site))|pip[23]?\s+(show|list|freeze|check|index\s+versions)\b|jq\s|yq\s|curl\s+(-s\b|--silent\b)(?!\s+[^|>]*\s-[oO]\b)(?!\s+[^|>]*\s--output\b)[^|>]*$|openssl\s+(version|x509|s_client)|env\b|printenv\b|true\b|false\b)/;
|
|
62
|
+
const BASH_VERIFICATION_RE = /^\s*(npm\s+(run\s+(build|test|test:\w+|lint|lint:\w+|typecheck|type-check|verify|ci|validate)\b|test\b)|pnpm\s+(build|test|lint|typecheck|verify)\b|yarn\s+(build|test|lint|typecheck|verify)\b|vitest\b|jest\b|go\s+test\b)/;
|
|
61
63
|
function createEmptyWriteGateState() {
|
|
62
64
|
return {
|
|
63
65
|
verifiedDepthMilestones: new Set(),
|
|
@@ -623,7 +625,7 @@ function matchesAllowedGlob(absPath, basePath, globs) {
|
|
|
623
625
|
function blockReason(unitType, mode, what) {
|
|
624
626
|
return [
|
|
625
627
|
`HARD BLOCK: unit "${unitType}" runs under tools-policy "${mode}" — ${what}.`,
|
|
626
|
-
`This is a mechanical gate enforced by manifest.tools
|
|
628
|
+
`This is a mechanical gate enforced by manifest.tools. You MUST NOT proceed,`,
|
|
627
629
|
`retry the same call, or rationalize past this block. If you need to write user source,`,
|
|
628
630
|
`the work belongs in execute-task, not in a planning unit.`,
|
|
629
631
|
].join(" ");
|
|
@@ -642,6 +644,9 @@ function blockReason(unitType, mode, what) {
|
|
|
642
644
|
* and listed in the policy's allowedSubagents.
|
|
643
645
|
* - "docs" → like "planning" but also allows writes to paths
|
|
644
646
|
* matching `allowedPathGlobs` relative to basePath.
|
|
647
|
+
* - "verification"
|
|
648
|
+
* → allows Bash for project verification commands, but keeps
|
|
649
|
+
* writes restricted to .gsd/ and blocks subagent dispatch.
|
|
645
650
|
*
|
|
646
651
|
* `pathOrCommand` is the file path for write/edit-shaped tools and the
|
|
647
652
|
* shell command for bash. Other tools ignore this argument.
|
|
@@ -673,7 +678,7 @@ export function shouldBlockPlanningUnit(toolName, pathOrCommand, basePath, unitT
|
|
|
673
678
|
// Unknown tool in read-only mode — block by default.
|
|
674
679
|
return { block: true, reason: blockReason(unitType, policy.mode, `tool "${tool}" is not on the read-only allowlist`) };
|
|
675
680
|
}
|
|
676
|
-
// planning / planning-dispatch / docs modes share the same surface for safe tools, bash, and subagent.
|
|
681
|
+
// planning / planning-dispatch / docs / verification modes share the same surface for safe tools, bash, and subagent.
|
|
677
682
|
if (PLANNING_SAFE_TOOLS.has(tool))
|
|
678
683
|
return { block: false };
|
|
679
684
|
if (tool.startsWith("gsd_"))
|
|
@@ -681,7 +686,8 @@ export function shouldBlockPlanningUnit(toolName, pathOrCommand, basePath, unitT
|
|
|
681
686
|
if (PLANNING_SUBAGENT_TOOLS.has(tool)) {
|
|
682
687
|
if (policy.mode === "planning-dispatch") {
|
|
683
688
|
const requested = (agentClasses ?? []).map(a => a.trim()).filter(Boolean);
|
|
684
|
-
const
|
|
689
|
+
const dispatchContract = compileSubagentPermissionContract(policy);
|
|
690
|
+
const allowedSubagents = dispatchContract.allowedSubagents;
|
|
685
691
|
const allowed = new Set(allowedSubagents);
|
|
686
692
|
// When agentClasses is undefined, the caller has not been updated to extract
|
|
687
693
|
// agent identities yet. Block and warn so stale callers surface in telemetry
|
|
@@ -718,6 +724,14 @@ export function shouldBlockPlanningUnit(toolName, pathOrCommand, basePath, unitT
|
|
|
718
724
|
return { block: true, reason: blockReason(unitType, policy.mode, `subagent dispatch is not permitted in planning units`) };
|
|
719
725
|
}
|
|
720
726
|
if (tool === "bash") {
|
|
727
|
+
if (policy.mode === "verification") {
|
|
728
|
+
if (BASH_VERIFICATION_RE.test(pathOrCommand) || BASH_READ_ONLY_RE.test(pathOrCommand))
|
|
729
|
+
return { block: false };
|
|
730
|
+
return {
|
|
731
|
+
block: true,
|
|
732
|
+
reason: blockReason(unitType, policy.mode, `bash is restricted to build/test verification commands (npm run build, npm test, etc.); cannot run "${pathOrCommand.slice(0, 80)}${pathOrCommand.length > 80 ? "…" : ""}"`),
|
|
733
|
+
};
|
|
734
|
+
}
|
|
721
735
|
if (BASH_READ_ONLY_RE.test(pathOrCommand))
|
|
722
736
|
return { block: false };
|
|
723
737
|
return {
|
|
@@ -796,9 +810,9 @@ function isPathContained(target, container) {
|
|
|
796
810
|
* while `git.isolation: worktree` is in effect and auto-mode hasn't created
|
|
797
811
|
* (or flipped cwd into) the milestone worktree.
|
|
798
812
|
*
|
|
799
|
-
* Pure / unit-testable. Callers in `register-hooks.ts` supply the
|
|
800
|
-
* project root and current auto liveness;
|
|
801
|
-
* realpath resolution.
|
|
813
|
+
* Pure / unit-testable. Callers in `register-hooks.ts` supply the effective
|
|
814
|
+
* execution base path (worker cwd or project root) and current auto liveness;
|
|
815
|
+
* this function does no I/O beyond realpath resolution.
|
|
802
816
|
*
|
|
803
817
|
* Allow rules (in order):
|
|
804
818
|
* 1. Tool isn't a planning-write (write/edit/multi_edit/notebook_edit).
|
|
@@ -832,10 +846,11 @@ export function shouldBlockWorktreeWrite(toolName, targetPath, effectiveBasePath
|
|
|
832
846
|
].join(" "),
|
|
833
847
|
};
|
|
834
848
|
}
|
|
835
|
-
// Resolve
|
|
849
|
+
// Resolve relative targets against the effective execution base path, then
|
|
850
|
+
// canonicalize against the project root to defeat
|
|
836
851
|
// symlink-based escapes and prefix tricks (e.g. .gsd/worktrees-extra/).
|
|
837
852
|
const projectRoot = resolveWorktreeProjectRoot(effectiveBasePath);
|
|
838
|
-
const absTarget = isAbsolute(targetPath) ? targetPath : resolve(
|
|
853
|
+
const absTarget = isAbsolute(targetPath) ? targetPath : resolve(effectiveBasePath, targetPath);
|
|
839
854
|
const realTarget = realpathOrResolve(absTarget);
|
|
840
855
|
const realRoot = realpathOrResolve(projectRoot);
|
|
841
856
|
const realGsd = realpathOrResolve(join(projectRoot, ".gsd"));
|
|
@@ -8,14 +8,200 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Design constraints (from Trek-e approval):
|
|
10
10
|
* - Warn the user before stashing (no silent surprises)
|
|
11
|
-
* - git stash push / git stash
|
|
12
|
-
* - Stash/
|
|
11
|
+
* - git stash push / git stash apply+drop for targeted restore
|
|
12
|
+
* - Stash/apply errors are logged but MUST NOT block the merge itself
|
|
13
13
|
* - Fast-path status check — clean trees pay no extra cost
|
|
14
14
|
*/
|
|
15
15
|
import { execFileSync } from "node:child_process";
|
|
16
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
17
|
+
import { join } from "node:path";
|
|
16
18
|
import { GIT_NO_PROMPT_ENV } from "./git-constants.js";
|
|
17
19
|
import { logWarning } from "./workflow-logger.js";
|
|
18
20
|
import { nativeHasChanges } from "./native-git-bridge.js";
|
|
21
|
+
import { listUnmergedGitPaths } from "./git-conflict-state.js";
|
|
22
|
+
function gitText(basePath, args) {
|
|
23
|
+
return execFileSync("git", args, {
|
|
24
|
+
cwd: basePath,
|
|
25
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
26
|
+
encoding: "utf-8",
|
|
27
|
+
env: GIT_NO_PROMPT_ENV,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function gitBuffer(basePath, args) {
|
|
31
|
+
return execFileSync("git", args, {
|
|
32
|
+
cwd: basePath,
|
|
33
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
34
|
+
env: GIT_NO_PROMPT_ENV,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function errorText(err) {
|
|
38
|
+
if (!err || typeof err !== "object")
|
|
39
|
+
return String(err);
|
|
40
|
+
const parts = [];
|
|
41
|
+
const stderr = err.stderr;
|
|
42
|
+
const stdout = err.stdout;
|
|
43
|
+
for (const value of [stderr, stdout]) {
|
|
44
|
+
if (typeof value === "string")
|
|
45
|
+
parts.push(value);
|
|
46
|
+
else if (value instanceof Uint8Array)
|
|
47
|
+
parts.push(Buffer.from(value).toString("utf-8"));
|
|
48
|
+
}
|
|
49
|
+
parts.push(err instanceof Error ? err.message : String(err));
|
|
50
|
+
return parts.filter(Boolean).join("\n");
|
|
51
|
+
}
|
|
52
|
+
function parseAlreadyExistsNoCheckoutPaths(text) {
|
|
53
|
+
const paths = [];
|
|
54
|
+
for (const line of text.split(/\r?\n/)) {
|
|
55
|
+
const match = /^(.+?) already exists, no checkout$/i.exec(line.trim());
|
|
56
|
+
if (match?.[1])
|
|
57
|
+
paths.push(match[1]);
|
|
58
|
+
}
|
|
59
|
+
return [...new Set(paths)];
|
|
60
|
+
}
|
|
61
|
+
function readZeroDelimitedPaths(output) {
|
|
62
|
+
return output.split("\0").filter(Boolean);
|
|
63
|
+
}
|
|
64
|
+
function listDirtyPaths(basePath) {
|
|
65
|
+
try {
|
|
66
|
+
const paths = new Set();
|
|
67
|
+
for (const args of [
|
|
68
|
+
["diff", "--name-only", "-z"],
|
|
69
|
+
["diff", "--cached", "--name-only", "-z"],
|
|
70
|
+
["ls-files", "--others", "--exclude-standard", "-z"],
|
|
71
|
+
]) {
|
|
72
|
+
for (const path of readZeroDelimitedPaths(gitText(basePath, args))) {
|
|
73
|
+
paths.add(path);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return [...paths];
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function listMilestoneChangedPaths(basePath, milestoneId) {
|
|
83
|
+
const milestoneBranch = `milestone/${milestoneId}`;
|
|
84
|
+
try {
|
|
85
|
+
gitText(basePath, ["rev-parse", "--verify", "--quiet", `refs/heads/${milestoneBranch}`]);
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
const mergeBase = gitText(basePath, ["merge-base", "HEAD", milestoneBranch]).trim();
|
|
92
|
+
if (!mergeBase)
|
|
93
|
+
return null;
|
|
94
|
+
return readZeroDelimitedPaths(gitText(basePath, ["diff", "--name-only", "-z", mergeBase, milestoneBranch]));
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function findOverlappingDirtyMilestonePaths(basePath, milestoneId) {
|
|
101
|
+
const dirtyPaths = listDirtyPaths(basePath);
|
|
102
|
+
const changedPaths = listMilestoneChangedPaths(basePath, milestoneId);
|
|
103
|
+
if (!dirtyPaths || !changedPaths)
|
|
104
|
+
return null;
|
|
105
|
+
const changedPathSet = new Set(changedPaths.filter((path) => !path.startsWith(".gsd/")));
|
|
106
|
+
return dirtyPaths
|
|
107
|
+
.filter((path) => !path.startsWith(".gsd/") && changedPathSet.has(path))
|
|
108
|
+
.sort();
|
|
109
|
+
}
|
|
110
|
+
function listStashUntrackedPaths(basePath, stashRef) {
|
|
111
|
+
try {
|
|
112
|
+
const output = gitText(basePath, ["ls-tree", "-r", "-z", "--name-only", `${stashRef}^3`]);
|
|
113
|
+
return readZeroDelimitedPaths(output);
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function listStashTrackedPaths(basePath, stashRef) {
|
|
120
|
+
try {
|
|
121
|
+
const output = gitText(basePath, ["diff", "--name-only", "-z", `${stashRef}^1`, stashRef]);
|
|
122
|
+
return readZeroDelimitedPaths(output);
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function isWorktreeClean(basePath) {
|
|
129
|
+
try {
|
|
130
|
+
return gitText(basePath, ["status", "--porcelain"]).trim() === "";
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function stashBlobEqualsWorktreeFile(basePath, stashRef, path) {
|
|
137
|
+
try {
|
|
138
|
+
const worktreePath = join(basePath, path);
|
|
139
|
+
if (!existsSync(worktreePath))
|
|
140
|
+
return false;
|
|
141
|
+
const worktreeContent = readFileSync(worktreePath);
|
|
142
|
+
const stashContent = gitBuffer(basePath, ["show", `${stashRef}^3:${path}`]);
|
|
143
|
+
return Buffer.compare(worktreeContent, stashContent) === 0;
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function reconcileAlreadyPresentUntrackedStash(basePath, milestoneId, stashRef, err) {
|
|
150
|
+
const text = errorText(err);
|
|
151
|
+
const collidedPaths = parseAlreadyExistsNoCheckoutPaths(text);
|
|
152
|
+
if (collidedPaths.length === 0)
|
|
153
|
+
return null;
|
|
154
|
+
const untrackedPaths = listStashUntrackedPaths(basePath, stashRef);
|
|
155
|
+
if (!untrackedPaths || untrackedPaths.length === 0)
|
|
156
|
+
return null;
|
|
157
|
+
const trackedPaths = listStashTrackedPaths(basePath, stashRef);
|
|
158
|
+
if (trackedPaths === null || trackedPaths.length > 0)
|
|
159
|
+
return null;
|
|
160
|
+
const untrackedPathSet = new Set(untrackedPaths);
|
|
161
|
+
if (!collidedPaths.every((path) => untrackedPathSet.has(path)))
|
|
162
|
+
return null;
|
|
163
|
+
if (!untrackedPaths.every((path) => existsSync(join(basePath, path))))
|
|
164
|
+
return null;
|
|
165
|
+
if (isWorktreeClean(basePath) !== true)
|
|
166
|
+
return null;
|
|
167
|
+
const blobComparisons = untrackedPaths.map((path) => stashBlobEqualsWorktreeFile(basePath, stashRef, path));
|
|
168
|
+
if (blobComparisons.some((result) => result === null))
|
|
169
|
+
return null;
|
|
170
|
+
const allIdentical = blobComparisons.every(Boolean);
|
|
171
|
+
if (allIdentical) {
|
|
172
|
+
let dropped = true;
|
|
173
|
+
try {
|
|
174
|
+
execFileSync("git", ["stash", "drop", stashRef], {
|
|
175
|
+
cwd: basePath,
|
|
176
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
177
|
+
encoding: "utf-8",
|
|
178
|
+
env: GIT_NO_PROMPT_ENV,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
catch (err) {
|
|
182
|
+
dropped = false;
|
|
183
|
+
logWarning("preflight", `git stash drop ${stashRef} failed after identical preflight stash reconciliation: ${err instanceof Error ? err.message : String(err)}`);
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
restored: true,
|
|
187
|
+
needsManualRecovery: false,
|
|
188
|
+
message: dropped
|
|
189
|
+
? `Preflight stash for milestone ${milestoneId} contained files already present after merge; identical stash dropped.`
|
|
190
|
+
: `Preflight stash for milestone ${milestoneId} contained files already present after merge, but ${stashRef} could not be dropped and remains as a backup.`,
|
|
191
|
+
stashRef,
|
|
192
|
+
resolution: dropped ? "already-present-dropped" : "already-present-preserved",
|
|
193
|
+
collidedPaths,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
restored: false,
|
|
198
|
+
needsManualRecovery: false,
|
|
199
|
+
message: `Preflight stash for milestone ${milestoneId} contained untracked files already present after merge. Keeping merged files and preserving ${stashRef} as a backup.`,
|
|
200
|
+
stashRef,
|
|
201
|
+
resolution: "already-present-preserved",
|
|
202
|
+
collidedPaths,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
19
205
|
function findPreflightStashRef(basePath, milestoneId, stashMarker) {
|
|
20
206
|
const markerPrefix = `gsd-preflight-stash:${milestoneId}:`;
|
|
21
207
|
let fallbackRef = null;
|
|
@@ -67,6 +253,56 @@ export function preflightCleanRoot(basePath, milestoneId, notify) {
|
|
|
67
253
|
if (!isDirty) {
|
|
68
254
|
return { stashPushed: false, summary: "" };
|
|
69
255
|
}
|
|
256
|
+
const conflictedPaths = listUnmergedGitPaths(basePath);
|
|
257
|
+
if (conflictedPaths === null) {
|
|
258
|
+
const msg = `Unable to verify unresolved Git conflicts before milestone ${milestoneId} merge. ` +
|
|
259
|
+
`Resolve Git/worktree state manually before resuming auto-mode.`;
|
|
260
|
+
notify(msg, "error");
|
|
261
|
+
return {
|
|
262
|
+
stashPushed: false,
|
|
263
|
+
blocked: true,
|
|
264
|
+
blockedReason: "unmerged-conflicts-eval-failed",
|
|
265
|
+
conflictedPaths: null,
|
|
266
|
+
summary: msg,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
if (conflictedPaths.length > 0) {
|
|
270
|
+
const msg = `Working tree has unresolved Git conflicts before milestone ${milestoneId} merge: ` +
|
|
271
|
+
`${conflictedPaths.join(", ")}. Resolve these files manually before resuming auto-mode.`;
|
|
272
|
+
notify(msg, "error");
|
|
273
|
+
return {
|
|
274
|
+
stashPushed: false,
|
|
275
|
+
blocked: true,
|
|
276
|
+
blockedReason: "unmerged-conflicts",
|
|
277
|
+
conflictedPaths,
|
|
278
|
+
summary: msg,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
const overlappingPaths = findOverlappingDirtyMilestonePaths(basePath, milestoneId);
|
|
282
|
+
if (overlappingPaths === null) {
|
|
283
|
+
const msg = `Unable to verify dirty-path overlap for milestone ${milestoneId}. ` +
|
|
284
|
+
`Resolve Git/worktree state manually before resuming auto-mode.`;
|
|
285
|
+
notify(msg, "error");
|
|
286
|
+
return {
|
|
287
|
+
stashPushed: false,
|
|
288
|
+
blocked: true,
|
|
289
|
+
blockedReason: "dirty-overlap-eval-failed",
|
|
290
|
+
overlappingPaths: null,
|
|
291
|
+
summary: msg,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
if (overlappingPaths && overlappingPaths.length > 0) {
|
|
295
|
+
const msg = `Working tree has uncommitted files that overlap milestone ${milestoneId} changes: ` +
|
|
296
|
+
`${overlappingPaths.join(", ")}. Commit, stash, or discard those files before resuming auto-mode.`;
|
|
297
|
+
notify(msg, "error");
|
|
298
|
+
return {
|
|
299
|
+
stashPushed: false,
|
|
300
|
+
blocked: true,
|
|
301
|
+
blockedReason: "dirty-overlap",
|
|
302
|
+
overlappingPaths,
|
|
303
|
+
summary: msg,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
70
306
|
// Warn the user before stashing
|
|
71
307
|
const warnMsg = `Working tree has uncommitted changes before milestone ${milestoneId} merge. Auto-stashing to allow clean merge (stash will be restored after merge).`;
|
|
72
308
|
notify(warnMsg, "warning");
|
|
@@ -115,28 +351,50 @@ export function postflightPopStash(basePath, milestoneId, stashMarker, notify) {
|
|
|
115
351
|
message: msg,
|
|
116
352
|
};
|
|
117
353
|
}
|
|
118
|
-
execFileSync("git", ["stash", "
|
|
354
|
+
execFileSync("git", ["stash", "apply", stashRef], {
|
|
119
355
|
cwd: basePath,
|
|
120
356
|
stdio: ["ignore", "pipe", "pipe"],
|
|
121
357
|
encoding: "utf-8",
|
|
122
358
|
env: GIT_NO_PROMPT_ENV,
|
|
123
359
|
});
|
|
360
|
+
let dropWarning = null;
|
|
361
|
+
try {
|
|
362
|
+
execFileSync("git", ["stash", "drop", stashRef], {
|
|
363
|
+
cwd: basePath,
|
|
364
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
365
|
+
encoding: "utf-8",
|
|
366
|
+
env: GIT_NO_PROMPT_ENV,
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
catch (err) {
|
|
370
|
+
dropWarning = ` Stash was restored, but git stash drop ${stashRef} failed: ${err instanceof Error ? err.message : String(err)}.`;
|
|
371
|
+
logWarning("preflight", dropWarning.trim());
|
|
372
|
+
}
|
|
124
373
|
const msg = `Restored stashed changes after milestone ${milestoneId} merge.`;
|
|
125
|
-
notify(msg
|
|
374
|
+
notify(`${msg}${dropWarning ?? ""}`, dropWarning ? "warning" : "info");
|
|
126
375
|
return {
|
|
127
376
|
restored: true,
|
|
128
377
|
needsManualRecovery: false,
|
|
129
|
-
message: msg
|
|
378
|
+
message: `${msg}${dropWarning ?? ""}`,
|
|
130
379
|
stashRef,
|
|
380
|
+
resolution: "applied",
|
|
131
381
|
};
|
|
132
382
|
}
|
|
133
383
|
catch (err) {
|
|
134
|
-
|
|
384
|
+
if (stashRef) {
|
|
385
|
+
const reconciled = reconcileAlreadyPresentUntrackedStash(basePath, milestoneId, stashRef, err);
|
|
386
|
+
if (reconciled) {
|
|
387
|
+
logWarning("preflight", reconciled.message);
|
|
388
|
+
notify(reconciled.message, reconciled.resolution === "already-present-preserved" ? "warning" : "info");
|
|
389
|
+
return reconciled;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
// Apply conflicts mean the merged code collides with the stashed changes.
|
|
135
393
|
// Log a warning — the user needs to resolve manually, but the merge succeeded.
|
|
136
394
|
const restoreHint = stashRef
|
|
137
|
-
? `Run "git stash
|
|
395
|
+
? `Run "git stash apply ${stashRef}" manually to restore the correct stash, then "git stash drop ${stashRef}" after recovery.`
|
|
138
396
|
: `Run "git stash list" to find the matching GSD preflight stash before restoring manually.`;
|
|
139
|
-
const msg = `git stash
|
|
397
|
+
const msg = `git stash apply ${stashRef ?? ""}`.trim() + ` failed after merge of milestone ${milestoneId}: ${err instanceof Error ? err.message : String(err)}. ${restoreHint}`;
|
|
140
398
|
logWarning("preflight", msg);
|
|
141
399
|
notify(msg, "warning");
|
|
142
400
|
return {
|
|
@@ -144,6 +402,7 @@ export function postflightPopStash(basePath, milestoneId, stashMarker, notify) {
|
|
|
144
402
|
needsManualRecovery: true,
|
|
145
403
|
message: msg,
|
|
146
404
|
...(stashRef ? { stashRef } : {}),
|
|
405
|
+
resolution: "manual-recovery",
|
|
147
406
|
};
|
|
148
407
|
}
|
|
149
408
|
}
|
|
@@ -2,7 +2,8 @@ import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
3
|
import { loadRegistry } from "../workflow-templates.js";
|
|
4
4
|
import { gsdHome } from "../gsd-home.js";
|
|
5
|
-
|
|
5
|
+
import { VISUAL_BRIEF_MODES } from "../../visual-brief/prompts.js";
|
|
6
|
+
export const GSD_COMMAND_DESCRIPTION = "GSD — Get Shit Done: /gsd help|start|templates|next|auto|stop|pause|status|widget|visualize|brief|queue|quick|discuss|capture|triage|dispatch|verdict|history|undo|undo-task|reset-slice|rate|skip|export|cleanup|model|mode|prefs|config|keys|hooks|run-hook|skill-health|doctor|debug|logs|forensics|changelog|migrate|remote|steer|knowledge|new-milestone|new-project|parallel|cmux|park|unpark|init|setup|onboarding|inspect|extensions|update|fast|mcp|rethink|workflow|codebase|notifications|ship|do|session-report|backlog|pr-branch|add-tests|scan|language|worktree|eval-review";
|
|
6
7
|
export const TOP_LEVEL_SUBCOMMANDS = [
|
|
7
8
|
{ cmd: "help", desc: "Categorized command reference with descriptions" },
|
|
8
9
|
{ cmd: "next", desc: "Explicit step mode (same as /gsd)" },
|
|
@@ -12,6 +13,7 @@ export const TOP_LEVEL_SUBCOMMANDS = [
|
|
|
12
13
|
{ cmd: "status", desc: "Progress dashboard" },
|
|
13
14
|
{ cmd: "widget", desc: "Cycle widget: full → small → min → off" },
|
|
14
15
|
{ cmd: "visualize", desc: "Open 10-tab workflow visualizer (progress, timeline, deps, metrics, health, agent, changes, knowledge, captures, export)" },
|
|
16
|
+
{ cmd: "brief", desc: "Generate a visual HTML brief: diagram, plan, diff review, recap, table, or slides" },
|
|
15
17
|
{ cmd: "queue", desc: "Queue and reorder future milestones" },
|
|
16
18
|
{ cmd: "quick", desc: "Execute a quick task without full planning overhead" },
|
|
17
19
|
{ cmd: "discuss", desc: "Discuss architecture and decisions" },
|
|
@@ -19,6 +21,7 @@ export const TOP_LEVEL_SUBCOMMANDS = [
|
|
|
19
21
|
{ cmd: "changelog", desc: "Show categorized release notes" },
|
|
20
22
|
{ cmd: "triage", desc: "Manually trigger triage of pending captures" },
|
|
21
23
|
{ cmd: "dispatch", desc: "Dispatch a specific phase directly" },
|
|
24
|
+
{ cmd: "verdict", desc: "Override the recorded milestone validation verdict (pass|needs-attention|needs-remediation)" },
|
|
22
25
|
{ cmd: "history", desc: "View execution history" },
|
|
23
26
|
{ cmd: "undo", desc: "Revert last completed unit" },
|
|
24
27
|
{ cmd: "undo-task", desc: "Reset a specific task's completion state (DB + markdown)" },
|
|
@@ -75,6 +78,7 @@ export const TOP_LEVEL_SUBCOMMANDS = [
|
|
|
75
78
|
{ cmd: "eval-review", desc: "Audit a slice's AI evaluation strategy and write a scored EVAL-REVIEW.md (--force, --show)" },
|
|
76
79
|
];
|
|
77
80
|
const NESTED_COMPLETIONS = {
|
|
81
|
+
brief: VISUAL_BRIEF_MODES.map((mode) => ({ cmd: mode.mode, desc: mode.description })),
|
|
78
82
|
auto: [
|
|
79
83
|
{ cmd: "--verbose", desc: "Show detailed execution output" },
|
|
80
84
|
{ cmd: "--debug", desc: "Enable debug logging" },
|
|
@@ -232,6 +236,11 @@ const NESTED_COMPLETIONS = {
|
|
|
232
236
|
{ cmd: "uat", desc: "Run user acceptance testing" },
|
|
233
237
|
{ cmd: "replan", desc: "Replan the current slice" },
|
|
234
238
|
],
|
|
239
|
+
verdict: [
|
|
240
|
+
{ cmd: "pass", desc: "Override the milestone validation verdict to pass" },
|
|
241
|
+
{ cmd: "needs-attention", desc: "Override the verdict to needs-attention (requires --rationale)" },
|
|
242
|
+
{ cmd: "needs-remediation", desc: "Override the verdict to needs-remediation (requires --rationale)" },
|
|
243
|
+
],
|
|
235
244
|
rate: [
|
|
236
245
|
{ cmd: "over", desc: "Model was overqualified for this task" },
|
|
237
246
|
{ cmd: "ok", desc: "Model was appropriate for this task" },
|