gsd-pi 2.75.0-dev.063e5a3 → 2.75.0-dev.96d4bb599
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 +186 -149
- package/dist/claude-cli-check.d.ts +10 -0
- package/dist/claude-cli-check.js +13 -3
- package/dist/headless-events.d.ts +1 -1
- package/dist/headless-events.js +5 -2
- package/dist/headless.js +5 -6
- package/dist/loader.js +0 -0
- package/dist/onboarding.d.ts +20 -1
- package/dist/onboarding.js +99 -39
- package/dist/resources/extensions/ask-user-questions.js +17 -5
- package/dist/resources/extensions/claude-code-cli/models.js +9 -0
- package/dist/resources/extensions/claude-code-cli/readiness.js +12 -2
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +76 -4
- package/dist/resources/extensions/gsd/auto/detect-stuck.js +9 -0
- package/dist/resources/extensions/gsd/auto/loop.js +67 -4
- package/dist/resources/extensions/gsd/auto/phases.js +70 -47
- package/dist/resources/extensions/gsd/auto/resolve.js +1 -1
- package/dist/resources/extensions/gsd/auto/run-unit.js +10 -1
- package/dist/resources/extensions/gsd/auto/session.js +5 -0
- package/dist/resources/extensions/gsd/auto-artifact-paths.js +20 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +15 -7
- package/dist/resources/extensions/gsd/auto-dispatch.js +112 -6
- package/dist/resources/extensions/gsd/auto-loop.js +1 -1
- package/dist/resources/extensions/gsd/auto-model-selection.js +11 -3
- package/dist/resources/extensions/gsd/auto-post-unit.js +10 -8
- package/dist/resources/extensions/gsd/auto-prompts.js +173 -39
- package/dist/resources/extensions/gsd/auto-recovery.js +57 -0
- package/dist/resources/extensions/gsd/auto-start.js +5 -3
- package/dist/resources/extensions/gsd/auto-verification.js +3 -3
- package/dist/resources/extensions/gsd/auto-worktree.js +55 -1
- package/dist/resources/extensions/gsd/auto.js +57 -25
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +8 -21
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +45 -23
- package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +128 -0
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +29 -0
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +2 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +22 -0
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +17 -4
- package/dist/resources/extensions/gsd/commands/catalog.js +81 -9
- package/dist/resources/extensions/gsd/commands/handlers/core.js +64 -24
- package/dist/resources/extensions/gsd/commands/handlers/escalate.js +171 -0
- package/dist/resources/extensions/gsd/commands/handlers/onboarding.js +159 -0
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +21 -0
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +228 -29
- package/dist/resources/extensions/gsd/commands-cmux.js +5 -2
- package/dist/resources/extensions/gsd/commands-config.js +5 -0
- package/dist/resources/extensions/gsd/commands-debug.js +388 -0
- package/dist/resources/extensions/gsd/commands-do.js +1 -0
- package/dist/resources/extensions/gsd/commands-extract-learnings.js +233 -75
- package/dist/resources/extensions/gsd/commands-handlers.js +21 -2
- package/dist/resources/extensions/gsd/commands-memory.js +462 -0
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +40 -12
- package/dist/resources/extensions/gsd/commands-scan.js +94 -0
- package/dist/resources/extensions/gsd/commands-workflow-templates.js +101 -2
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +74 -54
- package/dist/resources/extensions/gsd/db-writer.js +1 -0
- package/dist/resources/extensions/gsd/debug-session-store.js +238 -0
- package/dist/resources/extensions/gsd/definition-loader.js +7 -0
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +9 -9
- package/dist/resources/extensions/gsd/doctor-environment.js +2 -1
- package/dist/resources/extensions/gsd/doctor-git-checks.js +5 -1
- package/dist/resources/extensions/gsd/doctor-proactive.js +4 -1
- package/dist/resources/extensions/gsd/doctor-providers.js +48 -20
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +22 -4
- package/dist/resources/extensions/gsd/doctor.js +7 -1
- package/dist/resources/extensions/gsd/error-classifier.js +6 -3
- package/dist/resources/extensions/gsd/escalation.js +321 -0
- package/dist/resources/extensions/gsd/forensics.js +26 -29
- package/dist/resources/extensions/gsd/git-service.js +0 -1
- package/dist/resources/extensions/gsd/graph.js +26 -2
- package/dist/resources/extensions/gsd/gsd-db.js +490 -32
- package/dist/resources/extensions/gsd/health-widget-core.js +42 -14
- package/dist/resources/extensions/gsd/health-widget.js +7 -4
- package/dist/resources/extensions/gsd/init-wizard.js +86 -45
- package/dist/resources/extensions/gsd/markdown-renderer.js +5 -5
- package/dist/resources/extensions/gsd/memory-embeddings.js +219 -0
- package/dist/resources/extensions/gsd/memory-extractor.js +78 -27
- package/dist/resources/extensions/gsd/memory-ingest.js +218 -0
- package/dist/resources/extensions/gsd/memory-relations.js +189 -0
- package/dist/resources/extensions/gsd/memory-source-store.js +113 -0
- package/dist/resources/extensions/gsd/memory-store.js +299 -6
- package/dist/resources/extensions/gsd/metrics.js +1 -0
- package/dist/resources/extensions/gsd/model-cost-table.js +3 -1
- package/dist/resources/extensions/gsd/model-router.js +16 -6
- package/dist/resources/extensions/gsd/native-git-bridge.js +137 -5
- package/dist/resources/extensions/gsd/notification-overlay.js +7 -22
- package/dist/resources/extensions/gsd/notification-widget.js +24 -39
- package/dist/resources/extensions/gsd/notifications.js +4 -0
- package/dist/resources/extensions/gsd/onboarding-state.js +133 -0
- package/dist/resources/extensions/gsd/post-execution-checks.js +27 -11
- package/dist/resources/extensions/gsd/pre-execution-checks.js +97 -4
- package/dist/resources/extensions/gsd/preferences-models.js +1 -0
- package/dist/resources/extensions/gsd/preferences-types.js +2 -1
- package/dist/resources/extensions/gsd/preferences-validation.js +42 -8
- package/dist/resources/extensions/gsd/preferences.js +10 -10
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +4 -1
- package/dist/resources/extensions/gsd/prompts/debug-diagnose.md +25 -0
- package/dist/resources/extensions/gsd/prompts/debug-session-manager.md +80 -0
- package/dist/resources/extensions/gsd/prompts/execute-task.md +12 -0
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +12 -0
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +69 -0
- package/dist/resources/extensions/gsd/prompts/scan.md +79 -0
- package/dist/resources/extensions/gsd/prompts/workflow-oneshot.md +26 -0
- package/dist/resources/extensions/gsd/python-resolver.js +70 -0
- package/dist/resources/extensions/gsd/run-manager.js +37 -17
- package/dist/resources/extensions/gsd/setup-catalog.js +75 -0
- package/dist/resources/extensions/gsd/state.js +47 -3
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +7 -7
- package/dist/resources/extensions/gsd/tools/complete-task.js +80 -0
- package/dist/resources/extensions/gsd/tools/memory-tools.js +306 -0
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +37 -12
- package/dist/resources/extensions/gsd/tools/plan-slice.js +5 -2
- package/dist/resources/extensions/gsd/tools/skip-slice.js +78 -0
- package/dist/resources/extensions/gsd/uok/flags.js +7 -7
- package/dist/resources/extensions/gsd/uok/kernel.js +8 -3
- package/dist/resources/extensions/gsd/verification-gate.js +2 -1
- package/dist/resources/extensions/gsd/workflow-dispatch.js +64 -0
- package/dist/resources/extensions/gsd/workflow-install.js +327 -0
- package/dist/resources/extensions/gsd/workflow-manifest.js +8 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +1 -6
- package/dist/resources/extensions/gsd/workflow-plugins.js +346 -0
- package/dist/resources/extensions/gsd/workflow-projections.js +17 -15
- package/dist/resources/extensions/gsd/workflow-templates/accessibility-audit.md +88 -0
- package/dist/resources/extensions/gsd/workflow-templates/api-breaking-change.md +117 -0
- package/dist/resources/extensions/gsd/workflow-templates/bugfix.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/changelog-gen.md +82 -0
- package/dist/resources/extensions/gsd/workflow-templates/ci-bootstrap.md +144 -0
- package/dist/resources/extensions/gsd/workflow-templates/dead-code.md +81 -0
- package/dist/resources/extensions/gsd/workflow-templates/dep-upgrade.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/docs-sync.yaml +76 -0
- package/dist/resources/extensions/gsd/workflow-templates/env-audit.yaml +88 -0
- package/dist/resources/extensions/gsd/workflow-templates/full-project.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/hotfix.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/issue-triage.md +84 -0
- package/dist/resources/extensions/gsd/workflow-templates/observability-setup.md +133 -0
- package/dist/resources/extensions/gsd/workflow-templates/onboarding-check.md +74 -0
- package/dist/resources/extensions/gsd/workflow-templates/performance-audit.md +125 -0
- package/dist/resources/extensions/gsd/workflow-templates/pr-review.md +67 -0
- package/dist/resources/extensions/gsd/workflow-templates/pr-triage.md +83 -0
- package/dist/resources/extensions/gsd/workflow-templates/refactor.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/registry.json +184 -0
- package/dist/resources/extensions/gsd/workflow-templates/release.md +118 -0
- package/dist/resources/extensions/gsd/workflow-templates/rename-symbol.yaml +99 -0
- package/dist/resources/extensions/gsd/workflow-templates/security-audit.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/small-feature.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/spike.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/test-backfill.yaml +73 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +42 -1
- package/dist/resources/extensions/remote-questions/commands.js +380 -0
- package/dist/resources/extensions/remote-questions/manager.js +39 -5
- package/dist/resources/extensions/remote-questions/telegram-adapter.js +79 -4
- package/dist/resources/extensions/shared/interview-ui.js +189 -1
- package/dist/resources/extensions/shared/layout-utils.js +17 -0
- package/dist/resources/extensions/shared/rtk-shared.js +47 -0
- package/dist/resources/extensions/shared/rtk.js +3 -46
- package/dist/resources/skills/create-workflow/SKILL.md +33 -6
- package/dist/rtk-shared.d.ts +10 -0
- package/dist/rtk-shared.js +47 -0
- package/dist/rtk.d.ts +2 -6
- package/dist/rtk.js +3 -48
- package/dist/shared/workspace-types.d.ts +52 -0
- package/dist/shared/workspace-types.js +1 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/update-check.d.ts +10 -0
- package/dist/update-check.js +24 -3
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +5 -5
- 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/react-loadable-manifest.json +2 -2
- package/dist/web/standalone/.next/required-server-files.json +1 -1
- 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_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 +2 -2
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- 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 -2
- 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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +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/update/route.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/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +3 -3
- 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 +3 -3
- 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 +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +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 +5 -5
- package/dist/web/standalone/.next/server/chunks/6897.js +2 -2
- package/dist/web/standalone/.next/server/chunks/7461.js +1 -0
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +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/2826.e59e8578e2e28639.js +9 -0
- package/dist/web/standalone/.next/static/chunks/{2008.71ee9230ad78df21.js → 3621.fc7480022c972438.js} +2 -2
- package/dist/web/standalone/.next/static/chunks/app/{page-f1e30ab6bb269149.js → page-5b113fd32bc2a1c3.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/{webpack-b868033a5834586d.js → webpack-5fc74f13a25fa1bb.js} +1 -1
- package/dist/web/standalone/.next/static/css/632cd626b1731d88.css +1 -0
- package/dist/web/standalone/server.js +1 -1
- package/dist/welcome-screen.js +48 -24
- package/dist/wizard.js +2 -2
- package/dist/worktree-cli.d.ts +6 -5
- package/dist/worktree-cli.js +23 -7
- package/package.json +3 -3
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +12 -10
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/session-manager.d.ts.map +1 -1
- package/packages/mcp-server/dist/session-manager.js +8 -1
- package/packages/mcp-server/dist/session-manager.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts +1 -0
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +113 -14
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/mcp-server.test.ts +40 -4
- package/packages/mcp-server/src/server.ts +12 -10
- package/packages/mcp-server/src/session-manager.ts +10 -3
- package/packages/mcp-server/src/workflow-tools.test.ts +91 -1
- package/packages/mcp-server/src/workflow-tools.ts +128 -18
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/models/capability-patches.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/capability-patches.js +3 -2
- package/packages/pi-ai/dist/models/capability-patches.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts +68 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js +68 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/anthropic.js +17 -0
- package/packages/pi-ai/dist/models/generated/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/google-antigravity.js +17 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/groq.d.ts +0 -153
- package/packages/pi-ai/dist/models/generated/groq.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/groq.js +0 -153
- package/packages/pi-ai/dist/models/generated/groq.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/index.d.ts +136 -153
- package/packages/pi-ai/dist/models/generated/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openai-codex.js +17 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openrouter.js +17 -0
- package/packages/pi-ai/dist/models/generated/openrouter.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.test.js +17 -0
- package/packages/pi-ai/dist/models.generated.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts +22 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.js +40 -6
- package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.js +106 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +42 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +20 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +32 -2
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js +12 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +11 -0
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +18 -1
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/openai-codex.js +12 -0
- package/packages/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/scripts/generate-models.ts +50 -0
- package/packages/pi-ai/src/models/capability-patches.ts +5 -2
- package/packages/pi-ai/src/models/generated/amazon-bedrock.ts +68 -0
- package/packages/pi-ai/src/models/generated/anthropic.ts +17 -0
- package/packages/pi-ai/src/models/generated/google-antigravity.ts +17 -0
- package/packages/pi-ai/src/models/generated/groq.ts +0 -153
- package/packages/pi-ai/src/models/generated/openai-codex.ts +17 -0
- package/packages/pi-ai/src/models/generated/openrouter.ts +17 -0
- package/packages/pi-ai/src/models.generated.test.ts +17 -0
- package/packages/pi-ai/src/providers/amazon-bedrock.test.ts +164 -0
- package/packages/pi-ai/src/providers/amazon-bedrock.ts +41 -7
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +47 -1
- package/packages/pi-ai/src/providers/anthropic-shared.test.ts +15 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +36 -3
- package/packages/pi-ai/src/providers/anthropic.ts +19 -1
- package/packages/pi-ai/src/utils/oauth/openai-codex.ts +15 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +38 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +14 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +34 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js +74 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +4 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +32 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +32 -0
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js +2 -2
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +17 -7
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.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 +48 -34
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +83 -33
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +70 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +77 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -66
- 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 +1 -75
- 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 +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 +192 -24
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +56 -0
- package/packages/pi-coding-agent/src/core/auth-storage.test.ts +83 -0
- package/packages/pi-coding-agent/src/core/auth-storage.ts +35 -0
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +4 -1
- package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +37 -1
- package/packages/pi-coding-agent/src/core/sdk.ts +41 -0
- package/packages/pi-coding-agent/src/core/skill-tool.test.ts +2 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +19 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +53 -31
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +88 -36
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.ts +83 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +2 -83
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +208 -27
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts +70 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.js +77 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -66
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +1 -75
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js +192 -24
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/src/resources/extensions/ask-user-questions.ts +24 -6
- package/src/resources/extensions/claude-code-cli/models.ts +9 -0
- package/src/resources/extensions/claude-code-cli/readiness.ts +13 -2
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +94 -4
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +84 -0
- package/src/resources/extensions/gsd/auto/detect-stuck.ts +10 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +1 -0
- package/src/resources/extensions/gsd/auto/loop.ts +109 -3
- package/src/resources/extensions/gsd/auto/phases.ts +94 -60
- package/src/resources/extensions/gsd/auto/resolve.ts +1 -1
- package/src/resources/extensions/gsd/auto/run-unit.ts +11 -1
- package/src/resources/extensions/gsd/auto/session.ts +7 -0
- package/src/resources/extensions/gsd/auto-artifact-paths.ts +20 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +21 -4
- package/src/resources/extensions/gsd/auto-dispatch.ts +123 -5
- package/src/resources/extensions/gsd/auto-loop.ts +1 -1
- package/src/resources/extensions/gsd/auto-model-selection.ts +14 -3
- package/src/resources/extensions/gsd/auto-post-unit.ts +10 -8
- package/src/resources/extensions/gsd/auto-prompts.ts +201 -40
- package/src/resources/extensions/gsd/auto-recovery.ts +63 -1
- package/src/resources/extensions/gsd/auto-start.ts +8 -6
- package/src/resources/extensions/gsd/auto-verification.ts +3 -3
- package/src/resources/extensions/gsd/auto-worktree.ts +65 -0
- package/src/resources/extensions/gsd/auto.ts +61 -28
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +8 -21
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +46 -24
- package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +158 -0
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +31 -0
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +2 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +22 -0
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +20 -4
- package/src/resources/extensions/gsd/commands/catalog.ts +74 -9
- package/src/resources/extensions/gsd/commands/handlers/core.ts +69 -27
- package/src/resources/extensions/gsd/commands/handlers/escalate.ts +216 -0
- package/src/resources/extensions/gsd/commands/handlers/onboarding.ts +196 -0
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +21 -0
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +279 -29
- package/src/resources/extensions/gsd/commands-cmux.ts +6 -2
- package/src/resources/extensions/gsd/commands-config.ts +10 -0
- package/src/resources/extensions/gsd/commands-debug.ts +484 -0
- package/src/resources/extensions/gsd/commands-do.ts +1 -0
- package/src/resources/extensions/gsd/commands-extract-learnings.ts +295 -76
- package/src/resources/extensions/gsd/commands-handlers.ts +19 -2
- package/src/resources/extensions/gsd/commands-memory.ts +551 -0
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +49 -12
- package/src/resources/extensions/gsd/commands-scan.ts +125 -0
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +129 -2
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +85 -60
- package/src/resources/extensions/gsd/db-writer.ts +3 -0
- package/src/resources/extensions/gsd/debug-session-store.ts +377 -0
- package/src/resources/extensions/gsd/definition-loader.ts +7 -0
- package/src/resources/extensions/gsd/docs/preferences-reference.md +9 -9
- package/src/resources/extensions/gsd/doctor-environment.ts +2 -1
- package/src/resources/extensions/gsd/doctor-git-checks.ts +5 -1
- package/src/resources/extensions/gsd/doctor-proactive.ts +4 -1
- package/src/resources/extensions/gsd/doctor-providers.ts +52 -22
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +23 -4
- package/src/resources/extensions/gsd/doctor-types.ts +1 -0
- package/src/resources/extensions/gsd/doctor.ts +7 -1
- package/src/resources/extensions/gsd/error-classifier.ts +6 -3
- package/src/resources/extensions/gsd/escalation.ts +367 -0
- package/src/resources/extensions/gsd/forensics.ts +25 -29
- package/src/resources/extensions/gsd/git-service.ts +0 -1
- package/src/resources/extensions/gsd/graph.ts +33 -3
- package/src/resources/extensions/gsd/gsd-db.ts +578 -32
- package/src/resources/extensions/gsd/health-widget-core.ts +43 -14
- package/src/resources/extensions/gsd/health-widget.ts +7 -3
- package/src/resources/extensions/gsd/init-wizard.ts +87 -54
- package/src/resources/extensions/gsd/markdown-renderer.ts +5 -5
- package/src/resources/extensions/gsd/memory-embeddings.ts +235 -0
- package/src/resources/extensions/gsd/memory-extractor.ts +100 -34
- package/src/resources/extensions/gsd/memory-ingest.ts +286 -0
- package/src/resources/extensions/gsd/memory-relations.ts +240 -0
- package/src/resources/extensions/gsd/memory-source-store.ts +138 -0
- package/src/resources/extensions/gsd/memory-store.ts +351 -7
- package/src/resources/extensions/gsd/metrics.ts +1 -0
- package/src/resources/extensions/gsd/model-cost-table.ts +3 -1
- package/src/resources/extensions/gsd/model-router.ts +25 -6
- package/src/resources/extensions/gsd/native-git-bridge.ts +134 -6
- package/src/resources/extensions/gsd/notification-overlay.ts +9 -19
- package/src/resources/extensions/gsd/notification-widget.ts +25 -43
- package/src/resources/extensions/gsd/notifications.ts +6 -0
- package/src/resources/extensions/gsd/onboarding-state.ts +146 -0
- package/src/resources/extensions/gsd/post-execution-checks.ts +37 -14
- package/src/resources/extensions/gsd/pre-execution-checks.ts +98 -8
- package/src/resources/extensions/gsd/preferences-models.ts +1 -0
- package/src/resources/extensions/gsd/preferences-types.ts +10 -2
- package/src/resources/extensions/gsd/preferences-validation.ts +33 -7
- package/src/resources/extensions/gsd/preferences.ts +10 -10
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +4 -1
- package/src/resources/extensions/gsd/prompts/debug-diagnose.md +25 -0
- package/src/resources/extensions/gsd/prompts/debug-session-manager.md +80 -0
- package/src/resources/extensions/gsd/prompts/execute-task.md +12 -0
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +12 -0
- package/src/resources/extensions/gsd/prompts/refine-slice.md +69 -0
- package/src/resources/extensions/gsd/prompts/scan.md +79 -0
- package/src/resources/extensions/gsd/prompts/workflow-oneshot.md +26 -0
- package/src/resources/extensions/gsd/python-resolver.ts +76 -0
- package/src/resources/extensions/gsd/run-manager.ts +53 -19
- package/src/resources/extensions/gsd/setup-catalog.ts +105 -0
- package/src/resources/extensions/gsd/state.ts +50 -2
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +7 -7
- package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +1 -34
- package/src/resources/extensions/gsd/tests/artifact-corruption-2630.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +45 -31
- package/src/resources/extensions/gsd/tests/auto-migrating-recovery.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/auto-prompts-fallback.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +123 -1
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/autocomplete-regressions-1675.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/commands-do.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +333 -21
- package/src/resources/extensions/gsd/tests/commands-scan.test.ts +351 -0
- package/src/resources/extensions/gsd/tests/commands-workflow-custom.test.ts +8 -6
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +6 -8
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/debug-command-handler.test.ts +905 -0
- package/src/resources/extensions/gsd/tests/debug-command-lifecycle.integration.test.ts +1229 -0
- package/src/resources/extensions/gsd/tests/debug-session-store.test.ts +565 -0
- package/src/resources/extensions/gsd/tests/discuss-milestone-structured-questions.test.ts +64 -0
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +62 -18
- package/src/resources/extensions/gsd/tests/enhanced-verification-integration.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/escalation.test.ts +818 -0
- package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +29 -12
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +106 -0
- package/src/resources/extensions/gsd/tests/forensics-hook-key-parse.test.ts +74 -0
- package/src/resources/extensions/gsd/tests/graph-operations.test.ts +0 -4
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +44 -1
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +8 -2
- package/src/resources/extensions/gsd/tests/init-prefs-routing.test.ts +190 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-proactive.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-runtime.test.ts +68 -1
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +109 -11
- package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/integration/integration-proof.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/integration/test-isolation.ts +53 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +171 -1
- package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/memory-embeddings.test.ts +213 -0
- package/src/resources/extensions/gsd/tests/memory-ingest.test.ts +153 -0
- package/src/resources/extensions/gsd/tests/memory-maintenance.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/memory-relations.test.ts +175 -0
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/memory-tools.test.ts +295 -0
- package/src/resources/extensions/gsd/tests/milestone-status-tool.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/model-cost-table.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/model-router.test.ts +51 -1
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/notification-overlay.test.ts +56 -37
- package/src/resources/extensions/gsd/tests/notification-widget.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/onboarding-state.test.ts +105 -0
- package/src/resources/extensions/gsd/tests/plan-milestone-boundary-map-preservation.test.ts +114 -0
- package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +4 -5
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +17 -0
- package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +105 -1
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +275 -6
- package/src/resources/extensions/gsd/tests/preferences.test.ts +69 -1
- package/src/resources/extensions/gsd/tests/progressive-planning.test.ts +539 -0
- package/src/resources/extensions/gsd/tests/projection-no-plan-overwrite.test.ts +11 -2
- package/src/resources/extensions/gsd/tests/projection-regression.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +24 -0
- package/src/resources/extensions/gsd/tests/prompt-db.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/python-resolver.test.ts +131 -0
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/remote-notification-from-desktop.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/requirements.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +153 -0
- package/src/resources/extensions/gsd/tests/skip-slice-cascades-tasks.test.ts +125 -0
- package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +16 -4
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/uok-flags.test.ts +31 -1
- package/src/resources/extensions/gsd/tests/uok-kernel-path.test.ts +166 -0
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/workflow-install.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +15 -6
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/workflow-plugins.test.ts +310 -0
- package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +8 -2
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +77 -2
- package/src/resources/extensions/gsd/tools/complete-task.ts +87 -0
- package/src/resources/extensions/gsd/tools/memory-tools.ts +380 -0
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +42 -8
- package/src/resources/extensions/gsd/tools/plan-slice.ts +6 -1
- package/src/resources/extensions/gsd/tools/skip-slice.ts +133 -0
- package/src/resources/extensions/gsd/types.ts +62 -0
- package/src/resources/extensions/gsd/unit-runtime.ts +1 -0
- package/src/resources/extensions/gsd/uok/contracts.ts +2 -1
- package/src/resources/extensions/gsd/uok/flags.ts +7 -7
- package/src/resources/extensions/gsd/uok/kernel.ts +16 -4
- package/src/resources/extensions/gsd/verification-gate.ts +2 -1
- package/src/resources/extensions/gsd/workflow-dispatch.ts +106 -0
- package/src/resources/extensions/gsd/workflow-install.ts +423 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +3 -1
- package/src/resources/extensions/gsd/workflow-manifest.ts +8 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +1 -6
- package/src/resources/extensions/gsd/workflow-plugins.ts +403 -0
- package/src/resources/extensions/gsd/workflow-projections.ts +18 -16
- package/src/resources/extensions/gsd/workflow-templates/accessibility-audit.md +88 -0
- package/src/resources/extensions/gsd/workflow-templates/api-breaking-change.md +117 -0
- package/src/resources/extensions/gsd/workflow-templates/bugfix.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/changelog-gen.md +82 -0
- package/src/resources/extensions/gsd/workflow-templates/ci-bootstrap.md +144 -0
- package/src/resources/extensions/gsd/workflow-templates/dead-code.md +81 -0
- package/src/resources/extensions/gsd/workflow-templates/dep-upgrade.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/docs-sync.yaml +76 -0
- package/src/resources/extensions/gsd/workflow-templates/env-audit.yaml +88 -0
- package/src/resources/extensions/gsd/workflow-templates/full-project.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/hotfix.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/issue-triage.md +84 -0
- package/src/resources/extensions/gsd/workflow-templates/observability-setup.md +133 -0
- package/src/resources/extensions/gsd/workflow-templates/onboarding-check.md +74 -0
- package/src/resources/extensions/gsd/workflow-templates/performance-audit.md +125 -0
- package/src/resources/extensions/gsd/workflow-templates/pr-review.md +67 -0
- package/src/resources/extensions/gsd/workflow-templates/pr-triage.md +83 -0
- package/src/resources/extensions/gsd/workflow-templates/refactor.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/registry.json +184 -0
- package/src/resources/extensions/gsd/workflow-templates/release.md +118 -0
- package/src/resources/extensions/gsd/workflow-templates/rename-symbol.yaml +99 -0
- package/src/resources/extensions/gsd/workflow-templates/security-audit.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/small-feature.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/spike.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/test-backfill.yaml +73 -0
- package/src/resources/extensions/gsd/workflow-templates.ts +7 -0
- package/src/resources/extensions/gsd/workspace-index.ts +9 -4
- package/src/resources/extensions/gsd/worktree-resolver.ts +47 -1
- package/src/resources/extensions/remote-questions/commands.ts +480 -0
- package/src/resources/extensions/remote-questions/manager.ts +49 -4
- package/src/resources/extensions/remote-questions/telegram-adapter.ts +86 -4
- package/src/resources/extensions/remote-questions/tests/command-polling.test.ts +246 -0
- package/src/resources/extensions/remote-questions/tests/remote-answer-normalization.test.ts +92 -0
- package/src/resources/extensions/remote-questions/tests/telegram-commands.test.ts +267 -0
- package/src/resources/extensions/shared/interview-ui.ts +195 -1
- package/src/resources/extensions/shared/layout-utils.ts +26 -0
- package/src/resources/extensions/shared/rtk-shared.ts +58 -0
- package/src/resources/extensions/shared/rtk.ts +12 -52
- package/src/resources/extensions/shared/tests/interview-preview.test.ts +177 -0
- package/src/resources/extensions/shared/tests/preview-layout.test.ts +120 -0
- package/src/resources/skills/create-workflow/SKILL.md +33 -6
- package/dist/web/standalone/.next/static/chunks/2826.dd3dc8bbd3025fa5.js +0 -9
- package/dist/web/standalone/.next/static/css/f6e8833d46e738d8.css +0 -1
- package/packages/native/dist/ps/types.d.ts +0 -5
- package/packages/native/dist/ps/types.js +0 -2
- package/packages/native/src/ps/types.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/LICENSE +0 -201
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/README.md +0 -9
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-cjs/index.js +0 -762
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +0 -19
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/constants.js +0 -1
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +0 -9
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/index.js +0 -3
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +0 -230
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +0 -87
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +0 -32
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +0 -169
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +0 -21
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +0 -88
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +0 -36
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +0 -21
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +0 -22
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +0 -23
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +0 -8
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +0 -41
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +0 -21
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/timing.js +0 -4
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +0 -63
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +0 -10
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +0 -4
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +0 -3
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +0 -46
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +0 -24
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +0 -63
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +0 -8
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +0 -10
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +0 -4
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +0 -3
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +0 -46
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +0 -24
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +0 -63
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +0 -8
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/package.json +0 -68
- package/packages/pi-ai/oauth.d.ts +0 -1
- package/packages/pi-ai/oauth.js +0 -1
- /package/dist/web/standalone/.next/static/{j7IBD35UgrL2b298GLK3V → o61X3klsB6C0UE0X1x3PA}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{j7IBD35UgrL2b298GLK3V → o61X3klsB6C0UE0X1x3PA}/_ssgManifest.js +0 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* (auto.ts, auto-timeout-recovery.ts, agent-end-recovery.ts, tests)
|
|
7
7
|
* continue to work without changes.
|
|
8
8
|
*/
|
|
9
|
-
export { autoLoop } from "./auto/loop.js";
|
|
9
|
+
export { autoLoop, runUokKernelLoop, runLegacyAutoLoop } from "./auto/loop.js";
|
|
10
10
|
export { isInfrastructureError, INFRA_ERROR_CODES } from "./auto/infra-errors.js";
|
|
11
11
|
export { resolveAgentEnd, resolveAgentEndCancelled, isSessionSwitchInFlight, _resetPendingResolve, _setActiveSession } from "./auto/resolve.js";
|
|
12
12
|
export { detectStuck } from "./auto/detect-stuck.js";
|
|
@@ -24,8 +24,13 @@ export function resolvePreferredModelConfig(unitType, autoModeStartModel, isAuto
|
|
|
24
24
|
if (!routingConfig.enabled || !routingConfig.tier_models)
|
|
25
25
|
return undefined;
|
|
26
26
|
// Don't synthesize a routing config for flat-rate providers (#3453).
|
|
27
|
-
|
|
27
|
+
// Users can opt into routing for flat-rate subscriptions (e.g. claude-code)
|
|
28
|
+
// via dynamic_routing.allow_flat_rate_providers (#4386).
|
|
29
|
+
if (!routingConfig.allow_flat_rate_providers &&
|
|
30
|
+
autoModeStartModel &&
|
|
31
|
+
isFlatRateProvider(autoModeStartModel.provider, autoModeStartModel.flatRateCtx)) {
|
|
28
32
|
return undefined;
|
|
33
|
+
}
|
|
29
34
|
const ceilingModel = routingConfig.tier_models.heavy
|
|
30
35
|
?? (autoModeStartModel ? `${autoModeStartModel.provider}/${autoModeStartModel.id}` : undefined);
|
|
31
36
|
if (!ceilingModel)
|
|
@@ -113,7 +118,10 @@ sessionModelOverride) {
|
|
|
113
118
|
// model provides no cost benefit — it only degrades quality.
|
|
114
119
|
// Fail-closed: if primary model can't be resolved, fall back to
|
|
115
120
|
// provider-level signals rather than allowing unwanted downgrades.
|
|
116
|
-
|
|
121
|
+
// Opt-in: dynamic_routing.allow_flat_rate_providers skips the bypass so
|
|
122
|
+
// claude-code subscribers can still get intelligent per-task selection
|
|
123
|
+
// across their subscription (#4386).
|
|
124
|
+
if (routingConfig.enabled && !routingConfig.allow_flat_rate_providers) {
|
|
117
125
|
const primaryModel = resolveModelId(modelConfig.primary, routingEligibleModels, ctx.model?.provider);
|
|
118
126
|
if (primaryModel) {
|
|
119
127
|
const primaryFlatRateCtx = buildFlatRateContext(primaryModel.provider, ctx, prefs);
|
|
@@ -142,7 +150,7 @@ sessionModelOverride) {
|
|
|
142
150
|
const shouldClassify = !isHook || routingConfig.hooks !== false;
|
|
143
151
|
if (shouldClassify) {
|
|
144
152
|
let classification = classifyUnitComplexity(unitType, unitId, basePath, budgetPct, taskMetadataForPolicy);
|
|
145
|
-
const availableModelIds = routingEligibleModels.map(m => m.id);
|
|
153
|
+
const availableModelIds = routingEligibleModels.map(m => `${m.provider}/${m.id}`);
|
|
146
154
|
// Escalate tier on retry when escalate_on_failure is enabled (default: true)
|
|
147
155
|
if (retryContext?.isRetry &&
|
|
148
156
|
retryContext.previousTier &&
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Post-unit processing for
|
|
2
|
+
* Post-unit processing for auto-loop — auto-commit, doctor run,
|
|
3
3
|
* state rebuild, worktree sync, DB dual-write, hooks, triage, and
|
|
4
4
|
* quick-task dispatch.
|
|
5
5
|
*
|
|
6
|
-
* Split into two functions called sequentially by
|
|
6
|
+
* Split into two functions called sequentially by auto-loop with
|
|
7
7
|
* the verification gate between them:
|
|
8
8
|
* 1. postUnitPreVerification() — commit, doctor, state rebuild, worktree sync, artifact verification
|
|
9
9
|
* 2. postUnitPostVerification() — DB dual-write, hooks, triage, quick-tasks
|
|
10
10
|
*
|
|
11
|
-
* Extracted from
|
|
11
|
+
* Extracted from the pre-loop agent_end handler in auto.ts.
|
|
12
12
|
*/
|
|
13
13
|
import { deriveState } from "./state.js";
|
|
14
14
|
import { logWarning, logError } from "./workflow-logger.js";
|
|
@@ -66,7 +66,7 @@ function enqueueSidecar(s, ctx, entry, debugExtra, notification) {
|
|
|
66
66
|
* next actual task commit via `smartStage()`. */
|
|
67
67
|
const LIFECYCLE_ONLY_UNITS = new Set([
|
|
68
68
|
"research-milestone", "discuss-milestone", "discuss-slice", "plan-milestone",
|
|
69
|
-
"validate-milestone", "research-slice", "plan-slice",
|
|
69
|
+
"validate-milestone", "research-slice", "plan-slice", "refine-slice",
|
|
70
70
|
"replan-slice", "complete-slice", "run-uat",
|
|
71
71
|
"reassess-roadmap", "rewrite-docs",
|
|
72
72
|
]);
|
|
@@ -139,7 +139,7 @@ export function detectRogueFileWrites(unitType, unitId, basePath) {
|
|
|
139
139
|
rogues.push({ path: roadmapPath, unitType, unitId });
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
else if (unitType === "plan-slice" || unitType === "replan-slice") {
|
|
142
|
+
else if (unitType === "plan-slice" || unitType === "refine-slice" || unitType === "replan-slice") {
|
|
143
143
|
if (!mid || !sid)
|
|
144
144
|
return [];
|
|
145
145
|
const planPath = resolveSliceFile(basePath, mid, sid, "PLAN");
|
|
@@ -611,7 +611,7 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
611
611
|
try {
|
|
612
612
|
const { milestone: mid, slice: sid } = parseUnitId(s.currentUnit.id);
|
|
613
613
|
if (mid && sid) {
|
|
614
|
-
const regenerated = regenerateIfMissing(s.basePath, mid, sid, "PLAN");
|
|
614
|
+
const regenerated = await regenerateIfMissing(s.basePath, mid, sid, "PLAN");
|
|
615
615
|
if (regenerated) {
|
|
616
616
|
// Re-check after regeneration
|
|
617
617
|
triggerArtifactVerified = verifyExpectedArtifact(s.currentUnit.type, s.currentUnit.id, s.basePath);
|
|
@@ -855,9 +855,11 @@ export async function postUnitPostVerification(pctx) {
|
|
|
855
855
|
debugLog("postUnit", { phase: "capture-protection-error", error: String(e) });
|
|
856
856
|
}
|
|
857
857
|
}
|
|
858
|
-
// ── Pre-execution checks (after plan-slice completes) ──
|
|
858
|
+
// ── Pre-execution checks (after plan-slice or ADR-011 refine-slice completes) ──
|
|
859
|
+
// Both emit the same PLAN.md + task artifacts via gsd_plan_slice, so the
|
|
860
|
+
// same structural validation applies to both.
|
|
859
861
|
if (s.currentUnit &&
|
|
860
|
-
s.currentUnit.type === "plan-slice") {
|
|
862
|
+
(s.currentUnit.type === "plan-slice" || s.currentUnit.type === "refine-slice")) {
|
|
861
863
|
const currentUnit = s.currentUnit;
|
|
862
864
|
let preExecPauseNeeded = false;
|
|
863
865
|
await runSafely("postUnitPostVerification", "pre-execution-checks", async () => {
|
|
@@ -21,12 +21,53 @@ import { formatDecisionsCompact, formatRequirementsCompact } from "./structured-
|
|
|
21
21
|
import { readPhaseAnchor, formatAnchorForPrompt } from "./phase-anchor.js";
|
|
22
22
|
import { logWarning } from "./workflow-logger.js";
|
|
23
23
|
import { inlineGraphSubgraph } from "./graph-context.js";
|
|
24
|
+
import { buildExtractionStepsBlock } from "./commands-extract-learnings.js";
|
|
24
25
|
// ─── Preamble Cap ─────────────────────────────────────────────────────────────
|
|
26
|
+
/**
|
|
27
|
+
* Historical static ceiling for the preamble cap. Kept as an upper bound even
|
|
28
|
+
* after context-window-aware sizing so large-window users don't suddenly see
|
|
29
|
+
* 10× looser caps than before. Small-window users get a tighter cap derived
|
|
30
|
+
* from their configured executor window.
|
|
31
|
+
*/
|
|
25
32
|
const MAX_PREAMBLE_CHARS = 30_000;
|
|
33
|
+
/**
|
|
34
|
+
* Resolve prompt budgets from the configured executor context window.
|
|
35
|
+
*
|
|
36
|
+
* The prompt builders here don't have access to the runtime model registry
|
|
37
|
+
* (they're called from many non-ctx sites), so `resolveExecutorContextWindow`
|
|
38
|
+
* is fed the user-configurable `context_window_override` preference as the
|
|
39
|
+
* `sessionContextWindow` fallback. That preference exists specifically to
|
|
40
|
+
* cover small-window local models (e.g. 32K lemonade/llama.cpp servers) whose
|
|
41
|
+
* n_ctx is not discoverable through the model registry. Issue #4435.
|
|
42
|
+
*/
|
|
43
|
+
function resolvePromptBudgets() {
|
|
44
|
+
try {
|
|
45
|
+
const prefs = loadEffectiveGSDPreferences();
|
|
46
|
+
const sessionWindow = prefs?.preferences.context_window_override;
|
|
47
|
+
const windowTokens = resolveExecutorContextWindow(undefined, prefs?.preferences, sessionWindow);
|
|
48
|
+
return computeBudgets(windowTokens);
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
logWarning("prompt", `resolvePromptBudgets failed: ${e.message}`);
|
|
52
|
+
return computeBudgets(200_000);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Character budget for dependency/prior slice summaries injected into dispatch
|
|
57
|
+
* prompts. Scales with the executor's configured context window (issue #4435).
|
|
58
|
+
*/
|
|
59
|
+
function resolveSummaryBudgetChars() {
|
|
60
|
+
return resolvePromptBudgets().summaryBudgetChars;
|
|
61
|
+
}
|
|
26
62
|
function capPreamble(preamble) {
|
|
27
|
-
|
|
63
|
+
// Cap inlined context at min(historical 30K ceiling, scaled inline budget).
|
|
64
|
+
// The ceiling preserves pre-fix behavior for large-window users; the scaled
|
|
65
|
+
// budget tightens the cap for small-window users whose true safe limit is
|
|
66
|
+
// below 30K. `computeBudgets` allocates 40% of total chars to inline context.
|
|
67
|
+
const budget = Math.min(MAX_PREAMBLE_CHARS, resolvePromptBudgets().inlineContextBudgetChars);
|
|
68
|
+
if (preamble.length <= budget)
|
|
28
69
|
return preamble;
|
|
29
|
-
return truncateAtSectionBoundary(preamble,
|
|
70
|
+
return truncateAtSectionBoundary(preamble, budget).content;
|
|
30
71
|
}
|
|
31
72
|
// ─── Executor Constraints ─────────────────────────────────────────────────────
|
|
32
73
|
/**
|
|
@@ -57,7 +98,18 @@ function formatExecutorConstraints() {
|
|
|
57
98
|
`- Keep individual tasks completable within a single context window — if a task needs more context than fits, split it`,
|
|
58
99
|
].join("\n");
|
|
59
100
|
}
|
|
60
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Returns a markdown bullet list of known context file paths for the given
|
|
103
|
+
* milestone (and optionally slice). Falls back to a generic tool-agnostic
|
|
104
|
+
* instruction when no GSD artifacts are found.
|
|
105
|
+
*
|
|
106
|
+
* @param base - Absolute path to the project root.
|
|
107
|
+
* @param mid - Milestone ID (e.g. `"M001"`).
|
|
108
|
+
* @param sid - Optional slice ID (e.g. `"S01"`). When provided, the slice
|
|
109
|
+
* RESEARCH file is preferred over the milestone-level one.
|
|
110
|
+
* @returns Markdown string of file path bullets, or a fallback instruction.
|
|
111
|
+
*/
|
|
112
|
+
export function buildSourceFilePaths(base, mid, sid) {
|
|
61
113
|
const paths = [];
|
|
62
114
|
const projectPath = resolveGsdRootFile(base, "PROJECT");
|
|
63
115
|
if (existsSync(projectPath)) {
|
|
@@ -97,7 +149,7 @@ function buildSourceFilePaths(base, mid, sid) {
|
|
|
97
149
|
}
|
|
98
150
|
return paths.length > 0
|
|
99
151
|
? paths.join("\n")
|
|
100
|
-
: "- Use
|
|
152
|
+
: "- Use the Grep/Glob/Read tools to identify the relevant source files before planning.";
|
|
101
153
|
}
|
|
102
154
|
// ─── Inline Helpers ───────────────────────────────────────────────────────
|
|
103
155
|
/**
|
|
@@ -872,13 +924,13 @@ export async function checkNeedsRunUat(base, mid, state, prefs) {
|
|
|
872
924
|
* as a seed when present. The discussion agent interviews the user, writes
|
|
873
925
|
* a full CONTEXT.md, and the phase transitions to pre-planning automatically.
|
|
874
926
|
*/
|
|
875
|
-
export async function buildDiscussMilestonePrompt(mid, midTitle, base) {
|
|
927
|
+
export async function buildDiscussMilestonePrompt(mid, midTitle, base, structuredQuestionsAvailable = "false") {
|
|
876
928
|
const discussTemplates = inlineTemplate("context", "Context");
|
|
877
929
|
const basePrompt = loadPrompt("guided-discuss-milestone", {
|
|
878
930
|
milestoneId: mid,
|
|
879
931
|
milestoneTitle: midTitle,
|
|
880
932
|
inlinedTemplates: discussTemplates,
|
|
881
|
-
structuredQuestionsAvailable
|
|
933
|
+
structuredQuestionsAvailable,
|
|
882
934
|
commitInstruction: "Do not commit planning artifacts — .gsd/ is managed externally.",
|
|
883
935
|
fastPathInstruction: "",
|
|
884
936
|
});
|
|
@@ -1046,7 +1098,7 @@ export async function buildResearchSlicePrompt(mid, _midTitle, sid, sTitle, base
|
|
|
1046
1098
|
if (graphBlockRS)
|
|
1047
1099
|
inlined.push(graphBlockRS);
|
|
1048
1100
|
inlined.push(inlineTemplate("research", "Research"));
|
|
1049
|
-
const depContent = await inlineDependencySummaries(mid, sid, base);
|
|
1101
|
+
const depContent = await inlineDependencySummaries(mid, sid, base, resolveSummaryBudgetChars());
|
|
1050
1102
|
const activeOverrides = await loadActiveOverrides(base);
|
|
1051
1103
|
const overridesInline = formatOverridesSection(activeOverrides);
|
|
1052
1104
|
if (overridesInline)
|
|
@@ -1073,26 +1125,35 @@ export async function buildResearchSlicePrompt(mid, _midTitle, sid, sTitle, base
|
|
|
1073
1125
|
...buildSkillDiscoveryVars(),
|
|
1074
1126
|
});
|
|
1075
1127
|
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1128
|
+
/**
|
|
1129
|
+
* Shared assembly for plan-slice and refine-slice prompts. Both builders need
|
|
1130
|
+
* the same inlined context (roadmap excerpt, slice context, research, decisions,
|
|
1131
|
+
* requirements, knowledge, graph subgraph, templates, dependency summaries,
|
|
1132
|
+
* overrides). Extracted to prevent drift between the two sites.
|
|
1133
|
+
*
|
|
1134
|
+
* `prependBlocks` are pushed onto the start of the inlined array BEFORE any
|
|
1135
|
+
* shared content, so callers can add unit-specific headers (e.g., the refine
|
|
1136
|
+
* sketch-scope constraint).
|
|
1137
|
+
*/
|
|
1138
|
+
async function renderSlicePrompt(options) {
|
|
1139
|
+
const { mid, sid, sTitle, base, level, promptTemplate, prependBlocks = [], extraVars = {} } = options;
|
|
1078
1140
|
const roadmapPath = resolveMilestoneFile(base, mid, "ROADMAP");
|
|
1079
1141
|
const roadmapRel = relMilestoneFile(base, mid, "ROADMAP");
|
|
1080
1142
|
const researchPath = resolveSliceFile(base, mid, sid, "RESEARCH");
|
|
1081
1143
|
const researchRel = relSliceFile(base, mid, sid, "RESEARCH");
|
|
1082
1144
|
const sliceContextPath = resolveSliceFile(base, mid, sid, "CONTEXT");
|
|
1083
1145
|
const sliceContextRel = relSliceFile(base, mid, sid, "CONTEXT");
|
|
1084
|
-
const inlined = [];
|
|
1085
|
-
//
|
|
1146
|
+
const inlined = [...prependBlocks];
|
|
1147
|
+
// Phase handoff anchor from research phase (if available)
|
|
1086
1148
|
const researchSliceAnchor = readPhaseAnchor(base, mid, "research-slice");
|
|
1087
1149
|
if (researchSliceAnchor)
|
|
1088
1150
|
inlined.push(formatAnchorForPrompt(researchSliceAnchor));
|
|
1089
|
-
//
|
|
1090
|
-
const
|
|
1091
|
-
if (
|
|
1092
|
-
inlined.push(
|
|
1151
|
+
// Roadmap excerpt with full-roadmap fallback
|
|
1152
|
+
const roadmapExcerpt = await inlineRoadmapExcerpt(base, mid, sid);
|
|
1153
|
+
if (roadmapExcerpt) {
|
|
1154
|
+
inlined.push(roadmapExcerpt);
|
|
1093
1155
|
}
|
|
1094
1156
|
else {
|
|
1095
|
-
// Fall back to full roadmap if excerpt fails
|
|
1096
1157
|
inlined.push(await inlineFile(roadmapPath, roadmapRel, "Milestone Roadmap"));
|
|
1097
1158
|
}
|
|
1098
1159
|
const sliceCtxInline = await inlineFileOptional(sliceContextPath, sliceContextRel, "Slice Context (from discussion)");
|
|
@@ -1101,40 +1162,34 @@ export async function buildPlanSlicePrompt(mid, _midTitle, sid, sTitle, base, le
|
|
|
1101
1162
|
const researchInline = await inlineFileOptional(researchPath, researchRel, "Slice Research");
|
|
1102
1163
|
if (researchInline)
|
|
1103
1164
|
inlined.push(researchInline);
|
|
1104
|
-
if (
|
|
1105
|
-
|
|
1106
|
-
const
|
|
1107
|
-
const decisionsInline = await inlineDecisionsFromDb(base, mid, derivedScopePS, inlineLevel);
|
|
1165
|
+
if (level !== "minimal") {
|
|
1166
|
+
const derivedScope = deriveSliceScope(sTitle);
|
|
1167
|
+
const decisionsInline = await inlineDecisionsFromDb(base, mid, derivedScope, level);
|
|
1108
1168
|
if (decisionsInline)
|
|
1109
1169
|
inlined.push(decisionsInline);
|
|
1110
|
-
const requirementsInline = await inlineRequirementsFromDb(base, mid, sid,
|
|
1170
|
+
const requirementsInline = await inlineRequirementsFromDb(base, mid, sid, level);
|
|
1111
1171
|
if (requirementsInline)
|
|
1112
1172
|
inlined.push(requirementsInline);
|
|
1113
1173
|
}
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
const graphBlockPS = await inlineGraphSubgraph(base, `${sid} ${sTitle}`, { budget: 3000 });
|
|
1121
|
-
if (graphBlockPS)
|
|
1122
|
-
inlined.push(graphBlockPS);
|
|
1174
|
+
const knowledgeInline = await inlineKnowledgeScoped(base, extractKeywords(sTitle));
|
|
1175
|
+
if (knowledgeInline)
|
|
1176
|
+
inlined.push(knowledgeInline);
|
|
1177
|
+
const graphBlock = await inlineGraphSubgraph(base, `${sid} ${sTitle}`, { budget: 3000 });
|
|
1178
|
+
if (graphBlock)
|
|
1179
|
+
inlined.push(graphBlock);
|
|
1123
1180
|
inlined.push(inlineTemplate("plan", "Slice Plan"));
|
|
1124
|
-
if (
|
|
1181
|
+
if (level === "full") {
|
|
1125
1182
|
inlined.push(inlineTemplate("task-plan", "Task Plan"));
|
|
1126
1183
|
}
|
|
1127
|
-
const depContent = await inlineDependencySummaries(mid, sid, base);
|
|
1128
|
-
const
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
inlined.unshift(planOverridesInline);
|
|
1184
|
+
const depContent = await inlineDependencySummaries(mid, sid, base, resolveSummaryBudgetChars());
|
|
1185
|
+
const overridesInline = formatOverridesSection(await loadActiveOverrides(base));
|
|
1186
|
+
if (overridesInline)
|
|
1187
|
+
inlined.unshift(overridesInline);
|
|
1132
1188
|
const inlinedContext = capPreamble(`## Inlined Context (preloaded — do not re-read these files)\n\n${inlined.join("\n\n---\n\n")}`);
|
|
1133
|
-
// Build executor context constraints from the budget engine
|
|
1134
1189
|
const executorContextConstraints = formatExecutorConstraints();
|
|
1135
1190
|
const outputRelPath = relSliceFile(base, mid, sid, "PLAN");
|
|
1136
1191
|
const commitInstruction = "Do not commit — .gsd/ planning docs are managed externally and not tracked in git.";
|
|
1137
|
-
return loadPrompt(
|
|
1192
|
+
return loadPrompt(promptTemplate, {
|
|
1138
1193
|
workingDirectory: base,
|
|
1139
1194
|
milestoneId: mid, sliceId: sid, sliceTitle: sTitle,
|
|
1140
1195
|
slicePath: relSlicePath(base, mid, sid),
|
|
@@ -1153,6 +1208,56 @@ export async function buildPlanSlicePrompt(mid, _midTitle, sid, sTitle, base, le
|
|
|
1153
1208
|
sliceTitle: sTitle,
|
|
1154
1209
|
extraContext: [inlinedContext, depContent],
|
|
1155
1210
|
}),
|
|
1211
|
+
...extraVars,
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
export async function buildPlanSlicePrompt(mid, _midTitle, sid, sTitle, base, level, options) {
|
|
1215
|
+
const prependBlocks = [];
|
|
1216
|
+
// ADR-011: when the refining-phase dispatch rule gracefully downgrades to
|
|
1217
|
+
// plan-slice (progressive_planning was toggled off mid-milestone), it
|
|
1218
|
+
// forwards the stored sketch_scope as a SOFT hint — context, not a hard
|
|
1219
|
+
// constraint. The planner is free to expand beyond it.
|
|
1220
|
+
if (options?.softScopeHint && options.softScopeHint.trim().length > 0) {
|
|
1221
|
+
prependBlocks.push(`## Prior Sketch Scope (soft hint — non-binding)\n\n${options.softScopeHint.trim()}\n\n` +
|
|
1222
|
+
`This scope was captured during an earlier progressive-planning pass that was later disabled. Treat it as context only — you may plan beyond it if the work genuinely requires more scope. Do NOT treat this as a hard boundary.`);
|
|
1223
|
+
}
|
|
1224
|
+
return renderSlicePrompt({
|
|
1225
|
+
mid, sid, sTitle, base,
|
|
1226
|
+
level: level ?? resolveInlineLevel(),
|
|
1227
|
+
promptTemplate: "plan-slice",
|
|
1228
|
+
prependBlocks,
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* ADR-011 refine-slice: expand a sketch into a full plan using the current
|
|
1233
|
+
* codebase state and prior slice summary. Mechanically similar to plan-slice
|
|
1234
|
+
* but framed as a *transformation* (sketch → full plan) rather than a
|
|
1235
|
+
* blank-sheet planning pass. Reuses inlineDependencySummaries for prior
|
|
1236
|
+
* slice SUMMARY and inlines the stored sketch_scope as a hard constraint.
|
|
1237
|
+
*/
|
|
1238
|
+
export async function buildRefineSlicePrompt(mid, _midTitle, sid, sTitle, base, level) {
|
|
1239
|
+
// Pull the stored sketch scope from the DB — the hard constraint we plan within.
|
|
1240
|
+
let sketchScope = "";
|
|
1241
|
+
try {
|
|
1242
|
+
const { isDbAvailable, getSlice } = await import("./gsd-db.js");
|
|
1243
|
+
if (isDbAvailable()) {
|
|
1244
|
+
sketchScope = getSlice(mid, sid)?.sketch_scope ?? "";
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
catch {
|
|
1248
|
+
sketchScope = "";
|
|
1249
|
+
}
|
|
1250
|
+
const prependBlocks = [];
|
|
1251
|
+
if (sketchScope.trim().length > 0) {
|
|
1252
|
+
prependBlocks.push(`## Sketch Scope (hard constraint)\n\n${sketchScope.trim()}\n\n` +
|
|
1253
|
+
`Treat this as the authoritative boundary for the slice. Do not plan work outside this scope; if the scope is too narrow, surface it as a deviation rather than expanding silently.`);
|
|
1254
|
+
}
|
|
1255
|
+
return renderSlicePrompt({
|
|
1256
|
+
mid, sid, sTitle, base,
|
|
1257
|
+
level: level ?? resolveInlineLevel(),
|
|
1258
|
+
promptTemplate: "refine-slice",
|
|
1259
|
+
prependBlocks,
|
|
1260
|
+
extraVars: { sketchScope },
|
|
1156
1261
|
});
|
|
1157
1262
|
}
|
|
1158
1263
|
export async function buildExecuteTaskPrompt(mid, sid, sTitle, tid, tTitle, base, level) {
|
|
@@ -1233,7 +1338,28 @@ export async function buildExecuteTaskPrompt(mid, sid, sTitle, tid, tTitle, base
|
|
|
1233
1338
|
const runtimeContext = runtimeContent
|
|
1234
1339
|
? `### Runtime Context\nSource: \`.gsd/RUNTIME.md\`\n\n${runtimeContent.trim()}`
|
|
1235
1340
|
: "";
|
|
1236
|
-
|
|
1341
|
+
let phaseAnchorSection = planAnchor ? formatAnchorForPrompt(planAnchor) : "";
|
|
1342
|
+
// ADR-011 Phase 2: inject any resolved-but-unapplied escalation override
|
|
1343
|
+
// into this task's prompt. Claim is atomic via DB UPDATE WHERE IS NULL, so
|
|
1344
|
+
// if a parallel build already injected it, we skip. Feature-gated by
|
|
1345
|
+
// phases.mid_execution_escalation. Prepended to phaseAnchorSection so it
|
|
1346
|
+
// appears near the top of the prompt above planning anchors.
|
|
1347
|
+
if (prefs?.preferences?.phases?.mid_execution_escalation === true) {
|
|
1348
|
+
try {
|
|
1349
|
+
const { claimOverrideForInjection } = await import("./escalation.js");
|
|
1350
|
+
const claimed = claimOverrideForInjection(base, mid, sid);
|
|
1351
|
+
if (claimed) {
|
|
1352
|
+
const block = claimed.injectionBlock + "\n\n---\n\n";
|
|
1353
|
+
phaseAnchorSection = phaseAnchorSection
|
|
1354
|
+
? `${block}${phaseAnchorSection}`
|
|
1355
|
+
: block;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
catch (escalationErr) {
|
|
1359
|
+
// Escalation module unavailable or threw — log and proceed.
|
|
1360
|
+
logWarning("prompt", `escalation override injection failed: ${escalationErr.message}`);
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1237
1363
|
// Task-scoped gates owned by execute-task (Q5/Q6/Q7). Pull only the
|
|
1238
1364
|
// gates that plan-slice actually seeded for this task — tasks with no
|
|
1239
1365
|
// external dependencies legitimately skip Q5, tasks with no runtime
|
|
@@ -1398,6 +1524,13 @@ export async function buildCompleteMilestonePrompt(mid, midTitle, base, level) {
|
|
|
1398
1524
|
inlined.push(inlineTemplate("milestone-summary", "Milestone Summary"));
|
|
1399
1525
|
const inlinedContext = capPreamble(`## Inlined Context (preloaded — do not re-read these files)\n\n${inlined.join("\n\n---\n\n")}`);
|
|
1400
1526
|
const milestoneSummaryPath = join(base, `${relMilestonePath(base, mid)}/${mid}-SUMMARY.md`);
|
|
1527
|
+
const learningsRelPath = join(relMilestonePath(base, mid), `${mid}-LEARNINGS.md`);
|
|
1528
|
+
const learningsAbsPath = join(base, learningsRelPath);
|
|
1529
|
+
const extractLearningsSteps = buildExtractionStepsBlock({
|
|
1530
|
+
milestoneId: mid,
|
|
1531
|
+
outputPath: learningsAbsPath,
|
|
1532
|
+
relativeOutputPath: learningsRelPath,
|
|
1533
|
+
});
|
|
1401
1534
|
return loadPrompt("complete-milestone", {
|
|
1402
1535
|
workingDirectory: base,
|
|
1403
1536
|
milestoneId: mid,
|
|
@@ -1405,6 +1538,7 @@ export async function buildCompleteMilestonePrompt(mid, midTitle, base, level) {
|
|
|
1405
1538
|
roadmapPath: roadmapRel,
|
|
1406
1539
|
inlinedContext,
|
|
1407
1540
|
milestoneSummaryPath,
|
|
1541
|
+
extractLearningsSteps,
|
|
1408
1542
|
skillActivation: buildSkillActivationBlock({
|
|
1409
1543
|
base,
|
|
1410
1544
|
milestoneId: mid,
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { parseUnitId } from "./unit-id.js";
|
|
10
10
|
import { appendEvent } from "./workflow-events.js";
|
|
11
|
+
import { atomicWriteSync } from "./atomic-write.js";
|
|
11
12
|
import { clearParseCache } from "./files.js";
|
|
12
13
|
import { parseRoadmap as parseLegacyRoadmap, parsePlan as parseLegacyPlan } from "./parsers-legacy.js";
|
|
13
14
|
import { isDbAvailable, getTask, getSlice, getSliceTasks, getPendingGates, updateTaskStatus, updateSliceStatus } from "./gsd-db.js";
|
|
@@ -212,6 +213,47 @@ export function verifyExpectedArtifact(unitType, unitId, base) {
|
|
|
212
213
|
}
|
|
213
214
|
return true;
|
|
214
215
|
}
|
|
216
|
+
// #4414: research-slice parallel-research sentinel. The unitId
|
|
217
|
+
// `{mid}/parallel-research` is not a real slice — it triggers a single agent
|
|
218
|
+
// that fans out research across multiple slices. Verify success by checking
|
|
219
|
+
// that every slice which was "research-ready" in the roadmap now has a
|
|
220
|
+
// RESEARCH file. Without this, resolveExpectedArtifactPath returns null and
|
|
221
|
+
// the retry/escalation machinery silently re-dispatches forever.
|
|
222
|
+
//
|
|
223
|
+
// NOTE: this predicate mirrors the dispatch rule at
|
|
224
|
+
// auto-dispatch.ts parallel-research-slices — keep the two in sync.
|
|
225
|
+
if (unitType === "research-slice" && unitId.endsWith("/parallel-research")) {
|
|
226
|
+
const { milestone: mid } = parseUnitId(unitId);
|
|
227
|
+
if (!mid)
|
|
228
|
+
return false;
|
|
229
|
+
const roadmapFile = resolveMilestoneFile(base, mid, "ROADMAP");
|
|
230
|
+
if (!roadmapFile || !existsSync(roadmapFile)) {
|
|
231
|
+
logWarning("recovery", `verify-fail ${unitType} ${unitId}: roadmap missing`);
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
const roadmap = parseLegacyRoadmap(readFileSync(roadmapFile, "utf-8"));
|
|
236
|
+
const milestoneResearchFile = resolveMilestoneFile(base, mid, "RESEARCH");
|
|
237
|
+
for (const slice of roadmap.slices) {
|
|
238
|
+
if (slice.done)
|
|
239
|
+
continue;
|
|
240
|
+
if (milestoneResearchFile && slice.id === "S01")
|
|
241
|
+
continue;
|
|
242
|
+
const depsComplete = (slice.depends ?? []).every((depId) => !!resolveSliceFile(base, mid, depId, "SUMMARY"));
|
|
243
|
+
if (!depsComplete)
|
|
244
|
+
continue;
|
|
245
|
+
if (!resolveSliceFile(base, mid, slice.id, "RESEARCH")) {
|
|
246
|
+
logWarning("recovery", `verify-fail ${unitType} ${unitId}: slice ${slice.id} missing RESEARCH`);
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
catch (err) {
|
|
253
|
+
logWarning("recovery", `parallel-research verification failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
215
257
|
const absPath = resolveExpectedArtifactPath(unitType, unitId, base);
|
|
216
258
|
// For unit types with no verifiable artifact (null path), the parent directory
|
|
217
259
|
// is missing on disk — treat as stale completion state so the key gets evicted (#313).
|
|
@@ -405,6 +447,13 @@ export function writeBlockerPlaceholder(unitType, unitId, base, reason) {
|
|
|
405
447
|
`Review and replace this file before relying on downstream artifacts.`,
|
|
406
448
|
].join("\n");
|
|
407
449
|
writeFileSync(absPath, content, "utf-8");
|
|
450
|
+
// #4414: Clear caches so subsequent dispatch guards (e.g.
|
|
451
|
+
// resolveMilestoneFile) see the placeholder file. Without this, the
|
|
452
|
+
// cached directory listing is stale and the dispatch rule re-fires,
|
|
453
|
+
// producing an infinite loop despite the placeholder being on disk.
|
|
454
|
+
// Matches the pattern used in verifyExpectedArtifact above.
|
|
455
|
+
clearPathCache();
|
|
456
|
+
clearParseCache();
|
|
408
457
|
// Mark the task/slice as complete in the DB so verifyExpectedArtifact passes.
|
|
409
458
|
// Without this, the DB status stays "pending" and the dispatch loop
|
|
410
459
|
// re-derives the same unit indefinitely (#2531, #2653).
|
|
@@ -414,6 +463,14 @@ export function writeBlockerPlaceholder(unitType, unitId, base, reason) {
|
|
|
414
463
|
if (unitType === "execute-task" && mid && sid && tid) {
|
|
415
464
|
try {
|
|
416
465
|
updateTaskStatus(mid, sid, tid, "complete", ts);
|
|
466
|
+
const planPath = resolveSliceFile(base, mid, sid, "PLAN");
|
|
467
|
+
if (planPath && existsSync(planPath)) {
|
|
468
|
+
const planContent = readFileSync(planPath, "utf-8");
|
|
469
|
+
const updatedPlan = planContent.replace(new RegExp(`^(\\s*-\\s+)\\[ \\]\\s+\\*\\*${tid}:`, "m"), `$1[x] **${tid}:`);
|
|
470
|
+
if (updatedPlan !== planContent) {
|
|
471
|
+
atomicWriteSync(planPath, updatedPlan);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
417
474
|
}
|
|
418
475
|
catch (e) {
|
|
419
476
|
logWarning("recovery", `updateTaskStatus failed during context exhaustion: ${e instanceof Error ? e.message : String(e)}`);
|
|
@@ -348,10 +348,11 @@ export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, reques
|
|
|
348
348
|
// Detect survivor milestone branches in both pre-planning and complete phases.
|
|
349
349
|
// In phase=complete, the milestone artifacts exist but finalization (merge,
|
|
350
350
|
// worktree cleanup) was never run — the survivor branch must be merged.
|
|
351
|
+
// Applies to both worktree and branch isolation modes.
|
|
351
352
|
let hasSurvivorBranch = false;
|
|
352
353
|
if (state.activeMilestone &&
|
|
353
354
|
(state.phase === "pre-planning" || state.phase === "complete") &&
|
|
354
|
-
|
|
355
|
+
getIsolationMode() !== "none" &&
|
|
355
356
|
!detectWorktreeName(base) &&
|
|
356
357
|
!base.includes(`${pathSep}.gsd${pathSep}worktrees${pathSep}`)) {
|
|
357
358
|
const milestoneBranch = `milestone/${state.activeMilestone.id}`;
|
|
@@ -547,7 +548,7 @@ export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, reques
|
|
|
547
548
|
return symlinkRe.test(p);
|
|
548
549
|
};
|
|
549
550
|
if (s.currentMilestoneId &&
|
|
550
|
-
|
|
551
|
+
getIsolationMode() !== "none" &&
|
|
551
552
|
!detectWorktreeName(base) &&
|
|
552
553
|
!isUnderGsdWorktrees(base)) {
|
|
553
554
|
buildResolver().enterMilestone(s.currentMilestoneId, {
|
|
@@ -658,7 +659,8 @@ export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, reques
|
|
|
658
659
|
const bannerPrefs = loadEffectiveGSDPreferences()?.preferences;
|
|
659
660
|
const effectiveProvider = s.autoModeStartModel?.provider ?? ctx.model?.provider;
|
|
660
661
|
const effectivelyEnabled = routingConfig.enabled
|
|
661
|
-
&&
|
|
662
|
+
&& (routingConfig.allow_flat_rate_providers
|
|
663
|
+
|| !(effectiveProvider && isFlatRateProvider(effectiveProvider, buildFlatRateContext(effectiveProvider, ctx, bannerPrefs))));
|
|
662
664
|
// The actual ceiling may come from tier_models.heavy, not the start model.
|
|
663
665
|
const effectiveCeiling = (routingConfig.enabled && routingConfig.tier_models?.heavy)
|
|
664
666
|
? routingConfig.tier_models.heavy
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* dependency audits, handles auto-fix retry logic, and writes
|
|
6
6
|
* verification evidence JSON.
|
|
7
7
|
*
|
|
8
|
-
* Extracted from
|
|
9
|
-
* value instead of calling return/pauseAuto directly — the
|
|
10
|
-
* checks the result and handles control flow.
|
|
8
|
+
* Extracted from the pre-loop agent_end handler in auto.ts. Returns a
|
|
9
|
+
* sentinel value instead of calling return/pauseAuto directly — the
|
|
10
|
+
* caller checks the result and handles control flow.
|
|
11
11
|
*/
|
|
12
12
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
13
13
|
import { resolveSlicePath, resolveMilestoneFile } from "./paths.js";
|
|
@@ -20,7 +20,7 @@ import { MergeConflictError, readIntegrationBranch, RUNTIME_EXCLUSION_PATHS } fr
|
|
|
20
20
|
import { debugLog } from "./debug-logger.js";
|
|
21
21
|
import { logWarning, logError } from "./workflow-logger.js";
|
|
22
22
|
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
23
|
-
import { nativeGetCurrentBranch, nativeDetectMainBranch, nativeWorkingTreeStatus, nativeAddAllWithExclusions, nativeCommit, nativeCheckoutBranch, nativeMergeSquash, nativeConflictFiles, nativeCheckoutTheirs, nativeAddPaths, nativeRmForce, nativeBranchDelete, nativeBranchExists, nativeDiffNumstat, nativeUpdateRef, nativeIsAncestor, nativeMergeAbort, } from "./native-git-bridge.js";
|
|
23
|
+
import { nativeGetCurrentBranch, nativeDetectMainBranch, nativeWorkingTreeStatus, nativeAddAllWithExclusions, nativeCommit, nativeCheckoutBranch, nativeMergeSquash, nativeConflictFiles, nativeCheckoutTheirs, nativeAddPaths, nativeRmForce, nativeBranchDelete, nativeBranchForceReset, nativeBranchExists, nativeDiffNumstat, nativeUpdateRef, nativeIsAncestor, nativeMergeAbort, } from "./native-git-bridge.js";
|
|
24
24
|
const gsdHome = process.env.GSD_HOME || join(homedir(), ".gsd");
|
|
25
25
|
const PROJECT_PREFERENCES_FILE = "PREFERENCES.md";
|
|
26
26
|
const LEGACY_PROJECT_PREFERENCES_FILE = "preferences.md";
|
|
@@ -792,9 +792,63 @@ export function runWorktreePostCreateHook(sourceDir, worktreeDir, hookPath) {
|
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
// ─── Auto-Worktree Branch Naming ───────────────────────────────────────────
|
|
795
|
+
/** Returns the git branch name for a milestone worktree (`milestone/<MID>`). */
|
|
795
796
|
export function autoWorktreeBranch(milestoneId) {
|
|
796
797
|
return `milestone/${milestoneId}`;
|
|
797
798
|
}
|
|
799
|
+
// ─── Branch-mode Entry ─────────────────────────────────────────────────────
|
|
800
|
+
/**
|
|
801
|
+
* Enter branch isolation mode for a milestone.
|
|
802
|
+
*
|
|
803
|
+
* Creates `milestone/<MID>` from the integration branch (if it doesn't
|
|
804
|
+
* exist yet) and checks out to it. No worktree directory is created — the
|
|
805
|
+
* project root is the working copy; only HEAD changes.
|
|
806
|
+
*
|
|
807
|
+
* Uses the same 3-tier integration-branch fallback as createAutoWorktree:
|
|
808
|
+
* 1. META.json recorded integration branch
|
|
809
|
+
* 2. git.main_branch preference
|
|
810
|
+
* 3. nativeDetectMainBranch (origin/HEAD auto-detection)
|
|
811
|
+
*/
|
|
812
|
+
export function enterBranchModeForMilestone(basePath, milestoneId) {
|
|
813
|
+
const branch = autoWorktreeBranch(milestoneId);
|
|
814
|
+
const branchExists = nativeBranchExists(basePath, branch);
|
|
815
|
+
if (!branchExists) {
|
|
816
|
+
// Create the milestone branch from the integration branch start-point.
|
|
817
|
+
const integrationBranch = readIntegrationBranch(basePath, milestoneId) ?? undefined;
|
|
818
|
+
const gitPrefs = loadEffectiveGSDPreferences()?.preferences?.git;
|
|
819
|
+
// Validate main_branch preference exists in the repo before using it —
|
|
820
|
+
// a stale preference (e.g. "master" when repo uses "main") would cause
|
|
821
|
+
// nativeBranchForceReset to fail with a bad start-point reference.
|
|
822
|
+
const validatedPrefBranch = gitPrefs?.main_branch &&
|
|
823
|
+
typeof gitPrefs.main_branch === "string" &&
|
|
824
|
+
gitPrefs.main_branch.length > 0 &&
|
|
825
|
+
nativeBranchExists(basePath, gitPrefs.main_branch)
|
|
826
|
+
? gitPrefs.main_branch
|
|
827
|
+
: undefined;
|
|
828
|
+
const startPoint = integrationBranch ??
|
|
829
|
+
validatedPrefBranch ??
|
|
830
|
+
nativeDetectMainBranch(basePath);
|
|
831
|
+
// nativeBranchForceReset creates (or resets) branch at startPoint,
|
|
832
|
+
// then checkout switches HEAD to it.
|
|
833
|
+
nativeBranchForceReset(basePath, branch, startPoint);
|
|
834
|
+
debugLog("auto-worktree", {
|
|
835
|
+
action: "enterBranchMode",
|
|
836
|
+
milestoneId,
|
|
837
|
+
branch,
|
|
838
|
+
startPoint,
|
|
839
|
+
created: true,
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
else {
|
|
843
|
+
debugLog("auto-worktree", {
|
|
844
|
+
action: "enterBranchMode",
|
|
845
|
+
milestoneId,
|
|
846
|
+
branch,
|
|
847
|
+
reused: true,
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
nativeCheckoutBranch(basePath, branch);
|
|
851
|
+
}
|
|
798
852
|
// ─── Public API ────────────────────────────────────────────────────────────
|
|
799
853
|
/**
|
|
800
854
|
* Create a new auto-worktree for a milestone, chdir into it, and store
|