gsd-pi 2.77.0-dev.1d17f366c → 2.77.0-dev.2daa994b6
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/dist/headless.js +25 -4
- package/dist/resource-loader.d.ts +40 -0
- package/dist/resource-loader.js +32 -13
- package/dist/resources/extensions/browser-tools/capture.js +9 -0
- package/dist/resources/extensions/browser-tools/tests/browser-tools-integration.test.mjs +8 -59
- package/dist/resources/extensions/browser-tools/tests/browser-tools-unit.test.cjs +36 -24
- package/dist/resources/extensions/browser-tools/tests/capture-sharp-optional.test.cjs +69 -71
- package/dist/resources/extensions/browser-tools/tools/forms.js +5 -1
- package/dist/resources/extensions/browser-tools/tools/intent.js +5 -1
- package/dist/resources/extensions/gsd/auto/phases.js +5 -18
- package/dist/resources/extensions/gsd/auto/session.js +6 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +37 -8
- package/dist/resources/extensions/gsd/auto-post-unit.js +79 -0
- package/dist/resources/extensions/gsd/auto-prompts.js +372 -104
- package/dist/resources/extensions/gsd/auto-start.js +75 -24
- package/dist/resources/extensions/gsd/auto.js +34 -0
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +9 -1
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +7 -1
- package/dist/resources/extensions/gsd/component-loader.js +447 -0
- package/dist/resources/extensions/gsd/component-types.js +69 -0
- package/dist/resources/extensions/gsd/context-store.js +23 -7
- package/dist/resources/extensions/gsd/detection.js +49 -1
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +1 -1
- package/dist/resources/extensions/gsd/forensics.js +106 -0
- package/dist/resources/extensions/gsd/gsd-db.js +1 -1
- package/dist/resources/extensions/gsd/guided-flow.js +2 -4
- package/dist/resources/extensions/gsd/memory-extractor.js +7 -1
- package/dist/resources/extensions/gsd/milestone-scope-classifier.js +299 -0
- package/dist/resources/extensions/gsd/model-cost-table.js +3 -0
- package/dist/resources/extensions/gsd/model-router.js +6 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +23 -0
- package/dist/resources/extensions/gsd/prompt-cache-optimizer.js +4 -0
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +5 -1
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +15 -2
- package/dist/resources/extensions/gsd/service-tier.js +5 -2
- package/dist/resources/extensions/gsd/skill-manifest.js +168 -0
- package/dist/resources/extensions/gsd/slice-cadence.js +238 -0
- package/dist/resources/extensions/gsd/tools/validate-milestone.js +7 -2
- package/dist/resources/extensions/gsd/unit-context-composer.js +147 -0
- package/dist/resources/extensions/gsd/unit-context-manifest.js +334 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +51 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +86 -7
- package/dist/resources/extensions/gsd/worktree-telemetry.js +198 -0
- package/dist/resources/extensions/mcp-client/index.js +3 -1
- package/dist/resources/extensions/ollama/index.js +5 -1
- package/dist/resources/extensions/remote-questions/manager.js +11 -5
- 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 +17 -17
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- 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.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 +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- 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-paths-manifest.json +17 -17
- package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
- 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/package.json +1 -3
- package/packages/mcp-server/src/mcp-server.test.ts +25 -3
- package/packages/mcp-server/src/readers/graph.test.ts +87 -15
- package/packages/mcp-server/src/workflow-tools.test.ts +80 -39
- package/packages/native/package.json +1 -1
- package/packages/native/src/__tests__/_test-coverage-guard.test.mjs +98 -0
- package/packages/native/src/__tests__/module-compat.test.mjs +59 -27
- package/packages/native/src/__tests__/ps.test.mjs +14 -8
- package/packages/native/src/__tests__/stream-process.test.mjs +23 -2
- package/packages/native/src/__tests__/truncate.test.mjs +17 -2
- package/packages/pi-agent-core/src/agent-loop.test.ts +5 -15
- package/packages/pi-agent-core/src/agent.test.ts +96 -102
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/models/generated/index.d.ts +34 -0
- package/packages/pi-ai/dist/models/generated/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openai-codex.js +17 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/openai.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/openai.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openai.js +17 -0
- package/packages/pi-ai/dist/models/generated/openai.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.test.js +43 -70
- package/packages/pi-ai/dist/models.generated.test.js.map +1 -1
- package/packages/pi-ai/dist/models.test.js +29 -11
- package/packages/pi-ai/dist/models.test.js.map +1 -1
- package/packages/pi-ai/scripts/generate-models.ts +44 -0
- package/packages/pi-ai/src/models/generated/openai-codex.ts +17 -0
- package/packages/pi-ai/src/models/generated/openai.ts +17 -0
- package/packages/pi-ai/src/models.generated.test.ts +46 -73
- package/packages/pi-ai/src/models.test.ts +39 -11
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +96 -32
- 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-model-switch.test.js +75 -12
- package/packages/pi-coding-agent/dist/core/agent-session-model-switch.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js +99 -31
- package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +5 -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 +61 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js +30 -4
- package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +17 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader-cache-reset.test.js +76 -18
- package/packages/pi-coding-agent/dist/core/resource-loader-cache-reset.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js +2 -6
- package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js +5 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retryable-error-regex.d.ts +18 -0
- package/packages/pi-coding-agent/dist/core/retryable-error-regex.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/retryable-error-regex.js +18 -0
- package/packages/pi-coding-agent/dist/core/retryable-error-regex.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +20 -0
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +16 -2
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +1 -0
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +1 -0
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +36 -5
- 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/dynamic-border.test.js +20 -13
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +30 -12
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/tests/system-prompt-skill-filter.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-skill-filter.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-skill-filter.test.js +130 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-skill-filter.test.js.map +1 -0
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +113 -37
- package/packages/pi-coding-agent/src/core/agent-session-model-switch.test.ts +89 -17
- package/packages/pi-coding-agent/src/core/agent-session-tool-refresh.test.ts +112 -43
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +58 -0
- package/packages/pi-coding-agent/src/core/lsp/lsp-integration.test.ts +35 -4
- package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +20 -0
- package/packages/pi-coding-agent/src/core/resource-loader-cache-reset.test.ts +93 -28
- package/packages/pi-coding-agent/src/core/retry-handler.test.ts +5 -1
- package/packages/pi-coding-agent/src/core/retry-handler.ts +2 -8
- package/packages/pi-coding-agent/src/core/retryable-error-regex.ts +18 -0
- package/packages/pi-coding-agent/src/core/system-prompt.ts +35 -1
- package/packages/pi-coding-agent/src/index.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +49 -3
- package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.test.ts +26 -20
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +48 -9
- package/packages/pi-coding-agent/src/tests/system-prompt-skill-filter.test.ts +157 -0
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js +18 -8
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js.map +1 -1
- package/packages/pi-tui/dist/__tests__/overlay-layout.test.js +128 -17
- package/packages/pi-tui/dist/__tests__/overlay-layout.test.js.map +1 -1
- package/packages/pi-tui/dist/__tests__/stdin-buffer.test.js +36 -12
- package/packages/pi-tui/dist/__tests__/stdin-buffer.test.js.map +1 -1
- package/packages/pi-tui/dist/__tests__/tui.test.js +18 -30
- package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
- package/packages/pi-tui/dist/components/__tests__/input.test.js +10 -3
- package/packages/pi-tui/dist/components/__tests__/input.test.js.map +1 -1
- package/packages/pi-tui/dist/components/__tests__/loader.test.js +53 -9
- package/packages/pi-tui/dist/components/__tests__/loader.test.js.map +1 -1
- package/packages/pi-tui/dist/components/__tests__/markdown-maxlines.test.js +6 -2
- package/packages/pi-tui/dist/components/__tests__/markdown-maxlines.test.js.map +1 -1
- package/packages/pi-tui/dist/components/image.test.js +6 -5
- package/packages/pi-tui/dist/components/image.test.js.map +1 -1
- package/packages/pi-tui/src/__tests__/autocomplete.test.ts +24 -8
- package/packages/pi-tui/src/__tests__/overlay-layout.test.ts +140 -17
- package/packages/pi-tui/src/__tests__/stdin-buffer.test.ts +41 -12
- package/packages/pi-tui/src/__tests__/tui.test.ts +18 -37
- package/packages/pi-tui/src/components/__tests__/input.test.ts +19 -3
- package/packages/pi-tui/src/components/__tests__/loader.test.ts +112 -35
- package/packages/pi-tui/src/components/__tests__/markdown-maxlines.test.ts +9 -2
- package/packages/pi-tui/src/components/image.test.ts +10 -5
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/dist/rpc-client.test.js +101 -51
- package/packages/rpc-client/dist/rpc-client.test.js.map +1 -1
- package/packages/rpc-client/src/rpc-client.test.ts +109 -52
- package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
- package/scripts/install.js +15 -1
- package/src/resources/extensions/browser-tools/capture.ts +12 -0
- package/src/resources/extensions/browser-tools/tests/browser-tools-integration.test.mjs +8 -59
- package/src/resources/extensions/browser-tools/tests/browser-tools-unit.test.cjs +36 -24
- package/src/resources/extensions/browser-tools/tests/capture-sharp-optional.test.cjs +69 -71
- package/src/resources/extensions/browser-tools/tools/forms.ts +5 -1
- package/src/resources/extensions/browser-tools/tools/intent.ts +5 -1
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +80 -72
- package/src/resources/extensions/github-sync/tests/cli.test.ts +76 -7
- package/src/resources/extensions/github-sync/tests/templates.test.ts +33 -1
- package/src/resources/extensions/gsd/auto/phases.ts +6 -17
- package/src/resources/extensions/gsd/auto/session.ts +7 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +40 -8
- package/src/resources/extensions/gsd/auto-post-unit.ts +81 -0
- package/src/resources/extensions/gsd/auto-prompts.ts +385 -93
- package/src/resources/extensions/gsd/auto-start.ts +97 -4
- package/src/resources/extensions/gsd/auto.ts +37 -0
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +9 -1
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +7 -1
- package/src/resources/extensions/gsd/component-loader.ts +598 -0
- package/src/resources/extensions/gsd/component-types.ts +362 -0
- package/src/resources/extensions/gsd/context-store.ts +25 -8
- package/src/resources/extensions/gsd/detection.ts +58 -1
- package/src/resources/extensions/gsd/docs/preferences-reference.md +1 -1
- package/src/resources/extensions/gsd/forensics.ts +118 -1
- package/src/resources/extensions/gsd/git-service.ts +16 -0
- package/src/resources/extensions/gsd/gsd-db.ts +1 -1
- package/src/resources/extensions/gsd/guided-flow.ts +2 -4
- package/src/resources/extensions/gsd/journal.ts +11 -1
- package/src/resources/extensions/gsd/memory-extractor.ts +11 -3
- package/src/resources/extensions/gsd/milestone-scope-classifier.ts +366 -0
- package/src/resources/extensions/gsd/model-cost-table.ts +3 -0
- package/src/resources/extensions/gsd/model-router.ts +6 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +21 -0
- package/src/resources/extensions/gsd/prompt-cache-optimizer.ts +4 -0
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +5 -1
- package/src/resources/extensions/gsd/prompts/plan-slice.md +15 -2
- package/src/resources/extensions/gsd/service-tier.ts +5 -2
- package/src/resources/extensions/gsd/skill-manifest.ts +175 -0
- package/src/resources/extensions/gsd/slice-cadence.ts +299 -0
- package/src/resources/extensions/gsd/tests/artifacts-table-preserved-on-cache-invalidate.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +25 -292
- package/src/resources/extensions/gsd/tests/auto-remediate-slice-status.test.ts +4 -1
- package/src/resources/extensions/gsd/tests/auto-retry-mcp-churn-fixes.test.ts +8 -194
- package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/auto-start-cold-db-bootstrap.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/auto-start-needs-discussion.test.ts +15 -58
- package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/auto-thinking-restore.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/auto-warning-noise-regression.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/cache-staleness-regression.test.ts +17 -21
- package/src/resources/extensions/gsd/tests/canonical-milestone-root.test.ts +108 -0
- package/src/resources/extensions/gsd/tests/complete-milestone-excerpt.test.ts +263 -0
- package/src/resources/extensions/gsd/tests/complete-slice-composer.test.ts +192 -0
- package/src/resources/extensions/gsd/tests/complete-slice-verification-gate.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +8 -4
- package/src/resources/extensions/gsd/tests/component-loader.test.ts +589 -0
- package/src/resources/extensions/gsd/tests/component-types.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/context-store.test.ts +79 -0
- package/src/resources/extensions/gsd/tests/copy-planning-artifacts-samepath.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/discuss-slice-structured-questions.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/discuss-tool-scope-leak.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/double-merge-guard.test.ts +4 -3
- package/src/resources/extensions/gsd/tests/empty-content-abort-loop.test.ts +4 -3
- package/src/resources/extensions/gsd/tests/extension-bootstrap-isolation.test.ts +139 -129
- package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +8 -104
- package/src/resources/extensions/gsd/tests/hook-key-parsing.test.ts +4 -55
- package/src/resources/extensions/gsd/tests/integration/all-milestones-complete-merge.test.ts +7 -56
- package/src/resources/extensions/gsd/tests/integration/doctor-proactive.test.ts +18 -2
- package/src/resources/extensions/gsd/tests/integration/queue-completed-milestone-perf.test.ts +10 -4
- package/src/resources/extensions/gsd/tests/integration/state-machine-edge-cases.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +9 -3
- package/src/resources/extensions/gsd/tests/interrupted-session-ui.test.ts +6 -9
- package/src/resources/extensions/gsd/tests/knowledge.test.ts +93 -1
- package/src/resources/extensions/gsd/tests/mcp-client-security.test.ts +8 -37
- package/src/resources/extensions/gsd/tests/memory-extractor.test.ts +5 -15
- package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +227 -55
- package/src/resources/extensions/gsd/tests/milestone-scope-classifier.test.ts +187 -0
- package/src/resources/extensions/gsd/tests/model-cost-table.test.ts +9 -1
- package/src/resources/extensions/gsd/tests/model-router.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +6 -48
- package/src/resources/extensions/gsd/tests/notification-widget.test.ts +6 -3
- package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +59 -2
- package/src/resources/extensions/gsd/tests/parallel-research-dispatch.test.ts +273 -130
- package/src/resources/extensions/gsd/tests/pipeline-variant-dispatch.test.ts +301 -0
- package/src/resources/extensions/gsd/tests/preferences-worktree-sync.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/prompt-cache-optimizer.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +15 -4
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +22 -16
- package/src/resources/extensions/gsd/tests/queue-draft-detection.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/queued-discuss-fast-path.test.ts +4 -5
- package/src/resources/extensions/gsd/tests/reassess-default-optin.test.ts +132 -0
- package/src/resources/extensions/gsd/tests/recovery-attempts-reset.test.ts +8 -40
- package/src/resources/extensions/gsd/tests/regex-hardening.test.ts +136 -256
- package/src/resources/extensions/gsd/tests/research-milestone-composer.test.ts +114 -0
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +6 -3
- package/src/resources/extensions/gsd/tests/run-uat-composer.test.ts +148 -0
- package/src/resources/extensions/gsd/tests/service-tier.test.ts +4 -0
- package/src/resources/extensions/gsd/tests/sidecar-queue.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/silent-catch-diagnostics.test.ts +55 -95
- package/src/resources/extensions/gsd/tests/skill-activation.test.ts +120 -1
- package/src/resources/extensions/gsd/tests/skill-manifest.test.ts +112 -0
- package/src/resources/extensions/gsd/tests/slice-cadence.test.ts +242 -0
- package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/smart-entry-draft.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/structured-data-formatter.test.ts +11 -92
- package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +7 -6
- package/src/resources/extensions/gsd/tests/survivor-branch-complete.test.ts +102 -101
- package/src/resources/extensions/gsd/tests/sync-worktree-skip-current.test.ts +4 -3
- package/src/resources/extensions/gsd/tests/test-helpers.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/test-helpers.ts +153 -0
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +8 -1
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +355 -0
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +203 -0
- package/src/resources/extensions/gsd/tests/uok-gitops-wiring.test.ts +49 -26
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/verify-artifact-tightened.test.ts +144 -80
- package/src/resources/extensions/gsd/tests/visualizer-critical-path.test.ts +20 -54
- package/src/resources/extensions/gsd/tests/visualizer-overlay.test.ts +342 -277
- package/src/resources/extensions/gsd/tests/worker-model-override.test.ts +37 -29
- package/src/resources/extensions/gsd/tests/worktree-db.test.ts +226 -266
- package/src/resources/extensions/gsd/tests/worktree-health-monorepo.test.ts +103 -67
- package/src/resources/extensions/gsd/tests/worktree-nested-git-safety.test.ts +92 -90
- package/src/resources/extensions/gsd/tests/worktree-submodule-safety.test.ts +238 -59
- package/src/resources/extensions/gsd/tests/worktree-sync-overwrite-loop.test.ts +113 -161
- package/src/resources/extensions/gsd/tests/worktree-telemetry.test.ts +210 -0
- package/src/resources/extensions/gsd/tests/zombie-gsd-state.test.ts +80 -96
- package/src/resources/extensions/gsd/tools/validate-milestone.ts +8 -2
- package/src/resources/extensions/gsd/unit-context-composer.ts +218 -0
- package/src/resources/extensions/gsd/unit-context-manifest.ts +492 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +53 -0
- package/src/resources/extensions/gsd/worktree-resolver.ts +96 -9
- package/src/resources/extensions/gsd/worktree-telemetry.ts +322 -0
- package/src/resources/extensions/mcp-client/index.ts +3 -1
- package/src/resources/extensions/mcp-client/tests/server-name-spaces.test.ts +70 -36
- package/src/resources/extensions/ollama/index.ts +5 -1
- package/src/resources/extensions/ollama/ollama-auth-mode.test.ts +123 -15
- package/src/resources/extensions/ollama/ollama-status-indicator.test.ts +206 -19
- package/src/resources/extensions/remote-questions/manager.ts +36 -4
- package/src/resources/extensions/remote-questions/tests/command-polling.test.ts +200 -190
- package/src/resources/extensions/shared/tests/interview-preview.test.ts +11 -3
- package/src/resources/extensions/voice/tests/linux-ready.test.ts +129 -113
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.d.ts +0 -2
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.d.ts.map +0 -1
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.js +0 -289
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.js.map +0 -1
- package/packages/pi-ai/src/utils/oauth/oauth-providers.test.ts +0 -363
- package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +0 -143
- package/src/resources/extensions/gsd/tests/complete-milestone-false-merge.test.ts +0 -157
- package/src/resources/extensions/gsd/tests/dashboard-model-label-ordering.test.ts +0 -107
- package/src/resources/extensions/gsd/tests/find-missing-summaries-closed.test.ts +0 -48
- package/src/resources/extensions/gsd/tests/forensics-context-persist.test.ts +0 -159
- package/src/resources/extensions/gsd/tests/forensics-db-completion.test.ts +0 -96
- package/src/resources/extensions/gsd/tests/forensics-dedup.test.ts +0 -79
- package/src/resources/extensions/gsd/tests/forensics-hook-key-parse.test.ts +0 -74
- package/src/resources/extensions/gsd/tests/forensics-journal.test.ts +0 -162
- package/src/resources/extensions/gsd/tests/gitignore-bg-shell.test.ts +0 -38
- package/src/resources/extensions/gsd/tests/gsd-no-project-error.test.ts +0 -73
- package/src/resources/extensions/gsd/tests/idle-watchdog-stall-override.test.ts +0 -125
- package/src/resources/extensions/gsd/tests/import-done-milestones.test.ts +0 -42
- /package/dist/web/standalone/.next/static/{vidAVJkURvTJ0_V2-64ro → gYYky7yfxW8txb9vU2TrJ}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{vidAVJkURvTJ0_V2-64ro → gYYky7yfxW8txb9vU2TrJ}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
// GSD-2 — UnitContextManifest (#4782 phase 1).
|
|
2
|
+
//
|
|
3
|
+
// Declarative description of what context each auto-mode unit type needs
|
|
4
|
+
// in its system prompt. Establishes the contract that later phases will
|
|
5
|
+
// use to drive a single composeSystemPromptForUnit() — replacing the
|
|
6
|
+
// per-unit-type branching currently spread across `auto-prompts.ts`.
|
|
7
|
+
//
|
|
8
|
+
// **Phase 1 ships the type + the data + a CI coverage guard.** It adds
|
|
9
|
+
// zero wiring — no caller reads a manifest yet. Every unit type gets a
|
|
10
|
+
// manifest that describes today's behavior as faithfully as possible, so
|
|
11
|
+
// when the composer lands in phase 2 the migration can proceed manifest-
|
|
12
|
+
// by-manifest without behavior change.
|
|
13
|
+
//
|
|
14
|
+
// Phased rollout tracking:
|
|
15
|
+
// - Phase 1 (this PR): schema + manifests + coverage test.
|
|
16
|
+
// - Phase 2: add composeSystemPromptForUnit(); migrate one low-risk
|
|
17
|
+
// unit type (e.g. reassess-roadmap) as the pilot.
|
|
18
|
+
// - Phase 3: migrate remaining unit types, tighten manifests per
|
|
19
|
+
// empirical usage, introduce skipWhen predicates absorbing the
|
|
20
|
+
// reassess opt-in gate from #4778.
|
|
21
|
+
// - Phase 4: introduce pipeline variants as declared sequences,
|
|
22
|
+
// absorbing the scope-classifier gates from #4781.
|
|
23
|
+
//
|
|
24
|
+
// Naming:
|
|
25
|
+
// - Artifact keys are STABLE strings (not paths). Path resolution is
|
|
26
|
+
// the composer's job; manifests describe intent, not disk layout.
|
|
27
|
+
// - Char budgets are nominal — blown budgets log a telemetry event,
|
|
28
|
+
// they do not truncate or error (the composer decides fallback).
|
|
29
|
+
|
|
30
|
+
// ─── Artifact registry ────────────────────────────────────────────────────
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Stable identifiers for every artifact class a unit might inline, excerpt,
|
|
34
|
+
* or reference on-demand. Adding a new artifact class requires (a) a key
|
|
35
|
+
* here, (b) path/body resolution in the composer, and (c) updates to any
|
|
36
|
+
* manifest that should surface it.
|
|
37
|
+
*/
|
|
38
|
+
export const ARTIFACT_KEYS = [
|
|
39
|
+
// Milestone-scoped
|
|
40
|
+
"roadmap",
|
|
41
|
+
"milestone-context",
|
|
42
|
+
"milestone-summary",
|
|
43
|
+
"milestone-validation",
|
|
44
|
+
"milestone-research",
|
|
45
|
+
"milestone-plan",
|
|
46
|
+
// Slice-scoped
|
|
47
|
+
"slice-context",
|
|
48
|
+
"slice-research",
|
|
49
|
+
"slice-plan",
|
|
50
|
+
"slice-summary",
|
|
51
|
+
"slice-uat",
|
|
52
|
+
"slice-assessment",
|
|
53
|
+
// Task-scoped
|
|
54
|
+
"task-plan",
|
|
55
|
+
"task-summary",
|
|
56
|
+
"prior-task-summaries",
|
|
57
|
+
"dependency-summaries",
|
|
58
|
+
// Project-scoped
|
|
59
|
+
"requirements",
|
|
60
|
+
"decisions",
|
|
61
|
+
"project",
|
|
62
|
+
"templates",
|
|
63
|
+
] as const;
|
|
64
|
+
|
|
65
|
+
export type ArtifactKey = typeof ARTIFACT_KEYS[number];
|
|
66
|
+
|
|
67
|
+
// ─── Policy types ─────────────────────────────────────────────────────────
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Skill catalog policy. `all` preserves today's default: the full catalog
|
|
71
|
+
* is stamped into the prompt. `allowlist` narrows to the named skills.
|
|
72
|
+
* `none` suppresses the catalog entirely.
|
|
73
|
+
*
|
|
74
|
+
* The allowlist mode pairs with `skill-manifest.ts` (#4779) — entries
|
|
75
|
+
* there are the source of truth for "which skills are dispatched for a
|
|
76
|
+
* unit type"; this manifest carries the policy shape so the composer
|
|
77
|
+
* can unify the two surfaces in phase 2.
|
|
78
|
+
*/
|
|
79
|
+
export type SkillsPolicy =
|
|
80
|
+
| { readonly mode: "none" }
|
|
81
|
+
| { readonly mode: "all" }
|
|
82
|
+
| { readonly mode: "allowlist"; readonly skills: readonly string[] };
|
|
83
|
+
|
|
84
|
+
/** Knowledge block policy — see `bootstrap/system-context.ts` loadKnowledgeBlock. */
|
|
85
|
+
export type KnowledgePolicy = "none" | "critical-only" | "scoped" | "full";
|
|
86
|
+
|
|
87
|
+
/** Memory store policy — see `bootstrap/system-context.ts` loadMemoryBlock. */
|
|
88
|
+
export type MemoryPolicy = "none" | "critical-only" | "prompt-relevant";
|
|
89
|
+
|
|
90
|
+
/** Preferences block policy. */
|
|
91
|
+
export type PreferencesPolicy = "none" | "active-only" | "full";
|
|
92
|
+
|
|
93
|
+
// ─── Computed-artifact registry (#4924 v2 contract) ───────────────────────
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Typed registry of computed-artifact ids → their per-call input shape.
|
|
97
|
+
*
|
|
98
|
+
* **This is the core anti-`extra: Record<string, unknown>` surface.** Each
|
|
99
|
+
* computed block a unit may emit is registered here with an explicit input
|
|
100
|
+
* type. Adding a new computed block requires extending this interface — a
|
|
101
|
+
* deliberate, reviewable change rather than a silent ad-hoc field.
|
|
102
|
+
*
|
|
103
|
+
* Consumers extend via module augmentation if a downstream package needs to
|
|
104
|
+
* register new computed ids (rare in-tree; no public API today). The repo's
|
|
105
|
+
* own computed blocks are declared inline below.
|
|
106
|
+
*
|
|
107
|
+
* Invariant: the value type for each id MUST be a plain serializable shape.
|
|
108
|
+
* No closures, no class instances, no `any`. If a builder needs framework
|
|
109
|
+
* state, declare the specific fields it needs — don't smuggle objects.
|
|
110
|
+
*/
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
112
|
+
export interface ComputedArtifactInputs {
|
|
113
|
+
// Phase 3.5 (v2 contract PR — #4924): no computed ids are registered yet.
|
|
114
|
+
// Each follow-up batch (slice prompt, replan-slice, gate-evaluate, etc.)
|
|
115
|
+
// adds the ids it needs as part of its migration commit.
|
|
116
|
+
//
|
|
117
|
+
// Example shape an upcoming batch will register:
|
|
118
|
+
// "slice-handoff-anchors": { sliceId: string; phase: string };
|
|
119
|
+
// "roadmap-excerpt": { milestoneId: string; aroundSlice: string };
|
|
120
|
+
// "graph-subgraph": { rootArtifact: ArtifactKey };
|
|
121
|
+
// "blocker-task-summary": { sliceId: string };
|
|
122
|
+
// "overrides-banner": { /* basePath via BaseResolverContext */ };
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Stable string ids for registered computed artifacts. */
|
|
126
|
+
export type ComputedArtifactId = keyof ComputedArtifactInputs & string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Always-present context the composer hands every computed-artifact builder.
|
|
130
|
+
* Carries unit-shape fields that don't belong in per-id input types because
|
|
131
|
+
* every builder needs them (path resolution, dispatch identity).
|
|
132
|
+
*/
|
|
133
|
+
export interface BaseResolverContext {
|
|
134
|
+
readonly unitType: string;
|
|
135
|
+
readonly basePath: string;
|
|
136
|
+
readonly milestoneId?: string;
|
|
137
|
+
readonly sliceId?: string;
|
|
138
|
+
readonly taskId?: string;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Builder signature for one computed artifact id. Returns the rendered
|
|
143
|
+
* block body (joined into the composed prompt at the manifest-declared
|
|
144
|
+
* position) or `null` to omit the block entirely.
|
|
145
|
+
*/
|
|
146
|
+
export type ComputedArtifactBuilder<K extends ComputedArtifactId> = (
|
|
147
|
+
inputs: ComputedArtifactInputs[K],
|
|
148
|
+
base: BaseResolverContext,
|
|
149
|
+
) => Promise<string | null>;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Per-call registry: for each computed id the manifest declares, the
|
|
153
|
+
* caller supplies the matching builder + the input value for this call.
|
|
154
|
+
*
|
|
155
|
+
* Runtime shape: `{ [id]: { build, inputs } }`. Type narrowing per key is
|
|
156
|
+
* handled inside the composer via the `ComputedArtifactInputs` map — calls
|
|
157
|
+
* stay type-safe across the registration boundary.
|
|
158
|
+
*/
|
|
159
|
+
export type ComputedArtifactRegistry = {
|
|
160
|
+
readonly [K in ComputedArtifactId]?: {
|
|
161
|
+
readonly build: ComputedArtifactBuilder<K>;
|
|
162
|
+
readonly inputs: ComputedArtifactInputs[K];
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// ─── Manifest ─────────────────────────────────────────────────────────────
|
|
167
|
+
|
|
168
|
+
export interface UnitContextManifest {
|
|
169
|
+
/** Skills catalog shape to surface. */
|
|
170
|
+
readonly skills: SkillsPolicy;
|
|
171
|
+
/** Knowledge block policy. */
|
|
172
|
+
readonly knowledge: KnowledgePolicy;
|
|
173
|
+
/** Memory store policy. */
|
|
174
|
+
readonly memory: MemoryPolicy;
|
|
175
|
+
/** Whether CODEBASE.md is inlined. */
|
|
176
|
+
readonly codebaseMap: boolean;
|
|
177
|
+
/** Preferences block policy. */
|
|
178
|
+
readonly preferences: PreferencesPolicy;
|
|
179
|
+
/** Artifact handling: inline (full body), excerpt (compact), or on-demand (path only). */
|
|
180
|
+
readonly artifacts: {
|
|
181
|
+
readonly inline: readonly ArtifactKey[];
|
|
182
|
+
readonly excerpt: readonly ArtifactKey[];
|
|
183
|
+
readonly onDemand: readonly ArtifactKey[];
|
|
184
|
+
/**
|
|
185
|
+
* Ordered list of computed-block ids emitted in the inline position
|
|
186
|
+
* (interleaved with `inline` in declared order — see composer for the
|
|
187
|
+
* exact merge rule). v2 contract addition (#4924). Unknown ids fail
|
|
188
|
+
* the manifest validator; absent registry entries are skipped silently.
|
|
189
|
+
*/
|
|
190
|
+
readonly computed?: readonly ComputedArtifactId[];
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Ordered list of computed-block ids emitted ABOVE the main inlined
|
|
194
|
+
* context block. Models the existing pattern of overrides / banners
|
|
195
|
+
* that some builders prepend with `inlined.unshift(...)`. v2 contract
|
|
196
|
+
* addition (#4924).
|
|
197
|
+
*/
|
|
198
|
+
readonly prepend?: readonly ComputedArtifactId[];
|
|
199
|
+
/**
|
|
200
|
+
* Nominal upper bound for composer-generated system prompt size, in
|
|
201
|
+
* characters. Phase 2 composer logs telemetry when a unit exceeds its
|
|
202
|
+
* budget; truncation is not enforced. Set conservatively — today's
|
|
203
|
+
* observed maxima come from `complete-milestone` (~1.2M tokens cached;
|
|
204
|
+
* ~4.8M chars) and `validate-milestone` (~300K tokens; ~1.2M chars).
|
|
205
|
+
*/
|
|
206
|
+
readonly maxSystemPromptChars: number;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// ─── Manifests ────────────────────────────────────────────────────────────
|
|
210
|
+
|
|
211
|
+
// Phase 1 policy: every manifest encodes today's behavior. Skills = "all"
|
|
212
|
+
// unless the unit type was already narrowed via the existing skill-manifest
|
|
213
|
+
// resolver (#4779). Memory/knowledge policies reflect the defaults in
|
|
214
|
+
// `bootstrap/system-context.ts`. Artifact classifications follow what
|
|
215
|
+
// `auto-prompts.ts` inlines today for each unit type.
|
|
216
|
+
|
|
217
|
+
const COMMON_BUDGET_LARGE = 1_500_000; // ~400K tokens
|
|
218
|
+
const COMMON_BUDGET_MEDIUM = 750_000; // ~200K tokens
|
|
219
|
+
const COMMON_BUDGET_SMALL = 250_000; // ~65K tokens
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Canonical unit types handled by auto-mode dispatch. The coverage test
|
|
223
|
+
* enumerates these against `UNIT_MANIFESTS` to catch manifest drift when
|
|
224
|
+
* a new unit type lands.
|
|
225
|
+
*/
|
|
226
|
+
export const KNOWN_UNIT_TYPES = [
|
|
227
|
+
"research-milestone",
|
|
228
|
+
"plan-milestone",
|
|
229
|
+
"discuss-milestone",
|
|
230
|
+
"validate-milestone",
|
|
231
|
+
"complete-milestone",
|
|
232
|
+
"research-slice",
|
|
233
|
+
"plan-slice",
|
|
234
|
+
"refine-slice",
|
|
235
|
+
"replan-slice",
|
|
236
|
+
"complete-slice",
|
|
237
|
+
"reassess-roadmap",
|
|
238
|
+
"execute-task",
|
|
239
|
+
"reactive-execute",
|
|
240
|
+
"run-uat",
|
|
241
|
+
"gate-evaluate",
|
|
242
|
+
"rewrite-docs",
|
|
243
|
+
] as const;
|
|
244
|
+
|
|
245
|
+
export type UnitType = typeof KNOWN_UNIT_TYPES[number];
|
|
246
|
+
|
|
247
|
+
export const UNIT_MANIFESTS: Record<UnitType, UnitContextManifest> = {
|
|
248
|
+
// ─── Milestone-scoped ────────────────────────────────────────────────
|
|
249
|
+
"research-milestone": {
|
|
250
|
+
skills: { mode: "all" },
|
|
251
|
+
knowledge: "full",
|
|
252
|
+
memory: "prompt-relevant",
|
|
253
|
+
codebaseMap: true,
|
|
254
|
+
preferences: "active-only",
|
|
255
|
+
artifacts: {
|
|
256
|
+
// Phase 3 migration (#4782): matches today's actual
|
|
257
|
+
// buildResearchMilestonePrompt inlining order.
|
|
258
|
+
inline: ["milestone-context", "project", "requirements", "decisions", "templates"],
|
|
259
|
+
excerpt: [],
|
|
260
|
+
onDemand: [],
|
|
261
|
+
},
|
|
262
|
+
maxSystemPromptChars: COMMON_BUDGET_MEDIUM,
|
|
263
|
+
},
|
|
264
|
+
"plan-milestone": {
|
|
265
|
+
skills: { mode: "all" },
|
|
266
|
+
knowledge: "full",
|
|
267
|
+
memory: "prompt-relevant",
|
|
268
|
+
codebaseMap: true,
|
|
269
|
+
preferences: "active-only",
|
|
270
|
+
artifacts: {
|
|
271
|
+
inline: ["project", "requirements", "decisions", "milestone-research", "templates"],
|
|
272
|
+
excerpt: [],
|
|
273
|
+
onDemand: [],
|
|
274
|
+
},
|
|
275
|
+
maxSystemPromptChars: COMMON_BUDGET_LARGE,
|
|
276
|
+
},
|
|
277
|
+
"discuss-milestone": {
|
|
278
|
+
skills: { mode: "all" },
|
|
279
|
+
knowledge: "full",
|
|
280
|
+
memory: "prompt-relevant",
|
|
281
|
+
codebaseMap: true,
|
|
282
|
+
preferences: "active-only",
|
|
283
|
+
artifacts: {
|
|
284
|
+
inline: ["project", "requirements", "decisions", "milestone-context", "templates"],
|
|
285
|
+
excerpt: [],
|
|
286
|
+
onDemand: [],
|
|
287
|
+
},
|
|
288
|
+
maxSystemPromptChars: COMMON_BUDGET_MEDIUM,
|
|
289
|
+
},
|
|
290
|
+
"validate-milestone": {
|
|
291
|
+
skills: { mode: "all" },
|
|
292
|
+
knowledge: "scoped",
|
|
293
|
+
memory: "prompt-relevant",
|
|
294
|
+
codebaseMap: false,
|
|
295
|
+
preferences: "active-only",
|
|
296
|
+
artifacts: {
|
|
297
|
+
inline: ["roadmap", "slice-summary", "slice-uat", "requirements", "decisions", "templates"],
|
|
298
|
+
excerpt: [],
|
|
299
|
+
onDemand: [],
|
|
300
|
+
},
|
|
301
|
+
maxSystemPromptChars: COMMON_BUDGET_LARGE,
|
|
302
|
+
},
|
|
303
|
+
"complete-milestone": {
|
|
304
|
+
skills: { mode: "all" },
|
|
305
|
+
knowledge: "scoped",
|
|
306
|
+
memory: "prompt-relevant",
|
|
307
|
+
codebaseMap: false,
|
|
308
|
+
preferences: "active-only",
|
|
309
|
+
artifacts: {
|
|
310
|
+
// #4780 landed slice-summary as excerpt for this unit; phase 2 of
|
|
311
|
+
// the architecture will read this manifest as the source of truth
|
|
312
|
+
// and retire the special-case wiring in auto-prompts.ts.
|
|
313
|
+
inline: ["roadmap", "milestone-context", "requirements", "decisions", "project", "templates"],
|
|
314
|
+
excerpt: ["slice-summary"],
|
|
315
|
+
onDemand: ["slice-summary"],
|
|
316
|
+
},
|
|
317
|
+
maxSystemPromptChars: COMMON_BUDGET_MEDIUM,
|
|
318
|
+
},
|
|
319
|
+
|
|
320
|
+
// ─── Slice-scoped ────────────────────────────────────────────────────
|
|
321
|
+
"research-slice": {
|
|
322
|
+
skills: { mode: "all" },
|
|
323
|
+
knowledge: "full",
|
|
324
|
+
memory: "prompt-relevant",
|
|
325
|
+
codebaseMap: true,
|
|
326
|
+
preferences: "active-only",
|
|
327
|
+
artifacts: {
|
|
328
|
+
inline: ["roadmap", "milestone-research", "dependency-summaries", "templates"],
|
|
329
|
+
excerpt: [],
|
|
330
|
+
onDemand: [],
|
|
331
|
+
},
|
|
332
|
+
maxSystemPromptChars: COMMON_BUDGET_MEDIUM,
|
|
333
|
+
},
|
|
334
|
+
"plan-slice": {
|
|
335
|
+
skills: { mode: "all" },
|
|
336
|
+
knowledge: "full",
|
|
337
|
+
memory: "prompt-relevant",
|
|
338
|
+
codebaseMap: true,
|
|
339
|
+
preferences: "active-only",
|
|
340
|
+
artifacts: {
|
|
341
|
+
inline: ["roadmap", "slice-research", "dependency-summaries", "requirements", "decisions", "templates"],
|
|
342
|
+
excerpt: [],
|
|
343
|
+
onDemand: [],
|
|
344
|
+
},
|
|
345
|
+
maxSystemPromptChars: COMMON_BUDGET_LARGE,
|
|
346
|
+
},
|
|
347
|
+
"refine-slice": {
|
|
348
|
+
skills: { mode: "all" },
|
|
349
|
+
knowledge: "scoped",
|
|
350
|
+
memory: "prompt-relevant",
|
|
351
|
+
codebaseMap: true,
|
|
352
|
+
preferences: "active-only",
|
|
353
|
+
artifacts: {
|
|
354
|
+
inline: ["slice-plan", "slice-research", "dependency-summaries", "templates"],
|
|
355
|
+
excerpt: [],
|
|
356
|
+
onDemand: [],
|
|
357
|
+
},
|
|
358
|
+
maxSystemPromptChars: COMMON_BUDGET_MEDIUM,
|
|
359
|
+
},
|
|
360
|
+
"replan-slice": {
|
|
361
|
+
skills: { mode: "all" },
|
|
362
|
+
knowledge: "scoped",
|
|
363
|
+
memory: "prompt-relevant",
|
|
364
|
+
codebaseMap: true,
|
|
365
|
+
preferences: "active-only",
|
|
366
|
+
artifacts: {
|
|
367
|
+
inline: ["slice-plan", "slice-research", "dependency-summaries", "prior-task-summaries", "templates"],
|
|
368
|
+
excerpt: [],
|
|
369
|
+
onDemand: [],
|
|
370
|
+
},
|
|
371
|
+
maxSystemPromptChars: COMMON_BUDGET_MEDIUM,
|
|
372
|
+
},
|
|
373
|
+
"complete-slice": {
|
|
374
|
+
skills: { mode: "all" },
|
|
375
|
+
knowledge: "scoped",
|
|
376
|
+
memory: "prompt-relevant",
|
|
377
|
+
codebaseMap: false,
|
|
378
|
+
preferences: "active-only",
|
|
379
|
+
artifacts: {
|
|
380
|
+
// Phase 3 migration (#4782): matches today's actual
|
|
381
|
+
// buildCompleteSlicePrompt inlining order. Overrides prepend +
|
|
382
|
+
// knowledge splice stay in the builder imperatively (see RFC
|
|
383
|
+
// #4924 — computed/prepend blocks are phase-4 composer work).
|
|
384
|
+
inline: ["roadmap", "slice-context", "slice-plan", "requirements", "prior-task-summaries", "templates"],
|
|
385
|
+
excerpt: [],
|
|
386
|
+
onDemand: [],
|
|
387
|
+
},
|
|
388
|
+
maxSystemPromptChars: COMMON_BUDGET_LARGE,
|
|
389
|
+
},
|
|
390
|
+
"reassess-roadmap": {
|
|
391
|
+
skills: { mode: "all" },
|
|
392
|
+
knowledge: "scoped",
|
|
393
|
+
memory: "critical-only",
|
|
394
|
+
codebaseMap: false,
|
|
395
|
+
preferences: "none",
|
|
396
|
+
artifacts: {
|
|
397
|
+
// Phase 2 pilot (#4782): manifest now matches today's actual
|
|
398
|
+
// buildReassessRoadmapPrompt behavior for equivalence. Phase 3
|
|
399
|
+
// will tighten this list once the composer reports real telemetry.
|
|
400
|
+
inline: ["roadmap", "slice-context", "slice-summary", "project", "requirements", "decisions"],
|
|
401
|
+
excerpt: [],
|
|
402
|
+
onDemand: [],
|
|
403
|
+
},
|
|
404
|
+
maxSystemPromptChars: COMMON_BUDGET_MEDIUM,
|
|
405
|
+
},
|
|
406
|
+
|
|
407
|
+
// ─── Task-scoped ─────────────────────────────────────────────────────
|
|
408
|
+
"execute-task": {
|
|
409
|
+
skills: { mode: "all" },
|
|
410
|
+
knowledge: "scoped",
|
|
411
|
+
memory: "prompt-relevant",
|
|
412
|
+
codebaseMap: true,
|
|
413
|
+
preferences: "active-only",
|
|
414
|
+
artifacts: {
|
|
415
|
+
inline: ["task-plan", "slice-plan", "prior-task-summaries", "templates"],
|
|
416
|
+
excerpt: [],
|
|
417
|
+
onDemand: ["slice-research"],
|
|
418
|
+
},
|
|
419
|
+
maxSystemPromptChars: COMMON_BUDGET_LARGE,
|
|
420
|
+
},
|
|
421
|
+
"reactive-execute": {
|
|
422
|
+
skills: { mode: "all" },
|
|
423
|
+
knowledge: "scoped",
|
|
424
|
+
memory: "prompt-relevant",
|
|
425
|
+
codebaseMap: true,
|
|
426
|
+
preferences: "active-only",
|
|
427
|
+
artifacts: {
|
|
428
|
+
inline: ["slice-plan", "prior-task-summaries", "templates"],
|
|
429
|
+
excerpt: [],
|
|
430
|
+
onDemand: ["slice-research"],
|
|
431
|
+
},
|
|
432
|
+
maxSystemPromptChars: COMMON_BUDGET_LARGE,
|
|
433
|
+
},
|
|
434
|
+
|
|
435
|
+
// ─── Ancillary units ─────────────────────────────────────────────────
|
|
436
|
+
"run-uat": {
|
|
437
|
+
skills: { mode: "all" },
|
|
438
|
+
knowledge: "critical-only",
|
|
439
|
+
memory: "critical-only",
|
|
440
|
+
codebaseMap: false,
|
|
441
|
+
preferences: "active-only",
|
|
442
|
+
artifacts: {
|
|
443
|
+
// Phase 3 migration (#4782): manifest matches today's actual
|
|
444
|
+
// buildRunUatPrompt inlining. Prior phase-1 entry listed
|
|
445
|
+
// `slice-plan` aspirationally — the real builder inlines the UAT
|
|
446
|
+
// file, the slice SUMMARY (optional), and the project row.
|
|
447
|
+
inline: ["slice-uat", "slice-summary", "project"],
|
|
448
|
+
excerpt: [],
|
|
449
|
+
onDemand: [],
|
|
450
|
+
},
|
|
451
|
+
maxSystemPromptChars: COMMON_BUDGET_SMALL,
|
|
452
|
+
},
|
|
453
|
+
"gate-evaluate": {
|
|
454
|
+
skills: { mode: "all" },
|
|
455
|
+
knowledge: "critical-only",
|
|
456
|
+
memory: "critical-only",
|
|
457
|
+
codebaseMap: false,
|
|
458
|
+
preferences: "active-only",
|
|
459
|
+
artifacts: {
|
|
460
|
+
inline: ["slice-plan", "prior-task-summaries"],
|
|
461
|
+
excerpt: [],
|
|
462
|
+
onDemand: [],
|
|
463
|
+
},
|
|
464
|
+
maxSystemPromptChars: COMMON_BUDGET_SMALL,
|
|
465
|
+
},
|
|
466
|
+
"rewrite-docs": {
|
|
467
|
+
skills: { mode: "all" },
|
|
468
|
+
knowledge: "scoped",
|
|
469
|
+
memory: "prompt-relevant",
|
|
470
|
+
codebaseMap: true,
|
|
471
|
+
preferences: "active-only",
|
|
472
|
+
artifacts: {
|
|
473
|
+
inline: ["project", "requirements", "decisions", "templates"],
|
|
474
|
+
excerpt: [],
|
|
475
|
+
onDemand: [],
|
|
476
|
+
},
|
|
477
|
+
maxSystemPromptChars: COMMON_BUDGET_MEDIUM,
|
|
478
|
+
},
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
// ─── Lookup helper ────────────────────────────────────────────────────────
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Return the manifest for a unit type, or null when the type is unknown.
|
|
485
|
+
*
|
|
486
|
+
* Callers MUST treat null as "fall through to today's default behavior"
|
|
487
|
+
* rather than erroring — unknown unit types may be experimental and
|
|
488
|
+
* should not crash the composer.
|
|
489
|
+
*/
|
|
490
|
+
export function resolveManifest(unitType: string): UnitContextManifest | null {
|
|
491
|
+
return (UNIT_MANIFESTS as Record<string, UnitContextManifest>)[unitType] ?? null;
|
|
492
|
+
}
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
nativeWorktreePrune,
|
|
38
38
|
nativeWorktreeRemove,
|
|
39
39
|
} from "./native-git-bridge.js";
|
|
40
|
+
import { emitCanonicalRootRedirect } from "./worktree-telemetry.js";
|
|
40
41
|
|
|
41
42
|
// ─── Types ─────────────────────────────────────────────────────────────────
|
|
42
43
|
|
|
@@ -132,6 +133,58 @@ export function isInsideWorktreesDir(basePath: string, targetPath: string): bool
|
|
|
132
133
|
return resolved === wtDir || resolved.startsWith(wtDir + sep);
|
|
133
134
|
}
|
|
134
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Return the canonical path from which a milestone's artifacts should be read.
|
|
138
|
+
*
|
|
139
|
+
* If a live git worktree exists for this milestone at `.gsd/worktrees/<MID>/`
|
|
140
|
+
* (directory present AND a `.git` file indicating a registered worktree),
|
|
141
|
+
* returns that worktree path. Otherwise returns `basePath` unchanged.
|
|
142
|
+
*
|
|
143
|
+
* Readers that cross the session/worktree boundary (validators, the bootstrap
|
|
144
|
+
* audit, cross-session state queries) should route through this helper so they
|
|
145
|
+
* don't silently read stale project-root state while live work sits in the
|
|
146
|
+
* worktree. Writers and tools whose contract is "operate on the path I was
|
|
147
|
+
* given" should NOT use this helper — they preserve the legacy behavior.
|
|
148
|
+
*
|
|
149
|
+
* A stale worktree directory (no `.git` file) is treated as absent. The
|
|
150
|
+
* createWorktree() path already cleans these up, but readers must not trust
|
|
151
|
+
* them in the window before cleanup runs.
|
|
152
|
+
*
|
|
153
|
+
* Fixes #4761. Used by the #4762 audit for the pre-completion orphan case.
|
|
154
|
+
*/
|
|
155
|
+
export function resolveCanonicalMilestoneRoot(
|
|
156
|
+
basePath: string,
|
|
157
|
+
milestoneId: string,
|
|
158
|
+
): string {
|
|
159
|
+
if (!milestoneId || /[\/\\]|\.\./.test(milestoneId)) return basePath;
|
|
160
|
+
|
|
161
|
+
const wtPath = worktreePath(basePath, milestoneId);
|
|
162
|
+
if (!existsSync(wtPath)) return basePath;
|
|
163
|
+
|
|
164
|
+
// A registered git worktree has a .git *file* (not directory) containing
|
|
165
|
+
// "gitdir: <path>". A standalone .git directory indicates a copied repo
|
|
166
|
+
// or nested standalone repo — not a worktree registered with this project —
|
|
167
|
+
// and must not be treated as the canonical root.
|
|
168
|
+
const gitPath = join(wtPath, ".git");
|
|
169
|
+
if (!existsSync(gitPath)) return basePath;
|
|
170
|
+
try {
|
|
171
|
+
const stat = lstatSync(gitPath);
|
|
172
|
+
if (!stat.isFile()) return basePath;
|
|
173
|
+
} catch {
|
|
174
|
+
return basePath;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// #4764 — record the redirect so we can measure how often the #4761 fix
|
|
178
|
+
// would have mattered. Best-effort; emit is silent on any failure.
|
|
179
|
+
try {
|
|
180
|
+
emitCanonicalRootRedirect(basePath, milestoneId, wtPath);
|
|
181
|
+
} catch (err) {
|
|
182
|
+
logWarning("worktree", `canonical-root-redirect telemetry failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return wtPath;
|
|
186
|
+
}
|
|
187
|
+
|
|
135
188
|
// ─── Core Operations ───────────────────────────────────────────────────────
|
|
136
189
|
|
|
137
190
|
/**
|