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
|
@@ -19,14 +19,15 @@ import {
|
|
|
19
19
|
insertMilestone,
|
|
20
20
|
_getAdapter,
|
|
21
21
|
} from "../gsd-db.ts";
|
|
22
|
-
import { registerAutoWorker } from "../db/auto-workers.ts";
|
|
22
|
+
import { getAutoWorker, registerAutoWorker } from "../db/auto-workers.ts";
|
|
23
23
|
import { claimMilestoneLease } from "../db/milestone-leases.ts";
|
|
24
|
-
import { recordDispatchClaim } from "../db/unit-dispatches.ts";
|
|
24
|
+
import { getLatestForUnit, markRunning, recordDispatchClaim } from "../db/unit-dispatches.ts";
|
|
25
25
|
import { setRuntimeKv, getRuntimeKv } from "../db/runtime-kv.ts";
|
|
26
26
|
import {
|
|
27
27
|
writeLock,
|
|
28
28
|
readCrashLock,
|
|
29
29
|
clearLock,
|
|
30
|
+
clearStaleWorkerLock,
|
|
30
31
|
isLockProcessAlive,
|
|
31
32
|
} from "../crash-recovery.ts";
|
|
32
33
|
import { normalizeRealPath } from "../paths.ts";
|
|
@@ -223,3 +224,86 @@ test("clearLock removes the session_file row for the active worker", (t) => {
|
|
|
223
224
|
assert.equal(getRuntimeKv("worker", workerId, "session_file"), null,
|
|
224
225
|
"session_file row deleted by clearLock");
|
|
225
226
|
});
|
|
227
|
+
|
|
228
|
+
test("clearLock marks stale worker crashed when no current-process worker matches", (t) => {
|
|
229
|
+
const base = makeBase();
|
|
230
|
+
t.after(() => cleanup(base));
|
|
231
|
+
openDatabase(join(base, ".gsd", "gsd.db"));
|
|
232
|
+
const projectRoot = normalizeRealPath(base);
|
|
233
|
+
const workerId = registerAutoWorker({ projectRootRealpath: projectRoot });
|
|
234
|
+
|
|
235
|
+
setRuntimeKv("worker", workerId, "session_file", "/tmp/stale-session.jsonl");
|
|
236
|
+
setWorkerPid(workerId, 99999);
|
|
237
|
+
expireWorker(workerId);
|
|
238
|
+
assert.ok(readCrashLock(base), "stale worker is detected before clearLock");
|
|
239
|
+
|
|
240
|
+
clearLock(base);
|
|
241
|
+
|
|
242
|
+
assert.equal(getAutoWorker(workerId)?.status, "crashed");
|
|
243
|
+
assert.equal(getRuntimeKv("worker", workerId, "session_file"), null);
|
|
244
|
+
assert.equal(readCrashLock(base), null);
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
test("clearStaleWorkerLock crashes stale worker and cancels latest active dispatch", (t) => {
|
|
248
|
+
const base = makeBase();
|
|
249
|
+
t.after(() => cleanup(base));
|
|
250
|
+
openDatabase(join(base, ".gsd", "gsd.db"));
|
|
251
|
+
insertMilestone({ id: "M001", title: "T", status: "active" });
|
|
252
|
+
const projectRoot = normalizeRealPath(base);
|
|
253
|
+
const workerId = registerAutoWorker({ projectRootRealpath: projectRoot });
|
|
254
|
+
const lease = claimMilestoneLease(workerId, "M001");
|
|
255
|
+
assert.equal(lease.ok, true);
|
|
256
|
+
if (!lease.ok) return;
|
|
257
|
+
const claim = recordDispatchClaim({
|
|
258
|
+
traceId: "t1",
|
|
259
|
+
workerId,
|
|
260
|
+
milestoneLeaseToken: lease.token,
|
|
261
|
+
milestoneId: "M001",
|
|
262
|
+
sliceId: "S01",
|
|
263
|
+
taskId: "T02",
|
|
264
|
+
unitType: "hook/codex-review",
|
|
265
|
+
unitId: "M001/S01/T02",
|
|
266
|
+
});
|
|
267
|
+
assert.equal(claim.ok, true);
|
|
268
|
+
if (!claim.ok) return;
|
|
269
|
+
markRunning(claim.dispatchId);
|
|
270
|
+
setRuntimeKv("worker", workerId, "session_file", "/tmp/pi-session-hook.jsonl");
|
|
271
|
+
setWorkerPid(workerId, 99999);
|
|
272
|
+
expireWorker(workerId);
|
|
273
|
+
|
|
274
|
+
assert.ok(readCrashLock(base), "stale worker is detected before cleanup");
|
|
275
|
+
|
|
276
|
+
clearStaleWorkerLock(base);
|
|
277
|
+
|
|
278
|
+
assert.equal(getAutoWorker(workerId)?.status, "crashed");
|
|
279
|
+
const dispatch = getLatestForUnit("M001/S01/T02");
|
|
280
|
+
assert.ok(dispatch);
|
|
281
|
+
assert.equal(dispatch!.status, "canceled");
|
|
282
|
+
assert.equal(dispatch!.exit_reason, "crash-recovered");
|
|
283
|
+
assert.equal(getRuntimeKv("worker", workerId, "session_file"), null);
|
|
284
|
+
assert.equal(readCrashLock(base), null);
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
test("clearLock marks stale worker crashed and releases held milestone lease", (t) => {
|
|
288
|
+
const base = makeBase();
|
|
289
|
+
t.after(() => cleanup(base));
|
|
290
|
+
openDatabase(join(base, ".gsd", "gsd.db"));
|
|
291
|
+
insertMilestone({ id: "M001", title: "T", status: "active" });
|
|
292
|
+
const projectRoot = normalizeRealPath(base);
|
|
293
|
+
const workerId = registerAutoWorker({ projectRootRealpath: projectRoot });
|
|
294
|
+
const lease = claimMilestoneLease(workerId, "M001");
|
|
295
|
+
assert.equal(lease.ok, true);
|
|
296
|
+
if (!lease.ok) return;
|
|
297
|
+
|
|
298
|
+
setWorkerPid(workerId, 99999);
|
|
299
|
+
expireWorker(workerId);
|
|
300
|
+
assert.ok(readCrashLock(base), "stale worker is detected before clearLock");
|
|
301
|
+
|
|
302
|
+
clearLock(base);
|
|
303
|
+
|
|
304
|
+
assert.equal(getAutoWorker(workerId)?.status, "crashed");
|
|
305
|
+
const leaseRow = _getAdapter()!.prepare(
|
|
306
|
+
`SELECT status FROM milestone_leases WHERE milestone_id = :m`,
|
|
307
|
+
).get({ ":m": "M001" }) as { status: string } | undefined;
|
|
308
|
+
assert.equal(leaseRow?.status, "released");
|
|
309
|
+
});
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Regression tests for DB authority over markdown projections.
|
|
3
|
+
|
|
4
|
+
import test from "node:test";
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { tmpdir } from "node:os";
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
closeDatabase,
|
|
12
|
+
getAllMilestones,
|
|
13
|
+
getSliceTasks,
|
|
14
|
+
insertMilestone,
|
|
15
|
+
insertRequirement,
|
|
16
|
+
insertSlice,
|
|
17
|
+
openDatabase,
|
|
18
|
+
} from "../gsd-db.ts";
|
|
19
|
+
import { migrateHierarchyToDb } from "../md-importer.ts";
|
|
20
|
+
import { checkMarkdownHierarchyAgainstDb } from "../migration-auto-check.ts";
|
|
21
|
+
import { queryDecisions } from "../context-store.ts";
|
|
22
|
+
import { deriveStateFromDb, invalidateStateCache } from "../state.ts";
|
|
23
|
+
import type { Requirement } from "../types.ts";
|
|
24
|
+
|
|
25
|
+
function makeBase(prefix = "gsd-db-authority-"): string {
|
|
26
|
+
const base = mkdtempSync(join(tmpdir(), prefix));
|
|
27
|
+
mkdirSync(join(base, ".gsd"), { recursive: true });
|
|
28
|
+
return base;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function cleanup(base: string): void {
|
|
32
|
+
try {
|
|
33
|
+
closeDatabase();
|
|
34
|
+
} catch {
|
|
35
|
+
/* noop */
|
|
36
|
+
}
|
|
37
|
+
rmSync(base, { recursive: true, force: true });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function openProjectDb(base: string): void {
|
|
41
|
+
openDatabase(join(base, ".gsd", "gsd.db"));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function activeRequirement(id: string): Requirement {
|
|
45
|
+
return {
|
|
46
|
+
id,
|
|
47
|
+
class: "functional",
|
|
48
|
+
status: "active",
|
|
49
|
+
description: `${id} from DB`,
|
|
50
|
+
why: "DB authority regression fixture",
|
|
51
|
+
source: "test",
|
|
52
|
+
primary_owner: "M999/S01",
|
|
53
|
+
supporting_slices: "",
|
|
54
|
+
validation: "derive state",
|
|
55
|
+
notes: "",
|
|
56
|
+
full_content: `${id} from DB`,
|
|
57
|
+
superseded_by: null,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
test("DB authority: PROJECT.md and QUEUE-ORDER projections do not choose runtime milestone", async (t) => {
|
|
62
|
+
const base = makeBase();
|
|
63
|
+
t.after(() => cleanup(base));
|
|
64
|
+
|
|
65
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001"), { recursive: true });
|
|
66
|
+
writeFileSync(
|
|
67
|
+
join(base, ".gsd", "PROJECT.md"),
|
|
68
|
+
[
|
|
69
|
+
"# Projection Project",
|
|
70
|
+
"",
|
|
71
|
+
"## Milestone Sequence",
|
|
72
|
+
"- [ ] M001: Projection Only -- should not become active",
|
|
73
|
+
"",
|
|
74
|
+
].join("\n"),
|
|
75
|
+
);
|
|
76
|
+
writeFileSync(
|
|
77
|
+
join(base, ".gsd", "QUEUE-ORDER.json"),
|
|
78
|
+
JSON.stringify({ order: ["M001", "M999"], updatedAt: new Date().toISOString() }),
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
openProjectDb(base);
|
|
82
|
+
insertMilestone({ id: "M999", title: "DB Milestone", status: "active" });
|
|
83
|
+
insertSlice({ id: "S01", milestoneId: "M999", title: "DB Slice", status: "pending", risk: "low", depends: [], demo: "DB demo", sequence: 1 });
|
|
84
|
+
|
|
85
|
+
invalidateStateCache();
|
|
86
|
+
const state = await deriveStateFromDb(base);
|
|
87
|
+
|
|
88
|
+
assert.equal(state.activeMilestone?.id, "M999");
|
|
89
|
+
assert.equal(state.registry.some((entry) => entry.id === "M001"), false);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test("DB authority: REQUIREMENTS.md and DECISIONS.md projections do not populate DB reads", async (t) => {
|
|
93
|
+
const base = makeBase();
|
|
94
|
+
t.after(() => cleanup(base));
|
|
95
|
+
|
|
96
|
+
writeFileSync(
|
|
97
|
+
join(base, ".gsd", "REQUIREMENTS.md"),
|
|
98
|
+
[
|
|
99
|
+
"# Requirements",
|
|
100
|
+
"",
|
|
101
|
+
"## Active",
|
|
102
|
+
"### R001 - Projection-only requirement",
|
|
103
|
+
"- Class: functional",
|
|
104
|
+
"- Status: active",
|
|
105
|
+
"",
|
|
106
|
+
].join("\n"),
|
|
107
|
+
);
|
|
108
|
+
writeFileSync(
|
|
109
|
+
join(base, ".gsd", "DECISIONS.md"),
|
|
110
|
+
[
|
|
111
|
+
"# Decisions",
|
|
112
|
+
"",
|
|
113
|
+
"| # | When / Context | Scope | Decision | Choice | Rationale | Revisable | Made By |",
|
|
114
|
+
"|---|----------------|-------|----------|--------|-----------|----------|---------|",
|
|
115
|
+
"| D001 | Now | global | Projection-only decision | Ignore | DB is authority | Yes | human |",
|
|
116
|
+
"",
|
|
117
|
+
].join("\n"),
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
openProjectDb(base);
|
|
121
|
+
insertMilestone({ id: "M999", title: "DB Milestone", status: "active" });
|
|
122
|
+
|
|
123
|
+
invalidateStateCache();
|
|
124
|
+
const state = await deriveStateFromDb(base);
|
|
125
|
+
|
|
126
|
+
assert.deepEqual(state.requirements, {
|
|
127
|
+
active: 0,
|
|
128
|
+
validated: 0,
|
|
129
|
+
deferred: 0,
|
|
130
|
+
outOfScope: 0,
|
|
131
|
+
blocked: 0,
|
|
132
|
+
total: 0,
|
|
133
|
+
});
|
|
134
|
+
assert.deepEqual(queryDecisions(), []);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
test("DB authority: DB requirements remain canonical when REQUIREMENTS.md disagrees", async (t) => {
|
|
138
|
+
const base = makeBase();
|
|
139
|
+
t.after(() => cleanup(base));
|
|
140
|
+
|
|
141
|
+
writeFileSync(
|
|
142
|
+
join(base, ".gsd", "REQUIREMENTS.md"),
|
|
143
|
+
[
|
|
144
|
+
"# Requirements",
|
|
145
|
+
"",
|
|
146
|
+
"## Active",
|
|
147
|
+
"### R999 - Projection-only requirement",
|
|
148
|
+
"- Class: functional",
|
|
149
|
+
"- Status: active",
|
|
150
|
+
"",
|
|
151
|
+
].join("\n"),
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
openProjectDb(base);
|
|
155
|
+
insertMilestone({ id: "M999", title: "DB Milestone", status: "active" });
|
|
156
|
+
insertRequirement(activeRequirement("R001"));
|
|
157
|
+
|
|
158
|
+
invalidateStateCache();
|
|
159
|
+
const state = await deriveStateFromDb(base);
|
|
160
|
+
|
|
161
|
+
assert.ok(state.requirements);
|
|
162
|
+
assert.equal(state.requirements.active, 1);
|
|
163
|
+
assert.equal(state.requirements.total, 1);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test("explicit markdown import remains opt-in and is not run by startup mismatch check", async (t) => {
|
|
167
|
+
const base = makeBase();
|
|
168
|
+
t.after(() => cleanup(base));
|
|
169
|
+
|
|
170
|
+
const milestoneDir = join(base, ".gsd", "milestones", "M001");
|
|
171
|
+
const sliceDir = join(milestoneDir, "slices", "S01");
|
|
172
|
+
const tasksDir = join(sliceDir, "tasks");
|
|
173
|
+
mkdirSync(tasksDir, { recursive: true });
|
|
174
|
+
writeFileSync(
|
|
175
|
+
join(milestoneDir, "M001-ROADMAP.md"),
|
|
176
|
+
[
|
|
177
|
+
"# M001: Imported Explicitly",
|
|
178
|
+
"",
|
|
179
|
+
"**Vision:** Explicit recovery import only",
|
|
180
|
+
"",
|
|
181
|
+
"## Slices",
|
|
182
|
+
"- [ ] **S01: Slice** `risk:low` `depends:[]`",
|
|
183
|
+
"",
|
|
184
|
+
].join("\n"),
|
|
185
|
+
);
|
|
186
|
+
writeFileSync(
|
|
187
|
+
join(sliceDir, "S01-PLAN.md"),
|
|
188
|
+
[
|
|
189
|
+
"# S01: Slice",
|
|
190
|
+
"",
|
|
191
|
+
"**Goal:** prove explicit import",
|
|
192
|
+
"",
|
|
193
|
+
"## Tasks",
|
|
194
|
+
"- [ ] **T01: Task** `est:5m`",
|
|
195
|
+
"",
|
|
196
|
+
].join("\n"),
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
openProjectDb(base);
|
|
200
|
+
const check = await checkMarkdownHierarchyAgainstDb(base);
|
|
201
|
+
assert.equal(check.action, "recovery-required");
|
|
202
|
+
assert.equal(getAllMilestones().length, 0, "startup mismatch check must not import markdown");
|
|
203
|
+
|
|
204
|
+
const imported = migrateHierarchyToDb(base);
|
|
205
|
+
assert.deepEqual(imported, { milestones: 1, slices: 1, tasks: 1 });
|
|
206
|
+
assert.equal(getAllMilestones().length, 1);
|
|
207
|
+
assert.equal(getSliceTasks("M001", "S01").length, 1);
|
|
208
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import test from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
|
-
import { existsSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { execFileSync } from "node:child_process";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
6
|
import { join } from "node:path";
|
|
@@ -10,7 +10,7 @@ import { runDispatch, runPreDispatch } from "../auto/phases.ts";
|
|
|
10
10
|
import { AutoSession } from "../auto/session.ts";
|
|
11
11
|
import { resolveUnitSupervisionTimeouts } from "../auto-timers.ts";
|
|
12
12
|
import { bootstrapAutoSession } from "../auto-start.ts";
|
|
13
|
-
import { postUnitPreVerification } from "../auto-post-unit.ts";
|
|
13
|
+
import { postUnitPostVerification, postUnitPreVerification } from "../auto-post-unit.ts";
|
|
14
14
|
import { resolveDispatch, setResearchProjectPromptBuilderForTest } from "../auto-dispatch.ts";
|
|
15
15
|
import { resolveExpectedArtifactPath, verifyExpectedArtifact, writeBlockerPlaceholder } from "../auto-recovery.ts";
|
|
16
16
|
import { finalizeProjectResearchTimeout } from "../project-research-policy.ts";
|
|
@@ -272,6 +272,7 @@ test("deep project setup: bootstrap can start auto-mode without an active milest
|
|
|
272
272
|
{
|
|
273
273
|
shouldUseWorktreeIsolation: () => false,
|
|
274
274
|
registerSigtermHandler: () => {},
|
|
275
|
+
registerAutoWorkerForSession: () => {},
|
|
275
276
|
lockBase: () => base,
|
|
276
277
|
buildLifecycle: () => ({
|
|
277
278
|
adoptSessionRoot: (sessionBase: string, originalBase?: string) => {
|
|
@@ -386,6 +387,7 @@ test("deep project setup: bootstrap continues queued M002 without milestone cont
|
|
|
386
387
|
{
|
|
387
388
|
shouldUseWorktreeIsolation: () => false,
|
|
388
389
|
registerSigtermHandler: () => {},
|
|
390
|
+
registerAutoWorkerForSession: () => {},
|
|
389
391
|
lockBase: () => base,
|
|
390
392
|
buildLifecycle: () => ({
|
|
391
393
|
adoptSessionRoot: (sessionBase: string, originalBase?: string) => {
|
|
@@ -1587,6 +1589,61 @@ test("deep project setup: discuss-milestone question failure pauses instead of a
|
|
|
1587
1589
|
}
|
|
1588
1590
|
});
|
|
1589
1591
|
|
|
1592
|
+
test("verified task git closeout failure retries and continues auto-mode", async () => {
|
|
1593
|
+
const base = makeBase();
|
|
1594
|
+
try {
|
|
1595
|
+
execFileSync("git", ["init"], { cwd: base, stdio: "ignore" });
|
|
1596
|
+
execFileSync("git", ["config", "user.email", "test@example.com"], { cwd: base, stdio: "ignore" });
|
|
1597
|
+
execFileSync("git", ["config", "user.name", "Test User"], { cwd: base, stdio: "ignore" });
|
|
1598
|
+
const hookPath = join(base, ".git", "hooks", "pre-commit");
|
|
1599
|
+
writeFileSync(
|
|
1600
|
+
hookPath,
|
|
1601
|
+
[
|
|
1602
|
+
"#!/bin/sh",
|
|
1603
|
+
"count_file=.git/pre-commit-count",
|
|
1604
|
+
"count=0",
|
|
1605
|
+
"if [ -f \"$count_file\" ]; then count=$(cat \"$count_file\"); fi",
|
|
1606
|
+
"count=$((count + 1))",
|
|
1607
|
+
"printf \"%s\" \"$count\" > \"$count_file\"",
|
|
1608
|
+
"echo blocked by test hook >&2",
|
|
1609
|
+
"exit 1",
|
|
1610
|
+
].join("\n"),
|
|
1611
|
+
);
|
|
1612
|
+
chmodSync(hookPath, 0o755);
|
|
1613
|
+
writeFileSync(join(base, "work.txt"), "changed\n");
|
|
1614
|
+
|
|
1615
|
+
const s = new AutoSession();
|
|
1616
|
+
s.active = true;
|
|
1617
|
+
s.basePath = base;
|
|
1618
|
+
s.originalBasePath = base;
|
|
1619
|
+
s.currentUnit = { type: "execute-task", id: "M001/S01/T01", startedAt: Date.now() };
|
|
1620
|
+
|
|
1621
|
+
let pauseCalled = false;
|
|
1622
|
+
const notifications: Array<{ message: string; severity?: string }> = [];
|
|
1623
|
+
const result = await postUnitPostVerification({
|
|
1624
|
+
s,
|
|
1625
|
+
ctx: { ui: { notify: (message: string, severity?: string) => notifications.push({ message, severity }) } } as any,
|
|
1626
|
+
pi: {} as any,
|
|
1627
|
+
buildSnapshotOpts: () => ({}) as any,
|
|
1628
|
+
lockBase: () => base,
|
|
1629
|
+
stopAuto: async () => {},
|
|
1630
|
+
pauseAuto: async () => { pauseCalled = true; },
|
|
1631
|
+
updateProgressWidget: () => {},
|
|
1632
|
+
});
|
|
1633
|
+
|
|
1634
|
+
assert.equal(result, "continue");
|
|
1635
|
+
assert.equal(pauseCalled, false);
|
|
1636
|
+
assert.equal(s.lastGitActionStatus, "failed");
|
|
1637
|
+
assert.equal(readFileSync(join(base, ".git", "pre-commit-count"), "utf-8"), "3");
|
|
1638
|
+
assert.ok(
|
|
1639
|
+
notifications.some((entry) => entry.severity === "warning" && entry.message.includes("Git commit failed")),
|
|
1640
|
+
"verified task git closeout failure should warn instead of stopping auto-mode",
|
|
1641
|
+
);
|
|
1642
|
+
} finally {
|
|
1643
|
+
rmSync(base, { recursive: true, force: true });
|
|
1644
|
+
}
|
|
1645
|
+
});
|
|
1646
|
+
|
|
1590
1647
|
test("deep project setup: approval wait wins over deterministic write-gate placeholder", async () => {
|
|
1591
1648
|
const base = makeBase();
|
|
1592
1649
|
try {
|
|
@@ -10,6 +10,7 @@ import assert from "node:assert/strict";
|
|
|
10
10
|
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { join } from "node:path";
|
|
12
12
|
import { tmpdir } from "node:os";
|
|
13
|
+
import { execFileSync } from "node:child_process";
|
|
13
14
|
|
|
14
15
|
import { DISPATCH_RULES, type DispatchContext } from "../auto-dispatch.ts";
|
|
15
16
|
import { closeDatabase, insertMilestone, openDatabase } from "../gsd-db.ts";
|
|
@@ -23,6 +24,14 @@ function makeBase(): string {
|
|
|
23
24
|
return base;
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
function initGitRepo(base: string): void {
|
|
28
|
+
execFileSync("git", ["init"], { cwd: base, stdio: "ignore" });
|
|
29
|
+
execFileSync("git", ["config", "user.email", "test@test.com"], { cwd: base, stdio: "ignore" });
|
|
30
|
+
execFileSync("git", ["config", "user.name", "Test"], { cwd: base, stdio: "ignore" });
|
|
31
|
+
execFileSync("git", ["add", "."], { cwd: base, stdio: "ignore" });
|
|
32
|
+
execFileSync("git", ["commit", "-m", "initial"], { cwd: base, stdio: "ignore" });
|
|
33
|
+
}
|
|
34
|
+
|
|
26
35
|
function buildDispatchCtx(basePath: string): DispatchContext {
|
|
27
36
|
return {
|
|
28
37
|
basePath,
|
|
@@ -76,6 +85,24 @@ describe("completing-milestone dispatch guard (#4324)", () => {
|
|
|
76
85
|
assert.equal(result?.unitType, "complete-milestone");
|
|
77
86
|
assert.equal(result?.unitId, "M001");
|
|
78
87
|
});
|
|
88
|
+
|
|
89
|
+
test("dispatches complete-milestone when only .gsd/ files exist in git history (#5097)", async () => {
|
|
90
|
+
base = makeBase();
|
|
91
|
+
rmSync(join(base, "implementation.txt"), { force: true });
|
|
92
|
+
initGitRepo(base);
|
|
93
|
+
writeFileSync(join(base, ".gsd", "milestones", "M001", "M001-SUMMARY.md"), "# Milestone Summary\n");
|
|
94
|
+
execFileSync("git", ["add", "."], { cwd: base, stdio: "ignore" });
|
|
95
|
+
execFileSync("git", ["commit", "-m", "chore: planning artifacts only"], { cwd: base, stdio: "ignore" });
|
|
96
|
+
|
|
97
|
+
openDatabase(join(base, ".gsd", "gsd.db"));
|
|
98
|
+
insertMilestone({ id: "M001", title: "Milestone One", status: "active" });
|
|
99
|
+
|
|
100
|
+
const result = await rule.match(buildDispatchCtx(base));
|
|
101
|
+
|
|
102
|
+
assert.equal(result?.action, "dispatch");
|
|
103
|
+
assert.equal(result?.unitType, "complete-milestone");
|
|
104
|
+
assert.equal(result?.unitId, "M001");
|
|
105
|
+
});
|
|
79
106
|
});
|
|
80
107
|
|
|
81
108
|
describe("complete phase dispatch guard (#5683)", () => {
|
|
@@ -118,3 +145,42 @@ describe("complete phase dispatch guard (#5683)", () => {
|
|
|
118
145
|
assert.equal(result?.reason, "All milestones complete.");
|
|
119
146
|
});
|
|
120
147
|
});
|
|
148
|
+
|
|
149
|
+
describe("complete milestone context recovery guard (#5831)", () => {
|
|
150
|
+
let base = "";
|
|
151
|
+
const executionEntryRule = DISPATCH_RULES.find(
|
|
152
|
+
(candidate) => candidate.name === "execution-entry phase (no context) → discuss-milestone",
|
|
153
|
+
);
|
|
154
|
+
const prePlanningRule = DISPATCH_RULES.find(
|
|
155
|
+
(candidate) => candidate.name === "pre-planning (no context) → discuss-milestone",
|
|
156
|
+
);
|
|
157
|
+
assert.ok(executionEntryRule, "execution-entry missing-context rule should exist");
|
|
158
|
+
assert.ok(prePlanningRule, "pre-planning missing-context rule should exist");
|
|
159
|
+
|
|
160
|
+
afterEach(() => {
|
|
161
|
+
if (base) rmSync(base, { recursive: true, force: true });
|
|
162
|
+
base = "";
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
test("does not discuss a complete execution-entry milestone with no CONTEXT file", async () => {
|
|
166
|
+
base = makeBase();
|
|
167
|
+
const ctx = buildDispatchCtx(base);
|
|
168
|
+
ctx.state.registry = [{ id: "M001", title: "Milestone One", status: "complete" }];
|
|
169
|
+
ctx.state.phase = "completing-milestone";
|
|
170
|
+
|
|
171
|
+
const result = await executionEntryRule.match(ctx);
|
|
172
|
+
|
|
173
|
+
assert.equal(result, null);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
test("does not discuss a complete pre-planning milestone with no CONTEXT file", async () => {
|
|
177
|
+
base = makeBase();
|
|
178
|
+
const ctx = buildDispatchCtx(base);
|
|
179
|
+
ctx.state.registry = [{ id: "M001", title: "Milestone One", status: "complete" }];
|
|
180
|
+
ctx.state.phase = "pre-planning";
|
|
181
|
+
|
|
182
|
+
const result = await prePlanningRule.match(ctx);
|
|
183
|
+
|
|
184
|
+
assert.equal(result, null);
|
|
185
|
+
});
|
|
186
|
+
});
|
|
@@ -47,6 +47,33 @@ test("dispatch guard blocks when prior milestone has incomplete slices", (t) =>
|
|
|
47
47
|
);
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
+
test("dispatch guard skips prior DB parked or deferred milestones without marker files", (t) => {
|
|
51
|
+
const repo = setupRepo();
|
|
52
|
+
t.after(() => teardownRepo(repo));
|
|
53
|
+
|
|
54
|
+
mkdirSync(join(repo, ".gsd", "milestones", "M001"), { recursive: true });
|
|
55
|
+
mkdirSync(join(repo, ".gsd", "milestones", "M002"), { recursive: true });
|
|
56
|
+
mkdirSync(join(repo, ".gsd", "milestones", "M003"), { recursive: true });
|
|
57
|
+
|
|
58
|
+
insertMilestone({ id: "M001", title: "Parked", status: "parked" });
|
|
59
|
+
insertSlice({ id: "S01", milestoneId: "M001", title: "Incomplete", status: "pending", depends: [], sequence: 1 });
|
|
60
|
+
|
|
61
|
+
insertMilestone({ id: "M002", title: "Deferred", status: "deferred" });
|
|
62
|
+
insertSlice({ id: "S01", milestoneId: "M002", title: "Incomplete", status: "pending", depends: [], sequence: 1 });
|
|
63
|
+
|
|
64
|
+
insertMilestone({ id: "M003", title: "Current", status: "active" });
|
|
65
|
+
insertSlice({ id: "S01", milestoneId: "M003", title: "First", status: "pending", depends: [], sequence: 1 });
|
|
66
|
+
|
|
67
|
+
writeFileSync(join(repo, ".gsd", "milestones", "M001", "M001-ROADMAP.md"), "# M001\n");
|
|
68
|
+
writeFileSync(join(repo, ".gsd", "milestones", "M002", "M002-ROADMAP.md"), "# M002\n");
|
|
69
|
+
writeFileSync(join(repo, ".gsd", "milestones", "M003", "M003-ROADMAP.md"), "# M003\n");
|
|
70
|
+
|
|
71
|
+
assert.equal(
|
|
72
|
+
getPriorSliceCompletionBlocker(repo, "main", "plan-slice", "M003/S01"),
|
|
73
|
+
null,
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
|
|
50
77
|
test("dispatch guard blocks later slice in same milestone when earlier incomplete", (t) => {
|
|
51
78
|
const repo = setupRepo();
|
|
52
79
|
t.after(() => teardownRepo(repo));
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Regression tests for doctor repair of empty milestone worktrees.
|
|
3
|
+
|
|
4
|
+
import test from "node:test";
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
import { execFileSync } from "node:child_process";
|
|
7
|
+
import { existsSync, mkdtempSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { tmpdir } from "node:os";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
|
|
11
|
+
import { runGSDDoctor } from "../doctor.ts";
|
|
12
|
+
import { createWorktree, worktreePath } from "../worktree-manager.ts";
|
|
13
|
+
|
|
14
|
+
function runGit(args: string[], cwd: string): string {
|
|
15
|
+
return execFileSync("git", args, {
|
|
16
|
+
cwd,
|
|
17
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
18
|
+
encoding: "utf-8",
|
|
19
|
+
}).trim();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function makeRepo(): string {
|
|
23
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-doctor-empty-worktree-"));
|
|
24
|
+
runGit(["init", "-b", "main"], base);
|
|
25
|
+
runGit(["config", "user.name", "Test User"], base);
|
|
26
|
+
runGit(["config", "user.email", "test@example.com"], base);
|
|
27
|
+
writeFileSync(join(base, "package.json"), "{\"scripts\":{}}\n", "utf-8");
|
|
28
|
+
runGit(["add", "."], base);
|
|
29
|
+
runGit(["commit", "-m", "chore: init"], base);
|
|
30
|
+
return base;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
test("doctor fix recreates an empty registered milestone worktree", async (t) => {
|
|
34
|
+
const base = makeRepo();
|
|
35
|
+
t.after(() => rmSync(base, { recursive: true, force: true }));
|
|
36
|
+
|
|
37
|
+
createWorktree(base, "M001", { branch: "milestone/M001" });
|
|
38
|
+
const wtPath = worktreePath(base, "M001");
|
|
39
|
+
writeFileSync(join(wtPath, "milestone-note.txt"), "worktree branch content\n", "utf-8");
|
|
40
|
+
runGit(["add", "milestone-note.txt"], wtPath);
|
|
41
|
+
runGit(["commit", "-m", "test: add milestone content"], wtPath);
|
|
42
|
+
for (const entry of readdirSync(wtPath)) {
|
|
43
|
+
if (entry === ".git") continue;
|
|
44
|
+
rmSync(join(wtPath, entry), { recursive: true, force: true });
|
|
45
|
+
}
|
|
46
|
+
assert.ok(existsSync(join(wtPath, ".git")), "test setup keeps registered worktree marker");
|
|
47
|
+
assert.equal(existsSync(join(wtPath, "package.json")), false, "test setup removes project content");
|
|
48
|
+
|
|
49
|
+
const report = await runGSDDoctor(base, {
|
|
50
|
+
fix: true,
|
|
51
|
+
fixLevel: "all",
|
|
52
|
+
isolationMode: "worktree",
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
assert.ok(
|
|
56
|
+
report.issues.some((issue) => issue.code === "worktree_empty_with_project_content"),
|
|
57
|
+
"doctor reports the empty worktree",
|
|
58
|
+
);
|
|
59
|
+
assert.ok(
|
|
60
|
+
report.fixesApplied.some((fix) => fix.includes("recreated empty worktree")),
|
|
61
|
+
"doctor applies the repair",
|
|
62
|
+
);
|
|
63
|
+
assert.ok(existsSync(join(wtPath, "package.json")), "worktree content is restored");
|
|
64
|
+
assert.ok(existsSync(join(wtPath, "milestone-note.txt")), "branch content is restored");
|
|
65
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Tests for verification evidence cross-reference mismatch policy.
|
|
3
|
+
|
|
4
|
+
import test from "node:test";
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
|
|
7
|
+
import { crossReferenceEvidence } from "../safety/evidence-cross-ref.ts";
|
|
8
|
+
import type { EvidenceEntry } from "../safety/evidence-collector.ts";
|
|
9
|
+
|
|
10
|
+
test("claims of passing verification become errors when recorded bash evidence failed", () => {
|
|
11
|
+
const mismatches = crossReferenceEvidence(
|
|
12
|
+
[{ command: "npm test", exitCode: 0, verdict: "passed" }],
|
|
13
|
+
[
|
|
14
|
+
{
|
|
15
|
+
kind: "bash",
|
|
16
|
+
toolCallId: "call-1",
|
|
17
|
+
command: "npm test",
|
|
18
|
+
exitCode: 1,
|
|
19
|
+
outputSnippet: "failed",
|
|
20
|
+
timestamp: Date.now(),
|
|
21
|
+
},
|
|
22
|
+
] as EvidenceEntry[],
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
assert.equal(mismatches.length, 1);
|
|
26
|
+
assert.equal(mismatches[0].severity, "error");
|
|
27
|
+
assert.match(mismatches[0].reason, /Claimed exitCode=0/);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test("missing recorded bash evidence remains a warning", () => {
|
|
31
|
+
const mismatches = crossReferenceEvidence(
|
|
32
|
+
[{ command: "npm test", exitCode: 0, verdict: "passed" }],
|
|
33
|
+
[],
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
assert.equal(mismatches.length, 1);
|
|
37
|
+
assert.equal(mismatches[0].severity, "warning");
|
|
38
|
+
});
|
|
@@ -141,6 +141,14 @@ test("Feature 1: executive summary paragraph is rendered", () => {
|
|
|
141
141
|
assert.ok(html.includes("$2.50 spent"), "should contain cost");
|
|
142
142
|
});
|
|
143
143
|
|
|
144
|
+
test("report uses the shared GSD HTML shell", () => {
|
|
145
|
+
const html = generateHtmlReport(mockData(), mockOpts());
|
|
146
|
+
assert.ok(html.includes('<span class="logo">GSD</span>'), "should render shared shell logo");
|
|
147
|
+
assert.ok(html.includes('<span class="kind-chip">Report</span>'), "should render report kind chip");
|
|
148
|
+
assert.ok(html.includes('<nav class="toc" aria-label="Report sections">'), "should render shared shell TOC");
|
|
149
|
+
assert.ok(html.includes('<main>'), "should render content inside shared shell main");
|
|
150
|
+
});
|
|
151
|
+
|
|
144
152
|
test("Feature 1: executive summary includes budget context when set", () => {
|
|
145
153
|
const data = mockData({ health: { ...mockData().health, budgetCeiling: 10.00 } });
|
|
146
154
|
const html = generateHtmlReport(data, mockOpts());
|