gsd-pi 2.79.0 → 2.80.0-dev.b62439b9f
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 +94 -47
- package/dist/{cli-web-branch.d.ts → cli/cli-web-branch.d.ts} +1 -1
- package/dist/{cli-web-branch.js → cli/cli-web-branch.js} +3 -3
- package/dist/{cli.js → cli/cli.js} +25 -25
- package/dist/{web-mode.js → cli/web-mode.js} +3 -3
- package/dist/{extension-registry.js → extension-runtime/extension-registry.js} +1 -1
- package/dist/{headless-query.d.ts → headless/headless-query.d.ts} +1 -1
- package/dist/{headless-query.js → headless/headless-query.js} +3 -2
- package/dist/{headless-recover.js → headless/headless-recover.js} +3 -2
- package/dist/{headless.js → headless/headless.js} +3 -3
- package/dist/loader.js +10 -10
- package/dist/{onboarding.js → onboarding/onboarding.js} +8 -8
- package/dist/{welcome-screen.js → onboarding/welcome-screen.js} +1 -1
- package/dist/{models-resolver.js → providers/models-resolver.js} +1 -1
- package/dist/{remote-questions-config.js → providers/remote-questions-config.js} +1 -1
- package/dist/{resource-loader.d.ts → resource-runtime/resource-loader.d.ts} +1 -1
- package/dist/{resource-loader.js → resource-runtime/resource-loader.js} +6 -6
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/github-sync/templates.js +55 -70
- package/dist/resources/extensions/gsd/auto/contracts.js +1 -0
- package/dist/resources/extensions/gsd/auto/custom-verify-retry-store.js +53 -0
- package/dist/resources/extensions/gsd/auto/loop.js +362 -523
- package/dist/resources/extensions/gsd/auto/orchestrator.js +146 -0
- package/dist/resources/extensions/gsd/auto/phases.js +61 -7
- package/dist/resources/extensions/gsd/auto/session.js +8 -0
- package/dist/resources/extensions/gsd/auto/workflow-custom-engine-dispatch-outcome.js +12 -0
- package/dist/resources/extensions/gsd/auto/workflow-custom-engine-iteration.js +24 -0
- package/dist/resources/extensions/gsd/auto/workflow-custom-engine-reconcile-outcome.js +33 -0
- package/dist/resources/extensions/gsd/auto/workflow-custom-engine-reconcile.js +26 -0
- package/dist/resources/extensions/gsd/auto/workflow-custom-engine-retry.js +49 -0
- package/dist/resources/extensions/gsd/auto/workflow-custom-engine-verify-outcome.js +25 -0
- package/dist/resources/extensions/gsd/auto/workflow-dispatch-claim.js +48 -0
- package/dist/resources/extensions/gsd/auto/workflow-dispatch-ledger.js +26 -0
- package/dist/resources/extensions/gsd/auto/workflow-iteration-completion.js +10 -0
- package/dist/resources/extensions/gsd/auto/workflow-journal-reporter.js +16 -0
- package/dist/resources/extensions/gsd/auto/workflow-kernel.js +263 -0
- package/dist/resources/extensions/gsd/auto/workflow-memory-pressure.js +36 -0
- package/dist/resources/extensions/gsd/auto/workflow-phase-reporter.js +9 -0
- package/dist/resources/extensions/gsd/auto/workflow-session-lock.js +35 -0
- package/dist/resources/extensions/gsd/auto/workflow-sidecar-iteration.js +24 -0
- package/dist/resources/extensions/gsd/auto/workflow-sidecar-queue.js +26 -0
- package/dist/resources/extensions/gsd/auto/workflow-turn-reporter.js +36 -0
- package/dist/resources/extensions/gsd/auto/workflow-unit-dispatch.js +44 -0
- package/dist/resources/extensions/gsd/auto/workflow-worker-heartbeat.js +15 -0
- package/dist/resources/extensions/gsd/auto-artifact-paths.js +2 -2
- package/dist/resources/extensions/gsd/auto-dashboard.js +3 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +2 -0
- package/dist/resources/extensions/gsd/auto-prompts.js +220 -32
- package/dist/resources/extensions/gsd/auto-recovery.js +63 -55
- package/dist/resources/extensions/gsd/auto-runtime-state.js +4 -0
- package/dist/resources/extensions/gsd/auto-start.js +3 -2
- package/dist/resources/extensions/gsd/auto-verification.js +2 -11
- package/dist/resources/extensions/gsd/auto-worktree.js +85 -38
- package/dist/resources/extensions/gsd/auto.js +162 -5
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +9 -1
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +10 -0
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +2 -2
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +52 -50
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +8 -8
- package/dist/resources/extensions/gsd/commands/context.js +1 -1
- package/dist/resources/extensions/gsd/commands-ship.js +23 -46
- package/dist/resources/extensions/gsd/commands-workflow-templates.js +12 -7
- package/dist/resources/extensions/gsd/component-loader.js +5 -11
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +25 -1
- package/dist/resources/extensions/gsd/db-adapter.js +47 -0
- package/dist/resources/extensions/gsd/db-base-schema.js +337 -0
- package/dist/resources/extensions/gsd/db-connection-cache.js +31 -0
- package/dist/resources/extensions/gsd/db-coordination-schema.js +104 -0
- package/dist/resources/extensions/gsd/db-decision-requirement-rows.js +71 -0
- package/dist/resources/extensions/gsd/db-gate-rows.js +16 -0
- package/dist/resources/extensions/gsd/db-lightweight-query-rows.js +29 -0
- package/dist/resources/extensions/gsd/db-memory-fts-schema.js +56 -0
- package/dist/resources/extensions/gsd/db-migration-backup.js +22 -0
- package/dist/resources/extensions/gsd/db-migration-steps.js +394 -0
- package/dist/resources/extensions/gsd/db-milestone-artifact-rows.js +35 -0
- package/dist/resources/extensions/gsd/db-open-state.js +32 -0
- package/dist/resources/extensions/gsd/db-provider.js +108 -0
- package/dist/resources/extensions/gsd/db-runtime-kv-schema.js +27 -0
- package/dist/resources/extensions/gsd/db-schema-metadata.js +23 -0
- package/dist/resources/extensions/gsd/db-task-slice-rows.js +86 -0
- package/dist/resources/extensions/gsd/db-transaction.js +63 -0
- package/dist/resources/extensions/gsd/db-verification-evidence-rows.js +3 -0
- package/dist/resources/extensions/gsd/db-verification-evidence-schema.js +19 -0
- package/dist/resources/extensions/gsd/escalation.js +2 -0
- package/dist/resources/extensions/gsd/graph.js +9 -3
- package/dist/resources/extensions/gsd/gsd-db.js +215 -1519
- package/dist/resources/extensions/gsd/guided-flow.js +40 -0
- package/dist/resources/extensions/gsd/legacy-telemetry.js +70 -0
- package/dist/resources/extensions/gsd/markdown-renderer.js +2 -0
- package/dist/resources/extensions/gsd/model-router.js +9 -6
- package/dist/resources/extensions/gsd/notification-widget.js +21 -3
- package/dist/resources/extensions/gsd/paths.js +5 -1
- package/dist/resources/extensions/gsd/post-execution-checks.js +27 -6
- package/dist/resources/extensions/gsd/pr-evidence.js +76 -0
- package/dist/resources/extensions/gsd/pre-execution-checks.js +2 -0
- package/dist/resources/extensions/gsd/preferences-types.js +20 -2
- package/dist/resources/extensions/gsd/preferences-validation.js +3 -3
- package/dist/resources/extensions/gsd/process-task-path.js +61 -0
- package/dist/resources/extensions/gsd/prompt-loader.js +9 -5
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +32 -30
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +23 -34
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +50 -96
- package/dist/resources/extensions/gsd/prompts/discuss.md +81 -181
- package/dist/resources/extensions/gsd/prompts/execute-task.md +40 -67
- package/dist/resources/extensions/gsd/prompts/forensics.md +41 -84
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +29 -39
- package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +30 -65
- package/dist/resources/extensions/gsd/prompts/guided-discuss-requirements.md +25 -52
- package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +36 -36
- package/dist/resources/extensions/gsd/prompts/guided-research-project.md +20 -38
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +45 -59
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +25 -87
- package/dist/resources/extensions/gsd/prompts/queue.md +46 -53
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +23 -23
- package/dist/resources/extensions/gsd/prompts/research-slice.md +23 -23
- package/dist/resources/extensions/gsd/prompts/rethink.md +10 -10
- package/dist/resources/extensions/gsd/prompts/system.md +65 -107
- package/dist/resources/extensions/gsd/prompts/triage-captures.md +15 -15
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +24 -24
- package/dist/resources/extensions/gsd/prompts/worktree-merge.md +35 -35
- package/dist/resources/extensions/gsd/state.js +4 -0
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +14 -9
- package/dist/resources/extensions/gsd/tools/complete-task.js +2 -0
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +88 -3
- package/dist/resources/extensions/gsd/unit-context-composer.js +32 -0
- package/dist/resources/extensions/gsd/unit-context-manifest.js +21 -0
- package/dist/resources/extensions/gsd/uok/audit.js +23 -9
- package/dist/resources/extensions/gsd/uok/contracts.js +69 -1
- package/dist/resources/extensions/gsd/uok/dispatch-envelope.js +3 -0
- package/dist/resources/extensions/gsd/uok/kernel.js +8 -3
- package/dist/resources/extensions/gsd/uok/loop-adapter.js +48 -33
- package/dist/resources/extensions/gsd/uok/plan-v2.js +2 -0
- package/dist/resources/extensions/gsd/uok/timeline.js +125 -0
- package/dist/resources/extensions/gsd/workflow-logger.js +13 -13
- package/dist/resources/extensions/gsd/workflow-manifest.js +2 -0
- package/dist/resources/extensions/gsd/workflow-projections.js +2 -0
- package/dist/resources/extensions/gsd/workflow-templates.js +9 -0
- package/dist/resources/extensions/shared/gsd-phase-state.js +45 -3
- package/dist/resources/extensions/shared/interview-ui.js +15 -4
- package/dist/{security-overrides.js → security/security-overrides.js} +1 -1
- package/dist/{startup-model-validation.js → startup/startup-model-validation.js} +1 -1
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/{update-check.js → update/update-check.js} +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +12 -12
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/required-server-files.json +4 -4
- 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_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 +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- 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 +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- 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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- 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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- 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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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 +2 -2
- 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 +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +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 +3 -3
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
- 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.js.nft.json +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.js.nft.json +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 +4 -4
- 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 +4 -4
- 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 +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +12 -12
- package/dist/web/standalone/.next/server/chunks/167.js +2 -0
- package/dist/web/standalone/.next/server/chunks/63.js +3 -3
- package/dist/web/standalone/.next/server/chunks/7020.js +12 -0
- package/dist/web/standalone/.next/server/middleware-build-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/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-fab3ebb85b006001.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/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/package.json +1 -0
- package/dist/web/standalone/server.js +1 -1
- package/dist/{worktree-cli.js → worktrees/worktree-cli.js} +3 -2
- package/package.json +12 -5
- package/packages/contracts/dist/index.d.ts +3 -0
- package/packages/contracts/dist/index.d.ts.map +1 -0
- package/packages/contracts/dist/index.js +5 -0
- package/packages/contracts/dist/index.js.map +1 -0
- package/packages/contracts/dist/rpc.d.ts +549 -0
- package/packages/contracts/dist/rpc.d.ts.map +1 -0
- package/packages/contracts/dist/rpc.js +53 -0
- package/packages/contracts/dist/rpc.js.map +1 -0
- package/packages/contracts/dist/rpc.test.d.ts +2 -0
- package/packages/contracts/dist/rpc.test.d.ts.map +1 -0
- package/packages/contracts/dist/rpc.test.js +47 -0
- package/packages/contracts/dist/rpc.test.js.map +1 -0
- package/packages/contracts/dist/workflow.d.ts +180 -0
- package/packages/contracts/dist/workflow.d.ts.map +1 -0
- package/packages/contracts/dist/workflow.js +201 -0
- package/packages/contracts/dist/workflow.js.map +1 -0
- package/packages/contracts/package.json +39 -0
- package/packages/contracts/src/index.ts +5 -0
- package/packages/contracts/src/rpc.test.ts +72 -0
- package/packages/contracts/src/rpc.ts +286 -0
- package/packages/contracts/src/workflow.ts +213 -0
- package/packages/contracts/tsconfig.json +25 -0
- package/packages/daemon/package.json +3 -2
- package/packages/daemon/src/event-bridge.test.ts +2 -1
- package/packages/daemon/src/event-bridge.ts +1 -1
- package/packages/daemon/src/event-formatter.test.ts +1 -2
- package/packages/daemon/src/event-formatter.ts +1 -2
- package/packages/daemon/src/session-manager.ts +2 -2
- package/packages/daemon/src/types.ts +3 -18
- package/packages/mcp-server/dist/server.d.ts +13 -0
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +77 -0
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/session-manager.js +1 -1
- package/packages/mcp-server/dist/session-manager.js.map +1 -1
- package/packages/mcp-server/dist/types.d.ts +3 -11
- package/packages/mcp-server/dist/types.d.ts.map +1 -1
- package/packages/mcp-server/dist/types.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +52 -37
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +3 -2
- package/packages/mcp-server/src/mcp-server.test.ts +138 -0
- package/packages/mcp-server/src/server.ts +99 -1
- package/packages/mcp-server/src/session-manager.ts +2 -2
- package/packages/mcp-server/src/types.ts +7 -18
- package/packages/mcp-server/src/workflow-tools.test.ts +129 -2
- package/packages/mcp-server/src/workflow-tools.ts +80 -37
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +14 -0
- 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/tool-card-cleanup-and-success-runtime.test.js +20 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -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 +6 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +9 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +31 -10
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +1 -512
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js +3 -7
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -1
- package/packages/pi-coding-agent/package.json +2 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +23 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +31 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +6 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +50 -9
- package/packages/pi-coding-agent/src/modes/rpc/rpc-types.ts +3 -336
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/tui.test.js +25 -3
- package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
- package/packages/pi-tui/dist/tui.d.ts +3 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +3 -1
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/pi-tui/src/__tests__/tui.test.ts +30 -3
- package/packages/pi-tui/src/tui.ts +3 -1
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/README.md +3 -3
- package/packages/rpc-client/dist/index.d.ts +1 -1
- package/packages/rpc-client/dist/index.d.ts.map +1 -1
- package/packages/rpc-client/dist/index.js.map +1 -1
- package/packages/rpc-client/dist/rpc-client.d.ts +2 -6
- package/packages/rpc-client/dist/rpc-client.d.ts.map +1 -1
- package/packages/rpc-client/dist/rpc-client.js.map +1 -1
- package/packages/rpc-client/dist/rpc-types.d.ts +1 -565
- package/packages/rpc-client/dist/rpc-types.d.ts.map +1 -1
- package/packages/rpc-client/dist/rpc-types.js +3 -11
- package/packages/rpc-client/dist/rpc-types.js.map +1 -1
- package/packages/rpc-client/package.json +4 -1
- package/packages/rpc-client/src/index.ts +1 -1
- package/packages/rpc-client/src/rpc-client.ts +3 -6
- package/packages/rpc-client/src/rpc-types.ts +3 -398
- package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/github-sync/templates.ts +59 -84
- package/src/resources/extensions/github-sync/tests/templates.test.ts +10 -2
- package/src/resources/extensions/gsd/auto/contracts.ts +87 -0
- package/src/resources/extensions/gsd/auto/custom-verify-retry-store.ts +72 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +10 -3
- package/src/resources/extensions/gsd/auto/loop.ts +414 -598
- package/src/resources/extensions/gsd/auto/orchestrator.ts +161 -0
- package/src/resources/extensions/gsd/auto/phases.ts +88 -9
- package/src/resources/extensions/gsd/auto/session.ts +11 -0
- package/src/resources/extensions/gsd/auto/workflow-custom-engine-dispatch-outcome.ts +28 -0
- package/src/resources/extensions/gsd/auto/workflow-custom-engine-iteration.ts +52 -0
- package/src/resources/extensions/gsd/auto/workflow-custom-engine-reconcile-outcome.ts +58 -0
- package/src/resources/extensions/gsd/auto/workflow-custom-engine-reconcile.ts +71 -0
- package/src/resources/extensions/gsd/auto/workflow-custom-engine-retry.ts +90 -0
- package/src/resources/extensions/gsd/auto/workflow-custom-engine-verify-outcome.ts +50 -0
- package/src/resources/extensions/gsd/auto/workflow-dispatch-claim.ts +97 -0
- package/src/resources/extensions/gsd/auto/workflow-dispatch-ledger.ts +45 -0
- package/src/resources/extensions/gsd/auto/workflow-iteration-completion.ts +26 -0
- package/src/resources/extensions/gsd/auto/workflow-journal-reporter.ts +33 -0
- package/src/resources/extensions/gsd/auto/workflow-kernel.ts +520 -0
- package/src/resources/extensions/gsd/auto/workflow-memory-pressure.ts +58 -0
- package/src/resources/extensions/gsd/auto/workflow-phase-reporter.ts +22 -0
- package/src/resources/extensions/gsd/auto/workflow-session-lock.ts +68 -0
- package/src/resources/extensions/gsd/auto/workflow-sidecar-iteration.ts +46 -0
- package/src/resources/extensions/gsd/auto/workflow-sidecar-queue.ts +46 -0
- package/src/resources/extensions/gsd/auto/workflow-turn-reporter.ts +68 -0
- package/src/resources/extensions/gsd/auto/workflow-unit-dispatch.ts +89 -0
- package/src/resources/extensions/gsd/auto/workflow-worker-heartbeat.ts +38 -0
- package/src/resources/extensions/gsd/auto-artifact-paths.ts +2 -2
- package/src/resources/extensions/gsd/auto-dashboard.ts +4 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +1 -0
- package/src/resources/extensions/gsd/auto-prompts.ts +276 -31
- package/src/resources/extensions/gsd/auto-recovery.ts +59 -53
- package/src/resources/extensions/gsd/auto-runtime-state.ts +7 -0
- package/src/resources/extensions/gsd/auto-start.ts +3 -2
- package/src/resources/extensions/gsd/auto-verification.ts +5 -1
- package/src/resources/extensions/gsd/auto-worktree.ts +83 -36
- package/src/resources/extensions/gsd/auto.ts +170 -4
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +14 -1
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +11 -0
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +2 -2
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +62 -51
- package/src/resources/extensions/gsd/bootstrap/tests/write-gate-shouldblock-basepath.test.ts +97 -0
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +8 -4
- package/src/resources/extensions/gsd/commands/context.ts +1 -1
- package/src/resources/extensions/gsd/commands-ship.ts +24 -51
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +13 -0
- package/src/resources/extensions/gsd/component-loader.ts +5 -11
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +29 -0
- package/src/resources/extensions/gsd/db-adapter.ts +75 -0
- package/src/resources/extensions/gsd/db-base-schema.ts +368 -0
- package/src/resources/extensions/gsd/db-connection-cache.ts +45 -0
- package/src/resources/extensions/gsd/db-coordination-schema.ts +109 -0
- package/src/resources/extensions/gsd/db-decision-requirement-rows.ts +77 -0
- package/src/resources/extensions/gsd/db-gate-rows.ts +19 -0
- package/src/resources/extensions/gsd/db-lightweight-query-rows.ts +50 -0
- package/src/resources/extensions/gsd/db-memory-fts-schema.ts +66 -0
- package/src/resources/extensions/gsd/db-migration-backup.ts +34 -0
- package/src/resources/extensions/gsd/db-migration-steps.ts +434 -0
- package/src/resources/extensions/gsd/db-milestone-artifact-rows.ts +70 -0
- package/src/resources/extensions/gsd/db-open-state.ts +47 -0
- package/src/resources/extensions/gsd/db-provider.ts +148 -0
- package/src/resources/extensions/gsd/db-runtime-kv-schema.ts +30 -0
- package/src/resources/extensions/gsd/db-schema-metadata.ts +33 -0
- package/src/resources/extensions/gsd/db-task-slice-rows.ts +146 -0
- package/src/resources/extensions/gsd/db-transaction.ts +76 -0
- package/src/resources/extensions/gsd/db-verification-evidence-rows.ts +14 -0
- package/src/resources/extensions/gsd/db-verification-evidence-schema.ts +22 -0
- package/src/resources/extensions/gsd/escalation.ts +3 -1
- package/src/resources/extensions/gsd/graph.ts +12 -5
- package/src/resources/extensions/gsd/gsd-db.ts +260 -1659
- package/src/resources/extensions/gsd/guided-flow.ts +47 -0
- package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
- package/src/resources/extensions/gsd/legacy-telemetry.ts +99 -0
- package/src/resources/extensions/gsd/markdown-renderer.ts +4 -1
- package/src/resources/extensions/gsd/model-router.ts +10 -6
- package/src/resources/extensions/gsd/notification-widget.ts +25 -4
- package/src/resources/extensions/gsd/paths.ts +6 -1
- package/src/resources/extensions/gsd/post-execution-checks.ts +35 -7
- package/src/resources/extensions/gsd/pr-evidence.ts +124 -0
- package/src/resources/extensions/gsd/pre-execution-checks.ts +4 -1
- package/src/resources/extensions/gsd/preferences-types.ts +23 -4
- package/src/resources/extensions/gsd/preferences-validation.ts +3 -3
- package/src/resources/extensions/gsd/process-task-path.ts +81 -0
- package/src/resources/extensions/gsd/prompt-loader.ts +9 -5
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +32 -30
- package/src/resources/extensions/gsd/prompts/complete-slice.md +23 -34
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +50 -96
- package/src/resources/extensions/gsd/prompts/discuss.md +81 -181
- package/src/resources/extensions/gsd/prompts/execute-task.md +40 -67
- package/src/resources/extensions/gsd/prompts/forensics.md +41 -84
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +29 -39
- package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +30 -65
- package/src/resources/extensions/gsd/prompts/guided-discuss-requirements.md +25 -52
- package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +36 -36
- package/src/resources/extensions/gsd/prompts/guided-research-project.md +20 -38
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +45 -59
- package/src/resources/extensions/gsd/prompts/plan-slice.md +25 -87
- package/src/resources/extensions/gsd/prompts/queue.md +46 -53
- package/src/resources/extensions/gsd/prompts/refine-slice.md +23 -23
- package/src/resources/extensions/gsd/prompts/research-slice.md +23 -23
- package/src/resources/extensions/gsd/prompts/rethink.md +10 -10
- package/src/resources/extensions/gsd/prompts/system.md +65 -107
- package/src/resources/extensions/gsd/prompts/triage-captures.md +15 -15
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +24 -24
- package/src/resources/extensions/gsd/prompts/worktree-merge.md +35 -35
- package/src/resources/extensions/gsd/state.ts +6 -3
- package/src/resources/extensions/gsd/tests/auto-abort-pause-regression.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +353 -0
- package/src/resources/extensions/gsd/tests/auto-pr-bugs.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +108 -1
- package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/auto-session-encapsulation.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/check-auto-start-pending-gate.test.ts +203 -0
- package/src/resources/extensions/gsd/tests/check-auto-start-ready-guard.test.ts +148 -0
- package/src/resources/extensions/gsd/tests/commands-eval-review.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/commands-ship-eval-warn.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/complete-milestone-prompt-rendering.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +19 -5
- package/src/resources/extensions/gsd/tests/component-loader.test.ts +2 -9
- package/src/resources/extensions/gsd/tests/current-directory-root-homedir-fallback.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +144 -0
- package/src/resources/extensions/gsd/tests/custom-verify-retry-store.test.ts +139 -0
- package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/dashboard-custom-engine.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/db-adapter.test.ts +82 -0
- package/src/resources/extensions/gsd/tests/db-base-schema.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/db-connection-cache.test.ts +60 -0
- package/src/resources/extensions/gsd/tests/db-coordination-schema.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/db-decision-requirement-rows.test.ts +135 -0
- package/src/resources/extensions/gsd/tests/db-gate-rows.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/db-lightweight-query-rows.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/db-memory-fts-schema.test.ts +86 -0
- package/src/resources/extensions/gsd/tests/db-migration-backup.test.ts +105 -0
- package/src/resources/extensions/gsd/tests/db-migration-steps.test.ts +159 -0
- package/src/resources/extensions/gsd/tests/db-milestone-artifact-rows.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/db-open-state.test.ts +56 -0
- package/src/resources/extensions/gsd/tests/db-provider.test.ts +105 -0
- package/src/resources/extensions/gsd/tests/db-runtime-kv-schema.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/db-schema-metadata.test.ts +115 -0
- package/src/resources/extensions/gsd/tests/db-task-slice-rows.test.ts +128 -0
- package/src/resources/extensions/gsd/tests/db-transaction.test.ts +110 -0
- package/src/resources/extensions/gsd/tests/db-verification-evidence-schema.test.ts +76 -0
- package/src/resources/extensions/gsd/tests/deep-planning-mode-dispatch.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +63 -2
- package/src/resources/extensions/gsd/tests/discuss-headless-rendering.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/execute-summary-save-empty-project.test.ts +109 -0
- package/src/resources/extensions/gsd/tests/execute-task-rendering.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/forensics-prompt-rendering.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/graph-operations.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +95 -0
- package/src/resources/extensions/gsd/tests/guided-discuss-milestone-prompt-rendering.test.ts +43 -0
- package/src/resources/extensions/gsd/tests/guided-discuss-project-prompt-rendering.test.ts +41 -0
- package/src/resources/extensions/gsd/tests/guided-discuss-requirements-prompt-rendering.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/guided-flow-prompt-consolidation.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/headless-answers.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/headless-query.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts +79 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/integration/state-machine-live-validation.test.ts +5 -3
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +134 -0
- package/src/resources/extensions/gsd/tests/legacy-component-format-telemetry.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/legacy-telemetry.test.ts +144 -0
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +40 -16
- package/src/resources/extensions/gsd/tests/model-router.test.ts +33 -12
- package/src/resources/extensions/gsd/tests/notification-store.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/notification-widget.test.ts +40 -1
- package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/paused-session-via-db.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/plan-milestone-rendering.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +65 -16
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/pr-evidence.test.ts +79 -0
- package/src/resources/extensions/gsd/tests/pre-exec-gate-loop.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/process-task-path.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +16 -1
- package/src/resources/extensions/gsd/tests/queue-prompt-rendering.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/register-hooks-compaction-checkpoint.test.ts +85 -0
- package/src/resources/extensions/gsd/tests/resource-loader-import-path.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/run-uat-composer.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/tool-naming.test.ts +32 -9
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +42 -4
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +109 -1
- package/src/resources/extensions/gsd/tests/uok-kernel-path.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/uok-loop-adapter-writer.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/workflow-custom-engine-dispatch-outcome.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/workflow-custom-engine-iteration.test.ts +93 -0
- package/src/resources/extensions/gsd/tests/workflow-custom-engine-reconcile-outcome.test.ts +108 -0
- package/src/resources/extensions/gsd/tests/workflow-custom-engine-reconcile.test.ts +146 -0
- package/src/resources/extensions/gsd/tests/workflow-custom-engine-retry.test.ts +136 -0
- package/src/resources/extensions/gsd/tests/workflow-custom-engine-verify-outcome.test.ts +95 -0
- package/src/resources/extensions/gsd/tests/workflow-dispatch-claim.test.ts +158 -0
- package/src/resources/extensions/gsd/tests/workflow-dispatch-ledger.test.ts +82 -0
- package/src/resources/extensions/gsd/tests/workflow-iteration-completion.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/workflow-journal-reporter.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/workflow-kernel.test.ts +607 -0
- package/src/resources/extensions/gsd/tests/workflow-logger.test.ts +20 -4
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +8 -7
- package/src/resources/extensions/gsd/tests/workflow-memory-pressure.test.ts +71 -0
- package/src/resources/extensions/gsd/tests/workflow-phase-reporter.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/workflow-session-lock.test.ts +135 -0
- package/src/resources/extensions/gsd/tests/workflow-sidecar-iteration.test.ts +110 -0
- package/src/resources/extensions/gsd/tests/workflow-sidecar-queue.test.ts +116 -0
- package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +164 -3
- package/src/resources/extensions/gsd/tests/workflow-turn-reporter.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/workflow-unit-dispatch.test.ts +160 -0
- package/src/resources/extensions/gsd/tests/workflow-worker-heartbeat.test.ts +123 -0
- package/src/resources/extensions/gsd/tests/worktree-path-injection.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/worktree-submodule-safety.test.ts +18 -34
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +15 -9
- package/src/resources/extensions/gsd/tools/complete-task.ts +4 -1
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +90 -2
- package/src/resources/extensions/gsd/unit-context-composer.ts +49 -0
- package/src/resources/extensions/gsd/unit-context-manifest.ts +34 -0
- package/src/resources/extensions/gsd/uok/audit.ts +25 -9
- package/src/resources/extensions/gsd/uok/contracts.ts +105 -0
- package/src/resources/extensions/gsd/uok/dispatch-envelope.ts +4 -0
- package/src/resources/extensions/gsd/uok/kernel.ts +10 -3
- package/src/resources/extensions/gsd/uok/loop-adapter.ts +60 -45
- package/src/resources/extensions/gsd/uok/plan-v2.ts +5 -1
- package/src/resources/extensions/gsd/uok/timeline.ts +158 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +13 -13
- package/src/resources/extensions/gsd/workflow-manifest.ts +6 -15
- package/src/resources/extensions/gsd/workflow-projections.ts +5 -1
- package/src/resources/extensions/gsd/workflow-templates.ts +11 -0
- package/src/resources/extensions/shared/gsd-phase-state.ts +56 -3
- package/src/resources/extensions/shared/interview-ui.ts +18 -5
- package/src/resources/extensions/shared/tests/gsd-phase-state.test.ts +43 -1
- package/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +41 -0
- package/dist/web/standalone/.next/server/chunks/6336.js +0 -1
- package/dist/web/standalone/.next/server/chunks/6897.js +0 -12
- package/dist/web/standalone/.next/static/chunks/app/page-ff639266d978f2a0.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/{app-paths.d.ts → app/app-paths.d.ts} +0 -0
- /package/dist/{app-paths.js → app/app-paths.js} +0 -0
- /package/dist/{project-sessions.d.ts → app/project-sessions.d.ts} +0 -0
- /package/dist/{project-sessions.js → app/project-sessions.js} +0 -0
- /package/dist/{tool-bootstrap.d.ts → app/tool-bootstrap.d.ts} +0 -0
- /package/dist/{tool-bootstrap.js → app/tool-bootstrap.js} +0 -0
- /package/dist/{cli-auto-routing.d.ts → cli/cli-auto-routing.d.ts} +0 -0
- /package/dist/{cli-auto-routing.js → cli/cli-auto-routing.js} +0 -0
- /package/dist/{cli-policy.d.ts → cli/cli-policy.d.ts} +0 -0
- /package/dist/{cli-policy.js → cli/cli-policy.js} +0 -0
- /package/dist/{cli.d.ts → cli/cli.d.ts} +0 -0
- /package/dist/{help-text.d.ts → cli/help-text.d.ts} +0 -0
- /package/dist/{help-text.js → cli/help-text.js} +0 -0
- /package/dist/{logo.d.ts → cli/logo.d.ts} +0 -0
- /package/dist/{logo.js → cli/logo.js} +0 -0
- /package/dist/{web-mode.d.ts → cli/web-mode.d.ts} +0 -0
- /package/dist/{bundled-extension-paths.d.ts → extension-runtime/bundled-extension-paths.d.ts} +0 -0
- /package/dist/{bundled-extension-paths.js → extension-runtime/bundled-extension-paths.js} +0 -0
- /package/dist/{bundled-resource-path.d.ts → extension-runtime/bundled-resource-path.d.ts} +0 -0
- /package/dist/{bundled-resource-path.js → extension-runtime/bundled-resource-path.js} +0 -0
- /package/dist/{extension-discovery.d.ts → extension-runtime/extension-discovery.d.ts} +0 -0
- /package/dist/{extension-discovery.js → extension-runtime/extension-discovery.js} +0 -0
- /package/dist/{extension-registry.d.ts → extension-runtime/extension-registry.d.ts} +0 -0
- /package/dist/{extension-sort.d.ts → extension-runtime/extension-sort.d.ts} +0 -0
- /package/dist/{extension-sort.js → extension-runtime/extension-sort.js} +0 -0
- /package/dist/{extension-validator.d.ts → extension-runtime/extension-validator.d.ts} +0 -0
- /package/dist/{extension-validator.js → extension-runtime/extension-validator.js} +0 -0
- /package/dist/{headless-answers.d.ts → headless/headless-answers.d.ts} +0 -0
- /package/dist/{headless-answers.js → headless/headless-answers.js} +0 -0
- /package/dist/{headless-context.d.ts → headless/headless-context.d.ts} +0 -0
- /package/dist/{headless-context.js → headless/headless-context.js} +0 -0
- /package/dist/{headless-events.d.ts → headless/headless-events.d.ts} +0 -0
- /package/dist/{headless-events.js → headless/headless-events.js} +0 -0
- /package/dist/{headless-recover.d.ts → headless/headless-recover.d.ts} +0 -0
- /package/dist/{headless-types.d.ts → headless/headless-types.d.ts} +0 -0
- /package/dist/{headless-types.js → headless/headless-types.js} +0 -0
- /package/dist/{headless-ui.d.ts → headless/headless-ui.d.ts} +0 -0
- /package/dist/{headless-ui.js → headless/headless-ui.js} +0 -0
- /package/dist/{headless.d.ts → headless/headless.d.ts} +0 -0
- /package/dist/{mcp-server.d.ts → mcp/mcp-server.d.ts} +0 -0
- /package/dist/{mcp-server.js → mcp/mcp-server.js} +0 -0
- /package/dist/{onboarding.d.ts → onboarding/onboarding.d.ts} +0 -0
- /package/dist/{welcome-screen.d.ts → onboarding/welcome-screen.d.ts} +0 -0
- /package/dist/{wizard.d.ts → onboarding/wizard.d.ts} +0 -0
- /package/dist/{wizard.js → onboarding/wizard.js} +0 -0
- /package/dist/{models-resolver.d.ts → providers/models-resolver.d.ts} +0 -0
- /package/dist/{pi-migration.d.ts → providers/pi-migration.d.ts} +0 -0
- /package/dist/{pi-migration.js → providers/pi-migration.js} +0 -0
- /package/dist/{provider-migrations.d.ts → providers/provider-migrations.d.ts} +0 -0
- /package/dist/{provider-migrations.js → providers/provider-migrations.js} +0 -0
- /package/dist/{remote-questions-config.d.ts → providers/remote-questions-config.d.ts} +0 -0
- /package/dist/{rtk-shared.d.ts → rtk/rtk-shared.d.ts} +0 -0
- /package/dist/{rtk-shared.js → rtk/rtk-shared.js} +0 -0
- /package/dist/{rtk.d.ts → rtk/rtk.d.ts} +0 -0
- /package/dist/{rtk.js → rtk/rtk.js} +0 -0
- /package/dist/{security-overrides.d.ts → security/security-overrides.d.ts} +0 -0
- /package/dist/{claude-cli-check.d.ts → startup/claude-cli-check.d.ts} +0 -0
- /package/dist/{claude-cli-check.js → startup/claude-cli-check.js} +0 -0
- /package/dist/{runtime-checks.d.ts → startup/runtime-checks.d.ts} +0 -0
- /package/dist/{runtime-checks.js → startup/runtime-checks.js} +0 -0
- /package/dist/{startup-model-validation.d.ts → startup/startup-model-validation.d.ts} +0 -0
- /package/dist/{startup-timings.d.ts → startup/startup-timings.d.ts} +0 -0
- /package/dist/{startup-timings.js → startup/startup-timings.js} +0 -0
- /package/dist/{update-check.d.ts → update/update-check.d.ts} +0 -0
- /package/dist/{update-cmd.d.ts → update/update-cmd.d.ts} +0 -0
- /package/dist/{update-cmd.js → update/update-cmd.js} +0 -0
- /package/dist/web/standalone/.next/static/{J-CU-p_sp45CJHT3R9TJS → -WDXZiiJHGZDbYH75Mu6f}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{J-CU-p_sp45CJHT3R9TJS → -WDXZiiJHGZDbYH75Mu6f}/_ssgManifest.js +0 -0
- /package/dist/{worktree-cli.d.ts → worktrees/worktree-cli.d.ts} +0 -0
- /package/dist/{worktree-name-gen.d.ts → worktrees/worktree-name-gen.d.ts} +0 -0
- /package/dist/{worktree-name-gen.js → worktrees/worktree-name-gen.js} +0 -0
- /package/dist/{worktree-status-banner.d.ts → worktrees/worktree-status-banner.d.ts} +0 -0
- /package/dist/{worktree-status-banner.js → worktrees/worktree-status-banner.js} +0 -0
|
@@ -14,7 +14,7 @@ import { appendEvent } from "./workflow-events.js";
|
|
|
14
14
|
import { atomicWriteSync } from "./atomic-write.js";
|
|
15
15
|
import { clearParseCache } from "./files.js";
|
|
16
16
|
import { parseRoadmap as parseLegacyRoadmap, parsePlan as parseLegacyPlan } from "./parsers-legacy.js";
|
|
17
|
-
import { isDbAvailable, getTask, getSlice, getSliceTasks, getPendingGates, updateTaskStatus, updateSliceStatus, insertSlice, getMilestone } from "./gsd-db.js";
|
|
17
|
+
import { isDbAvailable, getTask, getSlice, getSliceTasks, getPendingGates, updateTaskStatus, updateSliceStatus, insertSlice, getMilestone, refreshOpenDatabaseFromDisk } from "./gsd-db.js";
|
|
18
18
|
import { isValidationTerminal } from "./state.js";
|
|
19
19
|
import { getErrorMessage } from "./error-utils.js";
|
|
20
20
|
import { logWarning, logError } from "./workflow-logger.js";
|
|
@@ -308,7 +308,7 @@ function scanGsdTaggedCommits(
|
|
|
308
308
|
if (!commitMessageHasGsdTrailer(message)) continue;
|
|
309
309
|
|
|
310
310
|
const commitFiles = getChangedFilesForCommit(basePath, hash);
|
|
311
|
-
if (!commitMatchesMilestone(message, milestoneId, commitFiles)) continue;
|
|
311
|
+
if (!commitMatchesMilestone(basePath, message, milestoneId, commitFiles)) continue;
|
|
312
312
|
|
|
313
313
|
matched = true;
|
|
314
314
|
for (const file of commitFiles) {
|
|
@@ -336,22 +336,36 @@ function commitMessageHasGsdTrailer(message: string): boolean {
|
|
|
336
336
|
return /^GSD-(?:Task|Unit):\s*\S+/m.test(message);
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
function commitMatchesMilestone(message: string, milestoneId: string, files: readonly string[]): boolean {
|
|
339
|
+
function commitMatchesMilestone(basePath: string, message: string, milestoneId: string, files: readonly string[]): boolean {
|
|
340
340
|
if (commitTrailerStartsWithMilestone(message, milestoneId)) return true;
|
|
341
341
|
|
|
342
342
|
// Meaningful execute-task commits currently store task scope as Sxx/Tyy
|
|
343
343
|
// rather than Mxx/Sxx/Tyy. Bind those commits back to the milestone when
|
|
344
344
|
// either the commit touched this milestone's artifacts, or — for projects
|
|
345
345
|
// where .gsd/ is gitignored/external (#5033) — the message explicitly
|
|
346
|
-
// names the milestone.
|
|
346
|
+
// names the milestone or local GSD state proves the task belongs here.
|
|
347
347
|
if (/^GSD-Task:\s*S[^/\s]+\/T\S+/m.test(message)) {
|
|
348
348
|
if (files.some((file) => isMilestoneArtifactPath(file, milestoneId))) return true;
|
|
349
349
|
if (commitMessageMentionsMilestone(message, milestoneId)) return true;
|
|
350
|
+
if (commitTaskTrailerBelongsToMilestone(basePath, message, milestoneId)) return true;
|
|
350
351
|
}
|
|
351
352
|
|
|
352
353
|
return false;
|
|
353
354
|
}
|
|
354
355
|
|
|
356
|
+
function commitTaskTrailerBelongsToMilestone(basePath: string, message: string, milestoneId: string): boolean {
|
|
357
|
+
const match = message.match(/^GSD-Task:\s*(S[^/\s]+)\/(T[^\s]+)/m);
|
|
358
|
+
if (!match) return false;
|
|
359
|
+
const [, sliceId, taskId] = match;
|
|
360
|
+
|
|
361
|
+
if (getTask(milestoneId, sliceId, taskId)) return true;
|
|
362
|
+
|
|
363
|
+
const tasksDir = resolveTasksDir(basePath, milestoneId, sliceId);
|
|
364
|
+
if (!tasksDir) return false;
|
|
365
|
+
return existsSync(join(tasksDir, `${taskId}-PLAN.md`))
|
|
366
|
+
|| existsSync(join(tasksDir, `${taskId}-SUMMARY.md`));
|
|
367
|
+
}
|
|
368
|
+
|
|
355
369
|
function commitMessageMentionsMilestone(message: string, milestoneId: string): boolean {
|
|
356
370
|
if (!MILESTONE_ID_RE.test(milestoneId)) return false;
|
|
357
371
|
|
|
@@ -574,65 +588,32 @@ export function verifyExpectedArtifact(
|
|
|
574
588
|
}
|
|
575
589
|
}
|
|
576
590
|
|
|
577
|
-
// plan-slice
|
|
578
|
-
//
|
|
579
|
-
//
|
|
580
|
-
// unit gets skipped — but deriveState still returns phase:"planning" because the
|
|
581
|
-
// plan has no tasks, creating an infinite skip loop (#699).
|
|
582
|
-
if (unitType === "plan-slice") {
|
|
583
|
-
const planContent = readFileSync(absPath, "utf-8");
|
|
584
|
-
// Accept checkbox-style (- [x] **T01: ...) or heading-style (### T01 -- / ### T01: / ### T01 —)
|
|
585
|
-
const hasCheckboxTask = /^- \[[xX ]\] \*\*T\d+:/m.test(planContent);
|
|
586
|
-
const hasHeadingTask = /^#{2,4}\s+T\d+\s*(?:--|—|:)/m.test(planContent);
|
|
587
|
-
if (!hasCheckboxTask && !hasHeadingTask) {
|
|
588
|
-
logWarning("recovery", `verify-fail ${unitType} ${unitId}: plan has no task checkbox/heading (len=${planContent.length}) at ${absPath}`);
|
|
589
|
-
return false;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
// execute-task: DB status is authoritative. Fall back to checked-checkbox
|
|
594
|
-
// detection when the DB is unavailable (unmigrated projects), or when the
|
|
595
|
-
// disk artifacts already reflect completion but the DB replay is one beat
|
|
596
|
-
// behind the completion write.
|
|
597
|
-
if (unitType === "execute-task") {
|
|
598
|
-
const { milestone: mid, slice: sid, task: tid } = parseUnitId(unitId);
|
|
599
|
-
if (mid && sid && tid) {
|
|
600
|
-
const dbTask = getTask(mid, sid, tid);
|
|
601
|
-
if (dbTask) {
|
|
602
|
-
if (dbTask.status !== "complete" && dbTask.status !== "done" && !hasCheckedTaskCompletionOnDisk(base, mid, sid, tid)) {
|
|
603
|
-
return false;
|
|
604
|
-
}
|
|
605
|
-
} else if (!isDbAvailable()) {
|
|
606
|
-
// LEGACY: Pre-migration fallback for projects without DB.
|
|
607
|
-
// Require a CHECKED checkbox — a bare heading or unchecked checkbox
|
|
608
|
-
// does not prove gsd_complete_task ran. Summary file on disk alone
|
|
609
|
-
// is not sufficient evidence (could be a rogue write) (#3607).
|
|
610
|
-
if (!hasCheckedTaskCompletionOnDisk(base, mid, sid, tid)) return false;
|
|
611
|
-
} else {
|
|
612
|
-
// DB available but task row not found — completion tool never ran (#3607)
|
|
613
|
-
return false;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
// plan-slice must also produce individual task plan files for every task listed
|
|
619
|
-
// in the slice plan. Without this check, a plan-slice that wrote S{sid}-PLAN.md
|
|
620
|
-
// but omitted T{tid}-PLAN.md files would be marked complete, causing execute-task
|
|
621
|
-
// to dispatch with a missing task plan (see issue #739).
|
|
591
|
+
// plan-slice verification is DB-primary. The slice plan is a projection, so
|
|
592
|
+
// DB task rows prove the slice was planned even if the rendered markdown no
|
|
593
|
+
// longer uses legacy checkbox/heading syntax.
|
|
622
594
|
if (unitType === "plan-slice") {
|
|
623
595
|
const { milestone: mid, slice: sid } = parseUnitId(unitId);
|
|
624
596
|
if (mid && sid) {
|
|
625
597
|
try {
|
|
626
|
-
// DB primary path — get task IDs to verify task plan files exist
|
|
627
598
|
let taskIds: string[] | null = null;
|
|
628
599
|
if (isDbAvailable()) {
|
|
629
|
-
const
|
|
630
|
-
if (
|
|
600
|
+
const refreshed = refreshOpenDatabaseFromDisk();
|
|
601
|
+
if (refreshed) {
|
|
602
|
+
const tasks = getSliceTasks(mid, sid);
|
|
603
|
+
if (tasks.length > 0) taskIds = tasks.map(t => t.id);
|
|
604
|
+
}
|
|
631
605
|
}
|
|
632
606
|
|
|
633
607
|
if (!taskIds) {
|
|
634
|
-
// LEGACY: DB unavailable or no tasks in DB
|
|
608
|
+
// LEGACY: DB unavailable or no tasks in DB. Require actual task
|
|
609
|
+
// entries so an empty scaffold cannot advance the pipeline (#699).
|
|
635
610
|
const planContent = readFileSync(absPath, "utf-8");
|
|
611
|
+
const hasCheckboxTask = /^\s*- \[[xX ]\] \*\*T\d+:/m.test(planContent);
|
|
612
|
+
const hasHeadingTask = /^\s*#{2,4}\s+T\d+\s*(?:--|—|:)/m.test(planContent);
|
|
613
|
+
if (!hasCheckboxTask && !hasHeadingTask) {
|
|
614
|
+
logWarning("recovery", `verify-fail ${unitType} ${unitId}: plan has no task checkbox/heading (len=${planContent.length}) at ${absPath}`);
|
|
615
|
+
return false;
|
|
616
|
+
}
|
|
636
617
|
const plan = parseLegacyPlan(planContent);
|
|
637
618
|
if (plan.tasks.length > 0) taskIds = plan.tasks.map((t: { id: string }) => t.id);
|
|
638
619
|
}
|
|
@@ -658,6 +639,31 @@ export function verifyExpectedArtifact(
|
|
|
658
639
|
}
|
|
659
640
|
}
|
|
660
641
|
|
|
642
|
+
// execute-task: DB status is authoritative. Fall back to checked-checkbox
|
|
643
|
+
// detection when the DB is unavailable (unmigrated projects), or when the
|
|
644
|
+
// disk artifacts already reflect completion but the DB replay is one beat
|
|
645
|
+
// behind the completion write.
|
|
646
|
+
if (unitType === "execute-task") {
|
|
647
|
+
const { milestone: mid, slice: sid, task: tid } = parseUnitId(unitId);
|
|
648
|
+
if (mid && sid && tid) {
|
|
649
|
+
const dbTask = getTask(mid, sid, tid);
|
|
650
|
+
if (dbTask) {
|
|
651
|
+
if (dbTask.status !== "complete" && dbTask.status !== "done" && !hasCheckedTaskCompletionOnDisk(base, mid, sid, tid)) {
|
|
652
|
+
return false;
|
|
653
|
+
}
|
|
654
|
+
} else if (!isDbAvailable()) {
|
|
655
|
+
// LEGACY: Pre-migration fallback for projects without DB.
|
|
656
|
+
// Require a CHECKED checkbox — a bare heading or unchecked checkbox
|
|
657
|
+
// does not prove gsd_complete_task ran. Summary file on disk alone
|
|
658
|
+
// is not sufficient evidence (could be a rogue write) (#3607).
|
|
659
|
+
if (!hasCheckedTaskCompletionOnDisk(base, mid, sid, tid)) return false;
|
|
660
|
+
} else {
|
|
661
|
+
// DB available but task row not found — completion tool never ran (#3607)
|
|
662
|
+
return false;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
661
667
|
// complete-slice: DB status is authoritative for whether the slice is done.
|
|
662
668
|
// Fall back to file-based check (roadmap [x]) when DB is unavailable.
|
|
663
669
|
if (unitType === "complete-slice") {
|
|
@@ -16,14 +16,21 @@ export type AutoRuntimeSnapshot = {
|
|
|
16
16
|
paused: boolean;
|
|
17
17
|
currentUnit: CurrentUnit | null;
|
|
18
18
|
basePath: string;
|
|
19
|
+
orchestrationPhase?: "idle" | "running" | "paused" | "stopped" | "error";
|
|
20
|
+
orchestrationTransitionCount?: number;
|
|
21
|
+
orchestrationLastTransitionAt?: number;
|
|
19
22
|
};
|
|
20
23
|
|
|
21
24
|
export function getAutoRuntimeSnapshot(): AutoRuntimeSnapshot {
|
|
25
|
+
const orchestrationStatus = autoSession.orchestration?.getStatus();
|
|
22
26
|
return {
|
|
23
27
|
active: autoSession.active,
|
|
24
28
|
paused: autoSession.paused,
|
|
25
29
|
currentUnit: autoSession.currentUnit ? { ...autoSession.currentUnit } : null,
|
|
26
30
|
basePath: autoSession.basePath,
|
|
31
|
+
orchestrationPhase: orchestrationStatus?.phase,
|
|
32
|
+
orchestrationTransitionCount: orchestrationStatus?.transitionCount,
|
|
33
|
+
orchestrationLastTransitionAt: orchestrationStatus?.lastTransitionAt,
|
|
27
34
|
};
|
|
28
35
|
}
|
|
29
36
|
|
|
@@ -663,9 +663,10 @@ export async function bootstrapAutoSession(
|
|
|
663
663
|
hasSurvivorBranch = false;
|
|
664
664
|
}
|
|
665
665
|
|
|
666
|
+
const effectivePrefs = loadEffectiveGSDPreferences(base)?.preferences;
|
|
666
667
|
const deepProjectStagePending = !hasSurvivorBranch
|
|
667
668
|
? (await import("./auto-dispatch.js")).hasPendingDeepStage(
|
|
668
|
-
|
|
669
|
+
effectivePrefs,
|
|
669
670
|
base,
|
|
670
671
|
)
|
|
671
672
|
: false;
|
|
@@ -714,7 +715,7 @@ export async function bootstrapAutoSession(
|
|
|
714
715
|
const mid = state.activeMilestone!.id;
|
|
715
716
|
const contextFile = resolveMilestoneFile(base, mid, "CONTEXT");
|
|
716
717
|
const hasContext = !!(contextFile && (await loadFile(contextFile)));
|
|
717
|
-
if (!hasContext) {
|
|
718
|
+
if (!hasContext && effectivePrefs?.planning_depth !== "deep") {
|
|
718
719
|
const { showSmartEntry } = await import("./guided-flow.js");
|
|
719
720
|
await showSmartEntry(ctx, pi, base, { step: requestedStepMode });
|
|
720
721
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Post-unit verification gate for GSD auto-mode units.
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Post-unit verification gate for auto-mode.
|
|
3
6
|
*
|
|
@@ -14,7 +17,8 @@ import type { ExtensionContext, ExtensionAPI } from "@gsd/pi-coding-agent";
|
|
|
14
17
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
15
18
|
import { resolveSliceFile, resolveSlicePath, resolveMilestoneFile } from "./paths.js";
|
|
16
19
|
import { parseUnitId } from "./unit-id.js";
|
|
17
|
-
import { isDbAvailable, getTask, getSliceTasks, getMilestoneSlices
|
|
20
|
+
import { isDbAvailable, getTask, getSliceTasks, getMilestoneSlices } from "./gsd-db.js";
|
|
21
|
+
import type { TaskRow } from "./db-task-slice-rows.js";
|
|
18
22
|
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
19
23
|
import { extractVerdict } from "./verdict-parser.js";
|
|
20
24
|
import { isClosedStatus } from "./status-guards.js";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Auto-mode worktree lifecycle, merge, and cleanup management.
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* GSD Auto-Worktree -- lifecycle management for auto-mode worktrees.
|
|
3
6
|
*
|
|
@@ -18,7 +21,7 @@ import {
|
|
|
18
21
|
statSync,
|
|
19
22
|
lstatSync as lstatSyncFn,
|
|
20
23
|
} from "node:fs";
|
|
21
|
-
import { isAbsolute, join, sep as pathSep } from "node:path";
|
|
24
|
+
import { isAbsolute, join, relative, sep as pathSep } from "node:path";
|
|
22
25
|
import { GSDError, GSD_IO_ERROR, GSD_GIT_ERROR } from "./errors.js";
|
|
23
26
|
import {
|
|
24
27
|
reconcileWorktreeDb,
|
|
@@ -50,7 +53,8 @@ import {
|
|
|
50
53
|
normalizeWorktreePathForCompare,
|
|
51
54
|
resolveWorktreeProjectRoot,
|
|
52
55
|
} from "./worktree-root.js";
|
|
53
|
-
import { MergeConflictError, readIntegrationBranch, RUNTIME_EXCLUSION_PATHS } from "./git-service.js";
|
|
56
|
+
import { MergeConflictError, createDraftPR, readIntegrationBranch, RUNTIME_EXCLUSION_PATHS } from "./git-service.js";
|
|
57
|
+
import { buildPrEvidence } from "./pr-evidence.js";
|
|
54
58
|
import { debugLog } from "./debug-logger.js";
|
|
55
59
|
import { logWarning, logError } from "./workflow-logger.js";
|
|
56
60
|
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
@@ -266,6 +270,38 @@ function getActiveWorkspace(): GsdWorkspace | null {
|
|
|
266
270
|
return activeWorkspace;
|
|
267
271
|
}
|
|
268
272
|
|
|
273
|
+
function gitPathspecForWorktreePath(basePath: string, targetPath: string): string | null {
|
|
274
|
+
let base = basePath;
|
|
275
|
+
let target = targetPath;
|
|
276
|
+
try {
|
|
277
|
+
base = realpathSync.native(basePath);
|
|
278
|
+
} catch (err) {
|
|
279
|
+
logWarning("worktree", `base realpath failed; using original path: ${err instanceof Error ? err.message : String(err)}`);
|
|
280
|
+
}
|
|
281
|
+
try {
|
|
282
|
+
target = realpathSync.native(targetPath);
|
|
283
|
+
} catch (err) {
|
|
284
|
+
logWarning("worktree", `target realpath failed; using original path: ${err instanceof Error ? err.message : String(err)}`);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const rel = relative(base, target);
|
|
288
|
+
if (rel === "" || rel.startsWith("..") || isAbsolute(rel)) return null;
|
|
289
|
+
return rel.replaceAll("\\", "/");
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function gitRemoteExists(basePath: string, remote: string): boolean {
|
|
293
|
+
try {
|
|
294
|
+
execFileSync("git", ["remote", "get-url", remote], {
|
|
295
|
+
cwd: basePath,
|
|
296
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
297
|
+
encoding: "utf-8",
|
|
298
|
+
});
|
|
299
|
+
return true;
|
|
300
|
+
} catch {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
269
305
|
function clearProjectRootStateFiles(basePath: string, milestoneId: string): void {
|
|
270
306
|
const gsdDir = gsdRoot(basePath);
|
|
271
307
|
// Phase C pt 2: auto.lock removed from this list — the file is gone
|
|
@@ -301,11 +337,14 @@ function clearProjectRootStateFiles(basePath: string, milestoneId: string): void
|
|
|
301
337
|
for (const dir of syncedDirs) {
|
|
302
338
|
try {
|
|
303
339
|
if (existsSync(dir)) {
|
|
340
|
+
const pathspec = gitPathspecForWorktreePath(basePath, dir);
|
|
341
|
+
if (!pathspec) continue;
|
|
342
|
+
|
|
304
343
|
// Only remove files that are untracked by git — tracked files are
|
|
305
344
|
// managed by the branch checkout and should not be deleted.
|
|
306
345
|
const untrackedOutput = execFileSync(
|
|
307
346
|
"git",
|
|
308
|
-
["ls-files", "--others", "--exclude-standard",
|
|
347
|
+
["ls-files", "--others", "--exclude-standard", pathspec],
|
|
309
348
|
{ cwd: basePath, stdio: ["ignore", "pipe", "pipe"], encoding: "utf-8" },
|
|
310
349
|
).trim();
|
|
311
350
|
if (untrackedOutput) {
|
|
@@ -2187,16 +2226,18 @@ export function mergeMilestoneToMain(
|
|
|
2187
2226
|
let pushed = false;
|
|
2188
2227
|
if (prefs.auto_push === true && prefs.auto_pr !== true && !nothingToCommit) {
|
|
2189
2228
|
const remote = prefs.remote ?? "origin";
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2229
|
+
if (gitRemoteExists(originalBasePath_, remote)) {
|
|
2230
|
+
try {
|
|
2231
|
+
execFileSync("git", ["push", remote, mainBranch], {
|
|
2232
|
+
cwd: originalBasePath_,
|
|
2233
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
2234
|
+
encoding: "utf-8",
|
|
2235
|
+
});
|
|
2236
|
+
pushed = true;
|
|
2237
|
+
} catch (err) {
|
|
2238
|
+
// Push failure is non-fatal
|
|
2239
|
+
logWarning("worktree", `git push failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
2240
|
+
}
|
|
2200
2241
|
}
|
|
2201
2242
|
}
|
|
2202
2243
|
|
|
@@ -2205,29 +2246,35 @@ export function mergeMilestoneToMain(
|
|
|
2205
2246
|
if (prefs.auto_pr === true && !nothingToCommit) {
|
|
2206
2247
|
const remote = prefs.remote ?? "origin";
|
|
2207
2248
|
const prTarget = prefs.pr_target_branch ?? mainBranch;
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2249
|
+
if (gitRemoteExists(originalBasePath_, remote)) {
|
|
2250
|
+
try {
|
|
2251
|
+
// Push the milestone branch to remote first
|
|
2252
|
+
execFileSync("git", ["push", remote, milestoneBranch], {
|
|
2253
|
+
cwd: originalBasePath_,
|
|
2254
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
2255
|
+
encoding: "utf-8",
|
|
2256
|
+
});
|
|
2257
|
+
const prEvidence = buildPrEvidence({
|
|
2258
|
+
milestoneId,
|
|
2259
|
+
milestoneTitle,
|
|
2260
|
+
changeType: "feat",
|
|
2261
|
+
summaries: completedSlices.map((slice) => `### ${slice.id}\n${slice.title}`),
|
|
2262
|
+
testsRun: ["Auto-created after milestone merge. Run `npm run verify:pr` before marking this draft ready."],
|
|
2263
|
+
rollbackNotes: ["Close the draft PR or revert the merge commit if review finds a behavior regression."],
|
|
2264
|
+
how: "Generated by git.auto_pr after the milestone branch was pushed and merged locally.",
|
|
2265
|
+
});
|
|
2266
|
+
const prUrl = createDraftPR(originalBasePath_, milestoneId, prEvidence.title, prEvidence.body, {
|
|
2267
|
+
head: milestoneBranch,
|
|
2268
|
+
base: prTarget,
|
|
2269
|
+
});
|
|
2270
|
+
if (!prUrl) {
|
|
2271
|
+
throw new Error("gh pr create returned no URL");
|
|
2272
|
+
}
|
|
2273
|
+
prCreated = true;
|
|
2274
|
+
} catch (err) {
|
|
2275
|
+
// PR creation failure is non-fatal — gh may not be installed or authenticated
|
|
2276
|
+
logWarning("worktree", `PR creation failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
2277
|
+
}
|
|
2231
2278
|
}
|
|
2232
2279
|
}
|
|
2233
2280
|
|
|
@@ -147,6 +147,7 @@ import {
|
|
|
147
147
|
MergeConflictError,
|
|
148
148
|
parseSliceBranch,
|
|
149
149
|
setActiveMilestoneId,
|
|
150
|
+
resolveProjectRoot,
|
|
150
151
|
} from "./worktree.js";
|
|
151
152
|
import { GitServiceImpl } from "./git-service.js";
|
|
152
153
|
import { getPriorSliceCompletionBlocker } from "./dispatch-guard.js";
|
|
@@ -231,6 +232,8 @@ import type { ErrorContext } from "./auto/types.js";
|
|
|
231
232
|
import { runAutoLoopWithUok } from "./uok/kernel.js";
|
|
232
233
|
import { resolveUokFlags } from "./uok/flags.js";
|
|
233
234
|
import { validateDirectory } from "./validate-directory.js";
|
|
235
|
+
import { createAutoOrchestrator } from "./auto/orchestrator.js";
|
|
236
|
+
import type { AutoOrchestrationModule, AutoOrchestratorDeps } from "./auto/contracts.js";
|
|
234
237
|
// Slice-level parallelism (#2340)
|
|
235
238
|
import { getEligibleSlices } from "./slice-parallel-eligibility.js";
|
|
236
239
|
import { startSliceParallel } from "./slice-parallel-orchestrator.js";
|
|
@@ -1208,6 +1211,12 @@ export async function stopAuto(
|
|
|
1208
1211
|
// changes the user made between sessions (#4959 / CodeRabbit).
|
|
1209
1212
|
if (pi) clearToolBaseline(pi);
|
|
1210
1213
|
|
|
1214
|
+
try {
|
|
1215
|
+
await s.orchestration?.stop(reason ?? "stop");
|
|
1216
|
+
} catch (err) {
|
|
1217
|
+
debugLog("stop-orchestration-stop", { error: err instanceof Error ? err.message : String(err) });
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1211
1220
|
// Reset all session state in one call
|
|
1212
1221
|
s.reset();
|
|
1213
1222
|
}
|
|
@@ -1264,6 +1273,7 @@ export async function pauseAuto(
|
|
|
1264
1273
|
activeRunDir: s.activeRunDir,
|
|
1265
1274
|
autoStartTime: s.autoStartTime,
|
|
1266
1275
|
milestoneLock: s.sessionMilestoneLock ?? undefined,
|
|
1276
|
+
pauseReason: _errorContext?.message,
|
|
1267
1277
|
};
|
|
1268
1278
|
setRuntimeKv("global", "", PAUSED_SESSION_KV_KEY, pausedMeta);
|
|
1269
1279
|
} catch (err) {
|
|
@@ -1306,6 +1316,12 @@ export async function pauseAuto(
|
|
|
1306
1316
|
resolveAgentEnd({ messages: [] });
|
|
1307
1317
|
_resetPendingResolve();
|
|
1308
1318
|
|
|
1319
|
+
try {
|
|
1320
|
+
await s.orchestration?.stop("pause");
|
|
1321
|
+
} catch (err) {
|
|
1322
|
+
debugLog("pause-orchestration-stop", { error: err instanceof Error ? err.message : String(err) });
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1309
1325
|
s.active = false;
|
|
1310
1326
|
s.paused = true;
|
|
1311
1327
|
deactivateGSD();
|
|
@@ -1363,6 +1379,141 @@ function buildResolver(): WorktreeResolver {
|
|
|
1363
1379
|
return new WorktreeResolver(s, buildResolverDeps());
|
|
1364
1380
|
}
|
|
1365
1381
|
|
|
1382
|
+
/**
|
|
1383
|
+
* Thin entry glue for the new Auto Orchestration module.
|
|
1384
|
+
*
|
|
1385
|
+
* This intentionally wires only dispatch + error notification today, with
|
|
1386
|
+
* no behavior changes to the existing auto loop. It provides a concrete seam
|
|
1387
|
+
* the next refactor steps can adopt incrementally.
|
|
1388
|
+
*/
|
|
1389
|
+
export function createWiredAutoOrchestrationModule(
|
|
1390
|
+
ctx: ExtensionContext,
|
|
1391
|
+
_pi: ExtensionAPI,
|
|
1392
|
+
dispatchBasePath: string,
|
|
1393
|
+
runtimeBasePath = resolveProjectRoot(dispatchBasePath),
|
|
1394
|
+
): AutoOrchestrationModule {
|
|
1395
|
+
const flowId = `auto-orchestrator-${Date.now()}`;
|
|
1396
|
+
let seq = 0;
|
|
1397
|
+
|
|
1398
|
+
const deps: AutoOrchestratorDeps = {
|
|
1399
|
+
dispatch: {
|
|
1400
|
+
async decideNextUnit() {
|
|
1401
|
+
const state = await deriveState(dispatchBasePath);
|
|
1402
|
+
const active = state.activeMilestone;
|
|
1403
|
+
if (!active) return null;
|
|
1404
|
+
|
|
1405
|
+
const prefs = loadEffectiveGSDPreferences(dispatchBasePath)?.preferences;
|
|
1406
|
+
const action = await resolveDispatch({
|
|
1407
|
+
basePath: dispatchBasePath,
|
|
1408
|
+
mid: active.id,
|
|
1409
|
+
midTitle: active.title,
|
|
1410
|
+
state,
|
|
1411
|
+
prefs,
|
|
1412
|
+
});
|
|
1413
|
+
|
|
1414
|
+
if (action.action !== "dispatch") return null;
|
|
1415
|
+
return {
|
|
1416
|
+
unitType: action.unitType,
|
|
1417
|
+
unitId: action.unitId,
|
|
1418
|
+
reason: action.matchedRule ?? "dispatch",
|
|
1419
|
+
preconditions: [],
|
|
1420
|
+
};
|
|
1421
|
+
},
|
|
1422
|
+
},
|
|
1423
|
+
recovery: {
|
|
1424
|
+
async classifyAndRecover(input) {
|
|
1425
|
+
const reason = input.error instanceof Error ? input.error.message : String(input.error ?? "unknown auto error");
|
|
1426
|
+
return { action: "escalate" as const, reason };
|
|
1427
|
+
},
|
|
1428
|
+
},
|
|
1429
|
+
worktree: {
|
|
1430
|
+
async prepareForUnit() {},
|
|
1431
|
+
async syncAfterUnit() {},
|
|
1432
|
+
async cleanupOnStop() {},
|
|
1433
|
+
},
|
|
1434
|
+
health: {
|
|
1435
|
+
async preAdvanceGate() {
|
|
1436
|
+
const gate = await preDispatchHealthGate(dispatchBasePath);
|
|
1437
|
+
return {
|
|
1438
|
+
allow: gate.proceed,
|
|
1439
|
+
reason: gate.reason,
|
|
1440
|
+
};
|
|
1441
|
+
},
|
|
1442
|
+
async postAdvanceRecord(result) {
|
|
1443
|
+
if (result.kind === "error") {
|
|
1444
|
+
recordHealthSnapshot(1, 0, 0, [{
|
|
1445
|
+
code: "orchestration-error",
|
|
1446
|
+
message: result.reason ?? "orchestration error",
|
|
1447
|
+
severity: "error",
|
|
1448
|
+
unitId: "orchestration",
|
|
1449
|
+
}], [], "orchestration");
|
|
1450
|
+
} else if (result.kind === "blocked") {
|
|
1451
|
+
recordHealthSnapshot(0, 1, 0, [{
|
|
1452
|
+
code: "orchestration-blocked",
|
|
1453
|
+
message: result.reason ?? "orchestration blocked",
|
|
1454
|
+
severity: "warning",
|
|
1455
|
+
unitId: "orchestration",
|
|
1456
|
+
}], [], "orchestration");
|
|
1457
|
+
}
|
|
1458
|
+
},
|
|
1459
|
+
},
|
|
1460
|
+
runtime: {
|
|
1461
|
+
async ensureLockOwnership() {
|
|
1462
|
+
const status = getSessionLockStatus(runtimeBasePath);
|
|
1463
|
+
if (!status.valid || status.failureReason === "pid-mismatch") {
|
|
1464
|
+
throw new Error("session lock held by another process");
|
|
1465
|
+
}
|
|
1466
|
+
},
|
|
1467
|
+
async journalTransition(event) {
|
|
1468
|
+
const eventType = event.name === "start"
|
|
1469
|
+
? "iteration-start"
|
|
1470
|
+
: event.name === "resume"
|
|
1471
|
+
? "iteration-start"
|
|
1472
|
+
: event.name === "advance"
|
|
1473
|
+
? "dispatch-match"
|
|
1474
|
+
: event.name === "advance-blocked"
|
|
1475
|
+
? "guard-block"
|
|
1476
|
+
: event.name === "advance-stopped"
|
|
1477
|
+
? "dispatch-stop"
|
|
1478
|
+
: event.name === "advance-error"
|
|
1479
|
+
? "iteration-end"
|
|
1480
|
+
: event.name === "advance-paused" || event.name === "advance-retry"
|
|
1481
|
+
? "guard-block"
|
|
1482
|
+
: event.name === "stop"
|
|
1483
|
+
? "terminal"
|
|
1484
|
+
: "iteration-end";
|
|
1485
|
+
|
|
1486
|
+
_emitJournalEvent(runtimeBasePath, {
|
|
1487
|
+
ts: new Date().toISOString(),
|
|
1488
|
+
flowId,
|
|
1489
|
+
seq: ++seq,
|
|
1490
|
+
eventType,
|
|
1491
|
+
data: {
|
|
1492
|
+
source: "auto-orchestrator",
|
|
1493
|
+
name: event.name,
|
|
1494
|
+
reason: event.reason,
|
|
1495
|
+
unitType: event.unitType,
|
|
1496
|
+
unitId: event.unitId,
|
|
1497
|
+
},
|
|
1498
|
+
});
|
|
1499
|
+
},
|
|
1500
|
+
},
|
|
1501
|
+
notifications: {
|
|
1502
|
+
async notifyLifecycle(event) {
|
|
1503
|
+
if (event.name === "error") {
|
|
1504
|
+
ctx.ui.notify(event.detail ?? "auto orchestration error", "error");
|
|
1505
|
+
}
|
|
1506
|
+
},
|
|
1507
|
+
},
|
|
1508
|
+
};
|
|
1509
|
+
|
|
1510
|
+
return createAutoOrchestrator(deps);
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
function ensureOrchestrationModule(ctx: ExtensionContext, pi: ExtensionAPI, basePath: string): void {
|
|
1514
|
+
s.orchestration = createWiredAutoOrchestrationModule(ctx, pi, basePath, lockBase());
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1366
1517
|
/**
|
|
1367
1518
|
* Build the LoopDeps object from auto.ts private scope.
|
|
1368
1519
|
* This bundles all private functions that autoLoop needs without exporting them.
|
|
@@ -1785,6 +1936,7 @@ export async function startAuto(
|
|
|
1785
1936
|
rebuildScope(s.basePath, s.currentMilestoneId);
|
|
1786
1937
|
}
|
|
1787
1938
|
|
|
1939
|
+
ensureOrchestrationModule(ctx, pi, s.basePath || base);
|
|
1788
1940
|
registerSigtermHandler(lockBase());
|
|
1789
1941
|
|
|
1790
1942
|
ctx.ui.setStatus("gsd-auto", s.stepMode ? "next" : "auto");
|
|
@@ -1797,15 +1949,15 @@ export async function startAuto(
|
|
|
1797
1949
|
// Re-sync managed resources on resume so long-lived auto sessions pick up
|
|
1798
1950
|
// bundled extension updates before resume-time verification/state logic runs.
|
|
1799
1951
|
// GSD_PKG_ROOT is set by loader.ts and points to the gsd-pi package root.
|
|
1800
|
-
// The relative import ("../../../resource-loader.js") only works from the source
|
|
1952
|
+
// The relative import ("../../../resource-runtime/resource-loader.js") only works from the source
|
|
1801
1953
|
// tree; deployed extensions live at ~/.gsd/agent/extensions/gsd/ where the
|
|
1802
1954
|
// relative path resolves to ~/.gsd/agent/resource-loader.js which doesn't exist.
|
|
1803
1955
|
// Using GSD_PKG_ROOT constructs a correct absolute path in both contexts (#3949).
|
|
1804
1956
|
const agentDir = process.env.GSD_CODING_AGENT_DIR || join(gsdHome(), "agent");
|
|
1805
1957
|
const pkgRoot = process.env.GSD_PKG_ROOT;
|
|
1806
1958
|
const resourceLoaderPath = pkgRoot
|
|
1807
|
-
? pathToFileURL(join(pkgRoot, "dist", "resource-loader.js")).href
|
|
1808
|
-
: new URL("../../../resource-loader.js", import.meta.url).href;
|
|
1959
|
+
? pathToFileURL(join(pkgRoot, "dist", "resource-runtime", "resource-loader.js")).href
|
|
1960
|
+
: new URL("../../../resource-runtime/resource-loader.js", import.meta.url).href;
|
|
1809
1961
|
const { initResources } = await import(resourceLoaderPath);
|
|
1810
1962
|
initResources(agentDir);
|
|
1811
1963
|
// Open the project DB before rebuild/derive so resume uses DB-backed
|
|
@@ -1868,6 +2020,11 @@ export async function startAuto(
|
|
|
1868
2020
|
}
|
|
1869
2021
|
pi.events.emit(CMUX_CHANNELS.LOG, { preferences: loadEffectiveGSDPreferences(s.basePath || undefined)?.preferences, message: s.stepMode ? "Step-mode resumed." : "Auto-mode resumed.", level: "progress" });
|
|
1870
2022
|
|
|
2023
|
+
try {
|
|
2024
|
+
await s.orchestration?.resume();
|
|
2025
|
+
} catch (err) {
|
|
2026
|
+
debugLog("resume-orchestration-resume", { error: err instanceof Error ? err.message : String(err) });
|
|
2027
|
+
}
|
|
1871
2028
|
startAutoCommandPolling(s.basePath);
|
|
1872
2029
|
await runAutoLoopWithUok({
|
|
1873
2030
|
ctx,
|
|
@@ -1904,7 +2061,7 @@ export async function startAuto(
|
|
|
1904
2061
|
// Build scope after bootstrap has populated s.basePath / s.originalBasePath /
|
|
1905
2062
|
// s.currentMilestoneId (including worktree setup inside bootstrapAutoSession).
|
|
1906
2063
|
rebuildScope(s.basePath, s.currentMilestoneId);
|
|
1907
|
-
|
|
2064
|
+
ensureOrchestrationModule(ctx, pi, s.basePath || base);
|
|
1908
2065
|
captureProjectRootEnv(s.originalBasePath || s.basePath);
|
|
1909
2066
|
registerAutoWorkerForSession(s);
|
|
1910
2067
|
try {
|
|
@@ -1915,6 +2072,12 @@ export async function startAuto(
|
|
|
1915
2072
|
}
|
|
1916
2073
|
pi.events.emit(CMUX_CHANNELS.LOG, { preferences: loadEffectiveGSDPreferences(s.basePath || undefined)?.preferences, message: requestedStepMode ? "Step-mode started." : "Auto-mode started.", level: "progress" });
|
|
1917
2074
|
|
|
2075
|
+
try {
|
|
2076
|
+
await s.orchestration?.start({ basePath: s.basePath, trigger: "auto-loop" });
|
|
2077
|
+
} catch (err) {
|
|
2078
|
+
debugLog("start-orchestration-start", { error: err instanceof Error ? err.message : String(err) });
|
|
2079
|
+
}
|
|
2080
|
+
|
|
1918
2081
|
startAutoCommandPolling(s.basePath);
|
|
1919
2082
|
|
|
1920
2083
|
// Dispatch the first unit
|
|
@@ -2037,6 +2200,9 @@ export async function dispatchHookUnit(
|
|
|
2037
2200
|
}
|
|
2038
2201
|
|
|
2039
2202
|
s.basePath = targetBasePath;
|
|
2203
|
+
if (!s.orchestration) {
|
|
2204
|
+
ensureOrchestrationModule(ctx, pi, s.basePath);
|
|
2205
|
+
}
|
|
2040
2206
|
|
|
2041
2207
|
const hookUnitType = `hook/${hookName}`;
|
|
2042
2208
|
const hookStartedAt = Date.now();
|