gsd-pi 2.66.1-dev.ed243f2 → 2.67.0
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/claude-cli-check.d.ts +8 -0
- package/dist/claude-cli-check.js +36 -0
- package/dist/cli.js +40 -0
- package/dist/onboarding.js +19 -2
- package/dist/resources/extensions/ask-user-questions.js +79 -11
- package/dist/resources/extensions/claude-code-cli/partial-builder.js +4 -3
- package/dist/resources/extensions/claude-code-cli/readiness.js +63 -12
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +10 -3
- package/dist/resources/extensions/gsd/auto/loop.js +13 -1
- package/dist/resources/extensions/gsd/auto/phases.js +22 -3
- package/dist/resources/extensions/gsd/auto/run-unit.js +10 -2
- package/dist/resources/extensions/gsd/auto/session.js +1 -1
- package/dist/resources/extensions/gsd/auto-dashboard.js +65 -15
- package/dist/resources/extensions/gsd/auto-dispatch.js +30 -28
- package/dist/resources/extensions/gsd/auto-model-selection.js +12 -3
- package/dist/resources/extensions/gsd/auto-prompts.js +173 -25
- package/dist/resources/extensions/gsd/auto-recovery.js +11 -12
- package/dist/resources/extensions/gsd/auto.js +13 -1
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +32 -1
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +18 -6
- package/dist/resources/extensions/gsd/bootstrap/provider-error-resume.js +5 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +59 -5
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +8 -5
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +186 -14
- package/dist/resources/extensions/gsd/codebase-generator.js +4 -0
- package/dist/resources/extensions/gsd/commands/handlers/core.js +3 -3
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +10 -4
- package/dist/resources/extensions/gsd/context-store.js +134 -2
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +3 -1
- package/dist/resources/extensions/gsd/detection.js +6 -0
- package/dist/resources/extensions/gsd/files.js +19 -2
- package/dist/resources/extensions/gsd/guided-flow.js +12 -8
- package/dist/resources/extensions/gsd/index.js +1 -1
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +2 -0
- package/dist/resources/extensions/gsd/parsers-legacy.js +3 -1
- package/dist/resources/extensions/gsd/preferences.js +6 -1
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/discuss-prepared.md +7 -7
- package/dist/resources/extensions/gsd/prompts/discuss.md +3 -3
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +3 -3
- package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +3 -1
- package/dist/resources/extensions/gsd/prompts/rethink.md +6 -2
- package/dist/resources/extensions/gsd/prompts/system.md +1 -1
- package/dist/resources/extensions/gsd/prompts/triage-captures.md +1 -1
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +4 -4
- package/dist/resources/extensions/gsd/prompts/worktree-merge.md +3 -1
- package/dist/resources/extensions/gsd/safety/file-change-validator.js +2 -1
- package/dist/resources/extensions/gsd/state.js +2 -1
- package/dist/resources/extensions/gsd/visualizer-overlay.js +27 -26
- package/dist/resources/extensions/gsd/workflow-reconcile.js +46 -7
- package/dist/resources/extensions/remote-questions/manager.js +8 -0
- package/dist/resources/extensions/shared/interview-ui.js +10 -0
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +14 -14
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/required-server-files.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +2 -2
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +14 -14
- package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
- package/dist/web/standalone/.next/server/chunks/7471.js +3 -3
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware.js +2 -2
- package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +2 -2
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-f2a7482d42a5614b.js → page-2f24283c162b6ab3.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-a16c7a7ecdf0c2cf.js → layout-9ecfd95f343793f0.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-62be3b5fa91e4c8f.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +1 -0
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/server.js +1 -1
- package/package.json +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +4 -3
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/utils/json-parse.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/json-parse.js +11 -1
- package/packages/pi-ai/dist/utils/json-parse.js.map +1 -1
- package/packages/pi-ai/dist/utils/repair-tool-json.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/repair-tool-json.js +60 -1
- package/packages/pi-ai/dist/utils/repair-tool-json.js.map +1 -1
- package/packages/pi-ai/dist/utils/tests/json-parse.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/tests/json-parse.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/tests/json-parse.test.js +14 -0
- package/packages/pi-ai/dist/utils/tests/json-parse.test.js.map +1 -0
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js +10 -0
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js.map +1 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +4 -3
- package/packages/pi-ai/src/utils/json-parse.ts +11 -1
- package/packages/pi-ai/src/utils/repair-tool-json.ts +69 -1
- package/packages/pi-ai/src/utils/tests/json-parse.test.ts +17 -0
- package/packages/pi-ai/src/utils/tests/repair-tool-json.test.ts +13 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +3 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +16 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js +58 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js +58 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +3 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/provider-display-name.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/provider-display-name.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/provider-display-name.test.js +17 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/provider-display-name.test.js.map +1 -0
- 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 +2 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +9 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.js +2 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/provider-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js +2 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +2 -2
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +4 -0
- package/packages/pi-coding-agent/src/core/retry-handler.test.ts +69 -0
- package/packages/pi-coding-agent/src/core/retry-handler.ts +66 -1
- package/packages/pi-coding-agent/src/core/sdk.ts +5 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/provider-display-name.test.ts +18 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +2 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +11 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/provider-manager.ts +2 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/scoped-models-selector.ts +2 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +2 -2
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js +13 -0
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js.map +1 -1
- package/packages/pi-tui/dist/__tests__/stdin-buffer.test.d.ts +2 -0
- package/packages/pi-tui/dist/__tests__/stdin-buffer.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/__tests__/stdin-buffer.test.js +35 -0
- package/packages/pi-tui/dist/__tests__/stdin-buffer.test.js.map +1 -0
- package/packages/pi-tui/dist/__tests__/tui.test.d.ts +2 -0
- package/packages/pi-tui/dist/__tests__/tui.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/__tests__/tui.test.js +43 -0
- package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -0
- package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/packages/pi-tui/dist/autocomplete.js +9 -7
- package/packages/pi-tui/dist/autocomplete.js.map +1 -1
- package/packages/pi-tui/dist/components/__tests__/editor.test.d.ts +2 -0
- package/packages/pi-tui/dist/components/__tests__/editor.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/__tests__/editor.test.js +54 -0
- package/packages/pi-tui/dist/components/__tests__/editor.test.js.map +1 -0
- package/packages/pi-tui/dist/components/editor.d.ts +3 -1
- package/packages/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/editor.js +14 -3
- package/packages/pi-tui/dist/components/editor.js.map +1 -1
- package/packages/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
- package/packages/pi-tui/dist/stdin-buffer.js +6 -0
- package/packages/pi-tui/dist/stdin-buffer.js.map +1 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +8 -0
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/__tests__/autocomplete.test.ts +15 -0
- package/packages/pi-tui/src/__tests__/stdin-buffer.test.ts +43 -0
- package/packages/pi-tui/src/__tests__/tui.test.ts +50 -0
- package/packages/pi-tui/src/autocomplete.ts +9 -7
- package/packages/pi-tui/src/components/__tests__/editor.test.ts +64 -0
- package/packages/pi-tui/src/components/editor.ts +14 -3
- package/packages/pi-tui/src/stdin-buffer.ts +7 -0
- package/packages/pi-tui/src/tui.ts +9 -0
- package/pkg/package.json +1 -1
- package/src/resources/extensions/ask-user-questions.ts +103 -11
- package/src/resources/extensions/claude-code-cli/partial-builder.ts +4 -3
- package/src/resources/extensions/claude-code-cli/readiness.ts +67 -12
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +12 -3
- package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +17 -0
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +18 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +2 -1
- package/src/resources/extensions/gsd/auto/loop.ts +14 -1
- package/src/resources/extensions/gsd/auto/phases.ts +27 -4
- package/src/resources/extensions/gsd/auto/run-unit.ts +14 -2
- package/src/resources/extensions/gsd/auto/session.ts +1 -1
- package/src/resources/extensions/gsd/auto-dashboard.ts +76 -16
- package/src/resources/extensions/gsd/auto-dispatch.ts +36 -35
- package/src/resources/extensions/gsd/auto-model-selection.ts +12 -3
- package/src/resources/extensions/gsd/auto-prompts.ts +195 -25
- package/src/resources/extensions/gsd/auto-recovery.ts +15 -15
- package/src/resources/extensions/gsd/auto.ts +12 -1
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +34 -1
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +27 -6
- package/src/resources/extensions/gsd/bootstrap/provider-error-resume.ts +6 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +67 -6
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +11 -8
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +209 -16
- package/src/resources/extensions/gsd/codebase-generator.ts +4 -0
- package/src/resources/extensions/gsd/commands/handlers/core.ts +6 -6
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +11 -4
- package/src/resources/extensions/gsd/context-store.ts +167 -2
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +3 -1
- package/src/resources/extensions/gsd/detection.ts +6 -0
- package/src/resources/extensions/gsd/files.ts +21 -2
- package/src/resources/extensions/gsd/guided-flow.ts +15 -8
- package/src/resources/extensions/gsd/index.ts +6 -0
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +2 -0
- package/src/resources/extensions/gsd/parsers-legacy.ts +3 -1
- package/src/resources/extensions/gsd/preferences.ts +6 -1
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/discuss-prepared.md +7 -7
- package/src/resources/extensions/gsd/prompts/discuss.md +3 -3
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +3 -3
- package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +3 -1
- package/src/resources/extensions/gsd/prompts/rethink.md +6 -2
- package/src/resources/extensions/gsd/prompts/system.md +1 -1
- package/src/resources/extensions/gsd/prompts/triage-captures.md +1 -1
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +4 -4
- package/src/resources/extensions/gsd/prompts/worktree-merge.md +3 -1
- package/src/resources/extensions/gsd/safety/file-change-validator.ts +4 -1
- package/src/resources/extensions/gsd/state.ts +2 -1
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +52 -1
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +50 -2
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +21 -7
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/codebase-generator.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/context-store.test.ts +176 -0
- package/src/resources/extensions/gsd/tests/core-overlay-fallback.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/decision-scope-cascade.test.ts +370 -0
- package/src/resources/extensions/gsd/tests/detection.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/file-change-validator.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/gsd-tools.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/guided-flow-session-isolation.test.ts +34 -0
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts +53 -13
- package/src/resources/extensions/gsd/tests/integration/state-machine-runtime-failures.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/measurement.test.ts +531 -0
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +3 -4
- package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/parallel-research-dispatch.test.ts +71 -2
- package/src/resources/extensions/gsd/tests/parsers.test.ts +25 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +8 -1
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +60 -0
- package/src/resources/extensions/gsd/tests/queue-execution-guard.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/reactive-graph.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/register-shortcuts.test.ts +73 -0
- package/src/resources/extensions/gsd/tests/remote-questions.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/visualizer-overlay.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/workflow-reconcile.test.ts +91 -0
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +210 -35
- package/src/resources/extensions/gsd/visualizer-overlay.ts +31 -27
- package/src/resources/extensions/gsd/workflow-reconcile.ts +59 -8
- package/src/resources/extensions/remote-questions/manager.ts +9 -0
- package/src/resources/extensions/shared/interview-ui.ts +13 -0
- package/dist/web/standalone/.next/static/chunks/app/page-0c485498795110d6.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +0 -1
- /package/dist/web/standalone/.next/static/{HAq0VE4k68rhRvJbQL1VW → DFZllMYDbO0OwyS6FSvm5}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{HAq0VE4k68rhRvJbQL1VW → DFZllMYDbO0OwyS6FSvm5}/_ssgManifest.js +0 -0
|
@@ -490,6 +490,8 @@ export class ParallelMonitorOverlay {
|
|
|
490
490
|
|
|
491
491
|
// Apply scroll — use terminal rows as height estimate
|
|
492
492
|
const termHeight = process.stdout.rows || 40;
|
|
493
|
+
const maxScroll = Math.max(0, lines.length - termHeight);
|
|
494
|
+
this.scrollOffset = Math.min(Math.max(this.scrollOffset, 0), maxScroll);
|
|
493
495
|
const visible = lines.slice(this.scrollOffset, this.scrollOffset + termHeight);
|
|
494
496
|
this.cachedLines = visible;
|
|
495
497
|
return visible;
|
|
@@ -210,7 +210,9 @@ function _parsePlanImpl(content: string): SlicePlan {
|
|
|
210
210
|
for (const line of lines) {
|
|
211
211
|
const cbMatch = line.match(/^-\s+\[([ xX])\]\s+\*\*([\w.]+):\s+(.+?)\*\*\s*(.*)/);
|
|
212
212
|
// Heading-style: ### T01 -- Title, ### T01: Title, ### T01 — Title
|
|
213
|
-
const hdMatch = !cbMatch
|
|
213
|
+
const hdMatch = !cbMatch
|
|
214
|
+
? line.match(/^#{2,4}\s+([A-Z]+\d+(?:\.[A-Z]+\d+)*)\s*(?:--|—|:)\s*(.+)/)
|
|
215
|
+
: null;
|
|
214
216
|
if (cbMatch || hdMatch) {
|
|
215
217
|
const taskId = cbMatch ? cbMatch[2] : hdMatch![1];
|
|
216
218
|
// Skip tasks already found in the Tasks section
|
|
@@ -200,11 +200,13 @@ function loadPreferencesFile(path: string, scope: "global" | "project"): LoadedG
|
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
let _warnedUnrecognizedFormat = false;
|
|
203
|
+
let _warnedSectionParse = false;
|
|
203
204
|
|
|
204
205
|
/** @internal Reset the warn-once flags — exported for testing only. */
|
|
205
206
|
export function _resetParseWarningFlag(): void {
|
|
206
207
|
_warnedUnrecognizedFormat = false;
|
|
207
208
|
_warnedFrontmatterParse = false;
|
|
209
|
+
_warnedSectionParse = false;
|
|
208
210
|
}
|
|
209
211
|
|
|
210
212
|
/** @internal Exported for testing only */
|
|
@@ -309,7 +311,10 @@ function parseHeadingListFormat(content: string): GSDPreferences {
|
|
|
309
311
|
|
|
310
312
|
typed[targetSection] = value;
|
|
311
313
|
} catch (e) {
|
|
312
|
-
|
|
314
|
+
if (!_warnedSectionParse) {
|
|
315
|
+
_warnedSectionParse = true;
|
|
316
|
+
logWarning("guided", `preferences section parse failed: ${(e as Error).message}`);
|
|
317
|
+
}
|
|
313
318
|
}
|
|
314
319
|
}
|
|
315
320
|
|
|
@@ -63,6 +63,6 @@ Then:
|
|
|
63
63
|
13. Do not commit manually — the system auto-commits your changes after this unit completes.
|
|
64
64
|
- Say: "Milestone {{milestoneId}} complete."
|
|
65
65
|
|
|
66
|
-
**Important:** Do NOT skip the code change verification, success criteria, or definition of done verification (steps 3-5). The milestone summary must reflect actual verified outcomes, not assumed success. Verification failures BLOCK completion — there is no override. The milestone stays in its current state until issues are resolved and verification is re-run.
|
|
66
|
+
**Important:** Do NOT skip the code change verification, success criteria, or definition of done verification (steps 3-5). The milestone summary must reflect actual verified outcomes, not assumed success. Verification failures BLOCK completion — there is no override. The milestone stays in its current state until issues are resolved and verification is re-run. **If a verification tool itself fails, errors, or returns unexpected output, treat it as a verification failure** — never rationalize past a tool error ("tool didn't respond, assuming success" is forbidden). A tool that cannot verify is a tool that did not verify.
|
|
67
67
|
|
|
68
68
|
**File system safety:** When scanning milestone directories for evidence, use `ls` or `find` to list directory contents first — never pass a directory path (e.g. `tasks/`, `slices/`) directly to the `read` tool. The `read` tool only accepts file paths, not directories.
|
|
@@ -109,7 +109,7 @@ Options:
|
|
|
109
109
|
- "Needs adjustment" — user will clarify, then re-present scope
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
**Do NOT proceed to Layer 2 until the user explicitly approves the scope
|
|
112
|
+
**CRITICAL — Non-bypassable gate:** Do NOT proceed to Layer 2 until the user explicitly approves the scope. If `ask_user_questions` fails, errors, returns no response, or the user's response does not match a provided option, you MUST re-ask — never rationalize past the block. "Tool not responding, I'll proceed," "auth issues," or "I'll use my recommended scope" are all **forbidden**. The gate exists to protect the user's work; treat a block as an instruction to wait, not an obstacle to work around.
|
|
113
113
|
|
|
114
114
|
---
|
|
115
115
|
|
|
@@ -120,7 +120,7 @@ Before presenting Layer 2 findings, use your available web search tools to resea
|
|
|
120
120
|
1. Search for "[technology] [version] best practices [current year]"
|
|
121
121
|
2. Search for "[technology] [version] known issues"
|
|
122
122
|
|
|
123
|
-
Summarize findings concisely. If
|
|
123
|
+
Summarize findings concisely. If search tools fail or are unavailable, note this and proceed using your training knowledge — but do NOT use a search failure as justification to skip any gate.
|
|
124
124
|
|
|
125
125
|
Present ecosystem findings at the start of Layer 2 alongside your architecture recommendation.
|
|
126
126
|
|
|
@@ -180,7 +180,7 @@ Options:
|
|
|
180
180
|
- "Want to adjust" — user will clarify, then re-present architecture
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
**Do NOT proceed to Layer 3 until the user explicitly approves the architecture
|
|
183
|
+
**CRITICAL — Non-bypassable gate:** Do NOT proceed to Layer 3 until the user explicitly approves the architecture. If `ask_user_questions` fails, errors, returns no response, or the user's response does not match a provided option, you MUST re-ask — never rationalize past the block. The gate exists to protect the user's work; treat a block as an instruction to wait, not an obstacle to work around.
|
|
184
184
|
|
|
185
185
|
---
|
|
186
186
|
|
|
@@ -243,7 +243,7 @@ Options:
|
|
|
243
243
|
- "Want to adjust error handling" — user will clarify, then re-present errors
|
|
244
244
|
```
|
|
245
245
|
|
|
246
|
-
**Do NOT proceed to Layer 4 until the user explicitly approves error handling
|
|
246
|
+
**CRITICAL — Non-bypassable gate:** Do NOT proceed to Layer 4 until the user explicitly approves error handling. If `ask_user_questions` fails, errors, returns no response, or the user's response does not match a provided option, you MUST re-ask — never rationalize past the block. The gate exists to protect the user's work; treat a block as an instruction to wait, not an obstacle to work around.
|
|
247
247
|
|
|
248
248
|
---
|
|
249
249
|
|
|
@@ -297,7 +297,7 @@ Options:
|
|
|
297
297
|
- "Want to adjust the quality bar" — user will clarify, then re-present quality
|
|
298
298
|
```
|
|
299
299
|
|
|
300
|
-
**Do NOT proceed to Output Phase until the user explicitly approves the quality bar
|
|
300
|
+
**CRITICAL — Non-bypassable gate:** Do NOT proceed to Output Phase until the user explicitly approves the quality bar. If `ask_user_questions` fails, errors, returns no response, or the user's response does not match a provided option, you MUST re-ask — never rationalize past the block. The gate exists to protect the user's work; treat a block as an instruction to wait, not an obstacle to work around.
|
|
301
301
|
|
|
302
302
|
---
|
|
303
303
|
|
|
@@ -315,13 +315,13 @@ Before writing a roadmap, produce or update `.gsd/REQUIREMENTS.md`.
|
|
|
315
315
|
|
|
316
316
|
Use it as the project's explicit capability contract. Requirements discovered during the 4-layer discussion should be captured here with source `user` or `inferred` as appropriate.
|
|
317
317
|
|
|
318
|
-
**Print the requirements in chat before writing the roadmap.** Print a markdown table with columns: ID, Title, Status, Owner, Source. Group by status (Active, Deferred, Out of Scope). After the table, ask: "Confirm, adjust, or add?"
|
|
318
|
+
**Print the requirements in chat before writing the roadmap.** Print a markdown table with columns: ID, Title, Status, Owner, Source. Group by status (Active, Deferred, Out of Scope). After the table, ask: "Confirm, adjust, or add?" **Non-bypassable:** If the user does not respond or gives an ambiguous answer, you MUST re-ask — never proceed to roadmap creation without explicit requirement confirmation.
|
|
319
319
|
|
|
320
320
|
### Roadmap Preview
|
|
321
321
|
|
|
322
322
|
Before writing any files, **print the planned roadmap in chat** so the user can see and approve it. Print a markdown table with columns: Slice, Title, Risk, Depends, Demo. One row per slice. Below the table, print the milestone definition of done as a bullet list.
|
|
323
323
|
|
|
324
|
-
If the user raises a substantive objection, adjust the roadmap. Otherwise, present the roadmap and ask: "Ready to write, or want to adjust?" — one gate, not two.
|
|
324
|
+
If the user raises a substantive objection, adjust the roadmap. Otherwise, present the roadmap and ask: "Ready to write, or want to adjust?" — one gate, not two. **Non-bypassable:** If the user does not respond or gives an ambiguous answer, you MUST re-ask — never write files without explicit approval. A missing response is not a "yes."
|
|
325
325
|
|
|
326
326
|
### Naming Convention
|
|
327
327
|
|
|
@@ -173,7 +173,7 @@ For multi-milestone projects, requirements should span the full vision. Requirem
|
|
|
173
173
|
|
|
174
174
|
If the project is new or has no `REQUIREMENTS.md`, surface candidate requirements in chat before writing the roadmap. Ask for correction only on material omissions, wrong ownership, or wrong scope. If the user has already been specific and raises no substantive objection, treat the requirement set as confirmed and continue.
|
|
175
175
|
|
|
176
|
-
**Print the requirements in chat before writing the roadmap.** Do not say "here are the requirements" and then only write them to a file. The user must see them in the terminal. Print a markdown table with columns: ID, Title, Status, Owner, Source. Group by status (Active, Deferred, Out of Scope). After the table, ask: "Confirm, adjust, or add?"
|
|
176
|
+
**Print the requirements in chat before writing the roadmap.** Do not say "here are the requirements" and then only write them to a file. The user must see them in the terminal. Print a markdown table with columns: ID, Title, Status, Owner, Source. Group by status (Active, Deferred, Out of Scope). After the table, ask: "Confirm, adjust, or add?" **Non-bypassable:** If the user does not respond or gives an ambiguous answer, you MUST re-ask — never proceed to roadmap creation without explicit requirement confirmation.
|
|
177
177
|
|
|
178
178
|
## Scope Assessment
|
|
179
179
|
|
|
@@ -185,7 +185,7 @@ Before moving to output, confirm the size estimate from your reflection still ho
|
|
|
185
185
|
|
|
186
186
|
Before writing any files, **print the planned roadmap in chat** so the user can see and approve it. Print a markdown table with columns: Slice, Title, Risk, Depends, Demo. One row per slice. Below the table, print the milestone definition of done as a bullet list.
|
|
187
187
|
|
|
188
|
-
If the user raises a substantive objection, adjust the roadmap. Otherwise, present the roadmap and ask: "Ready to write, or want to adjust?" — one gate, not two.
|
|
188
|
+
If the user raises a substantive objection, adjust the roadmap. Otherwise, present the roadmap and ask: "Ready to write, or want to adjust?" — one gate, not two. **Non-bypassable:** If the user does not respond or gives an ambiguous answer, you MUST re-ask — never write files without explicit approval. A missing response is not a "yes."
|
|
189
189
|
|
|
190
190
|
### Naming Convention
|
|
191
191
|
|
|
@@ -242,7 +242,7 @@ If a milestone has no dependencies, omit the frontmatter. The dependency chain f
|
|
|
242
242
|
|
|
243
243
|
#### Phase 3: Sequential readiness gate for remaining milestones
|
|
244
244
|
|
|
245
|
-
For each remaining milestone **one at a time, in sequence**, decide the most likely readiness mode from the evidence you already have, then use `ask_user_questions` to let the user correct that recommendation. Present three options:
|
|
245
|
+
For each remaining milestone **one at a time, in sequence**, decide the most likely readiness mode from the evidence you already have, then use `ask_user_questions` to let the user correct that recommendation. **Non-bypassable:** If `ask_user_questions` fails, errors, returns no response, or the user's response does not match a provided option, you MUST re-ask — never rationalize past the block or auto-select a readiness mode. Present three options:
|
|
246
246
|
|
|
247
247
|
- **"Discuss now"** — The user wants to conduct a focused discussion for this milestone in the current session, while the context from the broader discussion is still fresh. Proceed with a focused discussion for this milestone (reflection → investigation → questioning → depth verification). When the discussion concludes, write a full `CONTEXT.md`. Then move to the gate for the next milestone.
|
|
248
248
|
- **"Write draft for later"** — This milestone has seed material from the current conversation but needs its own dedicated discussion in a future session. Write a `CONTEXT-DRAFT.md` capturing the seed material (what was discussed, key ideas, provisional scope, open questions). Mark it clearly as a draft, not a finalized context. **What happens downstream:** When auto-mode reaches this milestone, it pauses and notifies the user: "M00x has draft context — needs discussion. Run /gsd." The `/gsd` wizard shows a "Discuss from draft" option that seeds the new discussion with this draft, so nothing from the current conversation is lost. After the dedicated discussion produces a full CONTEXT.md, the draft file is automatically deleted.
|
|
@@ -92,15 +92,15 @@ Before moving to the wrap-up gate, verify you have covered:
|
|
|
92
92
|
- header: "Depth Check"
|
|
93
93
|
- question: "Did I capture the depth right?"
|
|
94
94
|
- options: "Yes, you got it (Recommended)", "Not quite — let me clarify"
|
|
95
|
-
- **The question ID must contain `depth_verification
|
|
95
|
+
- **The question ID must contain `depth_verification` and the milestone id** (e.g. `depth_verification_{{milestoneId}}_confirm`) — this enables the write-gate downstream and keeps verification scoped to the milestone being discussed.
|
|
96
96
|
|
|
97
|
-
**If `{{structuredQuestionsAvailable}}` is `false`:** ask in plain text: "Did I capture that correctly? If not, tell me what I missed." Wait for confirmation before proceeding.
|
|
97
|
+
**If `{{structuredQuestionsAvailable}}` is `false`:** ask in plain text: "Did I capture that correctly? If not, tell me what I missed." Wait for explicit confirmation before proceeding. **The same non-bypassable gate applies to the plain-text path** — if the user does not respond, gives an ambiguous answer, or does not explicitly confirm, you MUST re-ask. Never rationalize past a missing confirmation.
|
|
98
98
|
|
|
99
99
|
If they clarify, absorb the correction and re-verify.
|
|
100
100
|
|
|
101
101
|
The depth verification is the only required confirmation gate. Do not add a second "ready to proceed?" gate after it.
|
|
102
102
|
|
|
103
|
-
**CRITICAL — Non-bypassable gate:** The system mechanically blocks CONTEXT.md writes until the user selects the "(Recommended)" option. If the user declines, cancels, or the tool fails, you MUST re-ask — never rationalize past the block ("tool not responding, I'll proceed" is forbidden). The gate exists to protect the user's work; treat a block as an instruction, not an obstacle to work around.
|
|
103
|
+
**CRITICAL — Non-bypassable gate:** The system mechanically blocks CONTEXT.md writes until the user selects the "(Recommended)" option (structured path) or explicitly confirms (plain-text path). If the user declines, cancels, does not respond, or the tool fails, you MUST re-ask — never rationalize past the block ("tool not responding, I'll proceed" is forbidden). The gate exists to protect the user's work; treat a block as an instruction, not an obstacle to work around.
|
|
104
104
|
|
|
105
105
|
---
|
|
106
106
|
|
|
@@ -41,11 +41,13 @@ After each round of answers, decide whether you already have enough signal to wr
|
|
|
41
41
|
- Ask a single wrap-up question only when you genuinely believe the slice is well understood or the user signals they want to stop.
|
|
42
42
|
- When you do ask it, offer two choices: "Write the context file" *(recommended when the slice is well understood)* or "One more pass". Use `ask_user_questions` if available, otherwise ask in plain text.
|
|
43
43
|
|
|
44
|
+
**CRITICAL — Non-bypassable gate:** Do NOT write the context file until the user explicitly selects "Write the context file." If `ask_user_questions` fails, errors, returns no response, or the user's response does not match a provided option, you MUST re-ask — never rationalize past the block. "Tool not responding, I'll proceed," "auth issues," or "the slice seems well understood, I'll write it" are all **forbidden**. The gate exists to protect the user's work; treat a block as an instruction to wait, not an obstacle to work around.
|
|
45
|
+
|
|
44
46
|
---
|
|
45
47
|
|
|
46
48
|
## Output
|
|
47
49
|
|
|
48
|
-
Once the user
|
|
50
|
+
Once the user has explicitly confirmed they are ready to write the context file:
|
|
49
51
|
|
|
50
52
|
1. Use the **Slice Context** output template below
|
|
51
53
|
2. `mkdir -p {{sliceDirPath}}`
|
|
@@ -12,7 +12,7 @@ You are a project reorganization assistant for a GSD (Get Shit Done) project. Th
|
|
|
12
12
|
|
|
13
13
|
1. Present the current milestone order as a clear numbered list with status indicators (e.g. ✅ complete, ▶ active, ⏳ pending, ⏸ parked)
|
|
14
14
|
2. Ask: **"What would you like to change?"**
|
|
15
|
-
3. Execute changes conversationally, confirming destructive operations before proceeding
|
|
15
|
+
3. Execute changes conversationally, confirming destructive operations before proceeding. **Non-bypassable:** For any destructive operation (discard, skip, reorder that breaks dependencies), you MUST get explicit user confirmation before executing. If the user does not respond, gives an ambiguous answer, or `ask_user_questions` fails, you MUST re-ask — never rationalize past the block. A missing confirmation is a "do not proceed."
|
|
16
16
|
|
|
17
17
|
## Supported Operations
|
|
18
18
|
|
|
@@ -53,8 +53,12 @@ gsd_skip_slice({ milestoneId: "M003", sliceId: "S02", reason: "Descoped — feat
|
|
|
53
53
|
Skipped slices are treated as closed by the state machine (like "complete" but distinct). Use when a slice is no longer needed or has been superseded. The slice data is preserved for reference.
|
|
54
54
|
**Do NOT** just check the slice checkbox in the roadmap — this does not update the DB and auto-mode will resume the slice.
|
|
55
55
|
|
|
56
|
+
**CRITICAL — Non-bypassable gate:** Skipping a slice is a permanent DB operation. You MUST confirm with the user before calling `gsd_skip_slice`. If the user does not respond or gives an ambiguous answer, you MUST re-ask — never proceed without explicit approval.
|
|
57
|
+
|
|
56
58
|
### Discard a milestone
|
|
57
|
-
**Permanently** delete a milestone directory and prune it from QUEUE-ORDER.json.
|
|
59
|
+
**Permanently** delete a milestone directory and prune it from QUEUE-ORDER.json.
|
|
60
|
+
|
|
61
|
+
**CRITICAL — Non-bypassable gate:** Discarding is irreversible. You MUST confirm with the user before discarding. Warn explicitly if the milestone has completed work. If the user does not respond or gives an ambiguous answer, you MUST re-ask — never rationalize past the block. A missing confirmation is a "do not discard."
|
|
58
62
|
|
|
59
63
|
### Add a new milestone
|
|
60
64
|
Use the `gsd_milestone_generate_id` tool to get the next ID, then call `gsd_summary_save` with `milestone_id: {ID}`, `artifact_type: "CONTEXT"`, and the scope/goals/success criteria as `content` — the tool writes the context file to disk and persists to DB. Update QUEUE-ORDER.json to place it at the desired position.
|
|
@@ -38,7 +38,7 @@ GSD ships with bundled skills. Load the relevant skill file with the `read` tool
|
|
|
38
38
|
- Never print, echo, log, or restate secrets or credentials. Report only key names and applied/skipped status.
|
|
39
39
|
- Never ask the user to edit `.env` files or set secrets manually. Use `secure_env_collect`.
|
|
40
40
|
- In enduring files, write current state only unless the file is explicitly historical.
|
|
41
|
-
- **Never take outward-facing actions on GitHub (or any external service) without explicit user confirmation.** This includes: creating issues, closing issues, merging PRs, approving PRs, posting comments, pushing to remote branches, publishing packages, or any other action that affects state outside the local filesystem. Read-only operations (listing, viewing, diffing) are fine. Always present what you intend to do and get a clear "yes" before executing.
|
|
41
|
+
- **Never take outward-facing actions on GitHub (or any external service) without explicit user confirmation.** This includes: creating issues, closing issues, merging PRs, approving PRs, posting comments, pushing to remote branches, publishing packages, or any other action that affects state outside the local filesystem. Read-only operations (listing, viewing, diffing) are fine. Always present what you intend to do and get a clear "yes" before executing. **Non-bypassable:** If the user does not respond, gives an ambiguous answer, or `ask_user_questions` fails, you MUST re-ask — never rationalize past the block ("tool not responding, I'll proceed" is forbidden). A missing "yes" is a "no."
|
|
42
42
|
|
|
43
43
|
If a `GSD Skill Preferences` block is present below this contract, treat it as explicit durable guidance for which skills to use, prefer, or avoid during GSD work. Follow it where it does not conflict with required GSD artifact rules, verification requirements, or higher-priority system/developer instructions.
|
|
44
44
|
|
|
@@ -51,7 +51,7 @@ For each capture, classify it as one of:
|
|
|
51
51
|
|
|
52
52
|
For captures classified as **note** or **defer**, auto-confirm without asking — these are low-impact.
|
|
53
53
|
For captures classified as **stop** or **backtrack**, auto-confirm without asking — these are urgent user directives that must be honored immediately.
|
|
54
|
-
For captures classified as **quick-task**, **inject**, or **replan**, ask the user to confirm or choose a different classification.
|
|
54
|
+
For captures classified as **quick-task**, **inject**, or **replan**, ask the user to confirm or choose a different classification. **Non-bypassable:** If `ask_user_questions` fails, errors, or the user does not respond, you MUST re-ask — never auto-confirm these classifications without explicit user approval.
|
|
55
55
|
|
|
56
56
|
3. **Update** `.gsd/CAPTURES.md` — for each capture, update its section with the confirmed classification:
|
|
57
57
|
- Change `**Status:** pending` to `**Status:** resolved`
|
|
@@ -14,7 +14,7 @@ This is remediation round {{remediationRound}}. If this is round 0, this is the
|
|
|
14
14
|
|
|
15
15
|
## Context
|
|
16
16
|
|
|
17
|
-
All relevant context has been preloaded below — the roadmap, all slice summaries,
|
|
17
|
+
All relevant context has been preloaded below — the roadmap, all slice summaries, assessment results, requirements, decisions, and project context are inlined. Start working immediately without re-reading these files.
|
|
18
18
|
|
|
19
19
|
{{inlinedContext}}
|
|
20
20
|
|
|
@@ -30,8 +30,8 @@ Prompt: "Review milestone {{milestoneId}} requirements coverage. Working directo
|
|
|
30
30
|
**Reviewer B — Cross-Slice Integration**
|
|
31
31
|
Prompt: "Review milestone {{milestoneId}} cross-slice integration. Working directory: {{workingDirectory}}. Read `{{roadmapPath}}` and find the boundary map (produces/consumes contracts). For each boundary, check that the producing slice's SUMMARY confirms it produced the artifact, and the consuming slice's SUMMARY confirms it consumed it. Output a markdown table: Boundary | Producer Summary | Consumer Summary | Status. End with a one-line verdict: PASS if all boundaries honored, NEEDS-ATTENTION if any gaps."
|
|
32
32
|
|
|
33
|
-
**Reviewer C —
|
|
34
|
-
Prompt: "Review milestone {{milestoneId}}
|
|
33
|
+
**Reviewer C — Assessment & Acceptance Criteria**
|
|
34
|
+
Prompt: "Review milestone {{milestoneId}} assessment evidence and acceptance criteria. Working directory: {{workingDirectory}}. Read `.gsd/{{milestoneId}}/CONTEXT.md` for acceptance criteria. Check for ASSESSMENT files in each slice directory. Verify each acceptance criterion maps to either a passing assessment result or clear SUMMARY evidence. Output a checklist: [ ] Criterion | Evidence. End with a one-line verdict: PASS if all criteria met, NEEDS-ATTENTION if gaps exist."
|
|
35
35
|
|
|
36
36
|
### Step 2 — Synthesize Findings
|
|
37
37
|
|
|
@@ -59,7 +59,7 @@ reviewers: 3
|
|
|
59
59
|
## Reviewer B — Cross-Slice Integration
|
|
60
60
|
<paste Reviewer B output>
|
|
61
61
|
|
|
62
|
-
## Reviewer C —
|
|
62
|
+
## Reviewer C — Assessment & Acceptance Criteria
|
|
63
63
|
<paste Reviewer C output>
|
|
64
64
|
|
|
65
65
|
## Synthesis
|
|
@@ -90,9 +90,11 @@ Present a merge plan to the user:
|
|
|
90
90
|
|
|
91
91
|
Ask the user to confirm the merge plan before proceeding.
|
|
92
92
|
|
|
93
|
+
**CRITICAL — Non-bypassable gate:** Do NOT execute any merge commands until the user explicitly approves the merge plan. If `ask_user_questions` fails, errors, returns no response, or the user's response is ambiguous, you MUST re-ask — never rationalize past the block. "No response, I'll proceed with the clean merges," "the plan looks safe, merging," or any other self-authorization is **forbidden**. The gate exists to protect the user's branches; treat a block as an instruction to wait, not an obstacle to work around.
|
|
94
|
+
|
|
93
95
|
### Step 4: Execute Merge
|
|
94
96
|
|
|
95
|
-
Once confirmed, run all commands from `{{mainTreePath}}` (your CWD):
|
|
97
|
+
Once the user has explicitly confirmed, run all commands from `{{mainTreePath}}` (your CWD):
|
|
96
98
|
|
|
97
99
|
1. Ensure you are on the target branch: `git checkout {{mainBranch}}`
|
|
98
100
|
2. If there are conflicts requiring manual reconciliation, apply the reconciled versions first
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { execFileSync } from "node:child_process";
|
|
13
|
+
import { normalizePlannedFileReference } from "../files.js";
|
|
13
14
|
import { logWarning } from "../workflow-logger.js";
|
|
14
15
|
|
|
15
16
|
// ─── Types ──────────────────────────────────────────────────────────────────
|
|
@@ -57,7 +58,9 @@ export function validateFileChanges(
|
|
|
57
58
|
|
|
58
59
|
// Normalize expected paths (strip leading ./ or /)
|
|
59
60
|
const normalizedExpected = new Set(
|
|
60
|
-
[...allExpected].map(f =>
|
|
61
|
+
[...allExpected].map((f) =>
|
|
62
|
+
normalizePlannedFileReference(f).replace(/^\.\//, "").replace(/^\//, ""),
|
|
63
|
+
),
|
|
61
64
|
);
|
|
62
65
|
|
|
63
66
|
// Compute symmetric difference
|
|
@@ -1317,7 +1317,8 @@ export async function _deriveStateImpl(basePath: string): Promise<GSDState> {
|
|
|
1317
1317
|
? `All milestones complete. ${activeReqs} active requirement${activeReqs === 1 ? '' : 's'} in REQUIREMENTS.md ${activeReqs === 1 ? 'has' : 'have'} not been mapped to a milestone.`
|
|
1318
1318
|
: 'All milestones complete.';
|
|
1319
1319
|
return {
|
|
1320
|
-
activeMilestone:
|
|
1320
|
+
activeMilestone: null,
|
|
1321
|
+
lastCompletedMilestone: lastEntry ? { id: lastEntry.id, title: lastEntry.title } : null,
|
|
1321
1322
|
activeSlice: null,
|
|
1322
1323
|
activeTask: null,
|
|
1323
1324
|
phase: 'complete',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import test from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
|
-
import { readFileSync } from "node:fs";
|
|
3
|
+
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
5
6
|
|
|
6
7
|
import {
|
|
7
8
|
unitVerb,
|
|
@@ -11,11 +12,29 @@ import {
|
|
|
11
12
|
formatWidgetTokens,
|
|
12
13
|
estimateTimeRemaining,
|
|
13
14
|
extractUatSliceId,
|
|
15
|
+
getWidgetMode,
|
|
16
|
+
cycleWidgetMode,
|
|
17
|
+
_resetWidgetModeForTests,
|
|
14
18
|
} from "../auto-dashboard.ts";
|
|
15
19
|
|
|
16
20
|
const autoSource = readFileSync(join(process.cwd(), "src", "resources", "extensions", "gsd", "auto.ts"), "utf-8");
|
|
17
21
|
const dashboardSource = readFileSync(join(process.cwd(), "src", "resources", "extensions", "gsd", "auto-dashboard.ts"), "utf-8");
|
|
18
22
|
|
|
23
|
+
function makeTempDir(prefix: string): string {
|
|
24
|
+
return join(
|
|
25
|
+
tmpdir(),
|
|
26
|
+
`gsd-auto-dashboard-test-${prefix}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function cleanup(dir: string): void {
|
|
31
|
+
try {
|
|
32
|
+
rmSync(dir, { recursive: true, force: true });
|
|
33
|
+
} catch {
|
|
34
|
+
// best-effort
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
19
38
|
// ─── unitVerb ─────────────────────────────────────────────────────────────
|
|
20
39
|
|
|
21
40
|
test("unitVerb maps known unit types to verbs", () => {
|
|
@@ -209,3 +228,35 @@ test("extractUatSliceId returns null for invalid formats", () => {
|
|
|
209
228
|
assert.equal(extractUatSliceId(""), null);
|
|
210
229
|
assert.equal(extractUatSliceId("M001/T01"), null);
|
|
211
230
|
});
|
|
231
|
+
|
|
232
|
+
test("widget mode respects project preference precedence and persists there", (t) => {
|
|
233
|
+
const homeDir = makeTempDir("home");
|
|
234
|
+
const projectDir = makeTempDir("project");
|
|
235
|
+
const globalPrefsPath = join(homeDir, ".gsd", "preferences.md");
|
|
236
|
+
const projectPrefsPath = join(projectDir, ".gsd", "preferences.md");
|
|
237
|
+
|
|
238
|
+
mkdirSync(join(homeDir, ".gsd"), { recursive: true });
|
|
239
|
+
mkdirSync(join(projectDir, ".gsd"), { recursive: true });
|
|
240
|
+
writeFileSync(globalPrefsPath, "---\nversion: 1\nwidget_mode: off\n---\n", "utf-8");
|
|
241
|
+
writeFileSync(projectPrefsPath, "---\nversion: 1\nwidget_mode: small\n---\n", "utf-8");
|
|
242
|
+
|
|
243
|
+
t.after(() => {
|
|
244
|
+
cleanup(homeDir);
|
|
245
|
+
cleanup(projectDir);
|
|
246
|
+
_resetWidgetModeForTests();
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
_resetWidgetModeForTests();
|
|
250
|
+
|
|
251
|
+
assert.equal(getWidgetMode(projectPrefsPath, globalPrefsPath), "small", "project widget_mode overrides global");
|
|
252
|
+
assert.equal(
|
|
253
|
+
cycleWidgetMode(projectPrefsPath, globalPrefsPath),
|
|
254
|
+
"min",
|
|
255
|
+
"cycling advances from the project-owned mode",
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
const projectPrefs = readFileSync(projectPrefsPath, "utf-8");
|
|
259
|
+
const globalPrefs = readFileSync(globalPrefsPath, "utf-8");
|
|
260
|
+
assert.match(projectPrefs, /widget_mode:\s*min/);
|
|
261
|
+
assert.match(globalPrefs, /widget_mode:\s*off/);
|
|
262
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import test from "node:test";
|
|
1
|
+
import test, { mock } from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { resolve } from "node:path";
|
|
@@ -191,6 +191,54 @@ test("runUnit returns cancelled when session creation times out", async () => {
|
|
|
191
191
|
assert.equal(pi.calls.length, 0);
|
|
192
192
|
});
|
|
193
193
|
|
|
194
|
+
test("runUnit keeps the session-switch guard across a late newSession settlement", async () => {
|
|
195
|
+
_resetPendingResolve();
|
|
196
|
+
mock.timers.enable();
|
|
197
|
+
|
|
198
|
+
try {
|
|
199
|
+
const ctx = makeMockCtx();
|
|
200
|
+
const pi = makeMockPi();
|
|
201
|
+
// Use delays longer than NEW_SESSION_TIMEOUT_MS (120s) so the timeout fires
|
|
202
|
+
const firstSession = makeMockSession({ newSessionDelayMs: 200_000 });
|
|
203
|
+
const secondSession = makeMockSession({ newSessionDelayMs: 200_000 });
|
|
204
|
+
|
|
205
|
+
const firstRun = runUnit(ctx, pi, firstSession, "task", "T01", "prompt");
|
|
206
|
+
|
|
207
|
+
// Tick past the 120s session timeout
|
|
208
|
+
mock.timers.tick(121_000);
|
|
209
|
+
await Promise.resolve();
|
|
210
|
+
|
|
211
|
+
const firstResult = await firstRun;
|
|
212
|
+
assert.equal(firstResult.status, "cancelled");
|
|
213
|
+
assert.equal(isSessionSwitchInFlight(), true, "guard should remain set after the timed-out session");
|
|
214
|
+
|
|
215
|
+
mock.timers.tick(1);
|
|
216
|
+
const secondRun = runUnit(ctx, pi, secondSession, "task", "T02", "prompt");
|
|
217
|
+
|
|
218
|
+
mock.timers.tick(100_000);
|
|
219
|
+
await Promise.resolve();
|
|
220
|
+
assert.equal(
|
|
221
|
+
isSessionSwitchInFlight(),
|
|
222
|
+
true,
|
|
223
|
+
"late settlement from the first session must not clear the newer session guard",
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
// Tick past the second session's timeout (121s total > 120s NEW_SESSION_TIMEOUT_MS)
|
|
227
|
+
mock.timers.tick(21_001);
|
|
228
|
+
await Promise.resolve();
|
|
229
|
+
|
|
230
|
+
const secondResult = await secondRun;
|
|
231
|
+
assert.equal(secondResult.status, "cancelled");
|
|
232
|
+
|
|
233
|
+
// Tick past the second session's delayed promise (200s) so .finally() fires
|
|
234
|
+
mock.timers.tick(80_000);
|
|
235
|
+
await Promise.resolve();
|
|
236
|
+
assert.equal(isSessionSwitchInFlight(), false, "guard should clear after the newer session settles");
|
|
237
|
+
} finally {
|
|
238
|
+
mock.timers.reset();
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
194
242
|
test("runUnit returns cancelled when s.active is false before sendMessage", async () => {
|
|
195
243
|
_resetPendingResolve();
|
|
196
244
|
|
|
@@ -412,7 +460,7 @@ function makeMockDeps(
|
|
|
412
460
|
getCurrentBranch: () => "main",
|
|
413
461
|
autoWorktreeBranch: () => "auto/M001",
|
|
414
462
|
resolveMilestoneFile: () => null,
|
|
415
|
-
reconcileMergeState: () =>
|
|
463
|
+
reconcileMergeState: () => "clean",
|
|
416
464
|
getLedger: () => null,
|
|
417
465
|
getProjectTotals: () => ({ cost: 0 }),
|
|
418
466
|
formatCost: (c: number) => `$${c.toFixed(2)}`,
|
|
@@ -143,17 +143,17 @@ test("resolvePreferredModelConfig keeps explicit phase models as the ceiling", (
|
|
|
143
143
|
|
|
144
144
|
// ─── resolveModelId tests ─────────────────────────────────────────────────
|
|
145
145
|
|
|
146
|
-
test("resolveModelId: bare ID resolves to
|
|
146
|
+
test("resolveModelId: bare ID resolves to claude-code when session is claude-code (#3772)", () => {
|
|
147
147
|
const availableModels = [
|
|
148
148
|
{ id: "claude-sonnet-4-6", provider: "anthropic" },
|
|
149
149
|
{ id: "claude-sonnet-4-6", provider: "claude-code" },
|
|
150
150
|
];
|
|
151
151
|
|
|
152
|
-
//
|
|
153
|
-
//
|
|
152
|
+
// When currentProvider is "claude-code" (set by startup migration for subscription
|
|
153
|
+
// users), bare IDs must resolve to claude-code to avoid the third-party block (#3772).
|
|
154
154
|
const result = resolveModelId("claude-sonnet-4-6", availableModels, "claude-code");
|
|
155
155
|
assert.ok(result, "should resolve a model");
|
|
156
|
-
assert.equal(result.provider, "
|
|
156
|
+
assert.equal(result.provider, "claude-code", "bare ID must resolve to claude-code when session provider is claude-code");
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
test("resolveModelId: bare ID still prefers current provider when it is a first-class API provider", () => {
|
|
@@ -227,14 +227,28 @@ test("model change notify in selectAndApplyModel is gated behind verbose flag",
|
|
|
227
227
|
);
|
|
228
228
|
});
|
|
229
229
|
|
|
230
|
-
test("resolveModelId: anthropic wins over claude-code
|
|
230
|
+
test("resolveModelId: anthropic wins over claude-code when session provider is not claude-code", () => {
|
|
231
231
|
const availableModels = [
|
|
232
232
|
{ id: "claude-sonnet-4-6", provider: "claude-code" },
|
|
233
233
|
{ id: "claude-sonnet-4-6", provider: "anthropic" },
|
|
234
234
|
];
|
|
235
235
|
|
|
236
|
-
//
|
|
236
|
+
// When the session is NOT on claude-code, bare IDs should resolve to
|
|
237
|
+
// the canonical anthropic provider (original #2905 behavior preserved).
|
|
238
|
+
const result = resolveModelId("claude-sonnet-4-6", availableModels, undefined);
|
|
239
|
+
assert.ok(result, "should resolve a model");
|
|
240
|
+
assert.equal(result.provider, "anthropic", "anthropic must win when session is not claude-code");
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
test("resolveModelId: claude-code wins when session is claude-code regardless of list order", () => {
|
|
244
|
+
const availableModels = [
|
|
245
|
+
{ id: "claude-sonnet-4-6", provider: "claude-code" },
|
|
246
|
+
{ id: "claude-sonnet-4-6", provider: "anthropic" },
|
|
247
|
+
];
|
|
248
|
+
|
|
249
|
+
// When session provider is claude-code (subscription user migration), it must
|
|
250
|
+
// win regardless of candidate ordering to avoid the third-party block (#3772).
|
|
237
251
|
const result = resolveModelId("claude-sonnet-4-6", availableModels, "claude-code");
|
|
238
252
|
assert.ok(result, "should resolve a model");
|
|
239
|
-
assert.equal(result.provider, "
|
|
253
|
+
assert.equal(result.provider, "claude-code", "claude-code must win when it is the session provider");
|
|
240
254
|
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import test, { afterEach } from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { mkdtempSync, mkdirSync, rmSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
6
|
+
|
|
7
|
+
import { verifyExpectedArtifact } from "../auto-recovery.ts";
|
|
8
|
+
import { openDatabase, closeDatabase, insertMilestone, insertSlice, insertGateRow } from "../gsd-db.ts";
|
|
9
|
+
|
|
10
|
+
const tmpDirs: string[] = [];
|
|
11
|
+
|
|
12
|
+
function makeTmpProject(): string {
|
|
13
|
+
const dir = mkdtempSync(join(tmpdir(), "auto-recovery-"));
|
|
14
|
+
mkdirSync(join(dir, ".gsd"), { recursive: true });
|
|
15
|
+
openDatabase(join(dir, ".gsd", "gsd.db"));
|
|
16
|
+
insertMilestone({ id: "M001", title: "Test Milestone", status: "active" });
|
|
17
|
+
insertSlice({
|
|
18
|
+
milestoneId: "M001",
|
|
19
|
+
id: "S01",
|
|
20
|
+
title: "Test Slice",
|
|
21
|
+
status: "pending",
|
|
22
|
+
risk: "low",
|
|
23
|
+
depends: [],
|
|
24
|
+
});
|
|
25
|
+
insertGateRow({ milestoneId: "M001", sliceId: "S01", gateId: "Q3", scope: "slice" });
|
|
26
|
+
tmpDirs.push(dir);
|
|
27
|
+
return dir;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
afterEach(() => {
|
|
31
|
+
closeDatabase();
|
|
32
|
+
for (const dir of tmpDirs) {
|
|
33
|
+
try {
|
|
34
|
+
rmSync(dir, { recursive: true, force: true });
|
|
35
|
+
} catch {
|
|
36
|
+
// Best-effort cleanup only.
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
tmpDirs.length = 0;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test("verifyExpectedArtifact checks pending gate-evaluate artifacts without ESM require failures", () => {
|
|
43
|
+
const base = makeTmpProject();
|
|
44
|
+
|
|
45
|
+
const verified = verifyExpectedArtifact("gate-evaluate", "M001/S01/gates+Q3", base);
|
|
46
|
+
|
|
47
|
+
assert.equal(verified, false, "pending gates should keep gate-evaluate unverified");
|
|
48
|
+
});
|
|
@@ -138,6 +138,28 @@ test("generateCodebaseMap: excludes .gsd/ files", () => {
|
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
|
|
141
|
+
test("generateCodebaseMap: excludes .claude/ and other tool directories", () => {
|
|
142
|
+
const base = makeTmpRepo();
|
|
143
|
+
try {
|
|
144
|
+
addFile(base, "src/main.ts");
|
|
145
|
+
addFile(base, ".claude/CLAUDE.md");
|
|
146
|
+
addFile(base, ".claude/memory/user.md");
|
|
147
|
+
addFile(base, ".plans/plan.md");
|
|
148
|
+
addFile(base, ".cursor/settings.json");
|
|
149
|
+
addFile(base, ".vscode/settings.json");
|
|
150
|
+
|
|
151
|
+
const result = generateCodebaseMap(base);
|
|
152
|
+
assert.ok(result.content.includes("`src/main.ts`"), "should include src/main.ts");
|
|
153
|
+
assert.ok(!result.content.includes("CLAUDE.md"), "should exclude .claude/ files");
|
|
154
|
+
assert.ok(!result.content.includes("user.md"), "should exclude .claude/memory/ files");
|
|
155
|
+
assert.ok(!result.content.includes(".plans"), "should exclude .plans/ files");
|
|
156
|
+
assert.ok(!result.content.includes(".cursor"), "should exclude .cursor/ files");
|
|
157
|
+
assert.ok(!result.content.includes(".vscode"), "should exclude .vscode/ files");
|
|
158
|
+
} finally {
|
|
159
|
+
cleanup(base);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
|
|
141
163
|
test("generateCodebaseMap: excludes binary and lock files", () => {
|
|
142
164
|
const base = makeTmpRepo();
|
|
143
165
|
try {
|