gsd-pi 2.81.0 → 2.82.0-dev.20138ae42
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 +64 -33
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +10 -1
- package/dist/resources/extensions/browser-tools/tools/screenshot.js +1 -0
- package/dist/resources/extensions/browser-tools/tools/zoom.js +1 -0
- package/dist/resources/extensions/claude-code-cli/partial-builder.js +2 -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 +116 -13
- package/dist/resources/extensions/gsd/auto/orchestrator.js +124 -6
- package/dist/resources/extensions/gsd/auto/phases.js +220 -98
- package/dist/resources/extensions/gsd/auto/run-unit.js +66 -3
- package/dist/resources/extensions/gsd/auto/session.js +9 -0
- package/dist/resources/extensions/gsd/auto/verification-retry-policy.js +43 -0
- package/dist/resources/extensions/gsd/auto/workflow-memory-pressure.js +12 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +247 -178
- package/dist/resources/extensions/gsd/auto-dispatch.js +27 -17
- package/dist/resources/extensions/gsd/auto-model-selection.js +2 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +240 -128
- package/dist/resources/extensions/gsd/auto-prompts.js +13 -5
- package/dist/resources/extensions/gsd/auto-recovery.js +34 -179
- package/dist/resources/extensions/gsd/auto-runtime-state.js +5 -0
- package/dist/resources/extensions/gsd/auto-start.js +105 -35
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +33 -5
- package/dist/resources/extensions/gsd/auto-verification.js +38 -26
- package/dist/resources/extensions/gsd/auto-worktree.js +119 -1
- package/dist/resources/extensions/gsd/auto.js +400 -108
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +38 -12
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +9 -8
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +17 -4
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +4 -8
- package/dist/resources/extensions/gsd/bootstrap/subagent-input.js +21 -9
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +55 -12
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +16 -2
- package/dist/resources/extensions/gsd/clean-root-preflight.js +170 -8
- package/dist/resources/extensions/gsd/commands/catalog.js +4 -1
- package/dist/resources/extensions/gsd/commands/handlers/core.js +38 -1
- package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +4 -10
- package/dist/resources/extensions/gsd/commands/handlers/parallel.js +9 -0
- package/dist/resources/extensions/gsd/commands-bootstrap.js +5 -0
- package/dist/resources/extensions/gsd/commands-handlers.js +15 -2
- package/dist/resources/extensions/gsd/context-store.js +112 -0
- package/dist/resources/extensions/gsd/crash-recovery.js +31 -5
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +3 -2
- package/dist/resources/extensions/gsd/db-writer.js +150 -84
- package/dist/resources/extensions/gsd/dispatch-guard.js +2 -2
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +1 -1
- package/dist/resources/extensions/gsd/doctor-git-checks.js +41 -6
- 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/git-service.js +41 -2
- package/dist/resources/extensions/gsd/gsd-db.js +8 -23
- package/dist/resources/extensions/gsd/guided-flow.js +93 -111
- package/dist/resources/extensions/gsd/guided-unit-context.js +23 -0
- package/dist/resources/extensions/gsd/health-widget-core.js +1 -1
- package/dist/resources/extensions/gsd/health-widget.js +4 -10
- package/dist/resources/extensions/gsd/knowledge-backfill.js +144 -0
- package/dist/resources/extensions/gsd/knowledge-capture.js +136 -0
- package/dist/resources/extensions/gsd/knowledge-parser.js +154 -0
- package/dist/resources/extensions/gsd/knowledge-projection.js +210 -0
- package/dist/resources/extensions/gsd/markdown-renderer.js +6 -96
- package/dist/resources/extensions/gsd/md-importer.js +1 -1
- package/dist/resources/extensions/gsd/memory-backfill.js +73 -17
- package/dist/resources/extensions/gsd/memory-consolidation-scanner.js +222 -0
- package/dist/resources/extensions/gsd/migrate/command.js +5 -0
- package/dist/resources/extensions/gsd/migrate/parsers.js +10 -0
- package/dist/resources/extensions/gsd/migrate/preview.js +9 -0
- package/dist/resources/extensions/gsd/migrate/transformer.js +51 -4
- package/dist/resources/extensions/gsd/migrate/writer.js +11 -1
- 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 +62 -26
- package/dist/resources/extensions/gsd/notification-overlay.js +35 -40
- package/dist/resources/extensions/gsd/parallel-merge.js +53 -30
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +25 -33
- 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 +14 -12
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +28 -10
- package/dist/resources/extensions/gsd/prompts/discuss.md +29 -11
- 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/prompts/system.md +2 -2
- package/dist/resources/extensions/gsd/provider-switch-observer.js +146 -0
- package/dist/resources/extensions/gsd/recovery-classification.js +15 -1
- package/dist/resources/extensions/gsd/session-lock.js +40 -0
- package/dist/resources/extensions/gsd/smart-entry-routing.js +36 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/completion.js +131 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/merge-state.js +252 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +45 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +82 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/sketch-flag.js +50 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-render.js +124 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-worker.js +32 -0
- package/dist/resources/extensions/gsd/state-reconciliation/errors.js +41 -0
- package/dist/resources/extensions/gsd/state-reconciliation/index.js +99 -0
- package/dist/resources/extensions/gsd/state-reconciliation/registry.js +24 -0
- package/dist/resources/extensions/gsd/state-reconciliation/spawn-gate.js +43 -0
- package/dist/resources/extensions/gsd/state-reconciliation/types.js +3 -0
- package/dist/resources/extensions/gsd/state-reconciliation.js +5 -26
- package/dist/resources/extensions/gsd/status-guards.js +4 -0
- package/dist/resources/extensions/gsd/templates/knowledge.md +2 -2
- package/dist/resources/extensions/gsd/templates/plan.md +8 -5
- package/dist/resources/extensions/gsd/templates/task-plan.md +4 -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 +89 -14
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +119 -0
- package/dist/resources/extensions/gsd/tui/render-kit.js +74 -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/watch/header-renderer.js +92 -69
- package/dist/resources/extensions/gsd/watch/splash-palette.js +10 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +2 -2
- package/dist/resources/extensions/gsd/workflow-projections.js +6 -8
- package/dist/resources/extensions/gsd/worktree-lifecycle.js +769 -319
- package/dist/resources/extensions/gsd/worktree-telemetry.js +3 -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/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 +10 -10
- 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 +3 -3
- 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 +10 -10
- 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.e059d86b255fce1c.js → 8359.7eb3bb8f8ecf4c01.js} +2 -2
- package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/layout-8c10ec293ae0f1d5.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/page-752f1e2ebdaa3e45.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-de742b64187e13fe.js → webpack-9a4db269f9ed63ad.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/dist/welcome-screen.d.ts +0 -7
- package/dist/welcome-screen.js +60 -69
- package/package.json +6 -5
- 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 +14 -3
- 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-parity.test.ts +244 -0
- 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-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/index.d.ts +2 -2
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +1 -1
- package/packages/pi-ai/dist/index.js.map +1 -1
- 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/dist/providers/transform-messages.d.ts +11 -0
- package/packages/pi-ai/dist/providers/transform-messages.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/transform-messages.js +20 -0
- package/packages/pi-ai/dist/providers/transform-messages.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/src/index.ts +7 -2
- 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/src/providers/transform-messages.ts +24 -0
- 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/system-prompt.js +4 -4
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.js +47 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +76 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.js +40 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts +0 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +30 -29
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js +10 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +13 -13
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +1 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +58 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts +2 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js +12 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.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 +33 -42
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +0 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +86 -82
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.d.ts +35 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.js +152 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.d.ts +16 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.js +73 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +12 -8
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.js +17 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +105 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +27 -26
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +9 -6
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.js +17 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-file-safety.test.js.map +1 -0
- 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/system-prompt.ts +4 -4
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/assistant-message-design.test.ts +56 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +113 -9
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/user-message-design.test.ts +48 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.test.ts +10 -3
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +43 -42
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +14 -14
- package/packages/pi-coding-agent/src/modes/interactive/components/bash-execution.ts +64 -3
- package/packages/pi-coding-agent/src/modes/interactive/components/diff.ts +13 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +33 -44
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +84 -104
- package/packages/pi-coding-agent/src/modes/interactive/components/transcript-design.ts +196 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tui-style-kit.ts +94 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +14 -9
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-highlight.test.ts +23 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +106 -1
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +27 -26
- package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +9 -6
- package/packages/pi-coding-agent/src/tests/system-prompt-file-safety.test.ts +22 -0
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/overlay-layout.test.js +14 -1
- package/packages/pi-tui/dist/__tests__/overlay-layout.test.js.map +1 -1
- package/packages/pi-tui/dist/overlay-layout.d.ts.map +1 -1
- package/packages/pi-tui/dist/overlay-layout.js +9 -6
- package/packages/pi-tui/dist/overlay-layout.js.map +1 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +5 -0
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/pi-tui/src/__tests__/overlay-layout.test.ts +20 -1
- package/packages/pi-tui/src/overlay-layout.ts +10 -7
- package/packages/pi-tui/src/tui.ts +6 -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/dist/modes/interactive/theme/theme-highlight.test.d.ts +2 -0
- package/pkg/dist/modes/interactive/theme/theme-highlight.test.d.ts.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme-highlight.test.js +17 -0
- package/pkg/dist/modes/interactive/theme/theme-highlight.test.js.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +105 -1
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js +27 -26
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/GSD-WORKFLOW.md +10 -1
- package/src/resources/extensions/browser-tools/tools/screenshot.ts +1 -0
- package/src/resources/extensions/browser-tools/tools/zoom.ts +1 -0
- package/src/resources/extensions/claude-code-cli/partial-builder.ts +2 -1
- package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +19 -2
- package/src/resources/extensions/cmux/index.ts +6 -0
- package/src/resources/extensions/gsd/auto/contracts.ts +59 -16
- package/src/resources/extensions/gsd/auto/infra-errors.ts +9 -3
- package/src/resources/extensions/gsd/auto/loop-deps.ts +9 -5
- package/src/resources/extensions/gsd/auto/loop.ts +121 -14
- package/src/resources/extensions/gsd/auto/orchestrator.ts +129 -6
- package/src/resources/extensions/gsd/auto/phases.ts +180 -20
- package/src/resources/extensions/gsd/auto/run-unit.ts +69 -4
- package/src/resources/extensions/gsd/auto/session.ts +10 -0
- package/src/resources/extensions/gsd/auto/verification-retry-policy.ts +82 -0
- package/src/resources/extensions/gsd/auto/workflow-memory-pressure.ts +13 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +301 -183
- package/src/resources/extensions/gsd/auto-dispatch.ts +29 -7
- package/src/resources/extensions/gsd/auto-model-selection.ts +2 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +273 -140
- package/src/resources/extensions/gsd/auto-prompts.ts +13 -5
- package/src/resources/extensions/gsd/auto-recovery.ts +36 -209
- package/src/resources/extensions/gsd/auto-runtime-state.ts +5 -0
- package/src/resources/extensions/gsd/auto-start.ts +114 -31
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +51 -0
- package/src/resources/extensions/gsd/auto-verification.ts +46 -38
- package/src/resources/extensions/gsd/auto-worktree.ts +127 -1
- package/src/resources/extensions/gsd/auto.ts +441 -107
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +54 -12
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +9 -8
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +16 -4
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +5 -8
- package/src/resources/extensions/gsd/bootstrap/subagent-input.ts +19 -7
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +58 -15
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +19 -3
- package/src/resources/extensions/gsd/clean-root-preflight.ts +174 -8
- package/src/resources/extensions/gsd/commands/catalog.ts +4 -1
- package/src/resources/extensions/gsd/commands/handlers/core.ts +41 -1
- package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +4 -10
- package/src/resources/extensions/gsd/commands/handlers/parallel.ts +12 -0
- package/src/resources/extensions/gsd/commands-bootstrap.ts +10 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +19 -2
- package/src/resources/extensions/gsd/context-store.ts +120 -1
- package/src/resources/extensions/gsd/crash-recovery.ts +30 -4
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +4 -3
- package/src/resources/extensions/gsd/db-writer.ts +167 -84
- package/src/resources/extensions/gsd/dispatch-guard.ts +2 -2
- package/src/resources/extensions/gsd/docs/preferences-reference.md +1 -1
- package/src/resources/extensions/gsd/doctor-git-checks.ts +44 -6
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +25 -13
- package/src/resources/extensions/gsd/doctor-types.ts +2 -0
- package/src/resources/extensions/gsd/doctor.ts +2 -27
- package/src/resources/extensions/gsd/export-html.ts +27 -427
- package/src/resources/extensions/gsd/git-service.ts +47 -1
- package/src/resources/extensions/gsd/gsd-db.ts +10 -23
- package/src/resources/extensions/gsd/guided-flow.ts +126 -128
- package/src/resources/extensions/gsd/guided-unit-context.ts +30 -0
- package/src/resources/extensions/gsd/health-widget-core.ts +1 -1
- package/src/resources/extensions/gsd/health-widget.ts +6 -10
- package/src/resources/extensions/gsd/journal.ts +2 -0
- package/src/resources/extensions/gsd/knowledge-backfill.ts +164 -0
- package/src/resources/extensions/gsd/knowledge-capture.ts +160 -0
- package/src/resources/extensions/gsd/knowledge-parser.ts +174 -0
- package/src/resources/extensions/gsd/knowledge-projection.ts +241 -0
- package/src/resources/extensions/gsd/markdown-renderer.ts +10 -96
- package/src/resources/extensions/gsd/md-importer.ts +1 -1
- package/src/resources/extensions/gsd/memory-backfill.ts +89 -17
- package/src/resources/extensions/gsd/memory-consolidation-scanner.ts +277 -0
- package/src/resources/extensions/gsd/migrate/command.ts +5 -0
- package/src/resources/extensions/gsd/migrate/parsers.ts +11 -0
- package/src/resources/extensions/gsd/migrate/preview.ts +10 -0
- package/src/resources/extensions/gsd/migrate/transformer.ts +58 -4
- package/src/resources/extensions/gsd/migrate/writer.ts +14 -1
- 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 +68 -25
- package/src/resources/extensions/gsd/notification-overlay.ts +50 -46
- package/src/resources/extensions/gsd/parallel-merge.ts +61 -34
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +33 -35
- 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 +14 -12
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +28 -10
- package/src/resources/extensions/gsd/prompts/discuss.md +29 -11
- 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/prompts/system.md +2 -2
- package/src/resources/extensions/gsd/provider-switch-observer.ts +185 -0
- package/src/resources/extensions/gsd/recovery-classification.ts +18 -1
- package/src/resources/extensions/gsd/session-lock.ts +41 -0
- package/src/resources/extensions/gsd/smart-entry-routing.ts +77 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/completion.ts +172 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/merge-state.ts +344 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +66 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +101 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/sketch-flag.ts +68 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/stale-render.ts +185 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/stale-worker.ts +46 -0
- package/src/resources/extensions/gsd/state-reconciliation/errors.ts +67 -0
- package/src/resources/extensions/gsd/state-reconciliation/index.ts +142 -0
- package/src/resources/extensions/gsd/state-reconciliation/registry.ts +27 -0
- package/src/resources/extensions/gsd/state-reconciliation/spawn-gate.ts +60 -0
- package/src/resources/extensions/gsd/state-reconciliation/types.ts +83 -0
- package/src/resources/extensions/gsd/state-reconciliation.ts +21 -53
- package/src/resources/extensions/gsd/status-guards.ts +5 -0
- package/src/resources/extensions/gsd/templates/knowledge.md +2 -2
- package/src/resources/extensions/gsd/templates/plan.md +8 -5
- package/src/resources/extensions/gsd/templates/task-plan.md +4 -2
- package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +170 -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 +783 -176
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +487 -4
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +292 -4
- 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 +12 -1
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +15 -1
- package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +20 -5
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/auto-unit-closeout.test.ts +68 -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/browser-tools-compatibility-declarations.test.ts +62 -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/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/context-store-decisions-from-memories.test.ts +312 -0
- package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +43 -2
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +28 -1
- package/src/resources/extensions/gsd/tests/db-authority-regression.test.ts +208 -0
- package/src/resources/extensions/gsd/tests/db-writer.test.ts +13 -8
- package/src/resources/extensions/gsd/tests/decisions-projection-from-memories.test.ts +453 -0
- package/src/resources/extensions/gsd/tests/decisions-stop-table-writes.test.ts +348 -0
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +79 -4
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +83 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +27 -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/freeform-decisions.test.ts +8 -4
- package/src/resources/extensions/gsd/tests/gsd-tools.test.ts +11 -7
- 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/header-renderer.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +17 -7
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +14 -4
- 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-git.test.ts +44 -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 +129 -1
- package/src/resources/extensions/gsd/tests/integration/integration-lifecycle.test.ts +13 -5
- package/src/resources/extensions/gsd/tests/integration/integration-proof.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/integration/migrate-command.test.ts +48 -3
- package/src/resources/extensions/gsd/tests/integration/parallel-merge.test.ts +116 -24
- 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 +0 -1
- package/src/resources/extensions/gsd/tests/knowledge-backfill-projection.test.ts +323 -0
- package/src/resources/extensions/gsd/tests/knowledge-capture.test.ts +242 -0
- package/src/resources/extensions/gsd/tests/knowledge.test.ts +47 -2
- package/src/resources/extensions/gsd/tests/load-knowledge-block-rules-only.test.ts +209 -0
- package/src/resources/extensions/gsd/tests/markdown-renderer.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/memory-consolidation-scanner.test.ts +316 -0
- package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +46 -11
- package/src/resources/extensions/gsd/tests/migrate-transformer.test.ts +5 -1
- package/src/resources/extensions/gsd/tests/migrate-validator-parsers.test.ts +24 -1
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +6 -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/notification-overlay.test.ts +78 -41
- package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/originalbase-path-comparison.test.ts +12 -217
- package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +121 -1
- package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +38 -6
- 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/plan-milestone-sketch-render.test.ts +157 -0
- 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 +225 -1
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +17 -0
- package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +81 -3
- 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/pre-execution-checks.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/progressive-planning.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +32 -1
- package/src/resources/extensions/gsd/tests/prompt-loader.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +20 -1
- package/src/resources/extensions/gsd/tests/provider-switch-observer.test.ts +252 -0
- package/src/resources/extensions/gsd/tests/remediation-completion-guard.test.ts +46 -2
- package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +7 -3
- package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +6 -3
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +16 -4
- package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +34 -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 +71 -58
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +1048 -0
- 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/token-tool-gating.test.ts +4 -0
- package/src/resources/extensions/gsd/tests/tui-header-lifecycle.test.ts +121 -1
- package/src/resources/extensions/gsd/tests/tui-render-kit.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +86 -7
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +110 -1
- package/src/resources/extensions/gsd/tests/verification-retry-policy.test.ts +83 -0
- package/src/resources/extensions/gsd/tests/verification-verdict.test.ts +78 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +7 -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 +211 -59
- package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +597 -118
- package/src/resources/extensions/gsd/tests/worktree-telemetry.test.ts +59 -2
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +72 -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 +98 -12
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +135 -0
- package/src/resources/extensions/gsd/tui/render-kit.ts +109 -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/watch/header-renderer.ts +121 -79
- package/src/resources/extensions/gsd/watch/splash-palette.ts +11 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +4 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +2 -2
- package/src/resources/extensions/gsd/workflow-projections.ts +6 -8
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +1196 -518
- package/src/resources/extensions/gsd/worktree-telemetry.ts +7 -2
- 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/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/app/layout-9ecfd95f343793f0.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/page-200592a7f3baf579.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.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/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +0 -1544
- /package/dist/web/standalone/.next/static/{drLMkgfHQ8lzS229_HWYR → xRy4LqKSNKdT7y6ATYyEl}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{drLMkgfHQ8lzS229_HWYR → xRy4LqKSNKdT7y6ATYyEl}/_ssgManifest.js +0 -0
|
@@ -16,6 +16,7 @@ import type {
|
|
|
16
16
|
ExtensionAPI,
|
|
17
17
|
ExtensionContext,
|
|
18
18
|
ExtensionCommandContext,
|
|
19
|
+
SessionMessageEntry,
|
|
19
20
|
} from "@gsd/pi-coding-agent";
|
|
20
21
|
|
|
21
22
|
import { deriveState } from "./state.js";
|
|
@@ -32,7 +33,7 @@ import {
|
|
|
32
33
|
setRuntimeKv,
|
|
33
34
|
deleteRuntimeKv,
|
|
34
35
|
} from "./db/runtime-kv.js";
|
|
35
|
-
import { getManifestStatus } from "./files.js";
|
|
36
|
+
import { extractSection, getManifestStatus, splitFrontmatter, parseFrontmatterMap } from "./files.js";
|
|
36
37
|
export { inlinePriorMilestoneSummary } from "./files.js";
|
|
37
38
|
import { collectSecretsFromManifest } from "../get-secrets-from-user.js";
|
|
38
39
|
import {
|
|
@@ -57,6 +58,7 @@ import {
|
|
|
57
58
|
import {
|
|
58
59
|
writeLock,
|
|
59
60
|
clearLock,
|
|
61
|
+
clearStaleWorkerLock,
|
|
60
62
|
readCrashLock,
|
|
61
63
|
isLockProcessAlive,
|
|
62
64
|
formatCrashInfo,
|
|
@@ -188,6 +190,8 @@ import { isClosedStatus } from "./status-guards.js";
|
|
|
188
190
|
import {
|
|
189
191
|
type AutoDashboardData,
|
|
190
192
|
updateProgressWidget as _updateProgressWidget,
|
|
193
|
+
setCompletionProgressWidget,
|
|
194
|
+
setAutoOutcomeWidget,
|
|
191
195
|
updateSliceProgressCache,
|
|
192
196
|
clearSliceProgressCache,
|
|
193
197
|
describeNextUnit as _describeNextUnit,
|
|
@@ -201,7 +205,7 @@ import {
|
|
|
201
205
|
deregisterSigtermHandler as _deregisterSigtermHandler,
|
|
202
206
|
detectWorkingTreeActivity,
|
|
203
207
|
} from "./auto-supervisor.js";
|
|
204
|
-
import { isDbAvailable, getMilestone } from "./gsd-db.js";
|
|
208
|
+
import { isDbAvailable, getMilestone, getMilestoneSlices } from "./gsd-db.js";
|
|
205
209
|
import { markLatestActiveForWorkerCanceled } from "./db/unit-dispatches.js";
|
|
206
210
|
import { writeUnitRuntimeRecord } from "./unit-runtime.js";
|
|
207
211
|
import { countPendingCaptures } from "./captures.js";
|
|
@@ -231,18 +235,20 @@ import { bootstrapAutoSession, openProjectDbIfPresent, type BootstrapDeps } from
|
|
|
231
235
|
import { initHealthWidget } from "./health-widget.js";
|
|
232
236
|
import { runLegacyAutoLoop, runUokKernelLoop } from "./auto/loop.js";
|
|
233
237
|
import { resolveAgentEnd, resolveAgentEndCancelled, _resetPendingResolve, isSessionSwitchInFlight } from "./auto/resolve.js";
|
|
234
|
-
import type { LoopDeps } from "./auto/loop-deps.js";
|
|
238
|
+
import type { LoopDeps, StopAutoOptions } from "./auto/loop-deps.js";
|
|
235
239
|
import type { ErrorContext } from "./auto/types.js";
|
|
236
240
|
import { runAutoLoopWithUok } from "./uok/kernel.js";
|
|
237
241
|
import { resolveUokFlags } from "./uok/flags.js";
|
|
238
242
|
import { validateDirectory } from "./validate-directory.js";
|
|
239
243
|
import { createAutoOrchestrator } from "./auto/orchestrator.js";
|
|
240
|
-
import type { AutoOrchestrationModule, AutoOrchestratorDeps } from "./auto/contracts.js";
|
|
244
|
+
import type { AutoAdvanceResult, AutoOrchestrationModule, AutoOrchestratorDeps, DispatchAdapter } from "./auto/contracts.js";
|
|
241
245
|
import { reconcileBeforeDispatch } from "./state-reconciliation.js";
|
|
242
246
|
import { compileUnitToolContract } from "./tool-contract.js";
|
|
243
247
|
import { createWorktreeSafetyModule } from "./worktree-safety.js";
|
|
244
248
|
import { resolveManifest } from "./unit-context-manifest.js";
|
|
245
249
|
import { classifyFailure } from "./recovery-classification.js";
|
|
250
|
+
import { supportsStructuredQuestions } from "./workflow-mcp.js";
|
|
251
|
+
import type { MinimalModelRegistry } from "./context-budget.js";
|
|
246
252
|
// Slice-level parallelism (#2340)
|
|
247
253
|
import { getEligibleSlices } from "./slice-parallel-eligibility.js";
|
|
248
254
|
import { startSliceParallel } from "./slice-parallel-orchestrator.js";
|
|
@@ -456,15 +462,10 @@ export function _synthesizePausedSessionRecoveryForTest(
|
|
|
456
462
|
return synthesizePausedSessionRecovery(basePath, unitType, unitId, sessionFile);
|
|
457
463
|
}
|
|
458
464
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
): string {
|
|
464
|
-
return pausedWorktreePath && pathExists(pausedWorktreePath)
|
|
465
|
-
? pausedWorktreePath
|
|
466
|
-
: basePath;
|
|
467
|
-
}
|
|
465
|
+
// `_resolvePausedResumeBasePathForTest` was retired in ADR-016 phase 2 / B3
|
|
466
|
+
// (#5621). Production callers go through
|
|
467
|
+
// `WorktreeLifecycle.resumeFromPausedSession`; the pure helper for tests is
|
|
468
|
+
// `resolvePausedResumeBasePath` exported from `worktree-lifecycle.ts`.
|
|
468
469
|
|
|
469
470
|
const DETACHED_AUTO_KEEPALIVE_INTERVAL_MS = 30_000;
|
|
470
471
|
|
|
@@ -668,6 +669,10 @@ export function isAutoActive(): boolean {
|
|
|
668
669
|
return s.active;
|
|
669
670
|
}
|
|
670
671
|
|
|
672
|
+
export function isAutoCompletionStopInProgress(): boolean {
|
|
673
|
+
return s.completionStopInProgress;
|
|
674
|
+
}
|
|
675
|
+
|
|
671
676
|
/** Test-only seam for validating auto-mode guards (#4704). Do not use in production code. */
|
|
672
677
|
export function _setAutoActiveForTest(active: boolean): void {
|
|
673
678
|
s.active = active;
|
|
@@ -928,6 +933,31 @@ function buildSnapshotOpts(
|
|
|
928
933
|
};
|
|
929
934
|
}
|
|
930
935
|
|
|
936
|
+
function currentUnitLabel(): string | null {
|
|
937
|
+
if (!s.currentUnit) return null;
|
|
938
|
+
return `${unitVerb(s.currentUnit.type)} ${s.currentUnit.id}`;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
function setLifecycleOutcome(
|
|
942
|
+
ctx: ExtensionContext | undefined,
|
|
943
|
+
input: {
|
|
944
|
+
status: "paused" | "stopped" | "blocked" | "failed" | "complete" | "waiting" | "step";
|
|
945
|
+
title: string;
|
|
946
|
+
detail?: string | null;
|
|
947
|
+
nextAction: string;
|
|
948
|
+
commands?: string[];
|
|
949
|
+
unitLabel?: string | null;
|
|
950
|
+
},
|
|
951
|
+
): void {
|
|
952
|
+
if (!ctx?.hasUI) return;
|
|
953
|
+
const { unitLabel: unitLabelOverride, ...rest } = input;
|
|
954
|
+
setAutoOutcomeWidget(ctx, {
|
|
955
|
+
...rest,
|
|
956
|
+
unitLabel: unitLabelOverride !== undefined ? unitLabelOverride : currentUnitLabel(),
|
|
957
|
+
startedAt: s.autoStartTime,
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
|
|
931
961
|
function handleLostSessionLock(
|
|
932
962
|
ctx?: ExtensionContext,
|
|
933
963
|
lockStatus?: SessionLockStatus,
|
|
@@ -1016,26 +1046,35 @@ export async function cleanupAfterLoopExit(ctx: ExtensionContext): Promise<void>
|
|
|
1016
1046
|
if (!s.paused) {
|
|
1017
1047
|
ctx.ui.setStatus("gsd-auto", undefined);
|
|
1018
1048
|
ctx.ui.setWidget("gsd-progress", undefined);
|
|
1049
|
+
if (s.completionStopInProgress) {
|
|
1050
|
+
s.completionStopInProgress = false;
|
|
1051
|
+
}
|
|
1019
1052
|
initHealthWidget(ctx);
|
|
1020
1053
|
}
|
|
1021
1054
|
|
|
1022
|
-
//
|
|
1055
|
+
// ADR-016 phase 3 (#5693): the stop-path basePath restore + chdir routes
|
|
1056
|
+
// through `Lifecycle.restoreToProjectRoot()`, the sole owner of both
|
|
1057
|
+
// `s.basePath` mutation and the paired `process.chdir` for auto-loop
|
|
1058
|
+
// transitions. The verb assigns `s.basePath` before any throwable work, so
|
|
1059
|
+
// a thrown error still leaves basePath restored.
|
|
1023
1060
|
if (s.originalBasePath) {
|
|
1024
|
-
s.basePath = s.originalBasePath;
|
|
1025
1061
|
try {
|
|
1026
|
-
|
|
1062
|
+
buildLifecycle().restoreToProjectRoot();
|
|
1027
1063
|
} catch (err) {
|
|
1028
|
-
|
|
1029
|
-
|
|
1064
|
+
logWarning(
|
|
1065
|
+
"engine",
|
|
1066
|
+
`restore project root failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
1067
|
+
{ file: "auto.ts" },
|
|
1068
|
+
);
|
|
1030
1069
|
}
|
|
1031
1070
|
}
|
|
1032
1071
|
|
|
1033
1072
|
if (s.originalBasePath && s.cmdCtx) {
|
|
1034
|
-
const result = await rerootCommandSession(s.cmdCtx, s.
|
|
1073
|
+
const result = await rerootCommandSession(s.cmdCtx, s.originalBasePath);
|
|
1035
1074
|
if (result.status === "cancelled") {
|
|
1036
|
-
logWarning("engine", "post-loop session re-root was cancelled", { file: "auto.ts", basePath: s.
|
|
1075
|
+
logWarning("engine", "post-loop session re-root was cancelled", { file: "auto.ts", basePath: s.originalBasePath });
|
|
1037
1076
|
} else if (result.status === "failed") {
|
|
1038
|
-
logWarning("engine", `post-loop session re-root failed: ${result.error ?? "unknown"}`, { file: "auto.ts", basePath: s.
|
|
1077
|
+
logWarning("engine", `post-loop session re-root failed: ${result.error ?? "unknown"}`, { file: "auto.ts", basePath: s.originalBasePath });
|
|
1039
1078
|
}
|
|
1040
1079
|
}
|
|
1041
1080
|
}
|
|
@@ -1046,6 +1085,58 @@ export function _cleanupAfterLoopExitForTest(ctx: ExtensionContext): Promise<voi
|
|
|
1046
1085
|
|
|
1047
1086
|
export type AutoWorktreeExitAction = "skip" | "merge" | "preserve";
|
|
1048
1087
|
|
|
1088
|
+
interface MilestoneCompletionRollup {
|
|
1089
|
+
milestoneTitle?: string;
|
|
1090
|
+
oneLiner?: string;
|
|
1091
|
+
successCriteriaResults?: string;
|
|
1092
|
+
definitionOfDoneResults?: string;
|
|
1093
|
+
requirementOutcomes?: string;
|
|
1094
|
+
deviations?: string;
|
|
1095
|
+
followUps?: string;
|
|
1096
|
+
keyDecisions?: string[];
|
|
1097
|
+
keyFiles?: string[];
|
|
1098
|
+
lessonsLearned?: string[];
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
function normalizeFrontmatterList(value: unknown): string[] {
|
|
1102
|
+
if (!Array.isArray(value)) return [];
|
|
1103
|
+
return value
|
|
1104
|
+
.map(item => typeof item === "string" ? item.trim() : "")
|
|
1105
|
+
.filter(item => item.length > 0 && item !== "(none)");
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
function firstBoldParagraph(body: string): string | undefined {
|
|
1109
|
+
const match = body.match(/\*\*([^*\n][\s\S]*?)\*\*/);
|
|
1110
|
+
return match?.[1]?.replace(/\s+/g, " ").trim() || undefined;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
function loadMilestoneCompletionRollup(basePath: string, milestoneId: string | null | undefined): MilestoneCompletionRollup {
|
|
1114
|
+
if (!milestoneId) return {};
|
|
1115
|
+
const summaryPath = resolveMilestoneFile(basePath, milestoneId, "SUMMARY");
|
|
1116
|
+
if (!summaryPath || !existsSync(summaryPath)) return {};
|
|
1117
|
+
|
|
1118
|
+
try {
|
|
1119
|
+
const raw = readFileSync(summaryPath, "utf-8");
|
|
1120
|
+
const [frontmatterLines, body] = splitFrontmatter(raw);
|
|
1121
|
+
const frontmatter = frontmatterLines ? parseFrontmatterMap(frontmatterLines) : {};
|
|
1122
|
+
return {
|
|
1123
|
+
milestoneTitle: typeof frontmatter.title === "string" ? frontmatter.title : undefined,
|
|
1124
|
+
oneLiner: firstBoldParagraph(body),
|
|
1125
|
+
successCriteriaResults: extractSection(body, "Success Criteria Results") ?? undefined,
|
|
1126
|
+
definitionOfDoneResults: extractSection(body, "Definition of Done Results") ?? undefined,
|
|
1127
|
+
requirementOutcomes: extractSection(body, "Requirement Outcomes") ?? undefined,
|
|
1128
|
+
deviations: extractSection(body, "Deviations") ?? undefined,
|
|
1129
|
+
followUps: extractSection(body, "Follow-ups") ?? undefined,
|
|
1130
|
+
keyDecisions: normalizeFrontmatterList(frontmatter.key_decisions),
|
|
1131
|
+
keyFiles: normalizeFrontmatterList(frontmatter.key_files),
|
|
1132
|
+
lessonsLearned: normalizeFrontmatterList(frontmatter.lessons_learned),
|
|
1133
|
+
};
|
|
1134
|
+
} catch (err) {
|
|
1135
|
+
logWarning("dashboard", `completion roll-up summary read failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1136
|
+
return {};
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1049
1140
|
export function _resolveAutoWorktreeExitActionForTest(
|
|
1050
1141
|
currentMilestoneId: string | null | undefined,
|
|
1051
1142
|
milestoneMergedInPhases: boolean,
|
|
@@ -1063,15 +1154,17 @@ export async function stopAuto(
|
|
|
1063
1154
|
ctx?: ExtensionContext,
|
|
1064
1155
|
pi?: ExtensionAPI,
|
|
1065
1156
|
reason?: string,
|
|
1157
|
+
options: StopAutoOptions = {},
|
|
1066
1158
|
): Promise<void> {
|
|
1067
1159
|
if (!s.active && !s.paused) return;
|
|
1068
1160
|
const loadedPreferences = loadEffectiveGSDPreferences(s.basePath || undefined)?.preferences;
|
|
1069
1161
|
const reasonSuffix = reason ? ` — ${reason}` : "";
|
|
1162
|
+
const preserveCompletionSurface = Boolean(options.completionWidget);
|
|
1163
|
+
s.completionStopInProgress = preserveCompletionSurface;
|
|
1070
1164
|
|
|
1071
|
-
// #4764 — telemetry: record the exit reason
|
|
1072
|
-
// was
|
|
1073
|
-
//
|
|
1074
|
-
// is exactly the pattern that strands work.
|
|
1165
|
+
// #4764 — telemetry: record the exit reason, isolation mode, whether an auto
|
|
1166
|
+
// worktree was active, and whether the current milestone was merged before
|
|
1167
|
+
// stopAuto. The unmerged-work warning is only meaningful for real worktrees.
|
|
1075
1168
|
try {
|
|
1076
1169
|
const { emitAutoExit } = await import("./worktree-telemetry.js");
|
|
1077
1170
|
type AutoExitReason =
|
|
@@ -1096,10 +1189,13 @@ export async function stopAuto(
|
|
|
1096
1189
|
: rawReason === "stop" || rawReason === "pause"
|
|
1097
1190
|
? rawReason
|
|
1098
1191
|
: "other";
|
|
1099
|
-
|
|
1192
|
+
const telemetryBase = s.originalBasePath || s.basePath;
|
|
1193
|
+
emitAutoExit(telemetryBase, {
|
|
1100
1194
|
reason: normalizedReason,
|
|
1101
1195
|
milestoneId: s.currentMilestoneId ?? undefined,
|
|
1102
1196
|
milestoneMerged: s.milestoneMergedInPhases === true,
|
|
1197
|
+
isolationMode: getIsolationMode(telemetryBase),
|
|
1198
|
+
worktreeActive: isInAutoWorktree(s.basePath),
|
|
1103
1199
|
});
|
|
1104
1200
|
} catch (err) {
|
|
1105
1201
|
logWarning("engine", `auto-exit telemetry failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -1257,6 +1353,21 @@ export async function stopAuto(
|
|
|
1257
1353
|
}
|
|
1258
1354
|
}
|
|
1259
1355
|
|
|
1356
|
+
// Pre-compute completion widget slice counts while the DB is still open.
|
|
1357
|
+
// Step 8 runs after closeDatabase(), so DB-backed slice lookups must happen here.
|
|
1358
|
+
const completionMilestoneId = options.completionWidget?.milestoneId ?? s.currentMilestoneId;
|
|
1359
|
+
let completedSlices: number | null = null;
|
|
1360
|
+
let totalSlices: number | null = null;
|
|
1361
|
+
if (preserveCompletionSurface && options.completionWidget && completionMilestoneId && isDbAvailable()) {
|
|
1362
|
+
try {
|
|
1363
|
+
const slices = getMilestoneSlices(completionMilestoneId);
|
|
1364
|
+
completedSlices = slices.filter(slice => isClosedStatus(slice.status)).length;
|
|
1365
|
+
totalSlices = slices.length;
|
|
1366
|
+
} catch (err) {
|
|
1367
|
+
logWarning("dashboard", `completion slice stats lookup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1260
1371
|
// ── Step 6: DB cleanup ──
|
|
1261
1372
|
if (isDbAvailable()) {
|
|
1262
1373
|
try {
|
|
@@ -1269,19 +1380,15 @@ export async function stopAuto(
|
|
|
1269
1380
|
}
|
|
1270
1381
|
}
|
|
1271
1382
|
|
|
1272
|
-
// ── Step 7: Restore basePath and chdir ──
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
logWarning("engine", `chdir failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
1281
|
-
}
|
|
1383
|
+
// ── Step 7: Restore basePath and chdir (ADR-016 phase 3, #5693) ──
|
|
1384
|
+
// `restoreToProjectRoot` owns both s.basePath restore and process.chdir;
|
|
1385
|
+
// no paired chdir is needed at the call site.
|
|
1386
|
+
if (s.originalBasePath) {
|
|
1387
|
+
try {
|
|
1388
|
+
buildLifecycle().restoreToProjectRoot();
|
|
1389
|
+
} catch (e) {
|
|
1390
|
+
debugLog("stop-cleanup-basepath", { error: e instanceof Error ? e.message : String(e) });
|
|
1282
1391
|
}
|
|
1283
|
-
} catch (e) {
|
|
1284
|
-
debugLog("stop-cleanup-basepath", { error: e instanceof Error ? e.message : String(e) });
|
|
1285
1392
|
}
|
|
1286
1393
|
|
|
1287
1394
|
// Re-root the active command session/tool runtime after worktree teardown.
|
|
@@ -1289,30 +1396,91 @@ export async function stopAuto(
|
|
|
1289
1396
|
// its own cwd for tools and system prompt; refresh it before returning to the
|
|
1290
1397
|
// user so follow-up commands do not target a removed milestone worktree.
|
|
1291
1398
|
if (s.originalBasePath && ctx && s.cmdCtx) {
|
|
1292
|
-
const result = await rerootCommandSession(s.cmdCtx, s.
|
|
1399
|
+
const result = await rerootCommandSession(s.cmdCtx, s.originalBasePath);
|
|
1293
1400
|
if (result.status === "cancelled") {
|
|
1294
|
-
logWarning("engine", "post-stop session re-root was cancelled", { file: "auto.ts", basePath: s.
|
|
1401
|
+
logWarning("engine", "post-stop session re-root was cancelled", { file: "auto.ts", basePath: s.originalBasePath });
|
|
1295
1402
|
} else if (result.status === "failed") {
|
|
1296
|
-
logWarning("engine", `post-stop session re-root failed: ${result.error ?? "unknown"}`, { file: "auto.ts", basePath: s.
|
|
1403
|
+
logWarning("engine", `post-stop session re-root failed: ${result.error ?? "unknown"}`, { file: "auto.ts", basePath: s.originalBasePath });
|
|
1297
1404
|
}
|
|
1298
1405
|
}
|
|
1299
1406
|
|
|
1300
1407
|
// ── Step 8: Ledger notification ──
|
|
1301
1408
|
try {
|
|
1302
1409
|
const ledger = getLedger();
|
|
1410
|
+
const isAllComplete = reason === "All milestones complete";
|
|
1411
|
+
const isMilestoneComplete = /^Milestone\s+\S+\s+complete$/i.test(reason ?? "");
|
|
1412
|
+
const notificationPrefix = isAllComplete
|
|
1413
|
+
? "All milestones complete"
|
|
1414
|
+
: isMilestoneComplete
|
|
1415
|
+
? `${reason}. Auto-mode finished this milestone`
|
|
1416
|
+
: `Auto-mode stopped${reasonSuffix}`;
|
|
1303
1417
|
if (ledger && ledger.units.length > 0) {
|
|
1304
1418
|
const totals = getProjectTotals(ledger.units);
|
|
1305
1419
|
ctx?.ui.notify(
|
|
1306
|
-
|
|
1420
|
+
`${notificationPrefix}. Session: ${formatCost(totals.cost)} · ${formatTokenCount(totals.tokens.total)} tokens · ${ledger.units.length} units`,
|
|
1307
1421
|
"info",
|
|
1308
1422
|
);
|
|
1309
1423
|
} else {
|
|
1310
|
-
ctx?.ui.notify(
|
|
1424
|
+
ctx?.ui.notify(`${notificationPrefix}.`, "info");
|
|
1311
1425
|
}
|
|
1312
1426
|
} catch (e) {
|
|
1313
1427
|
debugLog("stop-cleanup-ledger", { error: e instanceof Error ? e.message : String(e) });
|
|
1314
1428
|
}
|
|
1315
1429
|
|
|
1430
|
+
if (preserveCompletionSurface && ctx && options.completionWidget) {
|
|
1431
|
+
const ledger = getLedger();
|
|
1432
|
+
const units = ledger?.units ?? [];
|
|
1433
|
+
const totals = units.length > 0 ? getProjectTotals(units) : null;
|
|
1434
|
+
let totalInput = 0;
|
|
1435
|
+
let totalCacheRead = 0;
|
|
1436
|
+
try {
|
|
1437
|
+
for (const entry of s.cmdCtx?.sessionManager?.getEntries?.() ?? []) {
|
|
1438
|
+
if (entry.type === "message") {
|
|
1439
|
+
const msgEntry = entry as SessionMessageEntry;
|
|
1440
|
+
if (msgEntry.message?.role === "assistant") {
|
|
1441
|
+
const usage = (msgEntry.message as any).usage;
|
|
1442
|
+
if (usage) {
|
|
1443
|
+
totalInput += usage.input || 0;
|
|
1444
|
+
totalCacheRead += usage.cacheRead || 0;
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
} catch (err) {
|
|
1450
|
+
logWarning("dashboard", `completion stats lookup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1451
|
+
}
|
|
1452
|
+
const contextUsage = s.cmdCtx?.getContextUsage?.();
|
|
1453
|
+
const milestoneId = completionMilestoneId;
|
|
1454
|
+
const rollup = loadMilestoneCompletionRollup(s.originalBasePath || s.basePath, milestoneId);
|
|
1455
|
+
setCompletionProgressWidget(ctx, {
|
|
1456
|
+
milestoneId,
|
|
1457
|
+
milestoneTitle: options.completionWidget.milestoneTitle ?? rollup.milestoneTitle,
|
|
1458
|
+
oneLiner: rollup.oneLiner,
|
|
1459
|
+
successCriteriaResults: rollup.successCriteriaResults,
|
|
1460
|
+
definitionOfDoneResults: rollup.definitionOfDoneResults,
|
|
1461
|
+
requirementOutcomes: rollup.requirementOutcomes,
|
|
1462
|
+
deviations: rollup.deviations,
|
|
1463
|
+
followUps: rollup.followUps,
|
|
1464
|
+
keyDecisions: rollup.keyDecisions,
|
|
1465
|
+
keyFiles: rollup.keyFiles,
|
|
1466
|
+
lessonsLearned: rollup.lessonsLearned,
|
|
1467
|
+
reason: reason ?? "Milestone complete",
|
|
1468
|
+
startedAt: s.autoStartTime,
|
|
1469
|
+
totalCost: totals?.cost ?? 0,
|
|
1470
|
+
totalTokens: totals?.tokens.total ?? 0,
|
|
1471
|
+
unitCount: units.length,
|
|
1472
|
+
cacheHitRate: totalCacheRead + totalInput > 0
|
|
1473
|
+
? (totalCacheRead / (totalCacheRead + totalInput)) * 100
|
|
1474
|
+
: null,
|
|
1475
|
+
contextPercent: contextUsage?.percent ?? null,
|
|
1476
|
+
contextWindow: contextUsage?.contextWindow ?? s.cmdCtx?.model?.contextWindow ?? null,
|
|
1477
|
+
completedSlices,
|
|
1478
|
+
totalSlices,
|
|
1479
|
+
allMilestonesComplete: options.completionWidget.allMilestonesComplete,
|
|
1480
|
+
basePath: s.originalBasePath || s.basePath || null,
|
|
1481
|
+
});
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1316
1484
|
// ── Step 9: Cmux sidebar / event log ──
|
|
1317
1485
|
try {
|
|
1318
1486
|
pi?.events.emit(CMUX_CHANNELS.SIDEBAR, { action: "clear" as const, preferences: loadedPreferences });
|
|
@@ -1403,8 +1571,20 @@ export async function stopAuto(
|
|
|
1403
1571
|
|
|
1404
1572
|
// UI cleanup
|
|
1405
1573
|
ctx?.ui.setStatus("gsd-auto", undefined);
|
|
1406
|
-
|
|
1407
|
-
|
|
1574
|
+
if (!preserveCompletionSurface) {
|
|
1575
|
+
ctx?.ui.setWidget("gsd-progress", undefined);
|
|
1576
|
+
const status = reason?.startsWith("Blocked:") ? "blocked" : reason?.toLowerCase().includes("fail") ? "failed" : "stopped";
|
|
1577
|
+
setLifecycleOutcome(ctx, {
|
|
1578
|
+
status,
|
|
1579
|
+
title: status === "blocked" ? "Auto-mode blocked" : status === "failed" ? "Auto-mode stopped with an issue" : "Auto-mode stopped",
|
|
1580
|
+
detail: reason ?? "Auto-mode stopped.",
|
|
1581
|
+
nextAction: status === "blocked"
|
|
1582
|
+
? "Fix the blocker, then run /gsd auto to resume."
|
|
1583
|
+
: "Run /gsd status for the current project state, or /gsd auto to continue.",
|
|
1584
|
+
commands: ["/gsd status for overview", "/gsd auto to run", "/gsd visualize to inspect", "/gsd notifications for history"],
|
|
1585
|
+
});
|
|
1586
|
+
if (ctx) initHealthWidget(ctx);
|
|
1587
|
+
}
|
|
1408
1588
|
restoreProjectRootEnv();
|
|
1409
1589
|
restoreMilestoneLockEnv();
|
|
1410
1590
|
|
|
@@ -1421,7 +1601,7 @@ export async function stopAuto(
|
|
|
1421
1601
|
}
|
|
1422
1602
|
|
|
1423
1603
|
// Reset all session state in one call
|
|
1424
|
-
s.
|
|
1604
|
+
s.resetAfterStop({ preserveCompletionSurface });
|
|
1425
1605
|
}
|
|
1426
1606
|
}
|
|
1427
1607
|
|
|
@@ -1495,6 +1675,8 @@ export async function pauseAuto(
|
|
|
1495
1675
|
logWarning("engine", `paused-session DB write failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
1496
1676
|
}
|
|
1497
1677
|
|
|
1678
|
+
const pausedUnitLabel = currentUnitLabel();
|
|
1679
|
+
|
|
1498
1680
|
// Close out the current unit so its runtime record doesn't stay at "dispatched"
|
|
1499
1681
|
if (s.currentUnit && ctx) {
|
|
1500
1682
|
try {
|
|
@@ -1545,8 +1727,16 @@ export async function pauseAuto(
|
|
|
1545
1727
|
s.verificationRetryCount.clear();
|
|
1546
1728
|
ctx?.ui.setStatus("gsd-auto", "paused");
|
|
1547
1729
|
ctx?.ui.setWidget("gsd-progress", undefined);
|
|
1548
|
-
if (ctx) initHealthWidget(ctx);
|
|
1549
1730
|
const resumeCmd = s.stepMode ? "/gsd next" : "/gsd auto";
|
|
1731
|
+
setLifecycleOutcome(ctx, {
|
|
1732
|
+
status: "paused",
|
|
1733
|
+
title: `${s.stepMode ? "Step" : "Auto"}-mode paused`,
|
|
1734
|
+
detail: _errorContext?.message ?? "Paused by user request.",
|
|
1735
|
+
nextAction: `Type to steer, or run ${resumeCmd} to resume.`,
|
|
1736
|
+
commands: [resumeCmd, "/gsd status for overview", "/gsd notifications for history"],
|
|
1737
|
+
unitLabel: pausedUnitLabel,
|
|
1738
|
+
});
|
|
1739
|
+
if (ctx) initHealthWidget(ctx);
|
|
1550
1740
|
ctx?.ui.notify(
|
|
1551
1741
|
`${s.stepMode ? "Step" : "Auto"}-mode paused (Escape). Type to interact, or ${resumeCmd} to resume.`,
|
|
1552
1742
|
"info",
|
|
@@ -1561,29 +1751,112 @@ export async function pauseAuto(
|
|
|
1561
1751
|
* deps bag is intentionally focused — Lifecycle does not see the wider auto-
|
|
1562
1752
|
* mode dependency graph.
|
|
1563
1753
|
*/
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1754
|
+
/**
|
|
1755
|
+
* Construct a `WorktreeLifecycleDeps` bag without binding to any session.
|
|
1756
|
+
*
|
|
1757
|
+
* Exported so session-less callers (currently `parallel-merge.ts`) can build
|
|
1758
|
+
* the same deps and call `mergeMilestoneStandalone` through the Worktree
|
|
1759
|
+
* Lifecycle Module instead of bypassing it (ADR-016 phase 2 / A2).
|
|
1760
|
+
*/
|
|
1761
|
+
export function buildWorktreeLifecycleDeps(): WorktreeLifecycleDeps {
|
|
1762
|
+
// ADR-016 phase 2 / C-track close-out:
|
|
1763
|
+
// C1 (#5624) — fs + git-CLI primitives inlined
|
|
1764
|
+
// C2 (#5625) — worktree-manager helpers inlined
|
|
1765
|
+
// C3 (#5626) — cache + preferences + paths inlined
|
|
1766
|
+
// C4 (#5627) — GitServiceImpl constructor → gitServiceFactory
|
|
1767
|
+
//
|
|
1768
|
+
// Final WorktreeLifecycleDeps shape: 3 fields (gitServiceFactory,
|
|
1769
|
+
// worktreeProjection, mergeMilestoneToMain). Down from 18 at slice-7
|
|
1770
|
+
// closure.
|
|
1771
|
+
return {
|
|
1772
|
+
gitServiceFactory: (basePath: string) => {
|
|
1773
|
+
const gitConfig =
|
|
1774
|
+
loadEffectiveGSDPreferences()?.preferences?.git ?? {};
|
|
1775
|
+
return new GitServiceImpl(basePath, gitConfig);
|
|
1776
|
+
},
|
|
1574
1777
|
worktreeProjection: new WorktreeStateProjection(),
|
|
1575
|
-
isInAutoWorktree,
|
|
1576
|
-
autoCommitCurrentBranch,
|
|
1577
|
-
autoWorktreeBranch,
|
|
1578
|
-
teardownAutoWorktree,
|
|
1579
1778
|
mergeMilestoneToMain,
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1779
|
+
};
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
function buildLifecycle(): WorktreeLifecycle {
|
|
1783
|
+
return new WorktreeLifecycle(s, buildWorktreeLifecycleDeps());
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
/**
|
|
1787
|
+
* Build the production `DispatchAdapter` used by `createWiredAutoOrchestrationModule`.
|
|
1788
|
+
*
|
|
1789
|
+
* Exported so tests can verify parity with `runDispatch`'s `resolveDispatch` call —
|
|
1790
|
+
* the wired adapter must derive `structuredQuestionsAvailable`, `sessionContextWindow`,
|
|
1791
|
+
* `sessionProvider`, and `modelRegistry` the same way phases.ts:runDispatch does.
|
|
1792
|
+
*/
|
|
1793
|
+
export function createWiredDispatchAdapter(
|
|
1794
|
+
ctx: ExtensionContext,
|
|
1795
|
+
pi: ExtensionAPI,
|
|
1796
|
+
dispatchBasePath: string,
|
|
1797
|
+
): DispatchAdapter {
|
|
1798
|
+
return {
|
|
1799
|
+
async decideNextUnit(input) {
|
|
1800
|
+
const state = input.stateSnapshot;
|
|
1801
|
+
const active = state.activeMilestone;
|
|
1802
|
+
if (!active) return null;
|
|
1803
|
+
|
|
1804
|
+
const prefs = loadEffectiveGSDPreferences(dispatchBasePath)?.preferences;
|
|
1805
|
+
|
|
1806
|
+
// Derive session-derived dispatch inputs the same way phases.ts:runDispatch does
|
|
1807
|
+
// (#5789). Prefer caller-supplied values when present so test harnesses and
|
|
1808
|
+
// alternative wirings can inject deterministic snapshots; otherwise pull from
|
|
1809
|
+
// the captured pi/ctx references.
|
|
1810
|
+
const sessionProvider = input.sessionProvider ?? ctx.model?.provider;
|
|
1811
|
+
const sessionContextWindow = input.sessionContextWindow ?? ctx.model?.contextWindow;
|
|
1812
|
+
const modelRegistry = input.modelRegistry ?? (ctx.modelRegistry as MinimalModelRegistry | undefined);
|
|
1813
|
+
const authMode =
|
|
1814
|
+
sessionProvider && typeof ctx.modelRegistry?.getProviderAuthMode === "function"
|
|
1815
|
+
? ctx.modelRegistry.getProviderAuthMode(sessionProvider)
|
|
1816
|
+
: undefined;
|
|
1817
|
+
const activeTools = typeof pi.getActiveTools === "function" ? pi.getActiveTools() : [];
|
|
1818
|
+
// Mirrors runDispatch: deep-planning keeps approval gates in plain chat
|
|
1819
|
+
// because structured questions can be cancelled outside the chat turn on
|
|
1820
|
+
// some transports.
|
|
1821
|
+
const structuredQuestionsAvailable =
|
|
1822
|
+
input.structuredQuestionsAvailable ??
|
|
1823
|
+
(prefs?.planning_depth === "deep"
|
|
1824
|
+
? "false"
|
|
1825
|
+
: supportsStructuredQuestions(activeTools, {
|
|
1826
|
+
authMode,
|
|
1827
|
+
baseUrl: ctx.model?.baseUrl,
|
|
1828
|
+
})
|
|
1829
|
+
? "true"
|
|
1830
|
+
: "false");
|
|
1831
|
+
|
|
1832
|
+
const action = await resolveDispatch({
|
|
1833
|
+
basePath: dispatchBasePath,
|
|
1834
|
+
mid: active.id,
|
|
1835
|
+
midTitle: active.title,
|
|
1836
|
+
state,
|
|
1837
|
+
prefs,
|
|
1838
|
+
structuredQuestionsAvailable,
|
|
1839
|
+
sessionContextWindow,
|
|
1840
|
+
sessionProvider,
|
|
1841
|
+
modelRegistry,
|
|
1842
|
+
});
|
|
1843
|
+
|
|
1844
|
+
if (action.action === "stop") {
|
|
1845
|
+
return {
|
|
1846
|
+
kind: "blocked",
|
|
1847
|
+
reason: action.reason,
|
|
1848
|
+
action: action.level === "warning" ? "pause" : "stop",
|
|
1849
|
+
};
|
|
1850
|
+
}
|
|
1851
|
+
if (action.action !== "dispatch") return null;
|
|
1852
|
+
return {
|
|
1853
|
+
unitType: action.unitType,
|
|
1854
|
+
unitId: action.unitId,
|
|
1855
|
+
reason: action.matchedRule ?? "dispatch",
|
|
1856
|
+
preconditions: [],
|
|
1857
|
+
};
|
|
1858
|
+
},
|
|
1859
|
+
};
|
|
1587
1860
|
}
|
|
1588
1861
|
|
|
1589
1862
|
/**
|
|
@@ -1595,7 +1868,7 @@ function buildLifecycle(): WorktreeLifecycle {
|
|
|
1595
1868
|
*/
|
|
1596
1869
|
export function createWiredAutoOrchestrationModule(
|
|
1597
1870
|
ctx: ExtensionContext,
|
|
1598
|
-
|
|
1871
|
+
pi: ExtensionAPI,
|
|
1599
1872
|
dispatchBasePath: string,
|
|
1600
1873
|
runtimeBasePath = resolveProjectRoot(dispatchBasePath),
|
|
1601
1874
|
): AutoOrchestrationModule {
|
|
@@ -1606,44 +1879,25 @@ export function createWiredAutoOrchestrationModule(
|
|
|
1606
1879
|
stateReconciliation: {
|
|
1607
1880
|
async reconcileBeforeDispatch() {
|
|
1608
1881
|
const result = await reconcileBeforeDispatch(dispatchBasePath);
|
|
1609
|
-
if (
|
|
1882
|
+
if (result.blockers.length > 0) {
|
|
1610
1883
|
return {
|
|
1611
1884
|
ok: false,
|
|
1612
|
-
reason: result.
|
|
1885
|
+
reason: result.blockers[0],
|
|
1613
1886
|
stateSnapshot: result.stateSnapshot,
|
|
1614
1887
|
};
|
|
1615
1888
|
}
|
|
1889
|
+
const repairedKinds = result.repaired.map((d) => d.kind);
|
|
1616
1890
|
return {
|
|
1617
1891
|
ok: true,
|
|
1618
|
-
reason:
|
|
1892
|
+
reason:
|
|
1893
|
+
repairedKinds.length > 0
|
|
1894
|
+
? `repaired: ${repairedKinds.join(", ")}`
|
|
1895
|
+
: "clean",
|
|
1619
1896
|
stateSnapshot: result.stateSnapshot,
|
|
1620
1897
|
};
|
|
1621
1898
|
},
|
|
1622
1899
|
},
|
|
1623
|
-
dispatch:
|
|
1624
|
-
async decideNextUnit(input) {
|
|
1625
|
-
const state = input.stateSnapshot;
|
|
1626
|
-
const active = state.activeMilestone;
|
|
1627
|
-
if (!active) return null;
|
|
1628
|
-
|
|
1629
|
-
const prefs = loadEffectiveGSDPreferences(dispatchBasePath)?.preferences;
|
|
1630
|
-
const action = await resolveDispatch({
|
|
1631
|
-
basePath: dispatchBasePath,
|
|
1632
|
-
mid: active.id,
|
|
1633
|
-
midTitle: active.title,
|
|
1634
|
-
state,
|
|
1635
|
-
prefs,
|
|
1636
|
-
});
|
|
1637
|
-
|
|
1638
|
-
if (action.action !== "dispatch") return null;
|
|
1639
|
-
return {
|
|
1640
|
-
unitType: action.unitType,
|
|
1641
|
-
unitId: action.unitId,
|
|
1642
|
-
reason: action.matchedRule ?? "dispatch",
|
|
1643
|
-
preconditions: [],
|
|
1644
|
-
};
|
|
1645
|
-
},
|
|
1646
|
-
},
|
|
1900
|
+
dispatch: createWiredDispatchAdapter(ctx, pi, dispatchBasePath),
|
|
1647
1901
|
recovery: {
|
|
1648
1902
|
async classifyAndRecover(input) {
|
|
1649
1903
|
const recovery = classifyFailure(input);
|
|
@@ -1692,12 +1946,25 @@ export function createWiredAutoOrchestrationModule(
|
|
|
1692
1946
|
async cleanupOnStop() {},
|
|
1693
1947
|
},
|
|
1694
1948
|
health: {
|
|
1949
|
+
checkResourcesStale() {
|
|
1950
|
+
return checkResourcesStale(s.resourceVersionOnStart);
|
|
1951
|
+
},
|
|
1695
1952
|
async preAdvanceGate() {
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1953
|
+
try {
|
|
1954
|
+
const gate = await preDispatchHealthGate(dispatchBasePath);
|
|
1955
|
+
if (gate.proceed) {
|
|
1956
|
+
return {
|
|
1957
|
+
kind: "pass",
|
|
1958
|
+
fixesApplied: gate.fixesApplied,
|
|
1959
|
+
};
|
|
1960
|
+
}
|
|
1961
|
+
return {
|
|
1962
|
+
kind: "fail",
|
|
1963
|
+
reason: gate.reason ?? "Pre-dispatch health check failed — run /gsd doctor for details.",
|
|
1964
|
+
};
|
|
1965
|
+
} catch (error) {
|
|
1966
|
+
return { kind: "threw", error };
|
|
1967
|
+
}
|
|
1701
1968
|
},
|
|
1702
1969
|
async postAdvanceRecord(result) {
|
|
1703
1970
|
if (result.kind === "error") {
|
|
@@ -1765,11 +2032,60 @@ export function createWiredAutoOrchestrationModule(
|
|
|
1765
2032
|
}
|
|
1766
2033
|
},
|
|
1767
2034
|
},
|
|
2035
|
+
uokGate: {
|
|
2036
|
+
async emit(input) {
|
|
2037
|
+
const prefs = loadEffectiveGSDPreferences(dispatchBasePath)?.preferences;
|
|
2038
|
+
const uokFlags = resolveUokFlags(prefs);
|
|
2039
|
+
if (!uokFlags.gates) return;
|
|
2040
|
+
const milestoneId = input.milestoneId ?? s.currentMilestoneId ?? undefined;
|
|
2041
|
+
try {
|
|
2042
|
+
const { UokGateRunner } = await import("./uok/gate-runner.js");
|
|
2043
|
+
const runner = new UokGateRunner();
|
|
2044
|
+
runner.register({
|
|
2045
|
+
id: input.gateId,
|
|
2046
|
+
type: input.gateType,
|
|
2047
|
+
execute: async () => ({
|
|
2048
|
+
outcome: input.outcome,
|
|
2049
|
+
failureClass: input.failureClass,
|
|
2050
|
+
rationale: input.rationale,
|
|
2051
|
+
findings: input.findings ?? "",
|
|
2052
|
+
}),
|
|
2053
|
+
});
|
|
2054
|
+
await runner.run(input.gateId, {
|
|
2055
|
+
basePath: dispatchBasePath,
|
|
2056
|
+
traceId: `pre-dispatch:${flowId}`,
|
|
2057
|
+
turnId: `orch-${seq}`,
|
|
2058
|
+
milestoneId,
|
|
2059
|
+
unitType: "pre-dispatch",
|
|
2060
|
+
unitId: `orch-${seq}`,
|
|
2061
|
+
});
|
|
2062
|
+
} catch (err) {
|
|
2063
|
+
logWarning("engine", `uok gate emit failed: ${getErrorMessage(err)}`, {
|
|
2064
|
+
file: "auto.ts",
|
|
2065
|
+
gateId: input.gateId,
|
|
2066
|
+
gateType: input.gateType,
|
|
2067
|
+
...(milestoneId ? { milestoneId } : {}),
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
},
|
|
2071
|
+
},
|
|
1768
2072
|
};
|
|
1769
2073
|
|
|
1770
2074
|
return createAutoOrchestrator(deps);
|
|
1771
2075
|
}
|
|
1772
2076
|
|
|
2077
|
+
function notifyResumeBlocked(ctx: ExtensionContext, result: Extract<AutoAdvanceResult, { kind: "blocked" }>): void {
|
|
2078
|
+
const resumeCmd = s.stepMode ? "/gsd next" : "/gsd auto";
|
|
2079
|
+
ctx.ui.notify(`Auto-mode blocked: ${result.reason}. Fix and run ${resumeCmd} to resume.`, "warning");
|
|
2080
|
+
setLifecycleOutcome(ctx, {
|
|
2081
|
+
status: "blocked",
|
|
2082
|
+
title: "Auto-mode blocked",
|
|
2083
|
+
detail: result.reason,
|
|
2084
|
+
nextAction: `Fix the blocker, then run ${resumeCmd} to resume.`,
|
|
2085
|
+
commands: ["/gsd status for overview", `${resumeCmd} to resume`, "/gsd doctor to diagnose"],
|
|
2086
|
+
});
|
|
2087
|
+
}
|
|
2088
|
+
|
|
1773
2089
|
function ensureOrchestrationModule(ctx: ExtensionContext, pi: ExtensionAPI, basePath: string): void {
|
|
1774
2090
|
s.orchestration = createWiredAutoOrchestrationModule(ctx, pi, basePath, lockBase());
|
|
1775
2091
|
}
|
|
@@ -1825,7 +2141,6 @@ function buildLoopDeps(pi: ExtensionAPI): LoopDeps {
|
|
|
1825
2141
|
pruneQueueOrder,
|
|
1826
2142
|
isInAutoWorktree,
|
|
1827
2143
|
shouldUseWorktreeIsolation,
|
|
1828
|
-
mergeMilestoneToMain,
|
|
1829
2144
|
teardownAutoWorktree,
|
|
1830
2145
|
createAutoWorktree,
|
|
1831
2146
|
captureIntegrationBranch,
|
|
@@ -2108,7 +2423,7 @@ export async function startAuto(
|
|
|
2108
2423
|
// This closes the journal gap reported in #3348 where the worker wrote side
|
|
2109
2424
|
// effects (SUMMARY.md, DB updates) but died before emitting unit-end.
|
|
2110
2425
|
emitCrashRecoveredUnitEnd(base, freshStartAssessment.lock);
|
|
2111
|
-
|
|
2426
|
+
clearStaleWorkerLock(base);
|
|
2112
2427
|
}
|
|
2113
2428
|
|
|
2114
2429
|
if (!s.paused) {
|
|
@@ -2145,7 +2460,12 @@ export async function startAuto(
|
|
|
2145
2460
|
s.verbose = verboseMode;
|
|
2146
2461
|
s.stepMode = requestedStepMode;
|
|
2147
2462
|
s.cmdCtx = ctx;
|
|
2148
|
-
|
|
2463
|
+
// ADR-016 phase 2 / B2 (#5620): bootstrap basePath transition before
|
|
2464
|
+
// the resume path consults persisted worktree state. Defensive about
|
|
2465
|
+
// s.originalBasePath — the meta-restore above (line 2003 / 2055) may
|
|
2466
|
+
// have already populated it from paused metadata; the verb preserves
|
|
2467
|
+
// that value.
|
|
2468
|
+
buildLifecycle().adoptSessionRoot(base);
|
|
2149
2469
|
// ── Resume worktree: if the paused session was inside a milestone worktree,
|
|
2150
2470
|
// apply that path as the dispatch basePath immediately (#3723).
|
|
2151
2471
|
// This ensures the dispatch loop runs from the worktree directory even when
|
|
@@ -2161,7 +2481,8 @@ export async function startAuto(
|
|
|
2161
2481
|
{ file: "auto.ts", milestoneId: s.currentMilestoneId ?? "" },
|
|
2162
2482
|
);
|
|
2163
2483
|
}
|
|
2164
|
-
|
|
2484
|
+
// ADR-016 phase 2 / B3 (#5621): paused-resume worktree-path adoption.
|
|
2485
|
+
buildLifecycle().resumeFromPausedSession(base, resumeWorktreePath);
|
|
2165
2486
|
// Rebuild scope now that s.basePath reflects the actual worktree (or project root).
|
|
2166
2487
|
rebuildScope(s.basePath, s.currentMilestoneId);
|
|
2167
2488
|
// Ensure the workflow-logger audit log is pinned to the project root
|
|
@@ -2173,6 +2494,8 @@ export async function startAuto(
|
|
|
2173
2494
|
s.unitLifetimeDispatches.clear();
|
|
2174
2495
|
if (!getLedger()) initMetrics(base);
|
|
2175
2496
|
if (s.currentMilestoneId) setActiveMilestoneId(base, s.currentMilestoneId);
|
|
2497
|
+
await openProjectDbIfPresent(base);
|
|
2498
|
+
registerAutoWorkerForSession(s, base);
|
|
2176
2499
|
|
|
2177
2500
|
// Re-register health level notification callback lost across process restart
|
|
2178
2501
|
setLevelChangeCallback((_from, to, summary) => {
|
|
@@ -2280,7 +2603,12 @@ export async function startAuto(
|
|
|
2280
2603
|
pi.events.emit(CMUX_CHANNELS.LOG, { preferences: loadEffectiveGSDPreferences(s.basePath || undefined)?.preferences, message: s.stepMode ? "Step-mode resumed." : "Auto-mode resumed.", level: "progress" });
|
|
2281
2604
|
|
|
2282
2605
|
try {
|
|
2283
|
-
await s.orchestration?.resume();
|
|
2606
|
+
const resumeResult = await s.orchestration?.resume();
|
|
2607
|
+
if (resumeResult?.kind === "blocked") {
|
|
2608
|
+
notifyResumeBlocked(ctx, resumeResult);
|
|
2609
|
+
await cleanupAfterLoopExit(ctx);
|
|
2610
|
+
return;
|
|
2611
|
+
}
|
|
2284
2612
|
} catch (err) {
|
|
2285
2613
|
debugLog("resume-orchestration-resume", { error: err instanceof Error ? err.message : String(err) });
|
|
2286
2614
|
}
|
|
@@ -2301,6 +2629,7 @@ export async function startAuto(
|
|
|
2301
2629
|
const bootstrapDeps: BootstrapDeps = {
|
|
2302
2630
|
shouldUseWorktreeIsolation,
|
|
2303
2631
|
registerSigtermHandler,
|
|
2632
|
+
registerAutoWorkerForSession: (projectRoot) => registerAutoWorkerForSession(s, projectRoot),
|
|
2304
2633
|
lockBase,
|
|
2305
2634
|
buildLifecycle,
|
|
2306
2635
|
};
|
|
@@ -2463,7 +2792,12 @@ export async function dispatchHookUnit(
|
|
|
2463
2792
|
s.pendingQuickTasks = [];
|
|
2464
2793
|
}
|
|
2465
2794
|
|
|
2466
|
-
|
|
2795
|
+
// ADR-016 phase 2 / B2 (#5620): hook-trigger basePath transition. Treats
|
|
2796
|
+
// the trigger as a bootstrap variant — if the session is fresh,
|
|
2797
|
+
// `originalBasePath` gets set to `targetBasePath`; if the session was
|
|
2798
|
+
// already active with an established `originalBasePath`, the verb
|
|
2799
|
+
// preserves it.
|
|
2800
|
+
buildLifecycle().adoptSessionRoot(targetBasePath);
|
|
2467
2801
|
if (!s.orchestration) {
|
|
2468
2802
|
ensureOrchestrationModule(ctx, pi, s.basePath);
|
|
2469
2803
|
}
|