gsd-pi 2.80.0-dev.fbe7c8c6f → 2.81.0-dev.3cddbbba2
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 +47 -59
- package/dist/claude-cli-check.d.ts +30 -0
- package/dist/claude-cli-check.js +18 -7
- package/dist/cli.js +0 -19
- package/dist/headless-query.d.ts +10 -0
- package/dist/headless-query.js +6 -4
- package/dist/loader-entrypoint.d.ts +8 -0
- package/dist/loader-entrypoint.js +27 -0
- package/dist/loader.js +2 -11
- package/dist/mcp-server.d.ts +1 -0
- package/dist/mcp-server.js +6 -3
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/claude-code-cli/readiness.js +18 -7
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +40 -3
- package/dist/resources/extensions/github-sync/sync.js +4 -1
- package/dist/resources/extensions/gsd/auto/contracts.js +2 -0
- package/dist/resources/extensions/gsd/auto/loop.js +214 -17
- package/dist/resources/extensions/gsd/auto/orchestrator.js +48 -4
- package/dist/resources/extensions/gsd/auto/phases.js +372 -134
- package/dist/resources/extensions/gsd/auto/resolve.js +29 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +88 -33
- package/dist/resources/extensions/gsd/auto/session.js +18 -1
- package/dist/resources/extensions/gsd/auto/unit-runner-events.js +7 -0
- package/dist/resources/extensions/gsd/auto/verification-retry-policy.js +43 -0
- package/dist/resources/extensions/gsd/auto/workflow-dispatch-claim.js +33 -1
- package/dist/resources/extensions/gsd/auto/workflow-worker-heartbeat.js +9 -1
- package/dist/resources/extensions/gsd/auto-dashboard.js +199 -177
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +5 -32
- package/dist/resources/extensions/gsd/auto-dispatch.js +30 -11
- package/dist/resources/extensions/gsd/auto-post-unit.js +119 -79
- package/dist/resources/extensions/gsd/auto-prompts.js +103 -16
- package/dist/resources/extensions/gsd/auto-recovery.js +43 -1
- package/dist/resources/extensions/gsd/auto-runtime-state.js +5 -0
- package/dist/resources/extensions/gsd/auto-start.js +251 -16
- package/dist/resources/extensions/gsd/auto-supervisor.js +8 -1
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +2 -2
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +33 -5
- package/dist/resources/extensions/gsd/auto-verification.js +12 -6
- package/dist/resources/extensions/gsd/auto-worktree.js +237 -336
- package/dist/resources/extensions/gsd/auto.js +493 -129
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +133 -12
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +44 -37
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +37 -10
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +30 -20
- package/dist/resources/extensions/gsd/bootstrap/journal-tools.js +4 -1
- package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +6 -4
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +5 -3
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +1 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +337 -55
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +4 -8
- package/dist/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.js +4 -0
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +82 -23
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +19 -2
- package/dist/resources/extensions/gsd/clean-root-preflight.js +24 -6
- package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +4 -10
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +2 -2
- package/dist/resources/extensions/gsd/commands-config.js +1 -1
- package/dist/resources/extensions/gsd/commands-eval-review.js +2 -2
- package/dist/resources/extensions/gsd/commands-handlers.js +23 -9
- package/dist/resources/extensions/gsd/context-budget.js +37 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +56 -10
- package/dist/resources/extensions/gsd/dashboard-overlay.js +1 -1
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +92 -0
- package/dist/resources/extensions/gsd/db-base-schema.js +4 -2
- package/dist/resources/extensions/gsd/db-migration-steps.js +6 -0
- package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +2 -0
- package/dist/resources/extensions/gsd/git-service.js +75 -6
- package/dist/resources/extensions/gsd/gsd-db.js +46 -13
- package/dist/resources/extensions/gsd/guided-flow.js +119 -42
- package/dist/resources/extensions/gsd/health-widget-core.js +1 -1
- package/dist/resources/extensions/gsd/health-widget.js +6 -9
- package/dist/resources/extensions/gsd/init-wizard.js +4 -1
- package/dist/resources/extensions/gsd/memory-store.js +69 -12
- package/dist/resources/extensions/gsd/migrate/command.js +40 -1
- package/dist/resources/extensions/gsd/migration-auto-check.js +87 -0
- package/dist/resources/extensions/gsd/native-git-bridge.js +46 -22
- package/dist/resources/extensions/gsd/notification-overlay.js +35 -40
- package/dist/resources/extensions/gsd/orphan-stash-audit.js +101 -0
- package/dist/resources/extensions/gsd/parallel-merge.js +53 -30
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +25 -33
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +13 -3
- package/dist/resources/extensions/gsd/planning-path-scope.js +26 -0
- package/dist/resources/extensions/gsd/pre-execution-checks.js +22 -0
- package/dist/resources/extensions/gsd/prompt-loader.js +28 -2
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +22 -17
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +14 -12
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +20 -2
- package/dist/resources/extensions/gsd/prompts/discuss.md +20 -2
- package/dist/resources/extensions/gsd/prompts/execute-task.md +4 -2
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/quick-task.md +1 -5
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
- package/dist/resources/extensions/gsd/quick.js +34 -2
- package/dist/resources/extensions/gsd/recovery-classification.js +94 -0
- package/dist/resources/extensions/gsd/slice-cadence.js +45 -2
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +15 -9
- package/dist/resources/extensions/gsd/state-reconciliation.js +27 -0
- package/dist/resources/extensions/gsd/tool-contract.js +50 -0
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +6 -7
- package/dist/resources/extensions/gsd/tools/complete-task.js +1 -1
- package/dist/resources/extensions/gsd/tools/context-mode-tool-result.js +15 -0
- package/dist/resources/extensions/gsd/tools/exec-search-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/exec-tool.js +3 -15
- package/dist/resources/extensions/gsd/tools/memory-tools.js +1 -0
- package/dist/resources/extensions/gsd/tools/plan-slice.js +9 -0
- package/dist/resources/extensions/gsd/tools/plan-task.js +9 -0
- package/dist/resources/extensions/gsd/tools/resume-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +1 -1
- package/dist/resources/extensions/gsd/tui/render-kit.js +74 -0
- package/dist/resources/extensions/gsd/unit-context-composer.js +12 -3
- package/dist/resources/extensions/gsd/unit-runtime.js +22 -0
- package/dist/resources/extensions/gsd/watch/header-renderer.js +92 -69
- package/dist/resources/extensions/gsd/watch/splash-palette.js +10 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +2 -2
- package/dist/resources/extensions/gsd/workflow-protocol.js +131 -0
- package/dist/resources/extensions/gsd/worktree-lifecycle.js +1364 -0
- package/dist/resources/extensions/gsd/worktree-safety.js +119 -0
- package/dist/resources/extensions/gsd/worktree-state-projection.js +317 -0
- package/dist/resources/extensions/gsd/worktree-telemetry.js +3 -1
- package/dist/resources/skills/web-quality-audit/scripts/analyze.sh +0 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +13 -13
- 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/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 +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +2 -2
- 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 +2 -2
- 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 +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +13 -13
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware.js +3 -3
- 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/8359.e059d86b255fce1c.js +10 -0
- package/dist/web/standalone/.next/static/chunks/app/{page-fab3ebb85b006001.js → page-752f1e2ebdaa3e45.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/{webpack-0481f1221120a7c6.js → webpack-de742b64187e13fe.js} +1 -1
- package/dist/welcome-screen.d.ts +2 -7
- package/dist/welcome-screen.js +68 -75
- package/package.json +3 -3
- package/packages/daemon/package.json +2 -2
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +22 -17
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +2 -2
- package/packages/mcp-server/src/workflow-tools.test.ts +75 -2
- package/packages/mcp-server/src/workflow-tools.ts +30 -16
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/package.json +1 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +4 -1
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/agent.d.ts +9 -2
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent.js +43 -11
- package/packages/pi-agent-core/dist/agent.js.map +1 -1
- package/packages/pi-agent-core/dist/index.d.ts +1 -0
- package/packages/pi-agent-core/dist/index.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/index.js +2 -0
- package/packages/pi-agent-core/dist/index.js.map +1 -1
- package/packages/pi-agent-core/dist/token-audit.d.ts +47 -0
- package/packages/pi-agent-core/dist/token-audit.d.ts.map +1 -0
- package/packages/pi-agent-core/dist/token-audit.js +221 -0
- package/packages/pi-agent-core/dist/token-audit.js.map +1 -0
- package/packages/pi-agent-core/dist/types.d.ts +31 -0
- package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/types.js.map +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-agent-core/src/agent-loop.test.ts +128 -0
- package/packages/pi-agent-core/src/agent-loop.ts +4 -1
- package/packages/pi-agent-core/src/agent.ts +52 -11
- package/packages/pi-agent-core/src/index.ts +2 -0
- package/packages/pi-agent-core/src/token-audit.test.ts +189 -0
- package/packages/pi-agent-core/src/token-audit.ts +287 -0
- package/packages/pi-agent-core/src/types.ts +26 -10
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +35 -13
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js +21 -11
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +7 -0
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +9 -7
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js +23 -14
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +2 -0
- package/packages/pi-ai/dist/types.d.ts.map +1 -1
- package/packages/pi-ai/dist/types.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +48 -21
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js +22 -21
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js +22 -21
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +39 -25
- package/packages/pi-ai/src/providers/anthropic-bearer-auth.test.ts +26 -22
- package/packages/pi-ai/src/providers/anthropic.ts +22 -9
- package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +34 -21
- package/packages/pi-ai/src/types.ts +3 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +56 -22
- package/packages/pi-ai/src/utils/oauth/google-antigravity.test.ts +24 -28
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.test.ts +24 -28
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +36 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js +30 -1
- package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +21 -2
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +94 -16
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +6 -2
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +9 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js +103 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts +15 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.js +66 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.js +24 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +8 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +3 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +6 -6
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js +5 -3
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +60 -4
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js +2 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.js +46 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +10 -2
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +81 -4
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +20 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +25 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js +22 -0
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +6 -7
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +2 -3
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash-spawn-windows.test.js +22 -56
- package/packages/pi-coding-agent/dist/core/tools/bash-spawn-windows.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.js +12 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.js +14 -6
- package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/grep.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/grep.js +12 -3
- package/packages/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts +2 -1
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.js +1 -0
- package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/ls.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/ls.js +10 -3
- package/packages/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/read.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/read.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js +7 -62
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.js +115 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.d.ts +19 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.js +20 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/write.d.ts +4 -0
- package/packages/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/write.js +9 -1
- package/packages/pi-coding-agent/dist/core/tools/write.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.js +47 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/assistant-message-design.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +161 -7
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.js +40 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/user-message-design.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts +0 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +30 -29
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js +10 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +13 -13
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +1 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +58 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts +2 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js +12 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +14 -41
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +25 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +6 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +225 -73
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.d.ts +35 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.js +152 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/transcript-design.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.d.ts +16 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.js +73 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tui-style-kit.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +12 -8
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +31 -6
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +71 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +25 -3
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.js +17 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-highlight.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +105 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +27 -26
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +9 -6
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js +28 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js +3 -2
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +40 -1
- package/packages/pi-coding-agent/src/core/agent-session-tool-refresh.test.ts +40 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +102 -16
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +6 -2
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +18 -0
- package/packages/pi-coding-agent/src/core/compaction-threshold.test.ts +121 -0
- package/packages/pi-coding-agent/src/core/db-snapshot.test.ts +32 -0
- package/packages/pi-coding-agent/src/core/db-snapshot.ts +66 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +10 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.test.ts +5 -3
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +8 -5
- package/packages/pi-coding-agent/src/core/extensions/types.ts +63 -2
- package/packages/pi-coding-agent/src/core/hooks-runner.test.ts +2 -0
- package/packages/pi-coding-agent/src/core/sdk-tool-filter.test.ts +60 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +92 -4
- package/packages/pi-coding-agent/src/core/settings-manager.ts +39 -1
- package/packages/pi-coding-agent/src/core/skill-tool.test.ts +28 -0
- package/packages/pi-coding-agent/src/core/system-prompt.ts +8 -10
- package/packages/pi-coding-agent/src/core/tools/bash-spawn-windows.test.ts +22 -66
- package/packages/pi-coding-agent/src/core/tools/bash.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/edit.ts +13 -1
- package/packages/pi-coding-agent/src/core/tools/find.ts +15 -6
- package/packages/pi-coding-agent/src/core/tools/grep.ts +13 -3
- package/packages/pi-coding-agent/src/core/tools/hashline-read.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/index.ts +8 -0
- package/packages/pi-coding-agent/src/core/tools/ls.ts +11 -3
- package/packages/pi-coding-agent/src/core/tools/read.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/spawn-shell-windows.test.ts +11 -72
- package/packages/pi-coding-agent/src/core/tools/tool-target-metadata.test.ts +127 -0
- package/packages/pi-coding-agent/src/core/tools/tool-target.ts +48 -0
- package/packages/pi-coding-agent/src/core/tools/write.ts +14 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/assistant-message-design.test.ts +56 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +228 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/user-message-design.test.ts +48 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.test.ts +10 -3
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +43 -42
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +14 -14
- package/packages/pi-coding-agent/src/modes/interactive/components/bash-execution.ts +64 -3
- package/packages/pi-coding-agent/src/modes/interactive/components/diff.ts +13 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +15 -42
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +31 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +247 -94
- package/packages/pi-coding-agent/src/modes/interactive/components/transcript-design.ts +196 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tui-style-kit.ts +94 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +14 -9
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +75 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +39 -8
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +27 -3
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-highlight.test.ts +23 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +106 -1
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +27 -26
- package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +9 -6
- package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +1 -1
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage-safety-guard.test.ts +31 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage.ts +3 -2
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/overlay-layout.test.js +14 -1
- package/packages/pi-tui/dist/__tests__/overlay-layout.test.js.map +1 -1
- package/packages/pi-tui/dist/overlay-layout.d.ts.map +1 -1
- package/packages/pi-tui/dist/overlay-layout.js +9 -6
- package/packages/pi-tui/dist/overlay-layout.js.map +1 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +18 -8
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/pi-tui/src/__tests__/overlay-layout.test.ts +20 -1
- package/packages/pi-tui/src/overlay-layout.ts +10 -7
- package/packages/pi-tui/src/tui.ts +20 -8
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/README.md +7 -0
- package/packages/rpc-client/package.json +1 -1
- package/pkg/dist/modes/interactive/theme/theme-highlight.test.d.ts +2 -0
- package/pkg/dist/modes/interactive/theme/theme-highlight.test.d.ts.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme-highlight.test.js +17 -0
- package/pkg/dist/modes/interactive/theme/theme-highlight.test.js.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +105 -1
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js +27 -26
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/claude-code-cli/readiness.ts +25 -7
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +42 -3
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +67 -0
- package/src/resources/extensions/github-sync/sync.ts +8 -1
- package/src/resources/extensions/github-sync/tests/sync-source.test.ts +6 -18
- package/src/resources/extensions/gsd/auto/contracts.ts +19 -2
- package/src/resources/extensions/gsd/auto/loop-deps.ts +19 -16
- package/src/resources/extensions/gsd/auto/loop.ts +247 -25
- package/src/resources/extensions/gsd/auto/orchestrator.ts +52 -4
- package/src/resources/extensions/gsd/auto/phases.ts +512 -202
- package/src/resources/extensions/gsd/auto/resolve.ts +42 -1
- package/src/resources/extensions/gsd/auto/run-unit.ts +97 -34
- package/src/resources/extensions/gsd/auto/session.ts +19 -1
- package/src/resources/extensions/gsd/auto/types.ts +3 -0
- package/src/resources/extensions/gsd/auto/unit-runner-events.ts +15 -0
- package/src/resources/extensions/gsd/auto/verification-retry-policy.ts +82 -0
- package/src/resources/extensions/gsd/auto/workflow-dispatch-claim.ts +63 -1
- package/src/resources/extensions/gsd/auto/workflow-worker-heartbeat.ts +14 -1
- package/src/resources/extensions/gsd/auto-dashboard.ts +249 -182
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +8 -34
- package/src/resources/extensions/gsd/auto-dispatch.ts +31 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +131 -81
- package/src/resources/extensions/gsd/auto-prompts.ts +112 -15
- package/src/resources/extensions/gsd/auto-recovery.ts +54 -0
- package/src/resources/extensions/gsd/auto-runtime-state.ts +5 -0
- package/src/resources/extensions/gsd/auto-start.ts +321 -21
- package/src/resources/extensions/gsd/auto-supervisor.ts +7 -0
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +2 -2
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +51 -0
- package/src/resources/extensions/gsd/auto-verification.ts +12 -6
- package/src/resources/extensions/gsd/auto-worktree.ts +267 -360
- package/src/resources/extensions/gsd/auto.ts +578 -126
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +166 -12
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +45 -37
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +36 -10
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +32 -19
- package/src/resources/extensions/gsd/bootstrap/journal-tools.ts +5 -1
- package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +7 -4
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +6 -3
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +1 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +384 -55
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +5 -8
- package/src/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.ts +4 -0
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +90 -22
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +19 -2
- package/src/resources/extensions/gsd/clean-root-preflight.ts +32 -7
- package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +4 -10
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +4 -2
- package/src/resources/extensions/gsd/commands-config.ts +1 -1
- package/src/resources/extensions/gsd/commands-eval-review.ts +2 -2
- package/src/resources/extensions/gsd/commands-handlers.ts +34 -15
- package/src/resources/extensions/gsd/context-budget.ts +44 -2
- package/src/resources/extensions/gsd/crash-recovery.ts +67 -10
- package/src/resources/extensions/gsd/dashboard-overlay.ts +1 -1
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +107 -0
- package/src/resources/extensions/gsd/db-base-schema.ts +4 -2
- package/src/resources/extensions/gsd/db-migration-steps.ts +8 -0
- package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +3 -0
- package/src/resources/extensions/gsd/git-service.ts +89 -10
- package/src/resources/extensions/gsd/gsd-db.ts +50 -13
- package/src/resources/extensions/gsd/guided-flow.ts +148 -49
- package/src/resources/extensions/gsd/health-widget-core.ts +1 -1
- package/src/resources/extensions/gsd/health-widget.ts +8 -9
- package/src/resources/extensions/gsd/init-wizard.ts +5 -1
- package/src/resources/extensions/gsd/journal.ts +2 -0
- package/src/resources/extensions/gsd/memory-store.ts +77 -12
- package/src/resources/extensions/gsd/migrate/command.ts +47 -1
- package/src/resources/extensions/gsd/migration-auto-check.ts +129 -0
- package/src/resources/extensions/gsd/native-git-bridge.ts +53 -19
- package/src/resources/extensions/gsd/notification-overlay.ts +50 -46
- package/src/resources/extensions/gsd/orphan-stash-audit.ts +117 -0
- package/src/resources/extensions/gsd/parallel-merge.ts +61 -34
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +33 -35
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +13 -3
- package/src/resources/extensions/gsd/planning-path-scope.ts +35 -0
- package/src/resources/extensions/gsd/pre-execution-checks.ts +23 -0
- package/src/resources/extensions/gsd/preferences-types.ts +1 -1
- package/src/resources/extensions/gsd/prompt-loader.ts +27 -2
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +22 -17
- package/src/resources/extensions/gsd/prompts/complete-slice.md +14 -12
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +20 -2
- package/src/resources/extensions/gsd/prompts/discuss.md +20 -2
- package/src/resources/extensions/gsd/prompts/execute-task.md +4 -2
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/quick-task.md +1 -5
- package/src/resources/extensions/gsd/prompts/replan-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
- package/src/resources/extensions/gsd/quick.ts +37 -2
- package/src/resources/extensions/gsd/recovery-classification.ts +122 -0
- package/src/resources/extensions/gsd/slice-cadence.ts +49 -2
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +23 -9
- package/src/resources/extensions/gsd/state-reconciliation.ts +57 -0
- package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +59 -89
- package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +47 -172
- package/src/resources/extensions/gsd/tests/artifacts-table-preserved-on-cache-invalidate.test.ts +0 -35
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +134 -9
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +1125 -215
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +80 -59
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +119 -2
- package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +3 -47
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +363 -18
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +175 -11
- package/src/resources/extensions/gsd/tests/auto-pr-bugs.test.ts +54 -95
- package/src/resources/extensions/gsd/tests/auto-project-root-env.test.ts +67 -26
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +14 -1
- package/src/resources/extensions/gsd/tests/auto-remediate-slice-status.test.ts +32 -30
- package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +16 -1
- package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +32 -128
- package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +20 -54
- package/src/resources/extensions/gsd/tests/auto-start-cold-db-bootstrap.test.ts +20 -30
- package/src/resources/extensions/gsd/tests/auto-start-index-lock.test.ts +17 -29
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +160 -0
- package/src/resources/extensions/gsd/tests/auto-start-time-persistence.test.ts +21 -39
- package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +15 -24
- package/src/resources/extensions/gsd/tests/auto-thinking-restore.test.ts +44 -29
- package/src/resources/extensions/gsd/tests/auto-unit-closeout.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/auto-warning-noise-regression.test.ts +39 -51
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +159 -213
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +15 -32
- package/src/resources/extensions/gsd/tests/browser-teardown.test.ts +0 -41
- package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +15 -6
- package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +34 -27
- package/src/resources/extensions/gsd/tests/cmux.test.ts +51 -53
- package/src/resources/extensions/gsd/tests/cold-resume-db-reopen.test.ts +39 -61
- package/src/resources/extensions/gsd/tests/commands-config.test.ts +26 -19
- package/src/resources/extensions/gsd/tests/compaction-snapshot.test.ts +14 -1
- package/src/resources/extensions/gsd/tests/complete-milestone-excerpt.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/complete-slice-composer.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/complete-task-normalize-lists.test.ts +29 -33
- package/src/resources/extensions/gsd/tests/completed-units-metrics-sync.test.ts +45 -108
- package/src/resources/extensions/gsd/tests/context-budget.test.ts +10 -1
- package/src/resources/extensions/gsd/tests/context-store.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/crash-handler-secondary.test.ts +90 -31
- package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +46 -11
- package/src/resources/extensions/gsd/tests/cwd-fallback-hardening.test.ts +138 -0
- package/src/resources/extensions/gsd/tests/dashboard-custom-engine.test.ts +4 -68
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +24 -11
- package/src/resources/extensions/gsd/tests/deferred-milestone-dir-4996.test.ts +14 -65
- package/src/resources/extensions/gsd/tests/discuss-tool-scoping.test.ts +44 -37
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +100 -38
- package/src/resources/extensions/gsd/tests/dispatch-guard-closed-status.test.ts +25 -15
- package/src/resources/extensions/gsd/tests/dispatch-rule-coverage.test.ts +313 -0
- package/src/resources/extensions/gsd/tests/dispatcher-stuck-planning.test.ts +35 -17
- package/src/resources/extensions/gsd/tests/error-success-mask.test.ts +16 -21
- package/src/resources/extensions/gsd/tests/est-annotation-timeout.test.ts +15 -82
- package/src/resources/extensions/gsd/tests/exec-history.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/execute-task-rendering.test.ts +5 -2
- package/src/resources/extensions/gsd/tests/fast-forward-reused-milestone-branch.test.ts +219 -0
- package/src/resources/extensions/gsd/tests/finalize-survivor-branch.test.ts +151 -0
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +2 -20
- package/src/resources/extensions/gsd/tests/frontmatter-parse-noise.test.ts +18 -26
- package/src/resources/extensions/gsd/tests/header-renderer.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +14 -4
- package/src/resources/extensions/gsd/tests/init-skip-git.test.ts +9 -12
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/integration/commands-eval-review.integration.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/integration/git-locale.test.ts +31 -20
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +92 -0
- package/src/resources/extensions/gsd/tests/integration/milestone-transition-worktree.test.ts +0 -47
- package/src/resources/extensions/gsd/tests/integration/parallel-merge.test.ts +116 -24
- package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +60 -202
- package/src/resources/extensions/gsd/tests/isolation-none-branch-guard.test.ts +13 -56
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +248 -11
- package/src/resources/extensions/gsd/tests/journal-query-tool.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/knowledge.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/lazy-pi-tui-import.test.ts +44 -6
- package/src/resources/extensions/gsd/tests/memory-decay-factor.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +21 -35
- package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +77 -12
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/milestone-merge-stash-restore.test.ts +267 -0
- package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +88 -98
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +70 -278
- package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +34 -2
- package/src/resources/extensions/gsd/tests/needs-remediation-revalidation.test.ts +37 -30
- package/src/resources/extensions/gsd/tests/note-captures-executed.test.ts +32 -28
- package/src/resources/extensions/gsd/tests/notification-overlay.test.ts +78 -41
- package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/originalbase-path-comparison.test.ts +12 -182
- package/src/resources/extensions/gsd/tests/orphan-merge-bootstrap.test.ts +144 -0
- package/src/resources/extensions/gsd/tests/orphan-stash-audit.test.ts +201 -0
- package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +38 -6
- package/src/resources/extensions/gsd/tests/parallel-orchestrator-fast-forward.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/phantom-ghost-detection.test.ts +24 -37
- package/src/resources/extensions/gsd/tests/phantom-milestone-default-queued.test.ts +9 -24
- package/src/resources/extensions/gsd/tests/phases-merge-error-stops-auto.test.ts +95 -75
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +36 -22
- package/src/resources/extensions/gsd/tests/pre-exec-backtick-strip.test.ts +36 -30
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +45 -5
- package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +74 -4
- package/src/resources/extensions/gsd/tests/preferences-worktree-sync.test.ts +20 -22
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +130 -32
- package/src/resources/extensions/gsd/tests/project-root-cwd-crash.test.ts +18 -36
- package/src/resources/extensions/gsd/tests/projection-no-plan-overwrite.test.ts +35 -73
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +76 -138
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +24 -1
- package/src/resources/extensions/gsd/tests/prompt-duplication-cuts.test.ts +230 -0
- package/src/resources/extensions/gsd/tests/prompt-path-audit.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +70 -106
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +59 -161
- package/src/resources/extensions/gsd/tests/query-tools-db-open.test.ts +33 -29
- package/src/resources/extensions/gsd/tests/queue-auto-guard.test.ts +22 -196
- package/src/resources/extensions/gsd/tests/quick-auto-guard.test.ts +23 -93
- package/src/resources/extensions/gsd/tests/quick-external-gsd.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/quick-turn-end-cleanup.test.ts +50 -79
- package/src/resources/extensions/gsd/tests/reassess-default-optin.test.ts +27 -13
- package/src/resources/extensions/gsd/tests/remote-questions.test.ts +151 -251
- package/src/resources/extensions/gsd/tests/resource-loader-import-path.test.ts +41 -29
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +58 -69
- package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +36 -164
- package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +57 -41
- package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +91 -0
- package/src/resources/extensions/gsd/tests/schema-v27-v28-sequence.test.ts +156 -0
- package/src/resources/extensions/gsd/tests/select-resumable-milestone.test.ts +96 -0
- package/src/resources/extensions/gsd/tests/session-model-override.test.ts +14 -9
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +77 -0
- package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +222 -0
- package/src/resources/extensions/gsd/tests/show-config-command.test.ts +44 -42
- package/src/resources/extensions/gsd/tests/signal-handlers.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/skip-slice-state-rebuild.test.ts +56 -24
- package/src/resources/extensions/gsd/tests/skipped-validation-db-atomicity.test.ts +51 -11
- package/src/resources/extensions/gsd/tests/slice-cadence.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +66 -50
- package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +68 -107
- package/src/resources/extensions/gsd/tests/slice-sequence-insert.test.ts +115 -42
- package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +21 -77
- package/src/resources/extensions/gsd/tests/smart-entry-draft.test.ts +25 -116
- package/src/resources/extensions/gsd/tests/sqlite-unavailable-gate.test.ts +21 -57
- package/src/resources/extensions/gsd/tests/stale-dirlistcache-4648.test.ts +29 -76
- package/src/resources/extensions/gsd/tests/stale-lockfile-recovery.test.ts +33 -24
- package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +39 -30
- package/src/resources/extensions/gsd/tests/stalled-tool-recovery.test.ts +49 -1
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +65 -56
- package/src/resources/extensions/gsd/tests/status-db-open.test.ts +35 -40
- package/src/resources/extensions/gsd/tests/stop-auto-merge-back.test.ts +48 -46
- package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +14 -102
- package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +78 -232
- package/src/resources/extensions/gsd/tests/sync-worktree-skip-current.test.ts +32 -35
- package/src/resources/extensions/gsd/tests/system-context-memory.test.ts +112 -0
- package/src/resources/extensions/gsd/tests/system-context-message-routing.test.ts +7 -9
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +84 -309
- package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +295 -0
- package/src/resources/extensions/gsd/tests/triage-dispatch.test.ts +134 -341
- package/src/resources/extensions/gsd/tests/tui-header-lifecycle.test.ts +330 -0
- package/src/resources/extensions/gsd/tests/tui-render-kit.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +136 -4
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +8 -25
- package/src/resources/extensions/gsd/tests/unit-dispatches.test.ts +80 -1
- package/src/resources/extensions/gsd/tests/unit-runtime.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/unstructured-continue-context-injection.test.ts +5 -99
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +43 -36
- package/src/resources/extensions/gsd/tests/verification-retry-policy.test.ts +83 -0
- package/src/resources/extensions/gsd/tests/visualizer-data.test.ts +84 -444
- package/src/resources/extensions/gsd/tests/workflow-dispatch-claim.test.ts +142 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +44 -189
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +8 -57
- package/src/resources/extensions/gsd/tests/workflow-protocol-excerpt.test.ts +99 -0
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/workflow-worker-heartbeat.test.ts +32 -1
- package/src/resources/extensions/gsd/tests/worktree-db-same-file.test.ts +21 -44
- package/src/resources/extensions/gsd/tests/worktree-expected-warnings.test.ts +27 -26
- package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +14 -13
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +197 -78
- package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +888 -0
- package/src/resources/extensions/gsd/tests/worktree-main-branch.test.ts +20 -18
- package/src/resources/extensions/gsd/tests/worktree-path-injection.test.ts +22 -19
- package/src/resources/extensions/gsd/tests/worktree-project-root-degrade.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/worktree-safety.test.ts +327 -0
- package/src/resources/extensions/gsd/tests/worktree-state-projection.test.ts +120 -0
- package/src/resources/extensions/gsd/tests/worktree-telemetry.test.ts +59 -2
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +40 -1
- package/src/resources/extensions/gsd/tests/zero-slice-roadmap-guided.test.ts +19 -13
- package/src/resources/extensions/gsd/tool-contract.ts +82 -0
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +14 -15
- package/src/resources/extensions/gsd/tools/complete-task.ts +1 -1
- package/src/resources/extensions/gsd/tools/context-mode-tool-result.ts +25 -0
- package/src/resources/extensions/gsd/tools/exec-search-tool.ts +7 -7
- package/src/resources/extensions/gsd/tools/exec-tool.ts +4 -23
- package/src/resources/extensions/gsd/tools/memory-tools.ts +1 -0
- package/src/resources/extensions/gsd/tools/plan-slice.ts +13 -0
- package/src/resources/extensions/gsd/tools/plan-task.ts +10 -0
- package/src/resources/extensions/gsd/tools/resume-tool.ts +7 -7
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +1 -1
- package/src/resources/extensions/gsd/tui/render-kit.ts +109 -0
- package/src/resources/extensions/gsd/unit-context-composer.ts +19 -4
- package/src/resources/extensions/gsd/unit-runtime.ts +25 -0
- package/src/resources/extensions/gsd/watch/header-renderer.ts +121 -79
- package/src/resources/extensions/gsd/watch/splash-palette.ts +11 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +2 -2
- package/src/resources/extensions/gsd/workflow-protocol.ts +160 -0
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +1882 -0
- package/src/resources/extensions/gsd/worktree-safety.ts +282 -0
- package/src/resources/extensions/gsd/worktree-state-projection.ts +404 -0
- package/src/resources/extensions/gsd/worktree-telemetry.ts +7 -2
- package/src/resources/skills/create-gsd-extension/templates/templates.test.ts +86 -40
- package/src/resources/skills/web-quality-audit/scripts/analyze.sh +0 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +0 -733
- package/dist/web/standalone/.next/static/chunks/8336.631939fb583761fa.js +0 -10
- package/src/resources/extensions/gsd/tests/sync-layer-scope.test.ts +0 -434
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +0 -1247
- package/src/resources/extensions/gsd/worktree-resolver.ts +0 -909
- /package/dist/web/standalone/.next/static/{yTuahMMuJzVnsov5PreWl → F5x9E6H9k_52fjqyql93y}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{yTuahMMuJzVnsov5PreWl → F5x9E6H9k_52fjqyql93y}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Auto-mode post-unit git, verification, projection, and hook processing.
|
|
1
3
|
/**
|
|
2
4
|
* Post-unit processing for auto-loop — auto-commit, doctor run,
|
|
3
5
|
* state rebuild, projection checks, DB tool closeout, hooks, triage, and
|
|
@@ -23,7 +25,8 @@ import { closeoutUnit } from "./auto-unit-closeout.js";
|
|
|
23
25
|
import { runTurnGitAction, } from "./git-service.js";
|
|
24
26
|
import { verifyExpectedArtifact, resolveExpectedArtifactPath, writeBlockerPlaceholder, diagnoseExpectedArtifact, } from "./auto-recovery.js";
|
|
25
27
|
import { regenerateIfMissing } from "./workflow-projections.js";
|
|
26
|
-
import {
|
|
28
|
+
import { WorktreeStateProjection } from "./worktree-state-projection.js";
|
|
29
|
+
import { createWorkspace, scopeMilestone } from "./workspace.js";
|
|
27
30
|
import { normalizeWorktreePathForCompare } from "./worktree-root.js";
|
|
28
31
|
import { isDbAvailable, getTask, getSlice, getMilestone, updateTaskStatus, _getAdapter, getVerificationEvidence } from "./gsd-db.js";
|
|
29
32
|
import { renderPlanCheckboxes } from "./markdown-renderer.js";
|
|
@@ -52,11 +55,14 @@ import { detectAbandonMilestone } from "./abandon-detect.js";
|
|
|
52
55
|
import { isDeterministicPolicyError } from "./auto-tool-tracking.js";
|
|
53
56
|
import { clearProjectResearchInflightMarker, finalizeProjectResearchTimeout, } from "./project-research-policy.js";
|
|
54
57
|
import { validateArtifact } from "./schemas/validate.js";
|
|
58
|
+
import { verificationRetryKey } from "./auto/verification-retry-policy.js";
|
|
55
59
|
// ─── Path Comparison Helper ───────────────────────────────────────────────
|
|
56
60
|
/** Compare two paths for physical identity, tolerating trailing slashes and symlinks. */
|
|
57
61
|
function isSamePathLocal(a, b) {
|
|
58
62
|
return normalizeWorktreePathForCompare(a) === normalizeWorktreePathForCompare(b);
|
|
59
63
|
}
|
|
64
|
+
/** Stateless WorktreeStateProjection — methods are pure functions of MilestoneScope. */
|
|
65
|
+
const _worktreeProjection = new WorktreeStateProjection();
|
|
60
66
|
/** Maximum verification retry attempts before escalating to blocker placeholder (#2653). */
|
|
61
67
|
const MAX_VERIFICATION_RETRIES = 3;
|
|
62
68
|
/** Keep failure toasts short while still showing concrete examples. */
|
|
@@ -70,6 +76,62 @@ function formatPreExecutionCheckDetail(check) {
|
|
|
70
76
|
}
|
|
71
77
|
const COMPLETE_MILESTONE_DB_SETTLE_MS = 1500;
|
|
72
78
|
const COMPLETE_MILESTONE_DB_SETTLE_POLL_MS = 100;
|
|
79
|
+
function stripKnownIdPrefix(value, id) {
|
|
80
|
+
const raw = String(value ?? "").trim();
|
|
81
|
+
if (!raw)
|
|
82
|
+
return undefined;
|
|
83
|
+
const lower = raw.toLowerCase();
|
|
84
|
+
const idLower = id.toLowerCase();
|
|
85
|
+
if (lower.startsWith(`${idLower}:`))
|
|
86
|
+
return raw.slice(id.length + 1).trim() || undefined;
|
|
87
|
+
return raw;
|
|
88
|
+
}
|
|
89
|
+
async function buildTaskCommitContextForUnit(basePath, unitId) {
|
|
90
|
+
const { milestone: mid, slice: sid, task: tid } = parseUnitId(unitId);
|
|
91
|
+
if (!mid || !sid || !tid)
|
|
92
|
+
return undefined;
|
|
93
|
+
const milestone = isDbAvailable() ? getMilestone(mid) : null;
|
|
94
|
+
const slice = isDbAvailable() ? getSlice(mid, sid) : null;
|
|
95
|
+
const task = isDbAvailable() ? getTask(mid, sid, tid) : null;
|
|
96
|
+
let summary = null;
|
|
97
|
+
const summaryPath = resolveTaskFile(basePath, mid, sid, tid, "SUMMARY");
|
|
98
|
+
if (summaryPath) {
|
|
99
|
+
try {
|
|
100
|
+
const summaryContent = await loadFile(summaryPath);
|
|
101
|
+
if (summaryContent)
|
|
102
|
+
summary = parseSummary(summaryContent);
|
|
103
|
+
}
|
|
104
|
+
catch (e) {
|
|
105
|
+
debugLog("postUnit", { phase: "task-summary-parse", error: String(e) });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (!summary && !task)
|
|
109
|
+
return undefined;
|
|
110
|
+
let ghIssueNumber;
|
|
111
|
+
try {
|
|
112
|
+
const { getTaskIssueNumberForCommit } = await import("../github-sync/sync.js");
|
|
113
|
+
ghIssueNumber = getTaskIssueNumberForCommit(basePath, mid, sid, tid) ?? undefined;
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
logWarning("engine", `GitHub issue lookup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
taskId: `${sid}/${tid}`,
|
|
120
|
+
taskDisplayId: tid,
|
|
121
|
+
taskTitle: stripKnownIdPrefix(summary?.title, tid) ??
|
|
122
|
+
stripKnownIdPrefix(task?.title, tid) ??
|
|
123
|
+
tid,
|
|
124
|
+
milestoneId: mid,
|
|
125
|
+
milestoneTitle: stripKnownIdPrefix(milestone?.title, mid),
|
|
126
|
+
sliceId: sid,
|
|
127
|
+
sliceTitle: stripKnownIdPrefix(slice?.title, sid),
|
|
128
|
+
oneLiner: summary?.oneLiner || task?.one_liner || undefined,
|
|
129
|
+
keyFiles: summary?.frontmatter.key_files?.filter(f => !f.includes("{{")) ??
|
|
130
|
+
task?.key_files ??
|
|
131
|
+
undefined,
|
|
132
|
+
issueNumber: ghIssueNumber,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
73
135
|
async function waitForMilestoneDbClose(mid) {
|
|
74
136
|
const deadline = Date.now() + COMPLETE_MILESTONE_DB_SETTLE_MS;
|
|
75
137
|
while (Date.now() < deadline) {
|
|
@@ -96,6 +158,19 @@ function enqueueSidecar(s, ctx, entry, debugExtra, notification) {
|
|
|
96
158
|
ctx.ui.notify(notification, "info");
|
|
97
159
|
return "continue";
|
|
98
160
|
}
|
|
161
|
+
export function _shouldDispatchTriageForTest(state) {
|
|
162
|
+
return !state.stepMode &&
|
|
163
|
+
!!state.currentUnit &&
|
|
164
|
+
!state.currentUnit.type.startsWith("hook/") &&
|
|
165
|
+
state.currentUnit.type !== "triage-captures" &&
|
|
166
|
+
state.currentUnit.type !== "quick-task";
|
|
167
|
+
}
|
|
168
|
+
export function _shouldDispatchQuickTaskForTest(state) {
|
|
169
|
+
return !state.stepMode &&
|
|
170
|
+
state.pendingQuickTasks.length > 0 &&
|
|
171
|
+
!!state.currentUnit &&
|
|
172
|
+
state.currentUnit.type !== "quick-task";
|
|
173
|
+
}
|
|
99
174
|
/** Unit types that only touch `.gsd/` internal state files (no code changes).
|
|
100
175
|
* Auto-commit is skipped for these — their state files are picked up by the
|
|
101
176
|
* next actual task commit via `smartStage()`. */
|
|
@@ -216,7 +291,7 @@ export function detectRogueFileWrites(unitType, unitId, basePath) {
|
|
|
216
291
|
* in auto-verification.ts. Exceeding this limit pauses auto-mode instead of
|
|
217
292
|
* looping indefinitely (#2007).
|
|
218
293
|
*/
|
|
219
|
-
const MAX_ARTIFACT_VERIFICATION_RETRIES = 3;
|
|
294
|
+
export const MAX_ARTIFACT_VERIFICATION_RETRIES = 3;
|
|
220
295
|
export const STEP_COMPLETE_FALLBACK_MESSAGE = "Step complete. Run /clear, then /gsd to continue (or /gsd auto to run continuously).";
|
|
221
296
|
export function buildStepCompleteMessage(nextState) {
|
|
222
297
|
if (nextState.phase === "complete") {
|
|
@@ -267,36 +342,7 @@ export async function autoCommitUnit(basePath, unitType, unitId, ctx) {
|
|
|
267
342
|
try {
|
|
268
343
|
let taskContext;
|
|
269
344
|
if (unitType === "execute-task") {
|
|
270
|
-
|
|
271
|
-
if (mid && sid && tid) {
|
|
272
|
-
const summaryPath = resolveTaskFile(basePath, mid, sid, tid, "SUMMARY");
|
|
273
|
-
if (summaryPath) {
|
|
274
|
-
try {
|
|
275
|
-
const summaryContent = await loadFile(summaryPath);
|
|
276
|
-
if (summaryContent) {
|
|
277
|
-
const summary = parseSummary(summaryContent);
|
|
278
|
-
let ghIssueNumber;
|
|
279
|
-
try {
|
|
280
|
-
const { getTaskIssueNumberForCommit } = await import("../github-sync/sync.js");
|
|
281
|
-
ghIssueNumber = getTaskIssueNumberForCommit(basePath, mid, sid, tid) ?? undefined;
|
|
282
|
-
}
|
|
283
|
-
catch (err) {
|
|
284
|
-
logWarning("engine", `GitHub issue lookup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
285
|
-
}
|
|
286
|
-
taskContext = {
|
|
287
|
-
taskId: `${sid}/${tid}`,
|
|
288
|
-
taskTitle: summary.title?.replace(/^T\d+:\s*/, "") || tid,
|
|
289
|
-
oneLiner: summary.oneLiner || undefined,
|
|
290
|
-
keyFiles: summary.frontmatter.key_files?.filter(f => !f.includes("{{")) || undefined,
|
|
291
|
-
issueNumber: ghIssueNumber,
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
catch (e) {
|
|
296
|
-
debugLog("postUnit", { phase: "task-summary-parse", error: String(e) });
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
345
|
+
taskContext = await buildTaskCommitContextForUnit(basePath, unitId);
|
|
300
346
|
}
|
|
301
347
|
_resetHasChangesCache();
|
|
302
348
|
if (LIFECYCLE_ONLY_UNITS.has(unitType)) {
|
|
@@ -359,38 +405,7 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
359
405
|
try {
|
|
360
406
|
let taskContext;
|
|
361
407
|
if (turnAction === "commit" && s.currentUnit.type === "execute-task") {
|
|
362
|
-
|
|
363
|
-
if (mid && sid && tid) {
|
|
364
|
-
const summaryPath = resolveTaskFile(s.basePath, mid, sid, tid, "SUMMARY");
|
|
365
|
-
if (summaryPath) {
|
|
366
|
-
try {
|
|
367
|
-
const summaryContent = await loadFile(summaryPath);
|
|
368
|
-
if (summaryContent) {
|
|
369
|
-
const summary = parseSummary(summaryContent);
|
|
370
|
-
// Look up GitHub issue number for commit linking
|
|
371
|
-
let ghIssueNumber;
|
|
372
|
-
try {
|
|
373
|
-
const { getTaskIssueNumberForCommit } = await import("../github-sync/sync.js");
|
|
374
|
-
ghIssueNumber = getTaskIssueNumberForCommit(s.basePath, mid, sid, tid) ?? undefined;
|
|
375
|
-
}
|
|
376
|
-
catch (err) {
|
|
377
|
-
// GitHub sync not available — skip
|
|
378
|
-
logWarning("engine", `GitHub issue lookup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
379
|
-
}
|
|
380
|
-
taskContext = {
|
|
381
|
-
taskId: `${sid}/${tid}`,
|
|
382
|
-
taskTitle: summary.title?.replace(/^T\d+:\s*/, "") || tid,
|
|
383
|
-
oneLiner: summary.oneLiner || undefined,
|
|
384
|
-
keyFiles: summary.frontmatter.key_files?.filter(f => !f.includes("{{")) || undefined,
|
|
385
|
-
issueNumber: ghIssueNumber,
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
catch (e) {
|
|
390
|
-
debugLog("postUnit", { phase: "task-summary-parse", error: String(e) });
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
408
|
+
taskContext = await buildTaskCommitContextForUnit(s.basePath, s.currentUnit.id);
|
|
394
409
|
}
|
|
395
410
|
// Invalidate the nativeHasChanges cache before auto-commit (#1853).
|
|
396
411
|
// The cache has a 10-second TTL and is keyed by basePath. A stale
|
|
@@ -518,7 +533,20 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
518
533
|
// Sync worktree state back to project root (skipped for lightweight sidecars)
|
|
519
534
|
if (!opts?.skipWorktreeSync && s.originalBasePath && !isSamePathLocal(s.originalBasePath, s.basePath)) {
|
|
520
535
|
await runSafely("postUnit", "worktree-sync", () => {
|
|
521
|
-
|
|
536
|
+
let scope = s.scope;
|
|
537
|
+
if (!scope && s.currentMilestoneId) {
|
|
538
|
+
try {
|
|
539
|
+
scope = scopeMilestone(createWorkspace(s.basePath), s.currentMilestoneId);
|
|
540
|
+
}
|
|
541
|
+
catch {
|
|
542
|
+
// Non-fatal: scope construction can fail on synthetic test paths;
|
|
543
|
+
// skipping the projection mirrors the prior path-string variant's
|
|
544
|
+
// early-return behaviour for missing milestone/path inputs.
|
|
545
|
+
scope = null;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
if (scope)
|
|
549
|
+
_worktreeProjection.projectWorktreeToRoot(scope);
|
|
522
550
|
});
|
|
523
551
|
}
|
|
524
552
|
// Rewrite-docs completion
|
|
@@ -838,6 +866,7 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
838
866
|
const outcome = finalizeProjectResearchTimeout(s.basePath, "Project research unit ended before all required dimensions produced durable files.");
|
|
839
867
|
s.pendingVerificationRetry = null;
|
|
840
868
|
s.verificationRetryCount.delete(retryKey);
|
|
869
|
+
s.verificationRetryFailureHashes.delete(retryKey);
|
|
841
870
|
triggerArtifactVerified = verifyExpectedArtifact(s.currentUnit.type, s.currentUnit.id, s.basePath);
|
|
842
871
|
if (triggerArtifactVerified) {
|
|
843
872
|
invalidateAllCaches();
|
|
@@ -888,6 +917,7 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
888
917
|
s.lastToolInvocationError = null;
|
|
889
918
|
s.pendingVerificationRetry = null;
|
|
890
919
|
s.verificationRetryCount.delete(retryKey);
|
|
920
|
+
s.verificationRetryFailureHashes.delete(retryKey);
|
|
891
921
|
writeBlockerPlaceholder(s.currentUnit.type, s.currentUnit.id, s.basePath, reason);
|
|
892
922
|
ctx.ui.notify(`${s.currentUnit.type} ${s.currentUnit.id} — deterministic policy rejection, wrote blocker placeholder (no retries) (#4973)`, "warning");
|
|
893
923
|
// Fall through to "continue" — do NOT enter the retry or db-unavailable paths.
|
|
@@ -916,6 +946,7 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
916
946
|
const failureDetails = describeArtifactVerificationFailure(s.currentUnit.type, s.currentUnit.id, s.basePath);
|
|
917
947
|
if (attempt > MAX_ARTIFACT_VERIFICATION_RETRIES) {
|
|
918
948
|
s.verificationRetryCount.delete(retryKey);
|
|
949
|
+
s.verificationRetryFailureHashes.delete(retryKey);
|
|
919
950
|
debugLog("postUnit", { phase: "artifact-verify-exhausted", unitType: s.currentUnit.type, unitId: s.currentUnit.id, attempt });
|
|
920
951
|
ctx.ui.notify(`${failureDetails} Pausing auto-mode after ${MAX_ARTIFACT_VERIFICATION_RETRIES} retries.`, "error");
|
|
921
952
|
await pauseAuto(ctx, pi);
|
|
@@ -935,7 +966,9 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
935
966
|
// Verification succeeded — clear the retry counter so a future failure
|
|
936
967
|
// of the same unit gets a full retry budget instead of the stale count.
|
|
937
968
|
if (triggerArtifactVerified) {
|
|
938
|
-
|
|
969
|
+
const retryKey = verificationRetryKey(s.currentUnit.type, s.currentUnit.id);
|
|
970
|
+
s.verificationRetryCount.delete(retryKey);
|
|
971
|
+
s.verificationRetryFailureHashes.delete(retryKey);
|
|
939
972
|
}
|
|
940
973
|
}
|
|
941
974
|
else {
|
|
@@ -1123,8 +1156,12 @@ export async function postUnitPostVerification(pctx) {
|
|
|
1123
1156
|
return;
|
|
1124
1157
|
}
|
|
1125
1158
|
const strictMode = prefs?.enhanced_verification_strict === true;
|
|
1126
|
-
// Run pre-execution checks
|
|
1127
|
-
|
|
1159
|
+
// Run pre-execution checks against s.basePath — the actual checkout
|
|
1160
|
+
// where prior-slice files were created. In worktree isolation,
|
|
1161
|
+
// s.canonicalProjectRoot is the project root and lacks files that a
|
|
1162
|
+
// prior slice wrote to the worktree but hasn't merged to main yet.
|
|
1163
|
+
const preExecutionBasePath = s.basePath;
|
|
1164
|
+
const result = await runPreExecutionChecks(tasks, preExecutionBasePath);
|
|
1128
1165
|
// Log summary to stderr in existing verification output format
|
|
1129
1166
|
const emoji = result.status === "pass" ? "✅" : result.status === "warn" ? "⚠️" : "❌";
|
|
1130
1167
|
process.stderr.write(`gsd-pre-exec: ${emoji} Pre-execution checks ${result.status} for ${mid}/${sid} (${result.durationMs}ms)\n`);
|
|
@@ -1134,12 +1171,12 @@ export async function postUnitPostVerification(pctx) {
|
|
|
1134
1171
|
process.stderr.write(`gsd-pre-exec: ${checkEmoji} [${check.category}] ${check.target}: ${check.message}\n`);
|
|
1135
1172
|
}
|
|
1136
1173
|
// Write evidence JSON to slice artifacts directory
|
|
1137
|
-
const slicePath = resolveSlicePath(
|
|
1174
|
+
const slicePath = resolveSlicePath(preExecutionBasePath, mid, sid);
|
|
1138
1175
|
const evidenceFileName = `${sid}-PRE-EXEC-VERIFY.json`;
|
|
1139
1176
|
let evidencePath = join(".gsd", "milestones", mid, "slices", sid, evidenceFileName);
|
|
1140
1177
|
if (slicePath) {
|
|
1141
1178
|
writePreExecutionEvidence(result, slicePath, mid, sid);
|
|
1142
|
-
evidencePath = relative(
|
|
1179
|
+
evidencePath = relative(preExecutionBasePath, join(slicePath, evidenceFileName)) || evidenceFileName;
|
|
1143
1180
|
}
|
|
1144
1181
|
if (uokFlags.gates) {
|
|
1145
1182
|
const failedChecks = result.checks
|
|
@@ -1187,6 +1224,9 @@ export async function postUnitPostVerification(pctx) {
|
|
|
1187
1224
|
blockingFindings: blockingChecks.map(c => `[${c.category}] ${c.target}: ${c.message}`),
|
|
1188
1225
|
verdictExcerpt: `status=${result.status}; ${blockingCount} blocking issue${blockingCount === 1 ? "" : "s"} detected`,
|
|
1189
1226
|
};
|
|
1227
|
+
// Track consecutive pre-exec failures per slice for loop detection.
|
|
1228
|
+
const retryKey = currentUnit.id;
|
|
1229
|
+
s.preExecRetryCount.set(retryKey, (s.preExecRetryCount.get(retryKey) ?? 0) + 1);
|
|
1190
1230
|
preExecPauseNeeded = true;
|
|
1191
1231
|
}
|
|
1192
1232
|
else if (result.status === "warn") {
|
|
@@ -1199,9 +1239,16 @@ export async function postUnitPostVerification(pctx) {
|
|
|
1199
1239
|
blockingFindings: warnChecks.map(c => `[${c.category}] ${c.target}: ${c.message}`),
|
|
1200
1240
|
verdictExcerpt: `status=${result.status} (strict mode); ${warnChecks.length} warning${warnChecks.length === 1 ? "" : "s"} treated as blocking`,
|
|
1201
1241
|
};
|
|
1242
|
+
const retryKey = currentUnit.id;
|
|
1243
|
+
s.preExecRetryCount.set(retryKey, (s.preExecRetryCount.get(retryKey) ?? 0) + 1);
|
|
1202
1244
|
preExecPauseNeeded = true;
|
|
1203
1245
|
}
|
|
1204
1246
|
}
|
|
1247
|
+
// Reset the retry counter when checks pass — a successful re-plan
|
|
1248
|
+
// should not carry over a stale failure count into future slices.
|
|
1249
|
+
if (result.status === "pass") {
|
|
1250
|
+
s.preExecRetryCount.delete(currentUnit.id);
|
|
1251
|
+
}
|
|
1205
1252
|
debugLog("postUnitPostVerification", {
|
|
1206
1253
|
phase: "pre-execution-checks",
|
|
1207
1254
|
status: result.status,
|
|
@@ -1253,11 +1300,7 @@ export async function postUnitPostVerification(pctx) {
|
|
|
1253
1300
|
}
|
|
1254
1301
|
}
|
|
1255
1302
|
// ── Triage check ──
|
|
1256
|
-
if (
|
|
1257
|
-
s.currentUnit &&
|
|
1258
|
-
!s.currentUnit.type.startsWith("hook/") &&
|
|
1259
|
-
s.currentUnit.type !== "triage-captures" &&
|
|
1260
|
-
s.currentUnit.type !== "quick-task") {
|
|
1303
|
+
if (_shouldDispatchTriageForTest(s)) {
|
|
1261
1304
|
try {
|
|
1262
1305
|
if (hasPendingCaptures(s.basePath)) {
|
|
1263
1306
|
const pending = loadPendingCaptures(s.basePath);
|
|
@@ -1295,10 +1338,7 @@ export async function postUnitPostVerification(pctx) {
|
|
|
1295
1338
|
}
|
|
1296
1339
|
}
|
|
1297
1340
|
// ── Quick-task dispatch ──
|
|
1298
|
-
if (
|
|
1299
|
-
s.pendingQuickTasks.length > 0 &&
|
|
1300
|
-
s.currentUnit &&
|
|
1301
|
-
s.currentUnit.type !== "quick-task") {
|
|
1341
|
+
if (_shouldDispatchQuickTaskForTest(s)) {
|
|
1302
1342
|
try {
|
|
1303
1343
|
const capture = s.pendingQuickTasks.shift();
|
|
1304
1344
|
const { buildQuickTaskPrompt } = await import("./triage-resolution.js");
|
|
@@ -21,6 +21,7 @@ import { assertGateCoverage, getGatesForTurn, } from "./gate-registry.js";
|
|
|
21
21
|
import { formatDecisionsCompact, formatRequirementsCompact } from "./structured-data-formatter.js";
|
|
22
22
|
import { readPhaseAnchor, formatAnchorForPrompt } from "./phase-anchor.js";
|
|
23
23
|
import { composeContextModeInstructions, composeInlinedContext } from "./unit-context-composer.js";
|
|
24
|
+
import { readCompactionSnapshot } from "./compaction-snapshot.js";
|
|
24
25
|
import { logWarning } from "./workflow-logger.js";
|
|
25
26
|
import { inlineGraphSubgraph } from "./graph-context.js";
|
|
26
27
|
import { buildExtractionStepsBlock } from "./commands-extract-learnings.js";
|
|
@@ -28,12 +29,12 @@ import { resolveSkillManifest, warnIfManifestHasMissingSkills } from "./skill-ma
|
|
|
28
29
|
import { classifyProject } from "./detection.js";
|
|
29
30
|
// ─── Preamble Cap ─────────────────────────────────────────────────────────────
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
+
* Static ceiling for the preamble cap. Kept as an upper bound even
|
|
32
33
|
* after context-window-aware sizing so large-window users don't suddenly see
|
|
33
|
-
* 10× looser caps than
|
|
34
|
+
* 10× looser caps than needed. Small-window users get a tighter cap derived
|
|
34
35
|
* from their configured executor window.
|
|
35
36
|
*/
|
|
36
|
-
const MAX_PREAMBLE_CHARS =
|
|
37
|
+
const MAX_PREAMBLE_CHARS = 20_000;
|
|
37
38
|
/**
|
|
38
39
|
* Resolve prompt budgets from the configured executor context window.
|
|
39
40
|
*
|
|
@@ -162,8 +163,8 @@ function formatCloseoutReviewInstructions(validationContent, validationRel, curr
|
|
|
162
163
|
].join("\n");
|
|
163
164
|
}
|
|
164
165
|
function capPreamble(preamble) {
|
|
165
|
-
// Cap inlined context at min(
|
|
166
|
-
// The ceiling
|
|
166
|
+
// Cap inlined context at min(static ceiling, scaled inline budget).
|
|
167
|
+
// The ceiling bounds repeated auto prompt payloads; the scaled
|
|
167
168
|
// budget tightens the cap for small-window users whose true safe limit is
|
|
168
169
|
// below 30K. `computeBudgets` allocates 40% of total chars to inline context.
|
|
169
170
|
const budget = Math.min(MAX_PREAMBLE_CHARS, resolvePromptBudgets().inlineContextBudgetChars);
|
|
@@ -178,8 +179,19 @@ function renderContextModeForPrompt(unitType, base, renderMode = "standalone") {
|
|
|
178
179
|
renderMode,
|
|
179
180
|
});
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
+
function renderContextModeBlockForPrompt(unitType, base, renderMode = "standalone") {
|
|
182
183
|
const contextMode = renderContextModeForPrompt(unitType, base, renderMode);
|
|
184
|
+
if (!contextMode)
|
|
185
|
+
return "";
|
|
186
|
+
if (renderMode === "nested")
|
|
187
|
+
return contextMode;
|
|
188
|
+
const snapshot = readCompactionSnapshot(base);
|
|
189
|
+
if (!snapshot?.trim())
|
|
190
|
+
return contextMode;
|
|
191
|
+
return `${contextMode}\n\n## Context Snapshot\nSource: \`.gsd/last-snapshot.md\`\n\n${snapshot.trimEnd()}`;
|
|
192
|
+
}
|
|
193
|
+
function prependContextModeToBlock(unitType, base, block, renderMode = "standalone") {
|
|
194
|
+
const contextMode = renderContextModeBlockForPrompt(unitType, base, renderMode);
|
|
183
195
|
if (!contextMode)
|
|
184
196
|
return block;
|
|
185
197
|
if (!block.trim())
|
|
@@ -559,9 +571,77 @@ export async function buildSliceSummaryExcerpt(absPath, relPath, sid) {
|
|
|
559
571
|
}
|
|
560
572
|
catch {
|
|
561
573
|
// Defensive — any parse failure falls back to full inline.
|
|
562
|
-
return `### ${sid} Summary\nSource: \`${relPath}\`\n\n${content
|
|
574
|
+
return `### ${sid} Summary\nSource: \`${relPath}\`\n\n${capMalformedSummary(content, relPath)}`;
|
|
563
575
|
}
|
|
564
576
|
}
|
|
577
|
+
export async function buildTaskSummaryExcerpt(absPath, relPath, tid, options) {
|
|
578
|
+
const label = options?.blocker ? "Blocker Task Summary" : "Task Summary";
|
|
579
|
+
const header = `### ${label}: ${tid} (excerpt)\nSource: \`${relPath}\``;
|
|
580
|
+
const content = absPath ? await loadFile(absPath) : null;
|
|
581
|
+
if (!content) {
|
|
582
|
+
return `${header}\n\n_(not found — file does not exist yet)_`;
|
|
583
|
+
}
|
|
584
|
+
try {
|
|
585
|
+
const s = parseSummary(content);
|
|
586
|
+
if (!s.frontmatter.id) {
|
|
587
|
+
return `### ${label}: ${tid}\nSource: \`${relPath}\`\n\n${capMalformedSummary(content, relPath)}`;
|
|
588
|
+
}
|
|
589
|
+
const lines = [header, ""];
|
|
590
|
+
if (s.title)
|
|
591
|
+
lines.push(`**Title:** ${s.title}`);
|
|
592
|
+
if (s.oneLiner)
|
|
593
|
+
lines.push(`**One-liner:** ${s.oneLiner}`);
|
|
594
|
+
if (s.frontmatter.verification_result) {
|
|
595
|
+
lines.push(`**Verification:** \`${s.frontmatter.verification_result}\``);
|
|
596
|
+
}
|
|
597
|
+
lines.push(`**Blocker discovered:** ${s.frontmatter.blocker_discovered ? "yes — read full summary if blocker details are insufficient" : "no"}`);
|
|
598
|
+
if (s.frontmatter.provides.length > 0)
|
|
599
|
+
lines.push(`**Provides:** ${s.frontmatter.provides.slice(0, 4).join("; ")}`);
|
|
600
|
+
if (s.frontmatter.key_decisions.length > 0)
|
|
601
|
+
lines.push(`**Key decisions:** ${s.frontmatter.key_decisions.slice(0, 4).join("; ")}`);
|
|
602
|
+
if (s.frontmatter.patterns_established.length > 0)
|
|
603
|
+
lines.push(`**Patterns established:** ${s.frontmatter.patterns_established.slice(0, 4).join("; ")}`);
|
|
604
|
+
if (s.frontmatter.key_files.length > 0) {
|
|
605
|
+
const files = s.frontmatter.key_files.slice(0, 6);
|
|
606
|
+
const more = s.frontmatter.key_files.length > files.length ? ` (+${s.frontmatter.key_files.length - files.length} more)` : "";
|
|
607
|
+
lines.push(`**Key files:** ${files.join(", ")}${more}`);
|
|
608
|
+
}
|
|
609
|
+
const SECTION_CAP_CHARS = 500;
|
|
610
|
+
const capSection = (body) => {
|
|
611
|
+
const trimmed = body.trim();
|
|
612
|
+
if (trimmed.length <= SECTION_CAP_CHARS)
|
|
613
|
+
return trimmed;
|
|
614
|
+
return `${trimmed.slice(0, SECTION_CAP_CHARS)}\n… (truncated — see full \`${relPath}\`)`;
|
|
615
|
+
};
|
|
616
|
+
const verification = extractMarkdownSection(content, "Verification");
|
|
617
|
+
const diagnostics = extractMarkdownSection(content, "Diagnostics");
|
|
618
|
+
const knownIssues = extractMarkdownSection(content, "Known Issues");
|
|
619
|
+
if (verification && verification.trim()) {
|
|
620
|
+
lines.push("", "#### Verification", capSection(verification));
|
|
621
|
+
}
|
|
622
|
+
if (diagnostics && diagnostics.trim()) {
|
|
623
|
+
lines.push("", "#### Diagnostics", capSection(diagnostics));
|
|
624
|
+
}
|
|
625
|
+
if (s.deviations && s.deviations.trim()) {
|
|
626
|
+
lines.push("", "#### Deviations", capSection(s.deviations));
|
|
627
|
+
}
|
|
628
|
+
if (knownIssues && knownIssues.trim()) {
|
|
629
|
+
lines.push("", "#### Known issues", capSection(knownIssues));
|
|
630
|
+
}
|
|
631
|
+
lines.push("", `> **On-demand:** read \`${relPath}\` only when this excerpt is absent/truncated or you need fuller blocker, implementation, or file-change evidence.`);
|
|
632
|
+
return lines.join("\n");
|
|
633
|
+
}
|
|
634
|
+
catch {
|
|
635
|
+
return `### ${label}: ${tid}\nSource: \`${relPath}\`\n\n${capMalformedSummary(content, relPath)}`;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
function capMalformedSummary(content, relPath) {
|
|
639
|
+
const trimmed = content.trim();
|
|
640
|
+
const limit = 1_500;
|
|
641
|
+
if (trimmed.length <= limit)
|
|
642
|
+
return trimmed;
|
|
643
|
+
return `${trimmed.slice(0, limit).trimEnd()}\n\n[Truncated malformed summary — read \`${relPath}\` for full details.]`;
|
|
644
|
+
}
|
|
565
645
|
/**
|
|
566
646
|
* Load and inline dependency slice summaries (full content, not just paths).
|
|
567
647
|
*/
|
|
@@ -814,12 +894,12 @@ export async function inlineKnowledgeScoped(base, keywords) {
|
|
|
814
894
|
* plan-milestone, complete-slice, complete-milestone, validate-milestone,
|
|
815
895
|
* reassess-roadmap) previously injected the full KNOWLEDGE.md (~226KB for a
|
|
816
896
|
* real project) on every invocation. This helper scopes by caller-supplied
|
|
817
|
-
* keywords and caps the payload at `maxChars` (default
|
|
897
|
+
* keywords and caps the payload at `maxChars` (default 12,000 chars).
|
|
818
898
|
*
|
|
819
899
|
* Returns null when no KNOWLEDGE.md exists or no entries match any keyword.
|
|
820
900
|
*/
|
|
821
901
|
export async function inlineKnowledgeBudgeted(base, keywords, options) {
|
|
822
|
-
const DEFAULT_MAX_CHARS =
|
|
902
|
+
const DEFAULT_MAX_CHARS = 12_000;
|
|
823
903
|
const HARD_MAX_CHARS = 100_000;
|
|
824
904
|
const raw = Number(options?.maxChars ?? DEFAULT_MAX_CHARS);
|
|
825
905
|
const maxChars = Number.isFinite(raw)
|
|
@@ -1812,8 +1892,17 @@ export async function buildPlanSlicePrompt(mid, _midTitle, sid, sTitle, base, le
|
|
|
1812
1892
|
`The previous plan-slice attempt was blocked by pre-execution validation.\n` +
|
|
1813
1893
|
`Gate verdict: ${verdictExcerpt}\n\n` +
|
|
1814
1894
|
`Blocked references that must be resolved in this plan:\n${findingsList}\n\n` +
|
|
1815
|
-
|
|
1816
|
-
|
|
1895
|
+
`**How to fix each type of issue:**\n` +
|
|
1896
|
+
`- **"[file] X doesn't exist and isn't created by prior or same-task outputs"**: ` +
|
|
1897
|
+
`Either (a) add an earlier task that creates X on disk before the task that needs it, ` +
|
|
1898
|
+
`or (b) if this task IS the one that creates X, move X from inputs to expected_output. ` +
|
|
1899
|
+
`Do NOT put X in a task's expected_output if that task only reads or verifies X — only tasks that actually write X to disk should list it in expected_output.\n` +
|
|
1900
|
+
`- **"[file] X: Task T_early reads X but it's created by task T_late (sequence violation)"**: ` +
|
|
1901
|
+
`Either (a) reorder tasks so T_late (the creator) runs before T_early (the reader), ` +
|
|
1902
|
+
`or (b) if T_late doesn't actually create X (it only reads/tests it), remove X from T_late's expected_output entirely.\n` +
|
|
1903
|
+
`- **"[package] P not found on npm"**: Either remove the npm install for P, or use the correct package name.\n\n` +
|
|
1904
|
+
`Every file listed in a task's inputs must either exist on disk already or appear in an earlier task's expected_output. ` +
|
|
1905
|
+
`A task's expected_output must only list files it actually writes to disk.`);
|
|
1817
1906
|
}
|
|
1818
1907
|
return renderSlicePrompt({
|
|
1819
1908
|
mid, sid, sTitle, base,
|
|
@@ -2036,11 +2125,9 @@ export async function buildCompleteSlicePrompt(mid, midTitle, sid, sTitle, base,
|
|
|
2036
2125
|
const blocks = [];
|
|
2037
2126
|
for (const file of summaryFiles) {
|
|
2038
2127
|
const absPath = join(tDir, file);
|
|
2039
|
-
const content = await loadFile(absPath);
|
|
2040
|
-
if (!content)
|
|
2041
|
-
continue;
|
|
2042
2128
|
const relPath = `${sRel}/tasks/${file}`;
|
|
2043
|
-
|
|
2129
|
+
const taskId = file.replace(/-SUMMARY\.md$/i, "");
|
|
2130
|
+
blocks.push(await buildTaskSummaryExcerpt(absPath, relPath, taskId));
|
|
2044
2131
|
}
|
|
2045
2132
|
return blocks.length > 0 ? blocks.join("\n\n---\n\n") : null;
|
|
2046
2133
|
}
|
|
@@ -2387,7 +2474,7 @@ export async function buildReplanSlicePrompt(mid, midTitle, sid, sTitle, base) {
|
|
|
2387
2474
|
const relPath = `${sRel}/tasks/${file}`;
|
|
2388
2475
|
if (summary.frontmatter.blocker_discovered) {
|
|
2389
2476
|
blockerTaskId = summary.frontmatter.id || file.replace(/-SUMMARY\.md$/i, "");
|
|
2390
|
-
inlined.push(
|
|
2477
|
+
inlined.push(await buildTaskSummaryExcerpt(absPath, relPath, blockerTaskId, { blocker: true }));
|
|
2391
2478
|
}
|
|
2392
2479
|
}
|
|
2393
2480
|
}
|
|
@@ -30,7 +30,49 @@ import { getProjectResearchStatus } from "./project-research-policy.js";
|
|
|
30
30
|
// Re-export so existing consumers of auto-recovery.ts keep working.
|
|
31
31
|
export { resolveExpectedArtifactPath, diagnoseExpectedArtifact };
|
|
32
32
|
export { classifyMilestoneSummaryContent, } from "./milestone-summary-classifier.js";
|
|
33
|
-
|
|
33
|
+
export function refreshRecoveryDbForArtifact(unitType, unitId) {
|
|
34
|
+
if (unitType !== "plan-slice" && unitType !== "execute-task")
|
|
35
|
+
return { ok: true };
|
|
36
|
+
if (!isDbAvailable())
|
|
37
|
+
return { ok: true };
|
|
38
|
+
if (!refreshOpenDatabaseFromDisk()) {
|
|
39
|
+
return {
|
|
40
|
+
ok: false,
|
|
41
|
+
fatal: unitType === "execute-task",
|
|
42
|
+
reason: `${unitType}-db-refresh-failed`,
|
|
43
|
+
message: `Stuck recovery found ${unitType} ${unitId} artifacts, but the DB refresh failed.`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
if (unitType !== "execute-task")
|
|
47
|
+
return { ok: true };
|
|
48
|
+
const { milestone: mid, slice: sid, task: tid } = parseUnitId(unitId);
|
|
49
|
+
if (!mid || !sid || !tid) {
|
|
50
|
+
return {
|
|
51
|
+
ok: false,
|
|
52
|
+
fatal: true,
|
|
53
|
+
reason: "execute-task-invalid-unit-id",
|
|
54
|
+
message: `Stuck recovery found execute-task ${unitId} artifacts, but the unit id could not be parsed for DB verification.`,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const task = getTask(mid, sid, tid);
|
|
58
|
+
if (!task) {
|
|
59
|
+
return {
|
|
60
|
+
ok: false,
|
|
61
|
+
fatal: true,
|
|
62
|
+
reason: "execute-task-artifact-db-missing",
|
|
63
|
+
message: `Stuck recovery found execute-task ${unitId} artifacts, but no matching DB task row exists after refresh.`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (!isClosedStatus(task.status)) {
|
|
67
|
+
return {
|
|
68
|
+
ok: false,
|
|
69
|
+
fatal: true,
|
|
70
|
+
reason: "execute-task-artifact-db-mismatch",
|
|
71
|
+
message: `Stuck recovery found execute-task ${unitId} artifacts, but the DB task status is still '${task.status}' after refresh.`,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return { ok: true };
|
|
75
|
+
}
|
|
34
76
|
function hasCapturedWorkflowPrefs(base) {
|
|
35
77
|
const prefsPath = resolveExpectedArtifactPath("workflow-preferences", "WORKFLOW-PREFS", base);
|
|
36
78
|
if (!prefsPath || !existsSync(prefsPath))
|
|
@@ -33,3 +33,8 @@ export function recordToolInvocationError(toolName, errorMsg) {
|
|
|
33
33
|
autoSession.lastToolInvocationError = `${toolName}: ${errorMsg}`;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
+
export function clearToolInvocationError() {
|
|
37
|
+
if (!autoSession.active)
|
|
38
|
+
return;
|
|
39
|
+
autoSession.lastToolInvocationError = null;
|
|
40
|
+
}
|