gsd-pi 2.82.0-dev.ed17d078d → 3.0.0
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 +6 -5
- 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 +1 -1
- package/dist/resources/extensions/cmux/index.js +5 -0
- package/dist/resources/extensions/gsd/auto/infra-errors.js +9 -3
- package/dist/resources/extensions/gsd/auto/loop.js +19 -6
- package/dist/resources/extensions/gsd/auto/orchestrator.js +11 -0
- package/dist/resources/extensions/gsd/auto/phases.js +81 -31
- package/dist/resources/extensions/gsd/auto/session.js +4 -0
- 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-dashboard.js +66 -1
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +1 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +20 -19
- package/dist/resources/extensions/gsd/auto-model-selection.js +2 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +246 -133
- package/dist/resources/extensions/gsd/auto-prompts.js +2 -2
- package/dist/resources/extensions/gsd/auto-recovery.js +71 -14
- package/dist/resources/extensions/gsd/auto-start.js +87 -14
- package/dist/resources/extensions/gsd/auto-verification.js +45 -26
- package/dist/resources/extensions/gsd/auto-worktree.js +176 -10
- package/dist/resources/extensions/gsd/auto.js +57 -33
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +31 -7
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +10 -9
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +4 -2
- package/dist/resources/extensions/gsd/bootstrap/subagent-input.js +21 -9
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +17 -3
- package/dist/resources/extensions/gsd/clean-root-preflight.js +170 -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 +5 -0
- package/dist/resources/extensions/gsd/commands-bootstrap.js +5 -0
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +7 -2
- package/dist/resources/extensions/gsd/commands-verdict.js +139 -0
- package/dist/resources/extensions/gsd/crash-recovery.js +43 -5
- 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/dispatch-guard.js +2 -2
- package/dist/resources/extensions/gsd/doctor-git-checks.js +46 -1
- 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 +3 -3
- package/dist/resources/extensions/gsd/git-service.js +45 -3
- package/dist/resources/extensions/gsd/gsd-db.js +21 -6
- package/dist/resources/extensions/gsd/guided-flow-queue.js +4 -3
- package/dist/resources/extensions/gsd/guided-flow.js +101 -116
- package/dist/resources/extensions/gsd/guided-unit-context.js +23 -0
- package/dist/resources/extensions/gsd/markdown-renderer.js +10 -8
- package/dist/resources/extensions/gsd/migrate/parsers.js +10 -0
- 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 +48 -12
- 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/post-execution-checks.js +73 -2
- package/dist/resources/extensions/gsd/pre-execution-checks.js +28 -1
- 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/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/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/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 +3 -3
- package/dist/resources/extensions/gsd/status-guards.js +11 -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 +6 -8
- package/dist/resources/extensions/gsd/tools/complete-slice.js +6 -8
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +7 -1
- package/dist/resources/extensions/gsd/tools/plan-slice.js +87 -14
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +119 -0
- package/dist/resources/extensions/gsd/unit-context-manifest.js +32 -10
- package/dist/resources/extensions/gsd/validation.js +23 -1
- package/dist/resources/extensions/gsd/verification-gate.js +68 -7
- package/dist/resources/extensions/gsd/verification-verdict.js +26 -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 +54 -10
- package/dist/resources/extensions/gsd/worktree-manager.js +1 -1
- package/dist/resources/extensions/shared/html-shell.js +388 -0
- 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/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +11 -11
- package/dist/web/standalone/.next/build-manifest.json +4 -4
- 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 +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- 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/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +5 -8
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -8
- 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 +11 -11
- package/dist/web/standalone/.next/server/chunks/4266.js +2 -0
- package/dist/web/standalone/.next/server/chunks/63.js +3 -3
- package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware.js +2 -2
- 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/_not-found/{page-f2a7482d42a5614b.js → page-2f24283c162b6ab3.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/layout-b23b3f6858dc6dc8.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/page-200592a7f3baf579.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.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/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/server.js +1 -1
- 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/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/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/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/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +71 -97
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.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/sdk.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +23 -7
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +75 -102
- 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__/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/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/package.json +1 -1
- package/packages/pi-tui/src/__tests__/terminal.test.ts +121 -0
- package/packages/pi-tui/src/terminal.ts +11 -0
- 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 +1 -1
- 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 +9 -0
- package/src/resources/extensions/cmux/index.ts +6 -0
- package/src/resources/extensions/gsd/auto/contracts.ts +14 -6
- package/src/resources/extensions/gsd/auto/infra-errors.ts +9 -3
- package/src/resources/extensions/gsd/auto/loop.ts +22 -6
- package/src/resources/extensions/gsd/auto/orchestrator.ts +11 -0
- package/src/resources/extensions/gsd/auto/phases.ts +90 -38
- package/src/resources/extensions/gsd/auto/session.ts +4 -0
- 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-dashboard.ts +72 -1
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +1 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +21 -19
- package/src/resources/extensions/gsd/auto-model-selection.ts +2 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +279 -144
- package/src/resources/extensions/gsd/auto-prompts.ts +2 -2
- package/src/resources/extensions/gsd/auto-recovery.ts +74 -11
- package/src/resources/extensions/gsd/auto-start.ts +94 -12
- package/src/resources/extensions/gsd/auto-verification.ts +58 -36
- package/src/resources/extensions/gsd/auto-worktree.ts +193 -10
- package/src/resources/extensions/gsd/auto.ts +59 -31
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +42 -7
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +10 -9
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +4 -2
- package/src/resources/extensions/gsd/bootstrap/subagent-input.ts +19 -7
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +20 -4
- package/src/resources/extensions/gsd/clean-root-preflight.ts +174 -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 +5 -0
- package/src/resources/extensions/gsd/commands-bootstrap.ts +10 -0
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +8 -3
- package/src/resources/extensions/gsd/commands-verdict.ts +202 -0
- package/src/resources/extensions/gsd/crash-recovery.ts +44 -4
- 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/dispatch-guard.ts +2 -2
- package/src/resources/extensions/gsd/doctor-git-checks.ts +45 -1
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +25 -13
- package/src/resources/extensions/gsd/doctor-types.ts +1 -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 +3 -3
- package/src/resources/extensions/gsd/git-service.ts +51 -4
- package/src/resources/extensions/gsd/gsd-db.ts +21 -6
- package/src/resources/extensions/gsd/guided-flow-queue.ts +4 -3
- package/src/resources/extensions/gsd/guided-flow.ts +134 -133
- package/src/resources/extensions/gsd/guided-unit-context.ts +30 -0
- package/src/resources/extensions/gsd/markdown-renderer.ts +10 -8
- package/src/resources/extensions/gsd/migrate/parsers.ts +11 -0
- 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 +54 -12
- 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/post-execution-checks.ts +87 -2
- package/src/resources/extensions/gsd/pre-execution-checks.ts +32 -1
- 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/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/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/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 +3 -3
- package/src/resources/extensions/gsd/status-guards.ts +13 -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/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 +56 -0
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +80 -1
- 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 +91 -6
- 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-worktree-registry.test.ts +69 -1
- 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 +107 -2
- package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +11 -2
- 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 +4 -1
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +5 -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 +86 -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/deep-project-auto-loop.test.ts +59 -2
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/doctor-empty-worktree.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/evidence-cross-ref.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/export-html-enhancements.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +11 -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/integration/doctor-runtime.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +112 -1
- package/src/resources/extensions/gsd/tests/integration/state-machine-runtime-failures.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/merge-db-cycle.test.ts +179 -0
- package/src/resources/extensions/gsd/tests/migrate-validator-parsers.test.ts +24 -1
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +26 -18
- package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +63 -2
- package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +121 -1
- 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 +251 -2
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +17 -0
- 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 +86 -0
- package/src/resources/extensions/gsd/tests/post-unit-git-failure.test.ts +1 -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 +53 -0
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +59 -0
- 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/run-uat-replay-cap.test.ts +2 -3
- package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/smart-entry-routing.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +53 -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 +13 -1
- package/src/resources/extensions/gsd/tests/stuck-state-via-db.test.ts +64 -1
- package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +7 -3
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +103 -7
- package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +29 -2
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +110 -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 +1 -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 +25 -0
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +54 -0
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +8 -10
- package/src/resources/extensions/gsd/tools/complete-slice.ts +6 -8
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +5 -1
- package/src/resources/extensions/gsd/tools/plan-slice.ts +97 -12
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +135 -0
- package/src/resources/extensions/gsd/types.ts +1 -1
- package/src/resources/extensions/gsd/unit-context-manifest.ts +47 -11
- package/src/resources/extensions/gsd/validation.ts +23 -1
- package/src/resources/extensions/gsd/verification-gate.ts +78 -6
- package/src/resources/extensions/gsd/verification-verdict.ts +47 -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 +61 -10
- package/src/resources/extensions/gsd/worktree-manager.ts +1 -1
- package/src/resources/extensions/shared/html-shell.ts +412 -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/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/chunks/app/page-752f1e2ebdaa3e45.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.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 → qoMxZh-xuwuvpFW0x0k01}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{YEvjuT-fsFfYQhDSWtueS → qoMxZh-xuwuvpFW0x0k01}/_ssgManifest.js +0 -0
|
@@ -62,7 +62,11 @@ async function runSuccessfulFinalize(s: AutoSession) {
|
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
async function runFinalizeWithDeps(
|
|
65
|
+
async function runFinalizeWithDeps(
|
|
66
|
+
s: AutoSession,
|
|
67
|
+
depsOverrides: Record<string, unknown>,
|
|
68
|
+
ctxOverride?: Record<string, unknown>,
|
|
69
|
+
) {
|
|
66
70
|
const unit = s.currentUnit;
|
|
67
71
|
assert.ok(unit, "test setup must provide currentUnit");
|
|
68
72
|
|
|
@@ -86,7 +90,7 @@ async function runFinalizeWithDeps(s: AutoSession, depsOverrides: Record<string,
|
|
|
86
90
|
|
|
87
91
|
return runFinalize(
|
|
88
92
|
{
|
|
89
|
-
ctx: { ui: { notify() {} } },
|
|
93
|
+
ctx: ctxOverride ?? { ui: { notify() {} } },
|
|
90
94
|
pi: {},
|
|
91
95
|
s,
|
|
92
96
|
deps,
|
|
@@ -223,3 +227,50 @@ test("runFinalize merges a verified complete-milestone immediately and only once
|
|
|
223
227
|
assert.equal(lifecycleMergeCalls, 1);
|
|
224
228
|
assert.equal(resolverMergeCalls, 0);
|
|
225
229
|
});
|
|
230
|
+
|
|
231
|
+
test("runFinalize does not render next-phase handoff for complete-milestone", async (t) => {
|
|
232
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-finalize-complete-handoff-"));
|
|
233
|
+
t.after(() => {
|
|
234
|
+
rmSync(base, { recursive: true, force: true });
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
const s = new AutoSession();
|
|
238
|
+
const widgetCalls: Array<[string, unknown]> = [];
|
|
239
|
+
s.basePath = base;
|
|
240
|
+
s.originalBasePath = base;
|
|
241
|
+
s.currentMilestoneId = "M001";
|
|
242
|
+
s.currentUnit = {
|
|
243
|
+
type: "complete-milestone",
|
|
244
|
+
id: "M001",
|
|
245
|
+
startedAt: Date.now(),
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
const result = await runFinalizeWithDeps(
|
|
249
|
+
s,
|
|
250
|
+
{
|
|
251
|
+
preflightCleanRoot: () => ({ stashPushed: false }),
|
|
252
|
+
postflightPopStash: () => ({ needsManualRecovery: false }),
|
|
253
|
+
lifecycle: {
|
|
254
|
+
exitMilestone() {
|
|
255
|
+
return { ok: true, merged: true, codeFilesChanged: false };
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
hasUI: true,
|
|
261
|
+
ui: {
|
|
262
|
+
notify() {},
|
|
263
|
+
setWidget(key: string, value: unknown) {
|
|
264
|
+
widgetCalls.push([key, value]);
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
);
|
|
269
|
+
|
|
270
|
+
assert.equal(result.action, "next");
|
|
271
|
+
assert.equal(
|
|
272
|
+
widgetCalls.some(([key]) => key === "gsd-outcome"),
|
|
273
|
+
false,
|
|
274
|
+
"complete-milestone finalize should leave terminal completion UI to stopAuto",
|
|
275
|
+
);
|
|
276
|
+
});
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
// GSD-2
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Tests for step-mode completion messages in auto-post-unit.
|
|
2
3
|
|
|
3
4
|
import test from "node:test";
|
|
4
5
|
import assert from "node:assert/strict";
|
|
5
6
|
|
|
6
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
buildStepCompleteMessage,
|
|
9
|
+
shouldReturnStepWizardAfterUnit,
|
|
10
|
+
STEP_COMPLETE_FALLBACK_MESSAGE,
|
|
11
|
+
} from "../auto-post-unit.ts";
|
|
7
12
|
import type { GSDState } from "../types.ts";
|
|
8
13
|
|
|
9
14
|
function makeState(overrides: Partial<GSDState>): GSDState {
|
|
@@ -27,7 +32,7 @@ test("buildStepCompleteMessage: milestone complete surfaces review guidance", ()
|
|
|
27
32
|
assert.doesNotMatch(msg, /Next:/);
|
|
28
33
|
});
|
|
29
34
|
|
|
30
|
-
test("buildStepCompleteMessage: mid-flight step includes next unit label and /
|
|
35
|
+
test("buildStepCompleteMessage: mid-flight step includes next unit label and /gsd next hint", () => {
|
|
31
36
|
const state = makeState({
|
|
32
37
|
phase: "executing",
|
|
33
38
|
activeSlice: { id: "S01", title: "Core" },
|
|
@@ -36,7 +41,7 @@ test("buildStepCompleteMessage: mid-flight step includes next unit label and /cl
|
|
|
36
41
|
const msg = buildStepCompleteMessage(state);
|
|
37
42
|
assert.match(msg, /Next: Execute T03: Wire notify/);
|
|
38
43
|
assert.match(msg, /\/clear/);
|
|
39
|
-
assert.match(msg, /\/gsd to continue/);
|
|
44
|
+
assert.match(msg, /\/gsd next to continue one step/);
|
|
40
45
|
});
|
|
41
46
|
|
|
42
47
|
test("buildStepCompleteMessage: unknown phase falls back to generic continue label", () => {
|
|
@@ -47,7 +52,14 @@ test("buildStepCompleteMessage: unknown phase falls back to generic continue lab
|
|
|
47
52
|
assert.match(msg, /\/clear/);
|
|
48
53
|
});
|
|
49
54
|
|
|
50
|
-
test("STEP_COMPLETE_FALLBACK_MESSAGE: used when deriveState throws, still points users at /clear + /gsd", () => {
|
|
55
|
+
test("STEP_COMPLETE_FALLBACK_MESSAGE: used when deriveState throws, still points users at /clear + /gsd next", () => {
|
|
51
56
|
assert.match(STEP_COMPLETE_FALLBACK_MESSAGE, /\/clear/);
|
|
52
|
-
assert.match(STEP_COMPLETE_FALLBACK_MESSAGE, /\/gsd/);
|
|
57
|
+
assert.match(STEP_COMPLETE_FALLBACK_MESSAGE, /\/gsd next/);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test("shouldReturnStepWizardAfterUnit: terminal milestone completion continues to merge-back path", () => {
|
|
61
|
+
assert.equal(shouldReturnStepWizardAfterUnit("complete-milestone", "complete"), false);
|
|
62
|
+
assert.equal(shouldReturnStepWizardAfterUnit("complete-milestone", null), false);
|
|
63
|
+
assert.equal(shouldReturnStepWizardAfterUnit("execute-task", "complete"), false);
|
|
64
|
+
assert.equal(shouldReturnStepWizardAfterUnit("execute-task", "executing"), true);
|
|
53
65
|
});
|
|
@@ -5,7 +5,7 @@ import { join } from "node:path";
|
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
|
|
8
|
-
import { verifyExpectedArtifact, hasImplementationArtifacts, resolveExpectedArtifactPath, diagnoseExpectedArtifact, buildLoopRemediationSteps, writeBlockerPlaceholder, refreshRecoveryDbForArtifact } from "../auto-recovery.ts";
|
|
8
|
+
import { verifyExpectedArtifact, hasImplementationArtifacts, resolveExpectedArtifactPath, diagnoseExpectedArtifact, diagnoseWorktreeIntegrityFailure, buildLoopRemediationSteps, writeBlockerPlaceholder, refreshRecoveryDbForArtifact } from "../auto-recovery.ts";
|
|
9
9
|
import { resolveMilestoneFile } from "../paths.ts";
|
|
10
10
|
import { openDatabase, closeDatabase, insertMilestone, insertSlice, insertGateRow, insertTask, getMilestoneCommitAttributionShas } from "../gsd-db.ts";
|
|
11
11
|
import { clearParseCache } from "../files.ts";
|
|
@@ -141,6 +141,20 @@ test("resolveExpectedArtifactPath returns null for unknown type", () => {
|
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
143
|
|
|
144
|
+
test("diagnoseWorktreeIntegrityFailure reports missing GSD worktree paths only", () => {
|
|
145
|
+
const missingWorktreePath = join(tmpdir(), `gsd-test-${randomUUID()}`, ".gsd", "worktrees", "M001-S01");
|
|
146
|
+
assert.equal(
|
|
147
|
+
diagnoseWorktreeIntegrityFailure(join(tmpdir(), `gsd-test-${randomUUID()}`)),
|
|
148
|
+
null,
|
|
149
|
+
"non-GSD paths should keep falling through to artifact recovery",
|
|
150
|
+
);
|
|
151
|
+
assert.equal(
|
|
152
|
+
diagnoseWorktreeIntegrityFailure(missingWorktreePath),
|
|
153
|
+
`Worktree integrity failure: ${missingWorktreePath} does not exist. Repair or recreate the worktree before retrying.`,
|
|
154
|
+
"missing GSD worktree paths should fail terminally before artifact retry",
|
|
155
|
+
);
|
|
156
|
+
});
|
|
157
|
+
|
|
144
158
|
test("resolveExpectedArtifactPath returns correct path for all milestone-level types", () => {
|
|
145
159
|
const base = makeTmpBase();
|
|
146
160
|
try {
|
|
@@ -793,6 +807,51 @@ test("hasImplementationArtifacts finds integration implementation-only commits w
|
|
|
793
807
|
}
|
|
794
808
|
});
|
|
795
809
|
|
|
810
|
+
test("hasImplementationArtifacts ignores corrupted milestone/* integration metadata", () => {
|
|
811
|
+
const base = makeGitBase();
|
|
812
|
+
try {
|
|
813
|
+
mkdirSync(join(base, "src"), { recursive: true });
|
|
814
|
+
writeFileSync(join(base, "src", "feature.ts"), "export function feature() {}\n");
|
|
815
|
+
execFileSync("git", ["add", "src/feature.ts"], { cwd: base, stdio: "ignore" });
|
|
816
|
+
execFileSync("git", ["commit", "-m", "feat: add milestone feature\n\nGSD-Task: S01/T01"], { cwd: base, stdio: "ignore" });
|
|
817
|
+
|
|
818
|
+
mkdirSync(join(base, ".gsd"), { recursive: true });
|
|
819
|
+
openDatabase(join(base, ".gsd", "gsd.db"));
|
|
820
|
+
insertMilestone({ id: "M001", title: "Milestone One", status: "active" });
|
|
821
|
+
insertSlice({
|
|
822
|
+
id: "S01",
|
|
823
|
+
milestoneId: "M001",
|
|
824
|
+
title: "Slice One",
|
|
825
|
+
status: "complete",
|
|
826
|
+
risk: "low",
|
|
827
|
+
depends: [],
|
|
828
|
+
});
|
|
829
|
+
insertTask({
|
|
830
|
+
id: "T01",
|
|
831
|
+
sliceId: "S01",
|
|
832
|
+
milestoneId: "M001",
|
|
833
|
+
title: "Task One",
|
|
834
|
+
status: "complete",
|
|
835
|
+
});
|
|
836
|
+
|
|
837
|
+
execFileSync("git", ["checkout", "-b", "milestone/M001"], { cwd: base, stdio: "ignore" });
|
|
838
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001"), { recursive: true });
|
|
839
|
+
writeFileSync(join(base, ".gsd", "milestones", "M001", "M001-SUMMARY.md"), "# Milestone Summary\nDone.");
|
|
840
|
+
execFileSync("git", ["add", "."], { cwd: base, stdio: "ignore" });
|
|
841
|
+
execFileSync("git", ["commit", "-m", "chore: auto-commit after complete-milestone\n\nGSD-Unit: M001"], { cwd: base, stdio: "ignore" });
|
|
842
|
+
|
|
843
|
+
writeFileSync(
|
|
844
|
+
join(base, ".gsd", "milestones", "M001", "M001-META.json"),
|
|
845
|
+
JSON.stringify({ integrationBranch: "milestone/M001" }, null, 2) + "\n",
|
|
846
|
+
);
|
|
847
|
+
|
|
848
|
+
const result = hasImplementationArtifacts(base, "M001");
|
|
849
|
+
assert.equal(result, "present", "corrupted milestone integration metadata should fall back to main branch for artifact detection");
|
|
850
|
+
} finally {
|
|
851
|
+
cleanup(base);
|
|
852
|
+
}
|
|
853
|
+
});
|
|
854
|
+
|
|
796
855
|
test("hasImplementationArtifacts backfills untagged main implementation commits from completed task file hints", () => {
|
|
797
856
|
const base = makeGitBase();
|
|
798
857
|
try {
|
|
@@ -1029,24 +1088,50 @@ test("hasImplementationArtifacts binds GSD-Task trailer to milestone via DB stat
|
|
|
1029
1088
|
}
|
|
1030
1089
|
});
|
|
1031
1090
|
|
|
1032
|
-
test("hasImplementationArtifacts does not
|
|
1091
|
+
test("hasImplementationArtifacts does not claim Sxx/Tyy commit trailers across milestones when ownership points elsewhere", () => {
|
|
1033
1092
|
const base = makeGitBase();
|
|
1034
1093
|
try {
|
|
1035
1094
|
writeFileSync(join(base, ".git", "info", "exclude"), ".gsd/\n");
|
|
1095
|
+
mkdirSync(join(base, ".gsd"), { recursive: true });
|
|
1096
|
+
openDatabase(join(base, ".gsd", "gsd.db"));
|
|
1097
|
+
insertMilestone({ id: "M001", title: "Milestone One", status: "active" });
|
|
1098
|
+
insertMilestone({ id: "M002", title: "Milestone Two", status: "active" });
|
|
1099
|
+
insertSlice({
|
|
1100
|
+
id: "S01",
|
|
1101
|
+
milestoneId: "M002",
|
|
1102
|
+
title: "Slice One",
|
|
1103
|
+
status: "complete",
|
|
1104
|
+
risk: "low",
|
|
1105
|
+
depends: [],
|
|
1106
|
+
});
|
|
1107
|
+
insertTask({
|
|
1108
|
+
id: "T01",
|
|
1109
|
+
sliceId: "S01",
|
|
1110
|
+
milestoneId: "M002",
|
|
1111
|
+
title: "Task One",
|
|
1112
|
+
status: "complete",
|
|
1113
|
+
});
|
|
1114
|
+
|
|
1036
1115
|
mkdirSync(join(base, "src"), { recursive: true });
|
|
1037
1116
|
writeFileSync(join(base, "src", "feature.ts"), "export function feature() {}\n");
|
|
1038
1117
|
execFileSync("git", ["add", "."], { cwd: base, stdio: "ignore" });
|
|
1039
1118
|
execFileSync(
|
|
1040
1119
|
"git",
|
|
1041
|
-
["commit", "-m", "feat: add feature\n\nGSD-Task: S01/T01"],
|
|
1120
|
+
["commit", "-m", "feat: add sibling feature\n\nGSD-Task: S01/T01"],
|
|
1042
1121
|
{ cwd: base, stdio: "ignore" },
|
|
1043
1122
|
);
|
|
1044
1123
|
|
|
1045
|
-
const
|
|
1124
|
+
const m001Result = hasImplementationArtifacts(base, "M001");
|
|
1125
|
+
const m002Result = hasImplementationArtifacts(base, "M002");
|
|
1046
1126
|
assert.equal(
|
|
1047
|
-
|
|
1127
|
+
m001Result,
|
|
1048
1128
|
"absent",
|
|
1049
|
-
"
|
|
1129
|
+
"Sxx/Tyy commit trailers owned by M002 must not be attributed to M001",
|
|
1130
|
+
);
|
|
1131
|
+
assert.equal(
|
|
1132
|
+
m002Result,
|
|
1133
|
+
"present",
|
|
1134
|
+
"the owning milestone should still claim the implementation-bearing commit",
|
|
1050
1135
|
);
|
|
1051
1136
|
} finally {
|
|
1052
1137
|
cleanup(base);
|
|
@@ -98,6 +98,7 @@ test("bootstrap aborts before starting next milestone when completed orphan merg
|
|
|
98
98
|
{
|
|
99
99
|
shouldUseWorktreeIsolation: () => true,
|
|
100
100
|
registerSigtermHandler: () => {},
|
|
101
|
+
registerAutoWorkerForSession: () => {},
|
|
101
102
|
lockBase: () => base,
|
|
102
103
|
buildLifecycle: () => ({
|
|
103
104
|
adoptSessionRoot: (sessionBase: string, originalBase?: string) => {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Regression tests for auto-mode stop notification formatting.
|
|
3
|
+
|
|
4
|
+
import test from "node:test";
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
|
|
7
|
+
import { formatAutoStopNotification } from "../auto.ts";
|
|
8
|
+
|
|
9
|
+
test("auto stop notification keeps session totals on a separate line", () => {
|
|
10
|
+
const message = formatAutoStopNotification(
|
|
11
|
+
"Auto-mode stopped",
|
|
12
|
+
{ cost: 0.652, tokens: { total: 87000 } },
|
|
13
|
+
2,
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
assert.equal(
|
|
17
|
+
message,
|
|
18
|
+
"Auto-mode stopped.\nSession: $0.652 · 87.0k tokens · 2 units",
|
|
19
|
+
);
|
|
20
|
+
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { describe, test, beforeEach } from "node:test";
|
|
4
4
|
import assert from "node:assert/strict";
|
|
5
|
-
import { mkdtempSync, mkdirSync, writeFileSync, rmSync, realpathSync } from "node:fs";
|
|
5
|
+
import { existsSync, mkdtempSync, mkdirSync, writeFileSync, rmSync, realpathSync } from "node:fs";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { tmpdir } from "node:os";
|
|
8
8
|
import { execFileSync } from "node:child_process";
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
_resetAutoWorktreeOriginalBaseForTests,
|
|
14
14
|
createAutoWorktree,
|
|
15
15
|
enterAutoWorktree,
|
|
16
|
+
mergeMilestoneToMain,
|
|
16
17
|
teardownAutoWorktree,
|
|
17
18
|
} from "../auto-worktree.ts";
|
|
18
19
|
|
|
@@ -173,4 +174,71 @@ describe("auto-worktree workspace registry", () => {
|
|
|
173
174
|
teardownAutoWorktree(dir2, "M020");
|
|
174
175
|
try { process.chdir(savedCwd); } catch { /* ignore */ }
|
|
175
176
|
});
|
|
177
|
+
|
|
178
|
+
test("mergeMilestoneToMain cleans up when milestone branch was already regular-merged", (t) => {
|
|
179
|
+
const tempDir = createTempRepo(t);
|
|
180
|
+
const msDir = join(tempDir, ".gsd", "milestones", "M003");
|
|
181
|
+
mkdirSync(msDir, { recursive: true });
|
|
182
|
+
writeFileSync(join(msDir, "CONTEXT.md"), "# M003 Context\n");
|
|
183
|
+
git(["add", "."], tempDir);
|
|
184
|
+
git(["commit", "-m", "add milestone"], tempDir);
|
|
185
|
+
|
|
186
|
+
createAutoWorktree(tempDir, "M003");
|
|
187
|
+
const wtDir = join(tempDir, ".gsd", "worktrees", "M003");
|
|
188
|
+
writeFileSync(join(wtDir, "feature.txt"), "implemented\n");
|
|
189
|
+
git(["add", "feature.txt"], wtDir);
|
|
190
|
+
git(["commit", "-m", "feat: implement M003"], wtDir);
|
|
191
|
+
|
|
192
|
+
process.chdir(tempDir);
|
|
193
|
+
git(["merge", "--no-ff", "milestone/M003", "-m", "merge M003"], tempDir);
|
|
194
|
+
|
|
195
|
+
process.chdir(wtDir);
|
|
196
|
+
const result = mergeMilestoneToMain(tempDir, "M003", "# M003\n- [x] **S01: Done**\n");
|
|
197
|
+
|
|
198
|
+
assert.equal(result.codeFilesChanged, true);
|
|
199
|
+
assert.equal(result.pushed, false);
|
|
200
|
+
assert.equal(result.prCreated, false);
|
|
201
|
+
assert.equal(existsSync(wtDir), false, "worktree directory is removed");
|
|
202
|
+
assert.throws(
|
|
203
|
+
() => git(["rev-parse", "--verify", "milestone/M003"], tempDir),
|
|
204
|
+
/Command failed/,
|
|
205
|
+
"already-merged milestone branch is deleted",
|
|
206
|
+
);
|
|
207
|
+
try { process.chdir(savedCwd); } catch { /* ignore */ }
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
test("mergeMilestoneToMain cleans up already-merged milestone after main advances", (t) => {
|
|
211
|
+
const tempDir = createTempRepo(t);
|
|
212
|
+
const msDir = join(tempDir, ".gsd", "milestones", "M004");
|
|
213
|
+
mkdirSync(msDir, { recursive: true });
|
|
214
|
+
writeFileSync(join(msDir, "CONTEXT.md"), "# M004 Context\n");
|
|
215
|
+
git(["add", "."], tempDir);
|
|
216
|
+
git(["commit", "-m", "add milestone"], tempDir);
|
|
217
|
+
|
|
218
|
+
createAutoWorktree(tempDir, "M004");
|
|
219
|
+
const wtDir = join(tempDir, ".gsd", "worktrees", "M004");
|
|
220
|
+
writeFileSync(join(wtDir, "feature.txt"), "implemented\n");
|
|
221
|
+
git(["add", "feature.txt"], wtDir);
|
|
222
|
+
git(["commit", "-m", "feat: implement M004"], wtDir);
|
|
223
|
+
|
|
224
|
+
process.chdir(tempDir);
|
|
225
|
+
git(["merge", "--no-ff", "milestone/M004", "-m", "merge M004"], tempDir);
|
|
226
|
+
writeFileSync(join(tempDir, "hotfix.txt"), "later main work\n");
|
|
227
|
+
git(["add", "hotfix.txt"], tempDir);
|
|
228
|
+
git(["commit", "-m", "fix: advance main"], tempDir);
|
|
229
|
+
|
|
230
|
+
process.chdir(wtDir);
|
|
231
|
+
const result = mergeMilestoneToMain(tempDir, "M004", "# M004\n- [x] **S01: Done**\n");
|
|
232
|
+
|
|
233
|
+
assert.equal(result.codeFilesChanged, true);
|
|
234
|
+
assert.equal(result.pushed, false);
|
|
235
|
+
assert.equal(result.prCreated, false);
|
|
236
|
+
assert.equal(existsSync(wtDir), false, "worktree directory is removed");
|
|
237
|
+
assert.throws(
|
|
238
|
+
() => git(["rev-parse", "--verify", "milestone/M004"], tempDir),
|
|
239
|
+
/Command failed/,
|
|
240
|
+
"already-merged milestone branch is deleted",
|
|
241
|
+
);
|
|
242
|
+
try { process.chdir(savedCwd); } catch { /* ignore */ }
|
|
243
|
+
});
|
|
176
244
|
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// GSD-2 + /gsd brief command behavior tests
|
|
2
|
+
|
|
3
|
+
import test from "node:test";
|
|
4
|
+
import assert from "node:assert/strict";
|
|
5
|
+
|
|
6
|
+
import { GSD_COMMAND_DESCRIPTION, getGsdArgumentCompletions } from "../commands/catalog.ts";
|
|
7
|
+
import { handleCoreCommand, showHelp } from "../commands/handlers/core.ts";
|
|
8
|
+
import { VISUAL_BRIEF_USAGE } from "../../visual-brief/prompts.ts";
|
|
9
|
+
|
|
10
|
+
function createMockCtx() {
|
|
11
|
+
const notifications: { message: string; level: string }[] = [];
|
|
12
|
+
return {
|
|
13
|
+
notifications,
|
|
14
|
+
ui: {
|
|
15
|
+
notify(message: string, level: string) {
|
|
16
|
+
notifications.push({ message, level });
|
|
17
|
+
},
|
|
18
|
+
custom: async () => undefined,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function createMockPi() {
|
|
24
|
+
const sentMessages: string[] = [];
|
|
25
|
+
return {
|
|
26
|
+
sentMessages,
|
|
27
|
+
sendUserMessage(content: string) {
|
|
28
|
+
sentMessages.push(content);
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
test("/gsd brief appears in the command description and top-level completions", () => {
|
|
34
|
+
assert.match(GSD_COMMAND_DESCRIPTION, /brief/);
|
|
35
|
+
|
|
36
|
+
const completions = getGsdArgumentCompletions("br");
|
|
37
|
+
const entry = completions.find((completion) => completion.value === "brief");
|
|
38
|
+
|
|
39
|
+
assert.ok(entry, "brief should appear in top-level completions");
|
|
40
|
+
assert.match(entry.description, /visual HTML brief/i);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test("/gsd brief exposes Visual Brief mode completions", () => {
|
|
44
|
+
const completions = getGsdArgumentCompletions("brief d");
|
|
45
|
+
|
|
46
|
+
assert.ok(
|
|
47
|
+
completions.some((completion) => completion.value === "brief diagram"),
|
|
48
|
+
"diagram should be suggested as a /gsd brief mode",
|
|
49
|
+
);
|
|
50
|
+
assert.ok(
|
|
51
|
+
getGsdArgumentCompletions("brief ").some((completion) => completion.value === "brief diff"),
|
|
52
|
+
"diff should be suggested after /gsd brief",
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test("/gsd brief sends a Visual Brief prompt for valid args", async () => {
|
|
57
|
+
const ctx = createMockCtx();
|
|
58
|
+
const pi = createMockPi();
|
|
59
|
+
|
|
60
|
+
const handled = await handleCoreCommand("brief diagram extension loading lifecycle", ctx as any, pi as any);
|
|
61
|
+
|
|
62
|
+
assert.equal(handled, true);
|
|
63
|
+
assert.equal(ctx.notifications.length, 0);
|
|
64
|
+
assert.equal(pi.sentMessages.length, 1);
|
|
65
|
+
assert.match(pi.sentMessages[0], /Mode: diagram/);
|
|
66
|
+
assert.match(pi.sentMessages[0], /Subject: extension loading lifecycle/);
|
|
67
|
+
assert.match(pi.sentMessages[0], /Output directory:/);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test("/gsd brief reports usage for empty args instead of sending a prompt", async () => {
|
|
71
|
+
const ctx = createMockCtx();
|
|
72
|
+
const pi = createMockPi();
|
|
73
|
+
|
|
74
|
+
const handled = await handleCoreCommand("brief", ctx as any, pi as any);
|
|
75
|
+
|
|
76
|
+
assert.equal(handled, true);
|
|
77
|
+
assert.equal(pi.sentMessages.length, 0);
|
|
78
|
+
assert.deepEqual(ctx.notifications, [{ message: VISUAL_BRIEF_USAGE, level: "info" }]);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test("/gsd help full lists brief separately from visualize", () => {
|
|
82
|
+
const ctx = createMockCtx();
|
|
83
|
+
|
|
84
|
+
showHelp(ctx as any, "full");
|
|
85
|
+
|
|
86
|
+
const help = ctx.notifications.at(0)?.message ?? "";
|
|
87
|
+
assert.match(help, /\/gsd visualize\s+Interactive 10-tab TUI/);
|
|
88
|
+
assert.match(help, /\/gsd brief <mode>\s+Generate a visual HTML brief/);
|
|
89
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { describe, test } from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { execFileSync } from "node:child_process";
|
|
4
|
+
import { mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { tmpdir } from "node:os";
|
|
7
|
+
|
|
8
|
+
import { checkoutBranchWithStashGuard } from "../auto-worktree.ts";
|
|
9
|
+
|
|
10
|
+
function git(args: string[], cwd: string): string {
|
|
11
|
+
return execFileSync("git", args, {
|
|
12
|
+
cwd,
|
|
13
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
14
|
+
encoding: "utf-8",
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function createRepo(t: { after: (fn: () => void) => void }): string {
|
|
19
|
+
const dir = realpathSync(mkdtempSync(join(tmpdir(), "checkout-stash-guard-")));
|
|
20
|
+
t.after(() => rmSync(dir, { recursive: true, force: true }));
|
|
21
|
+
git(["init"], dir);
|
|
22
|
+
git(["config", "user.email", "test@example.com"], dir);
|
|
23
|
+
git(["config", "user.name", "Test User"], dir);
|
|
24
|
+
writeFileSync(join(dir, "note.txt"), "base\n");
|
|
25
|
+
git(["add", "note.txt"], dir);
|
|
26
|
+
git(["commit", "-m", "init"], dir);
|
|
27
|
+
git(["branch", "-M", "main"], dir);
|
|
28
|
+
return dir;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
describe("checkoutBranchWithStashGuard", () => {
|
|
32
|
+
test("restores dirty working tree after successful checkout", (t) => {
|
|
33
|
+
const repo = createRepo(t);
|
|
34
|
+
git(["checkout", "-b", "milestone/M001"], repo);
|
|
35
|
+
git(["checkout", "main"], repo);
|
|
36
|
+
|
|
37
|
+
writeFileSync(join(repo, "note.txt"), "dirty\n");
|
|
38
|
+
|
|
39
|
+
checkoutBranchWithStashGuard(repo, "milestone/M001", "test-success");
|
|
40
|
+
|
|
41
|
+
const branch = git(["branch", "--show-current"], repo).trim();
|
|
42
|
+
assert.equal(branch, "milestone/M001");
|
|
43
|
+
const content = git(["show", "HEAD:note.txt"], repo).trim();
|
|
44
|
+
assert.equal(content, "base");
|
|
45
|
+
const wtContent = readFileSync(join(repo, "note.txt"), "utf8");
|
|
46
|
+
assert.equal(wtContent, "dirty\n");
|
|
47
|
+
const status = git(["status", "--porcelain"], repo);
|
|
48
|
+
assert.match(status, /note\.txt/);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test("restores dirty working tree when checkout throws", (t) => {
|
|
52
|
+
const repo = createRepo(t);
|
|
53
|
+
writeFileSync(join(repo, "note.txt"), "dirty\n");
|
|
54
|
+
|
|
55
|
+
assert.throws(
|
|
56
|
+
() => checkoutBranchWithStashGuard(repo, "milestone/DOES-NOT-EXIST", "test-failure"),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const status = git(["status", "--porcelain"], repo);
|
|
60
|
+
assert.match(status, /note\.txt/);
|
|
61
|
+
const stashList = git(["stash", "list"], repo).trim();
|
|
62
|
+
assert.equal(stashList, "");
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test("surfaces distinct error when checkout succeeds but stash pop conflicts", (t) => {
|
|
66
|
+
const repo = createRepo(t);
|
|
67
|
+
// Branch B has a divergent version of note.txt so popping a stash made
|
|
68
|
+
// against main will conflict after the checkout to B.
|
|
69
|
+
git(["checkout", "-b", "milestone/B"], repo);
|
|
70
|
+
writeFileSync(join(repo, "note.txt"), "B-version\n");
|
|
71
|
+
git(["add", "note.txt"], repo);
|
|
72
|
+
git(["commit", "-m", "B"], repo);
|
|
73
|
+
git(["checkout", "main"], repo);
|
|
74
|
+
|
|
75
|
+
writeFileSync(join(repo, "note.txt"), "local\n");
|
|
76
|
+
|
|
77
|
+
assert.throws(
|
|
78
|
+
() => checkoutBranchWithStashGuard(repo, "milestone/B", "test-pop-failure"),
|
|
79
|
+
/checkout to 'milestone\/B' succeeded but stash restore failed/,
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const branch = git(["branch", "--show-current"], repo).trim();
|
|
83
|
+
assert.equal(branch, "milestone/B");
|
|
84
|
+
const stashList = git(["stash", "list"], repo).trim();
|
|
85
|
+
assert.match(stashList, /gsd: checkout stash/);
|
|
86
|
+
});
|
|
87
|
+
});
|