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
|
@@ -102,6 +102,9 @@ function missingSliceStop(mid, phase) {
|
|
|
102
102
|
level: "error",
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
+
function isRegistryMilestoneComplete(state, mid) {
|
|
106
|
+
return state.registry.some((milestone) => milestone.id === mid && milestone.status === "complete");
|
|
107
|
+
}
|
|
105
108
|
/**
|
|
106
109
|
* Check for milestone slices missing SUMMARY files.
|
|
107
110
|
* Returns array of missing slice IDs, or empty array if all present or DB unavailable.
|
|
@@ -247,6 +250,8 @@ export const DISPATCH_RULES = [
|
|
|
247
250
|
return null;
|
|
248
251
|
if (!MILESTONE_ID_RE.test(mid))
|
|
249
252
|
return null;
|
|
253
|
+
if (isRegistryMilestoneComplete(state, mid))
|
|
254
|
+
return null;
|
|
250
255
|
// Align with the plan-v2 gate's lookup semantics: whitespace-only counts
|
|
251
256
|
// as missing, and an auto worktree may fall back to GSD_PROJECT_ROOT.
|
|
252
257
|
if (hasFinalizedMilestoneContext(basePath, mid))
|
|
@@ -294,9 +299,7 @@ export const DISPATCH_RULES = [
|
|
|
294
299
|
const attempts = incrementUatCount(basePath, mid, sliceId);
|
|
295
300
|
if (attempts > MAX_UAT_ATTEMPTS) {
|
|
296
301
|
return {
|
|
297
|
-
action: "
|
|
298
|
-
reason: `run-uat for ${mid}/${sliceId} has been dispatched ${attempts - 1} times without producing a verdict. Verification commands may be broken — fix the UAT spec or manually write an ASSESSMENT verdict.`,
|
|
299
|
-
level: "warning",
|
|
302
|
+
action: "skip",
|
|
300
303
|
};
|
|
301
304
|
}
|
|
302
305
|
const uatFile = resolveSliceFile(basePath, mid, sliceId, "UAT");
|
|
@@ -557,6 +560,8 @@ export const DISPATCH_RULES = [
|
|
|
557
560
|
match: async ({ state, mid, midTitle, basePath, prefs, structuredQuestionsAvailable }) => {
|
|
558
561
|
if (state.phase !== "pre-planning")
|
|
559
562
|
return null;
|
|
563
|
+
if (isRegistryMilestoneComplete(state, mid))
|
|
564
|
+
return null;
|
|
560
565
|
const contextFile = resolveMilestoneFile(basePath, mid, "CONTEXT");
|
|
561
566
|
const hasContext = !!(contextFile && (await loadFile(contextFile)));
|
|
562
567
|
if (hasContext)
|
|
@@ -609,7 +614,7 @@ export const DISPATCH_RULES = [
|
|
|
609
614
|
},
|
|
610
615
|
},
|
|
611
616
|
{
|
|
612
|
-
name: "planning (require_slice_discussion) → pause for discussion
|
|
617
|
+
name: "planning (require_slice_discussion) → pause for discussion",
|
|
613
618
|
match: async ({ state, mid, basePath, prefs }) => {
|
|
614
619
|
if (state.phase !== "planning")
|
|
615
620
|
return null;
|
|
@@ -1016,7 +1021,7 @@ export const DISPATCH_RULES = [
|
|
|
1016
1021
|
mkdirSync(mDir, { recursive: true });
|
|
1017
1022
|
const validationPath = join(mDir, buildMilestoneFileName(mid, "VALIDATION"));
|
|
1018
1023
|
const skipSource = trivialVariant
|
|
1019
|
-
? "trivial-scope pipeline variant
|
|
1024
|
+
? "trivial-scope pipeline variant"
|
|
1020
1025
|
: "`skip_milestone_validation` preference";
|
|
1021
1026
|
const skipValidationReason = trivialVariant ? "trivial-scope" : "preference";
|
|
1022
1027
|
const content = [
|
|
@@ -1091,19 +1096,19 @@ export const DISPATCH_RULES = [
|
|
|
1091
1096
|
return { action: "skip" };
|
|
1092
1097
|
}
|
|
1093
1098
|
}
|
|
1094
|
-
// Safety guard (#2675): block completion when VALIDATION
|
|
1095
|
-
//
|
|
1096
|
-
// terminal
|
|
1097
|
-
//
|
|
1099
|
+
// Safety guard (#2675, #5747, #5920): block completion when VALIDATION
|
|
1100
|
+
// verdict is anything other than pass. The state machine treats these
|
|
1101
|
+
// verdicts as terminal, but completing-milestone should NOT proceed —
|
|
1102
|
+
// remediation or human attention is needed.
|
|
1098
1103
|
const validationFile = resolveMilestoneFile(basePath, mid, "VALIDATION");
|
|
1099
1104
|
if (validationFile) {
|
|
1100
1105
|
const validationContent = await loadFile(validationFile);
|
|
1101
1106
|
if (validationContent) {
|
|
1102
1107
|
const verdict = extractVerdict(validationContent);
|
|
1103
|
-
if (verdict
|
|
1108
|
+
if (verdict !== "pass") {
|
|
1104
1109
|
return {
|
|
1105
1110
|
action: "stop",
|
|
1106
|
-
reason: `Cannot complete milestone ${mid}: VALIDATION verdict is "
|
|
1111
|
+
reason: `Cannot complete milestone ${mid}: VALIDATION verdict is "${verdict}". Address the validation findings and re-run validation, or run \`/gsd verdict pass --rationale "..."\` to override.`,
|
|
1107
1112
|
level: "warning",
|
|
1108
1113
|
};
|
|
1109
1114
|
}
|
|
@@ -1118,16 +1123,12 @@ export const DISPATCH_RULES = [
|
|
|
1118
1123
|
level: "error",
|
|
1119
1124
|
};
|
|
1120
1125
|
}
|
|
1121
|
-
// Safety
|
|
1122
|
-
// artifacts
|
|
1123
|
-
//
|
|
1126
|
+
// Safety signal (#1703, #5097): detect milestones with only .gsd/
|
|
1127
|
+
// artifacts. This no longer hard-blocks completion because some
|
|
1128
|
+
// milestones are intentionally planning/documentation-only.
|
|
1124
1129
|
const artifactCheck = hasImplementationArtifacts(basePath, mid);
|
|
1125
1130
|
if (artifactCheck === "absent") {
|
|
1126
|
-
|
|
1127
|
-
action: "stop",
|
|
1128
|
-
reason: `Cannot complete milestone ${mid}: no implementation files found outside .gsd/. The milestone has only plan files — actual code changes are required.`,
|
|
1129
|
-
level: "error",
|
|
1130
|
-
};
|
|
1131
|
+
logWarning("dispatch", `Milestone ${mid} has no implementation files outside .gsd/ — continuing complete-milestone dispatch (planning-only/documentation-only milestone).`);
|
|
1131
1132
|
}
|
|
1132
1133
|
if (artifactCheck === "unknown") {
|
|
1133
1134
|
logWarning("dispatch", `Implementation artifact check inconclusive for ${mid} — proceeding (git context unavailable)`);
|
|
@@ -494,6 +494,8 @@ autoModeStartThinkingLevel) {
|
|
|
494
494
|
* Handles formats: "provider/model", "bare-id", "org/model-name" (OpenRouter).
|
|
495
495
|
*/
|
|
496
496
|
export function resolveModelId(modelId, availableModels, currentProvider) {
|
|
497
|
+
if (!modelId)
|
|
498
|
+
return undefined;
|
|
497
499
|
const slashIdx = modelId.indexOf("/");
|
|
498
500
|
if (slashIdx !== -1) {
|
|
499
501
|
const maybeProvider = modelId.substring(0, slashIdx);
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Split into two functions called sequentially by auto-loop with
|
|
9
9
|
* the verification gate between them:
|
|
10
|
-
* 1. postUnitPreVerification() —
|
|
11
|
-
* 2. postUnitPostVerification() — DB dual-write, hooks, triage, quick-tasks
|
|
10
|
+
* 1. postUnitPreVerification() — closeout git for non-task units, doctor, state rebuild, worktree sync, artifact verification
|
|
11
|
+
* 2. postUnitPostVerification() — post-verified task git, DB dual-write, hooks, triage, quick-tasks
|
|
12
12
|
*
|
|
13
13
|
* Extracted from the pre-loop agent_end handler in auto.ts.
|
|
14
14
|
*/
|
|
@@ -23,12 +23,12 @@ import { rebuildState } from "./doctor.js";
|
|
|
23
23
|
import { parseUnitId } from "./unit-id.js";
|
|
24
24
|
import { closeoutUnit } from "./auto-unit-closeout.js";
|
|
25
25
|
import { runTurnGitAction, } from "./git-service.js";
|
|
26
|
-
import { verifyExpectedArtifact, resolveExpectedArtifactPath, writeBlockerPlaceholder, diagnoseExpectedArtifact, } from "./auto-recovery.js";
|
|
26
|
+
import { verifyExpectedArtifact, resolveExpectedArtifactPath, writeBlockerPlaceholder, diagnoseExpectedArtifact, diagnoseWorktreeIntegrityFailure, } from "./auto-recovery.js";
|
|
27
27
|
import { regenerateIfMissing } from "./workflow-projections.js";
|
|
28
28
|
import { WorktreeStateProjection } from "./worktree-state-projection.js";
|
|
29
29
|
import { createWorkspace, scopeMilestone } from "./workspace.js";
|
|
30
30
|
import { normalizeWorktreePathForCompare } from "./worktree-root.js";
|
|
31
|
-
import { isDbAvailable, getTask, getSlice, getMilestone, updateTaskStatus, _getAdapter, getVerificationEvidence } from "./gsd-db.js";
|
|
31
|
+
import { isDbAvailable, getDbPath, refreshOpenDatabaseFromDisk, getTask, getSlice, getMilestone, updateTaskStatus, _getAdapter, getVerificationEvidence } from "./gsd-db.js";
|
|
32
32
|
import { renderPlanCheckboxes } from "./markdown-renderer.js";
|
|
33
33
|
import { consumeSignal } from "./session-status-io.js";
|
|
34
34
|
import { checkPostUnitHooks, isRetryPending, consumeRetryTrigger, persistHookState, resolveHookArtifactPath, } from "./post-unit-hooks.js";
|
|
@@ -37,8 +37,7 @@ import { debugLog } from "./debug-logger.js";
|
|
|
37
37
|
import { runSafely } from "./auto-utils.js";
|
|
38
38
|
import { getEvidence, clearEvidenceFromDisk } from "./safety/evidence-collector.js";
|
|
39
39
|
import { validateFileChanges } from "./safety/file-change-validator.js";
|
|
40
|
-
|
|
41
|
-
// import { crossReferenceEvidence, type ClaimedEvidence } from "./safety/evidence-cross-ref.js";
|
|
40
|
+
import { crossReferenceEvidence } from "./safety/evidence-cross-ref.js";
|
|
42
41
|
import { validateContent } from "./safety/content-validator.js";
|
|
43
42
|
import { resolveSafetyHarnessConfig } from "./safety/safety-harness.js";
|
|
44
43
|
import { resolveExpectedArtifactPath as resolveArtifactForContent } from "./auto-artifact-paths.js";
|
|
@@ -126,7 +125,7 @@ async function buildTaskCommitContextForUnit(basePath, unitId) {
|
|
|
126
125
|
sliceId: sid,
|
|
127
126
|
sliceTitle: stripKnownIdPrefix(slice?.title, sid),
|
|
128
127
|
oneLiner: summary?.oneLiner || task?.one_liner || undefined,
|
|
129
|
-
keyFiles: summary?.frontmatter.key_files?.filter(f => !f.includes("{{")) ??
|
|
128
|
+
keyFiles: summary?.frontmatter.key_files?.filter(f => !f.includes("{{") && f.trim() !== "(none)") ??
|
|
130
129
|
task?.key_files ??
|
|
131
130
|
undefined,
|
|
132
131
|
issueNumber: ghIssueNumber,
|
|
@@ -171,6 +170,9 @@ export function _shouldDispatchQuickTaskForTest(state) {
|
|
|
171
170
|
!!state.currentUnit &&
|
|
172
171
|
state.currentUnit.type !== "quick-task";
|
|
173
172
|
}
|
|
173
|
+
export function shouldDeferCloseoutGitAction(unitType) {
|
|
174
|
+
return unitType === "execute-task";
|
|
175
|
+
}
|
|
174
176
|
/** Unit types that only touch `.gsd/` internal state files (no code changes).
|
|
175
177
|
* Auto-commit is skipped for these — their state files are picked up by the
|
|
176
178
|
* next actual task commit via `smartStage()`. */
|
|
@@ -292,14 +294,27 @@ export function detectRogueFileWrites(unitType, unitId, basePath) {
|
|
|
292
294
|
* looping indefinitely (#2007).
|
|
293
295
|
*/
|
|
294
296
|
export const MAX_ARTIFACT_VERIFICATION_RETRIES = 3;
|
|
295
|
-
export const STEP_COMPLETE_FALLBACK_MESSAGE = "Step complete. Run /clear, then /gsd to continue (or /gsd auto to run continuously).";
|
|
297
|
+
export const STEP_COMPLETE_FALLBACK_MESSAGE = "Step complete. Run /clear if you want a clean view, then /gsd next to continue one step (or /gsd auto to run continuously).";
|
|
296
298
|
export function buildStepCompleteMessage(nextState) {
|
|
297
299
|
if (nextState.phase === "complete") {
|
|
298
300
|
return "Step complete — milestone finished. Run /gsd status to review, or start the next milestone.";
|
|
299
301
|
}
|
|
300
302
|
const next = describeNextUnit(nextState);
|
|
301
303
|
return `Step complete. Next: ${next.label}\n`
|
|
302
|
-
+ `Run /clear, then /gsd to continue (or /gsd auto to run continuously).`;
|
|
304
|
+
+ `Run /clear if you want a clean view, then /gsd next to continue one step (or /gsd auto to run continuously).`;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Decide whether step mode should stop at the step wizard after a unit finishes.
|
|
308
|
+
*
|
|
309
|
+
* @param currentUnitType The just-finished unit type, such as "execute-task" or
|
|
310
|
+
* "complete-milestone"; may be null/undefined when no current unit is known.
|
|
311
|
+
* @param phaseAfterUnit The freshly derived next phase, such as "executing" or
|
|
312
|
+
* "complete"; may be null/undefined if state derivation failed.
|
|
313
|
+
* @returns true to show the step wizard; false to keep the loop running so
|
|
314
|
+
* terminal milestone completion can reach the merge/finalization path.
|
|
315
|
+
*/
|
|
316
|
+
export function shouldReturnStepWizardAfterUnit(currentUnitType, phaseAfterUnit) {
|
|
317
|
+
return currentUnitType !== "complete-milestone" && phaseAfterUnit !== "complete";
|
|
303
318
|
}
|
|
304
319
|
export const USER_DRIVEN_DEEP_UNITS = new Set([
|
|
305
320
|
"discuss-project",
|
|
@@ -316,6 +331,10 @@ function artifactValidationKind(unitType) {
|
|
|
316
331
|
return null;
|
|
317
332
|
}
|
|
318
333
|
function describeArtifactVerificationFailure(unitType, unitId, basePath) {
|
|
334
|
+
const worktreeFailure = diagnoseWorktreeIntegrityFailure(basePath);
|
|
335
|
+
if (worktreeFailure) {
|
|
336
|
+
return `${worktreeFailure} Unit: ${unitType} ${unitId}.`;
|
|
337
|
+
}
|
|
319
338
|
const artifactPath = resolveExpectedArtifactPath(unitType, unitId, basePath);
|
|
320
339
|
if (!artifactPath) {
|
|
321
340
|
return `Artifact verification failed: ${unitType} "${unitId}" has no resolvable artifact path.`;
|
|
@@ -360,6 +379,148 @@ export async function autoCommitUnit(basePath, unitType, unitId, ctx) {
|
|
|
360
379
|
return null;
|
|
361
380
|
}
|
|
362
381
|
}
|
|
382
|
+
/**
|
|
383
|
+
* Execute the turn-level git action (commit, snapshot, or status-only).
|
|
384
|
+
*
|
|
385
|
+
* @param opts.softFailure - Defaults to false. When true, retry git failures,
|
|
386
|
+
* warn, and continue without pausing auto-mode; use for best-effort deferred
|
|
387
|
+
* closeout work where a git failure should not block the run.
|
|
388
|
+
*/
|
|
389
|
+
async function runCloseoutGitAction(pctx, unit, opts) {
|
|
390
|
+
const { s, ctx, pi, pauseAuto } = pctx;
|
|
391
|
+
const prefs = loadEffectiveGSDPreferences()?.preferences;
|
|
392
|
+
const uokFlags = resolveUokFlags(prefs);
|
|
393
|
+
const turnAction = uokFlags.gitops ? uokFlags.gitopsTurnAction : "commit";
|
|
394
|
+
const traceId = s.currentTraceId ?? `turn:${unit.startedAt}`;
|
|
395
|
+
const turnId = s.currentTurnId ?? `${unit.type}/${unit.id}/${unit.startedAt}`;
|
|
396
|
+
s.lastGitActionFailure = null;
|
|
397
|
+
s.lastGitActionStatus = null;
|
|
398
|
+
try {
|
|
399
|
+
let taskContext;
|
|
400
|
+
if (turnAction === "commit" && unit.type === "execute-task") {
|
|
401
|
+
taskContext = await buildTaskCommitContextForUnit(s.basePath, unit.id);
|
|
402
|
+
}
|
|
403
|
+
// Invalidate the nativeHasChanges cache before auto-commit (#1853).
|
|
404
|
+
// The cache has a 10-second TTL and is keyed by basePath. A stale
|
|
405
|
+
// `false` result causes autoCommit to skip staging entirely.
|
|
406
|
+
_resetHasChangesCache();
|
|
407
|
+
const skipLifecycleCommit = turnAction === "commit" && LIFECYCLE_ONLY_UNITS.has(unit.type);
|
|
408
|
+
if (skipLifecycleCommit) {
|
|
409
|
+
debugLog("postUnit", {
|
|
410
|
+
phase: "git-action-skipped",
|
|
411
|
+
reason: "lifecycle-only-unit",
|
|
412
|
+
unitType: unit.type,
|
|
413
|
+
unitId: unit.id,
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
const maxAttempts = opts?.softFailure ? 3 : 1;
|
|
418
|
+
let gitResult = runTurnGitAction({
|
|
419
|
+
basePath: s.basePath,
|
|
420
|
+
action: turnAction,
|
|
421
|
+
unitType: unit.type,
|
|
422
|
+
unitId: unit.id,
|
|
423
|
+
taskContext,
|
|
424
|
+
});
|
|
425
|
+
for (let attempt = 1; gitResult.status === "failed" && attempt < maxAttempts; attempt++) {
|
|
426
|
+
await new Promise((resolve) => setTimeout(resolve, 250 * attempt));
|
|
427
|
+
gitResult = runTurnGitAction({
|
|
428
|
+
basePath: s.basePath,
|
|
429
|
+
action: turnAction,
|
|
430
|
+
unitType: unit.type,
|
|
431
|
+
unitId: unit.id,
|
|
432
|
+
taskContext,
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
if (uokFlags.gitops) {
|
|
436
|
+
writeTurnGitTransaction({
|
|
437
|
+
basePath: s.basePath,
|
|
438
|
+
traceId,
|
|
439
|
+
turnId,
|
|
440
|
+
unitType: unit.type,
|
|
441
|
+
unitId: unit.id,
|
|
442
|
+
stage: "publish",
|
|
443
|
+
action: turnAction,
|
|
444
|
+
push: uokFlags.gitopsTurnPush,
|
|
445
|
+
status: gitResult.status,
|
|
446
|
+
error: gitResult.error,
|
|
447
|
+
metadata: {
|
|
448
|
+
dirty: gitResult.dirty,
|
|
449
|
+
commitMessage: gitResult.commitMessage,
|
|
450
|
+
snapshotLabel: gitResult.snapshotLabel,
|
|
451
|
+
},
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
if (gitResult.status === "failed") {
|
|
455
|
+
s.lastGitActionFailure = gitResult.error ?? `git ${turnAction} failed`;
|
|
456
|
+
s.lastGitActionStatus = "failed";
|
|
457
|
+
if (uokFlags.gitops && uokFlags.gates) {
|
|
458
|
+
const parsed = parseUnitId(unit.id);
|
|
459
|
+
const gateRunner = new UokGateRunner();
|
|
460
|
+
gateRunner.register({
|
|
461
|
+
id: "closeout-git-action",
|
|
462
|
+
type: "closeout",
|
|
463
|
+
execute: async () => ({
|
|
464
|
+
outcome: "fail",
|
|
465
|
+
failureClass: "git",
|
|
466
|
+
rationale: `turn git action "${turnAction}" failed`,
|
|
467
|
+
findings: gitResult.error ?? "unknown git failure",
|
|
468
|
+
}),
|
|
469
|
+
});
|
|
470
|
+
await gateRunner.run("closeout-git-action", {
|
|
471
|
+
basePath: s.basePath,
|
|
472
|
+
traceId,
|
|
473
|
+
turnId,
|
|
474
|
+
milestoneId: parsed.milestone ?? undefined,
|
|
475
|
+
sliceId: parsed.slice ?? undefined,
|
|
476
|
+
taskId: parsed.task ?? undefined,
|
|
477
|
+
unitType: unit.type,
|
|
478
|
+
unitId: unit.id,
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
const failureMsg = `Git ${turnAction} failed: ${(gitResult.error ?? "unknown error").split("\n")[0]}`;
|
|
482
|
+
ctx.ui.notify(failureMsg, opts?.softFailure ? "warning" : "error");
|
|
483
|
+
debugLog("postUnit", {
|
|
484
|
+
phase: opts?.softFailure ? "git-action-failed-soft" : "git-action-failed-blocking",
|
|
485
|
+
action: turnAction,
|
|
486
|
+
error: gitResult.error ?? "unknown error",
|
|
487
|
+
});
|
|
488
|
+
if (opts?.softFailure) {
|
|
489
|
+
return "continue";
|
|
490
|
+
}
|
|
491
|
+
await pauseAuto(ctx, pi);
|
|
492
|
+
return "dispatched";
|
|
493
|
+
}
|
|
494
|
+
s.lastGitActionStatus = "ok";
|
|
495
|
+
if (turnAction === "commit" && gitResult.commitMessage) {
|
|
496
|
+
ctx.ui.notify(`Committed: ${gitResult.commitMessage.split("\n")[0]}`, "info");
|
|
497
|
+
}
|
|
498
|
+
else if (turnAction === "snapshot" && gitResult.snapshotLabel) {
|
|
499
|
+
ctx.ui.notify(`Snapshot recorded: ${gitResult.snapshotLabel}`, "info");
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
catch (e) {
|
|
504
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
505
|
+
s.lastGitActionFailure = message;
|
|
506
|
+
s.lastGitActionStatus = "failed";
|
|
507
|
+
debugLog("postUnit", { phase: "git-action", error: message, action: turnAction });
|
|
508
|
+
ctx.ui.notify(`Git ${turnAction} failed: ${message.split("\n")[0]}`, opts?.softFailure ? "warning" : "error");
|
|
509
|
+
if (opts?.softFailure) {
|
|
510
|
+
return "continue";
|
|
511
|
+
}
|
|
512
|
+
if (uokFlags.gitops) {
|
|
513
|
+
await pauseAuto(ctx, pi);
|
|
514
|
+
return "dispatched";
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
// GitHub sync (non-blocking, opt-in)
|
|
518
|
+
await runSafely("postUnit", "github-sync", async () => {
|
|
519
|
+
const { runGitHubSync } = await import("../github-sync/sync.js");
|
|
520
|
+
await runGitHubSync(s.basePath, unit.type, unit.id);
|
|
521
|
+
});
|
|
522
|
+
return "continue";
|
|
523
|
+
}
|
|
363
524
|
/**
|
|
364
525
|
* Pre-verification processing: parallel worker signal check, cache invalidation,
|
|
365
526
|
* auto-commit, doctor run, state rebuild, worktree sync, artifact verification.
|
|
@@ -370,7 +531,7 @@ export async function autoCommitUnit(basePath, unitType, unitId, ctx) {
|
|
|
370
531
|
* - "retry" — artifact verification failed, s.pendingVerificationRetry set for loop re-iteration
|
|
371
532
|
*/
|
|
372
533
|
export async function postUnitPreVerification(pctx, opts) {
|
|
373
|
-
const { s, ctx, pi,
|
|
534
|
+
const { s, ctx, pi, stopAuto, pauseAuto } = pctx;
|
|
374
535
|
// ── Parallel worker signal check ──
|
|
375
536
|
const milestoneLock = process.env.GSD_MILESTONE_LOCK;
|
|
376
537
|
if (milestoneLock) {
|
|
@@ -392,125 +553,29 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
392
553
|
if (!opts?.skipSettleDelay) {
|
|
393
554
|
await new Promise(r => setTimeout(r, 100));
|
|
394
555
|
}
|
|
395
|
-
const
|
|
396
|
-
|
|
556
|
+
const dbPath = getDbPath();
|
|
557
|
+
if (isDbAvailable() && dbPath && dbPath !== ":memory:") {
|
|
558
|
+
const refreshed = refreshOpenDatabaseFromDisk();
|
|
559
|
+
if (!refreshed) {
|
|
560
|
+
logWarning("db", "post-unit database refresh failed; derived state may be stale");
|
|
561
|
+
}
|
|
562
|
+
}
|
|
397
563
|
// Turn-level git action (commit | snapshot | status-only)
|
|
398
564
|
if (s.currentUnit) {
|
|
399
565
|
const unit = s.currentUnit;
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
let taskContext;
|
|
407
|
-
if (turnAction === "commit" && s.currentUnit.type === "execute-task") {
|
|
408
|
-
taskContext = await buildTaskCommitContextForUnit(s.basePath, s.currentUnit.id);
|
|
409
|
-
}
|
|
410
|
-
// Invalidate the nativeHasChanges cache before auto-commit (#1853).
|
|
411
|
-
// The cache has a 10-second TTL and is keyed by basePath. A stale
|
|
412
|
-
// `false` result causes autoCommit to skip staging entirely, leaving
|
|
413
|
-
// code files only in the working tree where they are destroyed by
|
|
414
|
-
// `git worktree remove --force` during teardown.
|
|
415
|
-
_resetHasChangesCache();
|
|
416
|
-
const skipLifecycleCommit = turnAction === "commit" && LIFECYCLE_ONLY_UNITS.has(s.currentUnit.type);
|
|
417
|
-
if (skipLifecycleCommit) {
|
|
418
|
-
debugLog("postUnit", {
|
|
419
|
-
phase: "git-action-skipped",
|
|
420
|
-
reason: "lifecycle-only-unit",
|
|
421
|
-
unitType: s.currentUnit.type,
|
|
422
|
-
unitId: s.currentUnit.id,
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
else {
|
|
426
|
-
const gitResult = runTurnGitAction({
|
|
427
|
-
basePath: s.basePath,
|
|
428
|
-
action: turnAction,
|
|
429
|
-
unitType: s.currentUnit.type,
|
|
430
|
-
unitId: s.currentUnit.id,
|
|
431
|
-
taskContext,
|
|
432
|
-
});
|
|
433
|
-
if (uokFlags.gitops) {
|
|
434
|
-
writeTurnGitTransaction({
|
|
435
|
-
basePath: s.basePath,
|
|
436
|
-
traceId,
|
|
437
|
-
turnId,
|
|
438
|
-
unitType: unit.type,
|
|
439
|
-
unitId: unit.id,
|
|
440
|
-
stage: "publish",
|
|
441
|
-
action: turnAction,
|
|
442
|
-
push: uokFlags.gitopsTurnPush,
|
|
443
|
-
status: gitResult.status,
|
|
444
|
-
error: gitResult.error,
|
|
445
|
-
metadata: {
|
|
446
|
-
dirty: gitResult.dirty,
|
|
447
|
-
commitMessage: gitResult.commitMessage,
|
|
448
|
-
snapshotLabel: gitResult.snapshotLabel,
|
|
449
|
-
},
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
if (gitResult.status === "failed") {
|
|
453
|
-
s.lastGitActionFailure = gitResult.error ?? `git ${turnAction} failed`;
|
|
454
|
-
s.lastGitActionStatus = "failed";
|
|
455
|
-
if (uokFlags.gitops && uokFlags.gates) {
|
|
456
|
-
const parsed = parseUnitId(unit.id);
|
|
457
|
-
const gateRunner = new UokGateRunner();
|
|
458
|
-
gateRunner.register({
|
|
459
|
-
id: "closeout-git-action",
|
|
460
|
-
type: "closeout",
|
|
461
|
-
execute: async () => ({
|
|
462
|
-
outcome: "fail",
|
|
463
|
-
failureClass: "git",
|
|
464
|
-
rationale: `turn git action "${turnAction}" failed`,
|
|
465
|
-
findings: gitResult.error ?? "unknown git failure",
|
|
466
|
-
}),
|
|
467
|
-
});
|
|
468
|
-
await gateRunner.run("closeout-git-action", {
|
|
469
|
-
basePath: s.basePath,
|
|
470
|
-
traceId,
|
|
471
|
-
turnId,
|
|
472
|
-
milestoneId: parsed.milestone ?? undefined,
|
|
473
|
-
sliceId: parsed.slice ?? undefined,
|
|
474
|
-
taskId: parsed.task ?? undefined,
|
|
475
|
-
unitType: unit.type,
|
|
476
|
-
unitId: unit.id,
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
const failureMsg = `Git ${turnAction} failed: ${(gitResult.error ?? "unknown error").split("\n")[0]}`;
|
|
480
|
-
ctx.ui.notify(failureMsg, "error");
|
|
481
|
-
debugLog("postUnit", {
|
|
482
|
-
phase: "git-action-failed-blocking",
|
|
483
|
-
action: turnAction,
|
|
484
|
-
error: gitResult.error ?? "unknown error",
|
|
485
|
-
});
|
|
486
|
-
await pauseAuto(ctx, pi);
|
|
487
|
-
return "dispatched";
|
|
488
|
-
}
|
|
489
|
-
s.lastGitActionStatus = "ok";
|
|
490
|
-
if (turnAction === "commit" && gitResult.commitMessage) {
|
|
491
|
-
ctx.ui.notify(`Committed: ${gitResult.commitMessage.split("\n")[0]}`, "info");
|
|
492
|
-
}
|
|
493
|
-
else if (turnAction === "snapshot" && gitResult.snapshotLabel) {
|
|
494
|
-
ctx.ui.notify(`Snapshot recorded: ${gitResult.snapshotLabel}`, "info");
|
|
495
|
-
}
|
|
496
|
-
}
|
|
566
|
+
if (shouldDeferCloseoutGitAction(unit.type)) {
|
|
567
|
+
debugLog("postUnit", {
|
|
568
|
+
phase: "git-action-deferred-until-verification",
|
|
569
|
+
unitType: unit.type,
|
|
570
|
+
unitId: unit.id,
|
|
571
|
+
});
|
|
497
572
|
}
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
s.lastGitActionStatus = "failed";
|
|
502
|
-
debugLog("postUnit", { phase: "git-action", error: message, action: turnAction });
|
|
503
|
-
ctx.ui.notify(`Git ${turnAction} failed: ${message.split("\n")[0]}`, uokFlags.gitops ? "error" : "warning");
|
|
504
|
-
if (uokFlags.gitops) {
|
|
505
|
-
await pauseAuto(ctx, pi);
|
|
573
|
+
else {
|
|
574
|
+
const gitActionResult = await runCloseoutGitAction(pctx, unit);
|
|
575
|
+
if (gitActionResult === "dispatched") {
|
|
506
576
|
return "dispatched";
|
|
507
577
|
}
|
|
508
578
|
}
|
|
509
|
-
// GitHub sync (non-blocking, opt-in)
|
|
510
|
-
await runSafely("postUnit", "github-sync", async () => {
|
|
511
|
-
const { runGitHubSync } = await import("../github-sync/sync.js");
|
|
512
|
-
await runGitHubSync(s.basePath, unit.type, unit.id);
|
|
513
|
-
});
|
|
514
579
|
// Prune dead bg-shell processes
|
|
515
580
|
await runSafely("postUnit", "prune-bg-shell", async () => {
|
|
516
581
|
const { pruneDeadProcesses } = await import("../bg-shell/process-manager.js");
|
|
@@ -723,7 +788,7 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
723
788
|
const safetyConfig = resolveSafetyHarnessConfig(prefs?.safety_harness);
|
|
724
789
|
if (safetyConfig.enabled) {
|
|
725
790
|
const { milestone: sMid, slice: sSid, task: sTid } = parseUnitId(s.currentUnit.id);
|
|
726
|
-
// File change validation (execute-task only, after
|
|
791
|
+
// File change validation (execute-task only, after unit execution)
|
|
727
792
|
if (safetyConfig.file_change_validation && s.currentUnit.type === "execute-task" && sMid && sSid && sTid && isDbAvailable()) {
|
|
728
793
|
try {
|
|
729
794
|
const taskRow = getTask(sMid, sSid, sTid);
|
|
@@ -756,12 +821,34 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
756
821
|
const bashCalls = actual.filter(e => e.kind === "bash");
|
|
757
822
|
if (sMid && sSid && sTid && isDbAvailable()) {
|
|
758
823
|
const taskRow = getTask(sMid, sSid, sTid);
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
824
|
+
if (taskRow?.status === "complete") {
|
|
825
|
+
const claimedEvidence = getVerificationEvidence(sMid, sSid, sTid)
|
|
826
|
+
.map((row) => ({
|
|
827
|
+
command: row.command,
|
|
828
|
+
exitCode: row.exit_code,
|
|
829
|
+
verdict: row.verdict,
|
|
830
|
+
}))
|
|
831
|
+
.filter((row) => typeof row.command === "string" && row.command.trim().length > 0);
|
|
832
|
+
const mismatches = crossReferenceEvidence(claimedEvidence, actual);
|
|
833
|
+
for (const mismatch of mismatches) {
|
|
834
|
+
const logMessage = `evidence-xref: ${mismatch.reason}`;
|
|
835
|
+
if (mismatch.severity === "error") {
|
|
836
|
+
logError("safety", logMessage);
|
|
837
|
+
}
|
|
838
|
+
else {
|
|
839
|
+
logWarning("safety", logMessage);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
if (claimedEvidence.length > 0 && bashCalls.length === 0) {
|
|
843
|
+
logWarning("safety", "task claimed verification command evidence but no execution tool calls were recorded");
|
|
844
|
+
ctx.ui.notify(`Safety: task ${sTid} claimed command evidence but no execution tool calls were recorded`, "warning");
|
|
845
|
+
}
|
|
846
|
+
const blockingMismatch = mismatches.find((mismatch) => mismatch.severity === "error");
|
|
847
|
+
if (blockingMismatch) {
|
|
848
|
+
ctx.ui.notify(`Safety: task ${sTid} claimed passing verification that failed in recorded execution`, "error");
|
|
849
|
+
await pauseAuto(ctx, pi);
|
|
850
|
+
return "dispatched";
|
|
851
|
+
}
|
|
765
852
|
}
|
|
766
853
|
}
|
|
767
854
|
}
|
|
@@ -919,9 +1006,25 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
919
1006
|
s.verificationRetryCount.delete(retryKey);
|
|
920
1007
|
s.verificationRetryFailureHashes.delete(retryKey);
|
|
921
1008
|
writeBlockerPlaceholder(s.currentUnit.type, s.currentUnit.id, s.basePath, reason);
|
|
922
|
-
ctx.ui.notify(`${s.currentUnit.type} ${s.currentUnit.id} — deterministic policy rejection, wrote blocker placeholder (no retries)
|
|
1009
|
+
ctx.ui.notify(`${s.currentUnit.type} ${s.currentUnit.id} — deterministic policy rejection, wrote blocker placeholder (no retries)`, "warning");
|
|
923
1010
|
// Fall through to "continue" — do NOT enter the retry or db-unavailable paths.
|
|
924
1011
|
}
|
|
1012
|
+
else if (!triggerArtifactVerified && diagnoseWorktreeIntegrityFailure(s.basePath)) {
|
|
1013
|
+
const retryKey = `${s.currentUnit.type}:${s.currentUnit.id}`;
|
|
1014
|
+
const worktreeFailure = diagnoseWorktreeIntegrityFailure(s.basePath);
|
|
1015
|
+
s.pendingVerificationRetry = null;
|
|
1016
|
+
s.verificationRetryCount.delete(retryKey);
|
|
1017
|
+
s.verificationRetryFailureHashes.delete(retryKey);
|
|
1018
|
+
debugLog("postUnit", {
|
|
1019
|
+
phase: "worktree-integrity-failure",
|
|
1020
|
+
unitType: s.currentUnit.type,
|
|
1021
|
+
unitId: s.currentUnit.id,
|
|
1022
|
+
basePath: s.basePath,
|
|
1023
|
+
});
|
|
1024
|
+
ctx.ui.notify(`${worktreeFailure} Retry ${s.currentUnit.id} after repair.`, "error");
|
|
1025
|
+
await pauseAuto(ctx, pi);
|
|
1026
|
+
return "dispatched";
|
|
1027
|
+
}
|
|
925
1028
|
else if (!triggerArtifactVerified && !isDbAvailable()) {
|
|
926
1029
|
debugLog("postUnit", { phase: "artifact-verify-skip-db-unavailable", unitType: s.currentUnit.type, unitId: s.currentUnit.id });
|
|
927
1030
|
const dbSkipDiag = diagnoseExpectedArtifact(s.currentUnit.type, s.currentUnit.id, s.basePath);
|
|
@@ -992,6 +1095,12 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
992
1095
|
export async function postUnitPostVerification(pctx) {
|
|
993
1096
|
const { s, ctx, pi, buildSnapshotOpts, lockBase, stopAuto, pauseAuto, updateProgressWidget } = pctx;
|
|
994
1097
|
if (s.currentUnit) {
|
|
1098
|
+
if (shouldDeferCloseoutGitAction(s.currentUnit.type)) {
|
|
1099
|
+
const gitActionResult = await runCloseoutGitAction(pctx, s.currentUnit, { softFailure: true });
|
|
1100
|
+
if (gitActionResult === "dispatched") {
|
|
1101
|
+
return "stopped";
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
995
1104
|
try {
|
|
996
1105
|
const codebasePrefs = loadEffectiveGSDPreferences()?.preferences?.codebase;
|
|
997
1106
|
const refresh = ensureCodebaseMapFresh(s.basePath, codebasePrefs
|
|
@@ -1356,18 +1465,22 @@ export async function postUnitPostVerification(pctx) {
|
|
|
1356
1465
|
}
|
|
1357
1466
|
}
|
|
1358
1467
|
// Step mode → show wizard instead of dispatch.
|
|
1359
|
-
// Without this notify(), /gsd
|
|
1360
|
-
//
|
|
1468
|
+
// Without this notify(), /gsd next finishes a unit and silently exits the
|
|
1469
|
+
// loop, leaving the user with no next-step command.
|
|
1361
1470
|
if (s.stepMode) {
|
|
1471
|
+
let phaseAfterUnit = null;
|
|
1362
1472
|
try {
|
|
1363
1473
|
const nextState = await deriveState(s.canonicalProjectRoot);
|
|
1474
|
+
phaseAfterUnit = nextState.phase;
|
|
1364
1475
|
ctx.ui.notify(buildStepCompleteMessage(nextState), "info");
|
|
1365
1476
|
}
|
|
1366
1477
|
catch (e) {
|
|
1367
1478
|
debugLog("postUnit", { phase: "step-wizard-notify", error: String(e) });
|
|
1368
1479
|
ctx.ui.notify(STEP_COMPLETE_FALLBACK_MESSAGE, "info");
|
|
1369
1480
|
}
|
|
1370
|
-
return
|
|
1481
|
+
return shouldReturnStepWizardAfterUnit(s.currentUnit?.type, phaseAfterUnit)
|
|
1482
|
+
? "step-wizard"
|
|
1483
|
+
: "continue";
|
|
1371
1484
|
}
|
|
1372
1485
|
return "continue";
|
|
1373
1486
|
}
|
|
@@ -2777,7 +2777,7 @@ export async function buildParallelResearchSlicesPrompt(mid, midTitle, slices, b
|
|
|
2777
2777
|
subagentSections.push([
|
|
2778
2778
|
`### ${slice.id}: ${slice.title}`,
|
|
2779
2779
|
"",
|
|
2780
|
-
`Use this as the prompt for a \`subagent\` call${modelSuffix} (agent: \`
|
|
2780
|
+
`Use this as the prompt for a \`subagent\` call${modelSuffix} (agent: \`scout\`):`,
|
|
2781
2781
|
"",
|
|
2782
2782
|
"```",
|
|
2783
2783
|
slicePrompt,
|
|
@@ -2846,7 +2846,7 @@ export async function buildGateEvaluatePrompt(mid, midTitle, sid, sTitle, base,
|
|
|
2846
2846
|
subagentSections.push([
|
|
2847
2847
|
`### ${def.id}: ${def.question}`,
|
|
2848
2848
|
"",
|
|
2849
|
-
`Use this as the prompt for a \`subagent\` call${modelSuffix}:`,
|
|
2849
|
+
`Use this as the prompt for a \`subagent\` call${modelSuffix} (agent: \`tester\`):`,
|
|
2850
2850
|
"",
|
|
2851
2851
|
"```",
|
|
2852
2852
|
subPrompt,
|