gsd-pi 2.80.0-dev.c5f2443b3 → 2.80.0-dev.e51d2c88c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +2 -2
- package/dist/resources/extensions/github-sync/templates.js +39 -8
- package/dist/resources/extensions/gsd/auto/loop.js +48 -10
- package/dist/resources/extensions/gsd/auto/phases.js +66 -45
- package/dist/resources/extensions/gsd/auto/resolve.js +17 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +32 -16
- package/dist/resources/extensions/gsd/auto-dashboard.js +51 -15
- package/dist/resources/extensions/gsd/auto-dispatch.js +10 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +10 -10
- package/dist/resources/extensions/gsd/auto-prompts.js +124 -2
- package/dist/resources/extensions/gsd/auto-recovery.js +197 -9
- package/dist/resources/extensions/gsd/auto-start.js +2 -3
- package/dist/resources/extensions/gsd/auto-supervisor.js +8 -1
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +2 -2
- package/dist/resources/extensions/gsd/auto.js +75 -5
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +36 -3
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +27 -20
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +32 -1
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +129 -1
- package/dist/resources/extensions/gsd/clean-root-preflight.js +42 -4
- package/dist/resources/extensions/gsd/commands/dispatcher.js +5 -0
- package/dist/resources/extensions/gsd/commands-extract-learnings.js +17 -12
- package/dist/resources/extensions/gsd/context-budget.js +37 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +56 -10
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +22 -2
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +39 -0
- package/dist/resources/extensions/gsd/db-base-schema.js +18 -2
- package/dist/resources/extensions/gsd/db-migration-steps.js +22 -0
- package/dist/resources/extensions/gsd/detection.js +106 -0
- package/dist/resources/extensions/gsd/graph.js +9 -3
- package/dist/resources/extensions/gsd/gsd-db.js +146 -13
- package/dist/resources/extensions/gsd/guided-flow.js +82 -16
- package/dist/resources/extensions/gsd/memory-store.js +69 -12
- package/dist/resources/extensions/gsd/migrate/command.js +40 -1
- package/dist/resources/extensions/gsd/migration-auto-check.js +87 -0
- package/dist/resources/extensions/gsd/planning-path-scope.js +26 -0
- package/dist/resources/extensions/gsd/pr-evidence.js +57 -16
- package/dist/resources/extensions/gsd/prompt-loader.js +28 -2
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +19 -19
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/quick-task.md +1 -5
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
- package/dist/resources/extensions/gsd/quick.js +34 -2
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +10 -2
- package/dist/resources/extensions/gsd/tools/context-mode-tool-result.js +15 -0
- package/dist/resources/extensions/gsd/tools/exec-search-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/exec-tool.js +3 -15
- package/dist/resources/extensions/gsd/tools/memory-tools.js +1 -0
- package/dist/resources/extensions/gsd/tools/plan-slice.js +9 -0
- package/dist/resources/extensions/gsd/tools/plan-task.js +9 -0
- package/dist/resources/extensions/gsd/tools/resume-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +1 -1
- package/dist/resources/extensions/gsd/unit-context-composer.js +12 -3
- package/dist/resources/extensions/gsd/unit-runtime.js +22 -0
- package/dist/resources/extensions/gsd/working-output-messages.js +64 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +16 -14
- 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 +11 -11
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.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/api/onboarding/route.js +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 +11 -11
- package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/{8336.6f6f30e410419aff.js → 8336.631939fb583761fa.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/{webpack-d82dbee6356c1733.js → webpack-0481f1221120a7c6.js} +1 -1
- package/package.json +12 -8
- package/packages/contracts/package.json +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +22 -17
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +75 -2
- package/packages/mcp-server/src/workflow-tools.ts +30 -16
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/models/fake-model.d.ts +12 -0
- package/packages/pi-ai/dist/models/fake-model.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/fake-model.js +27 -0
- package/packages/pi-ai/dist/models/fake-model.js.map +1 -0
- package/packages/pi-ai/dist/models/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/index.js +8 -0
- package/packages/pi-ai/dist/models/index.js.map +1 -1
- package/packages/pi-ai/dist/providers/fake.d.ts +42 -0
- package/packages/pi-ai/dist/providers/fake.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/fake.js +319 -0
- package/packages/pi-ai/dist/providers/fake.js.map +1 -0
- package/packages/pi-ai/dist/providers/register-builtins.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/register-builtins.js +24 -0
- package/packages/pi-ai/dist/providers/register-builtins.js.map +1 -1
- package/packages/pi-ai/src/models/fake-model.ts +30 -0
- package/packages/pi-ai/src/models/index.ts +9 -0
- package/packages/pi-ai/src/providers/fake.ts +376 -0
- package/packages/pi-ai/src/providers/register-builtins.ts +23 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +32 -0
- 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.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +8 -0
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +76 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +9 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js +103 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts +15 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.js +66 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.js +24 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +3 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +17 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js +99 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +7 -0
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +5 -0
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +24 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +33 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/slash-commands.js +1 -0
- package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js +6 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +54 -15
- 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/adaptive-layout.d.ts +26 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +112 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js +51 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +10 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +3 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +7 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +17 -0
- 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 +109 -17
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +69 -2
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +93 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +26 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +20 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.js +79 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +12 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +13 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +18 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +36 -27
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.d.ts +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.js +18 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +48 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js +10 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js +3 -2
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +36 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +8 -0
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +89 -0
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +18 -0
- package/packages/pi-coding-agent/src/core/compaction-threshold.test.ts +121 -0
- package/packages/pi-coding-agent/src/core/db-snapshot.test.ts +32 -0
- package/packages/pi-coding-agent/src/core/db-snapshot.ts +66 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.test.ts +110 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +19 -1
- package/packages/pi-coding-agent/src/core/extensions/types.ts +7 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +4 -0
- package/packages/pi-coding-agent/src/core/settings-manager.ts +51 -1
- package/packages/pi-coding-agent/src/core/slash-commands.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.ts +7 -5
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +78 -15
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.test.ts +59 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +160 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +10 -9
- package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +15 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +10 -9
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +122 -17
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +99 -1
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +92 -3
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-state.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +28 -0
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.test.ts +95 -0
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +24 -1
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.ts +13 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +32 -2
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +36 -27
- package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +65 -0
- package/packages/pi-coding-agent/src/modes/interactive/tui-mode.ts +29 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage-safety-guard.test.ts +14 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage.ts +3 -2
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/style.test.d.ts +2 -0
- package/packages/pi-tui/dist/__tests__/style.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/__tests__/style.test.js +63 -0
- package/packages/pi-tui/dist/__tests__/style.test.js.map +1 -0
- package/packages/pi-tui/dist/__tests__/tui.test.js +24 -3
- package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
- package/packages/pi-tui/dist/index.d.ts +1 -0
- package/packages/pi-tui/dist/index.d.ts.map +1 -1
- package/packages/pi-tui/dist/index.js +2 -0
- package/packages/pi-tui/dist/index.js.map +1 -1
- package/packages/pi-tui/dist/style.d.ts +41 -0
- package/packages/pi-tui/dist/style.d.ts.map +1 -0
- package/packages/pi-tui/dist/style.js +158 -0
- package/packages/pi-tui/dist/style.js.map +1 -0
- package/packages/pi-tui/dist/tui.d.ts +0 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +21 -16
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/__tests__/style.test.ts +76 -0
- package/packages/pi-tui/src/__tests__/tui.test.ts +29 -3
- package/packages/pi-tui/src/index.ts +9 -0
- package/packages/pi-tui/src/style.ts +225 -0
- package/packages/pi-tui/src/tui.ts +23 -16
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts +12 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme-schema.js +13 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +18 -1
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js +36 -27
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/src/resources/GSD-WORKFLOW.md +2 -2
- package/src/resources/extensions/github-sync/templates.ts +38 -8
- package/src/resources/extensions/github-sync/tests/inline-code.test.ts +66 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +1 -0
- package/src/resources/extensions/gsd/auto/loop.ts +67 -18
- package/src/resources/extensions/gsd/auto/phases.ts +77 -48
- package/src/resources/extensions/gsd/auto/resolve.ts +23 -1
- package/src/resources/extensions/gsd/auto/run-unit.ts +42 -15
- package/src/resources/extensions/gsd/auto-dashboard.ts +57 -8
- package/src/resources/extensions/gsd/auto-dispatch.ts +17 -0
- package/src/resources/extensions/gsd/auto-post-unit.ts +10 -10
- package/src/resources/extensions/gsd/auto-prompts.ts +133 -2
- package/src/resources/extensions/gsd/auto-recovery.ts +207 -7
- package/src/resources/extensions/gsd/auto-start.ts +7 -6
- package/src/resources/extensions/gsd/auto-supervisor.ts +7 -0
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +2 -2
- package/src/resources/extensions/gsd/auto.ts +90 -4
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +37 -2
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +27 -19
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +39 -1
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +135 -1
- package/src/resources/extensions/gsd/clean-root-preflight.ts +41 -3
- package/src/resources/extensions/gsd/commands/dispatcher.ts +6 -0
- package/src/resources/extensions/gsd/commands-extract-learnings.ts +17 -12
- package/src/resources/extensions/gsd/context-budget.ts +44 -2
- package/src/resources/extensions/gsd/crash-recovery.ts +67 -10
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +24 -1
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +41 -0
- package/src/resources/extensions/gsd/db-base-schema.ts +19 -2
- package/src/resources/extensions/gsd/db-migration-steps.ts +25 -0
- package/src/resources/extensions/gsd/detection.ts +128 -0
- package/src/resources/extensions/gsd/graph.ts +12 -5
- package/src/resources/extensions/gsd/gsd-db.ts +168 -13
- package/src/resources/extensions/gsd/guided-flow.ts +98 -16
- package/src/resources/extensions/gsd/memory-store.ts +77 -12
- package/src/resources/extensions/gsd/migrate/command.ts +47 -1
- package/src/resources/extensions/gsd/migration-auto-check.ts +129 -0
- package/src/resources/extensions/gsd/planning-path-scope.ts +35 -0
- package/src/resources/extensions/gsd/pr-evidence.ts +63 -5
- package/src/resources/extensions/gsd/preferences-types.ts +1 -1
- package/src/resources/extensions/gsd/prompt-loader.ts +27 -2
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +19 -19
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/quick-task.md +1 -5
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
- package/src/resources/extensions/gsd/quick.ts +37 -2
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +11 -2
- package/src/resources/extensions/gsd/tests/auto-abort-pause-regression.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +155 -5
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +56 -13
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +184 -2
- package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +88 -2
- package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/compaction-snapshot.test.ts +14 -1
- package/src/resources/extensions/gsd/tests/context-budget.test.ts +10 -1
- package/src/resources/extensions/gsd/tests/crash-handler-secondary.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +112 -6
- package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +40 -2
- package/src/resources/extensions/gsd/tests/db-migration-steps.integration.test.ts +428 -0
- package/src/resources/extensions/gsd/tests/db-schema-metadata.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/detection.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/dispatch-rule-coverage.test.ts +313 -0
- package/src/resources/extensions/gsd/tests/exec-history.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/commands-ship-basic.md +52 -0
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/commands-ship-empty-optionals.md +42 -0
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-no-blockers.md +55 -0
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-with-blockers.md +60 -0
- package/src/resources/extensions/gsd/tests/graph-operations.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/has-pending-deep-stage.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +234 -0
- package/src/resources/extensions/gsd/tests/memory-decay-factor.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/pr-evidence-equivalence.test.ts +102 -0
- package/src/resources/extensions/gsd/tests/pr-evidence-hardening.test.ts +165 -0
- package/src/resources/extensions/gsd/tests/prompt-path-audit.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/quick-external-gsd.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/right-sized-workflow-prompts.test.ts +192 -0
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/schema-v27-v28-sequence.test.ts +156 -0
- package/src/resources/extensions/gsd/tests/signal-handlers.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/stalled-tool-recovery.test.ts +49 -1
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +101 -2
- package/src/resources/extensions/gsd/tests/status-db-open.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +136 -4
- package/src/resources/extensions/gsd/tests/unit-dispatches.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/unit-runtime.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/working-output-messages.test.ts +93 -0
- package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +37 -6
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/worktree-nested-git-safety.test.ts +9 -2
- package/src/resources/extensions/gsd/tests/worktree-write-gate.test.ts +179 -0
- package/src/resources/extensions/gsd/tools/context-mode-tool-result.ts +25 -0
- package/src/resources/extensions/gsd/tools/exec-search-tool.ts +7 -7
- package/src/resources/extensions/gsd/tools/exec-tool.ts +4 -23
- package/src/resources/extensions/gsd/tools/memory-tools.ts +1 -0
- package/src/resources/extensions/gsd/tools/plan-slice.ts +13 -0
- package/src/resources/extensions/gsd/tools/plan-task.ts +10 -0
- package/src/resources/extensions/gsd/tools/resume-tool.ts +7 -7
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +1 -1
- package/src/resources/extensions/gsd/unit-context-composer.ts +19 -4
- package/src/resources/extensions/gsd/unit-runtime.ts +25 -0
- package/src/resources/extensions/gsd/working-output-messages.ts +120 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +15 -4
- package/packages/contracts/tsconfig.tsbuildinfo +0 -1
- /package/dist/web/standalone/.next/static/{bQDK5_LtkGVS64AirQgQG → 8F5YpnZNBaooIWGF4GBV3}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{bQDK5_LtkGVS64AirQgQG → 8F5YpnZNBaooIWGF4GBV3}/_ssgManifest.js +0 -0
|
@@ -5,9 +5,11 @@ import {
|
|
|
5
5
|
clearUnitRuntimeRecord,
|
|
6
6
|
formatExecuteTaskRecoveryStatus,
|
|
7
7
|
inspectExecuteTaskDurability,
|
|
8
|
+
isInFlightRuntimePhase,
|
|
8
9
|
readUnitRuntimeRecord,
|
|
9
10
|
writeUnitRuntimeRecord,
|
|
10
11
|
} from "../unit-runtime.ts";
|
|
12
|
+
import { closeDatabase, insertMilestone, insertSlice, insertTask, openDatabase } from "../gsd-db.ts";
|
|
11
13
|
import { clearPathCache } from '../paths.ts';
|
|
12
14
|
import { test } from 'node:test';
|
|
13
15
|
import assert from 'node:assert/strict';
|
|
@@ -22,6 +24,12 @@ writeFileSync(
|
|
|
22
24
|
"utf-8",
|
|
23
25
|
);
|
|
24
26
|
|
|
27
|
+
console.log("\n=== in-flight runtime phases ===");
|
|
28
|
+
{
|
|
29
|
+
assert.equal(isInFlightRuntimePhase("crashed"), true, "crashed records remain recoverable");
|
|
30
|
+
assert.equal(isInFlightRuntimePhase("finalized"), false, "finalized records are terminal");
|
|
31
|
+
}
|
|
32
|
+
|
|
25
33
|
console.log("\n=== runtime record write/read/update ===");
|
|
26
34
|
{
|
|
27
35
|
const first = writeUnitRuntimeRecord(base, "execute-task", "M100/S02/T09", 1000, { phase: "dispatched" });
|
|
@@ -65,6 +73,35 @@ console.log("\n=== runtime record cleanup ===");
|
|
|
65
73
|
assert.deepStrictEqual(loaded, null, "record removed");
|
|
66
74
|
}
|
|
67
75
|
|
|
76
|
+
console.log("\n=== execute-task durability trusts closed DB task status ===");
|
|
77
|
+
{
|
|
78
|
+
const dbBase = mkdtempSync(join(tmpdir(), "gsd-unit-runtime-db-test-"));
|
|
79
|
+
mkdirSync(join(dbBase, ".gsd", "milestones", "M300", "slices", "S01", "tasks"), { recursive: true });
|
|
80
|
+
try {
|
|
81
|
+
openDatabase(join(dbBase, ".gsd", "gsd.db"));
|
|
82
|
+
insertMilestone({ id: "M300", title: "DB Milestone", status: "active" });
|
|
83
|
+
insertSlice({ id: "S01", milestoneId: "M300", title: "DB Slice", status: "in_progress" });
|
|
84
|
+
insertTask({ id: "T01", milestoneId: "M300", sliceId: "S01", title: "DB Task", status: "complete" });
|
|
85
|
+
writeFileSync(
|
|
86
|
+
join(dbBase, ".gsd", "milestones", "M300", "slices", "S01", "S01-PLAN.md"),
|
|
87
|
+
"# S01\n\n## Tasks\n\n- [ ] **T01: DB Task** `est:10m`\n",
|
|
88
|
+
"utf-8",
|
|
89
|
+
);
|
|
90
|
+
writeFileSync(join(dbBase, ".gsd", "STATE.md"), "## Next Action\nExecute T01 for S01: DB task\n", "utf-8");
|
|
91
|
+
|
|
92
|
+
const status = await inspectExecuteTaskDurability(dbBase, "M300/S01/T01");
|
|
93
|
+
assert.ok(status !== null, "db-complete: status exists");
|
|
94
|
+
assert.equal(status!.dbComplete, true, "db-complete: closed DB status is captured");
|
|
95
|
+
assert.equal(status!.summaryExists, false, "db-complete: summary can still be missing");
|
|
96
|
+
assert.equal(status!.taskChecked, false, "db-complete: checkbox can still be unchecked");
|
|
97
|
+
assert.equal(status!.nextActionAdvanced, false, "db-complete: next action can still point at task");
|
|
98
|
+
assert.equal(formatExecuteTaskRecoveryStatus(status!), "DB task status is closed");
|
|
99
|
+
} finally {
|
|
100
|
+
closeDatabase();
|
|
101
|
+
rmSync(dbBase, { recursive: true, force: true });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
68
105
|
console.log("\n=== hook unit type sanitization (slash in unitType) ===");
|
|
69
106
|
{
|
|
70
107
|
// Hook units have unitType like "hook/code-review" with a slash
|
|
@@ -118,7 +118,7 @@ test("guided flow checks pending deep setup before plan-v2 gate", () => {
|
|
|
118
118
|
const source = readFileSync(join(gsdDir, "guided-flow.ts"), "utf-8");
|
|
119
119
|
const showSmartEntryIdx = source.indexOf("export async function showSmartEntry");
|
|
120
120
|
assert.notEqual(showSmartEntryIdx, -1);
|
|
121
|
-
const deepIdx = source.indexOf("
|
|
121
|
+
const deepIdx = source.indexOf("shouldRunDeepProjectSetup(state, prefs, basePath)", showSmartEntryIdx);
|
|
122
122
|
const planIdx = source.indexOf("runPlanV2Gate(ctx, basePath, state)", showSmartEntryIdx);
|
|
123
123
|
assert.ok(
|
|
124
124
|
deepIdx > -1 && planIdx > -1 && deepIdx < planIdx,
|
|
@@ -165,6 +165,9 @@ test("executeMilestoneStatus returns milestone metadata and slice counts", async
|
|
|
165
165
|
assert.equal(parsed.sliceCount, 1);
|
|
166
166
|
assert.equal(parsed.slices[0].id, "S01");
|
|
167
167
|
assert.equal(parsed.slices[0].taskCounts.pending, 1);
|
|
168
|
+
assert.equal(result.details.status, "active");
|
|
169
|
+
assert.equal(result.details.title, "Milestone One");
|
|
170
|
+
assert.deepEqual(result.details.slices, parsed.slices);
|
|
168
171
|
} finally {
|
|
169
172
|
closeDatabase();
|
|
170
173
|
cleanup(base);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// GSD-2 + src/resources/extensions/gsd/tests/working-output-messages.test.ts - Regression coverage for user-facing working-state message quality.
|
|
2
|
+
|
|
3
|
+
import test from "node:test";
|
|
4
|
+
import assert from "node:assert/strict";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
evaluateWorkingOutputMessage,
|
|
8
|
+
evaluateWorkingOutputMessages,
|
|
9
|
+
formatAutoUnitWorkingMessage,
|
|
10
|
+
} from "../working-output-messages.ts";
|
|
11
|
+
|
|
12
|
+
test("auto unit loader messages name the active work", () => {
|
|
13
|
+
assert.equal(
|
|
14
|
+
formatAutoUnitWorkingMessage("research-milestone", "M001"),
|
|
15
|
+
"Researching M001: waiting for provider response",
|
|
16
|
+
);
|
|
17
|
+
assert.equal(
|
|
18
|
+
evaluateWorkingOutputMessage({
|
|
19
|
+
surface: "loader",
|
|
20
|
+
message: formatAutoUnitWorkingMessage("research-milestone", "M001"),
|
|
21
|
+
context: { unitType: "research-milestone", unitId: "M001", health: "waiting" },
|
|
22
|
+
}).length,
|
|
23
|
+
0,
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test("generic working messages are flagged", () => {
|
|
28
|
+
const findings = evaluateWorkingOutputMessage({
|
|
29
|
+
surface: "loader",
|
|
30
|
+
message: "Working...",
|
|
31
|
+
context: { health: "waiting" },
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
assert.deepEqual(findings.map(f => f.code), ["generic-working-message"]);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("dashboard messages cannot claim healthy progress while recovering", () => {
|
|
38
|
+
const findings = evaluateWorkingOutputMessage({
|
|
39
|
+
surface: "dashboard",
|
|
40
|
+
message: "GSD AUTO Progressing well",
|
|
41
|
+
context: { health: "recovering", recoveryAttempts: 1 },
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
assert.deepEqual(findings.map(f => f.code), ["misleading-healthy-message"]);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test("pre-roadmap zero-slice counters are flagged", () => {
|
|
48
|
+
const findings = evaluateWorkingOutputMessage({
|
|
49
|
+
surface: "dashboard",
|
|
50
|
+
message: "0/0 slices",
|
|
51
|
+
context: { health: "waiting" },
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
assert.deepEqual(findings.map(f => f.code), ["fake-zero-progress"]);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("stalled/provider-error/timeout messages need an action", () => {
|
|
58
|
+
const noAction = evaluateWorkingOutputMessage({
|
|
59
|
+
surface: "notification",
|
|
60
|
+
message: "Provider stalled after 2m",
|
|
61
|
+
context: { health: "stalled" },
|
|
62
|
+
});
|
|
63
|
+
assert.deepEqual(noAction.map(f => f.code), ["missing-action"]);
|
|
64
|
+
|
|
65
|
+
const withAction = evaluateWorkingOutputMessage({
|
|
66
|
+
surface: "notification",
|
|
67
|
+
message: "Provider stalled after 2m. Type /gsd stop or wait for retry.",
|
|
68
|
+
context: { health: "stalled" },
|
|
69
|
+
});
|
|
70
|
+
assert.equal(withAction.length, 0);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test("current fixed research working surfaces pass the audit", () => {
|
|
74
|
+
const findings = evaluateWorkingOutputMessages([
|
|
75
|
+
{
|
|
76
|
+
surface: "loader",
|
|
77
|
+
message: "Researching M001: waiting for provider response",
|
|
78
|
+
context: { unitType: "research-milestone", unitId: "M001", health: "waiting" },
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
surface: "dashboard",
|
|
82
|
+
message: "Recovering\nretry 1 after idle stall",
|
|
83
|
+
context: { unitType: "research-milestone", unitId: "M001", health: "recovering", recoveryAttempts: 1 },
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
surface: "notification",
|
|
87
|
+
message: "Auto-mode stopped - User requested stop.",
|
|
88
|
+
context: { health: "stopped" },
|
|
89
|
+
},
|
|
90
|
+
]);
|
|
91
|
+
|
|
92
|
+
assert.equal(findings.length, 0);
|
|
93
|
+
});
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
import { describe, test, beforeEach, afterEach } from "node:test";
|
|
11
11
|
import assert from "node:assert/strict";
|
|
12
|
-
import { mkdtempSync, mkdirSync, writeFileSync, rmSync, readdirSync } from "node:fs";
|
|
12
|
+
import { existsSync, mkdtempSync, mkdirSync, readFileSync, writeFileSync, rmSync, readdirSync } from "node:fs";
|
|
13
13
|
import { join } from "node:path";
|
|
14
14
|
import { tmpdir } from "node:os";
|
|
15
15
|
import { execSync } from "node:child_process";
|
|
16
16
|
|
|
17
|
-
import { PROJECT_FILES } from "../detection.js";
|
|
17
|
+
import { PROJECT_FILES, classifyProject } from "../detection.js";
|
|
18
18
|
|
|
19
19
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
20
20
|
|
|
@@ -30,6 +30,14 @@ function createGitRepo(): string {
|
|
|
30
30
|
return dir;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
function createEmptyGitRepo(): string {
|
|
34
|
+
const dir = mkdtempSync(join(tmpdir(), "wt-dispatch-test-empty-"));
|
|
35
|
+
execSync("git init", { cwd: dir, stdio: "ignore" });
|
|
36
|
+
execSync("git config user.email test@test.com", { cwd: dir, stdio: "ignore" });
|
|
37
|
+
execSync("git config user.name Test", { cwd: dir, stdio: "ignore" });
|
|
38
|
+
return dir;
|
|
39
|
+
}
|
|
40
|
+
|
|
33
41
|
/**
|
|
34
42
|
* Simulate the health check logic from auto/phases.ts.
|
|
35
43
|
*
|
|
@@ -64,8 +72,6 @@ function hasXcodeBundle(basePath: string): boolean {
|
|
|
64
72
|
} catch { return false; }
|
|
65
73
|
}
|
|
66
74
|
|
|
67
|
-
import { existsSync } from "node:fs";
|
|
68
|
-
|
|
69
75
|
// ─── Tests ───────────────────────────────────────────────────────────────────
|
|
70
76
|
|
|
71
77
|
test("PROJECT_FILES is exported and contains expected multi-ecosystem entries", () => {
|
|
@@ -80,6 +86,21 @@ test("PROJECT_FILES is exported and contains expected multi-ecosystem entries",
|
|
|
80
86
|
assert.ok(PROJECT_FILES.includes("Package.swift"), "includes Swift marker");
|
|
81
87
|
});
|
|
82
88
|
|
|
89
|
+
test("runUnitPhase fails closed when classification returns invalid-repo", () => {
|
|
90
|
+
const source = readFileSync(join(process.cwd(), "src/resources/extensions/gsd/auto/phases.ts"), "utf-8");
|
|
91
|
+
const invalidRepoBranch = source.slice(
|
|
92
|
+
source.indexOf('projectClassification.kind === "invalid-repo"'),
|
|
93
|
+
source.indexOf('projectClassification.kind === "greenfield"'),
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
assert.match(invalidRepoBranch, /projectClassification\.reason === "missing \.git" && hasGit/);
|
|
97
|
+
assert.match(invalidRepoBranch, /project classification could not confirm \.git/);
|
|
98
|
+
assert.match(invalidRepoBranch, /ctx\.ui\.notify\(msg,\s*"error"\)/);
|
|
99
|
+
assert.match(invalidRepoBranch, /await deps\.stopAuto\(ctx,\s*pi,\s*msg\)/);
|
|
100
|
+
assert.match(invalidRepoBranch, /return \{ action: "break", reason: "worktree-invalid" \}/);
|
|
101
|
+
assert.match(invalidRepoBranch, /classified as invalid-repo/);
|
|
102
|
+
});
|
|
103
|
+
|
|
83
104
|
describe("health check with git repo", () => {
|
|
84
105
|
let dir: string;
|
|
85
106
|
beforeEach(() => { dir = createGitRepo(); });
|
|
@@ -132,8 +153,18 @@ describe("health check with git repo", () => {
|
|
|
132
153
|
});
|
|
133
154
|
|
|
134
155
|
test("health check passes for empty git repo (greenfield project)", () => {
|
|
135
|
-
|
|
136
|
-
|
|
156
|
+
const empty = createEmptyGitRepo();
|
|
157
|
+
try {
|
|
158
|
+
assert.ok(wouldPassHealthCheck(empty, existsSync), "empty git repo should pass health check (greenfield)");
|
|
159
|
+
assert.equal(classifyProject(empty).kind, "greenfield");
|
|
160
|
+
} finally {
|
|
161
|
+
rmSync(empty, { recursive: true, force: true });
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
test("health check classifies README-only repo as untyped existing, not greenfield", () => {
|
|
166
|
+
assert.ok(wouldPassHealthCheck(dir, existsSync), "README-only repo should pass health check");
|
|
167
|
+
assert.equal(classifyProject(dir).kind, "untyped-existing");
|
|
137
168
|
});
|
|
138
169
|
});
|
|
139
170
|
|
|
@@ -235,4 +235,11 @@ describe("removeWorktree — missing worktree", () => {
|
|
|
235
235
|
"should not throw when worktree does not exist",
|
|
236
236
|
);
|
|
237
237
|
});
|
|
238
|
+
|
|
239
|
+
test("deleteBranch is quiet when the branch is already gone", () => {
|
|
240
|
+
assert.doesNotThrow(
|
|
241
|
+
() => removeWorktree(base, "nonexistent", { deleteBranch: true }),
|
|
242
|
+
"missing branch should be treated as already cleaned up",
|
|
243
|
+
);
|
|
244
|
+
});
|
|
238
245
|
});
|
|
@@ -56,11 +56,11 @@ test("#2616: findNestedGitDirs ignores .git files (worktree pointers)", (t) => {
|
|
|
56
56
|
);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
test("#2616: findNestedGitDirs skips excluded directories (node_modules, .gsd, target)", (t) => {
|
|
59
|
+
test("#2616: findNestedGitDirs skips excluded directories (node_modules, .gsd, .bg-shell, target)", (t) => {
|
|
60
60
|
const root = makeRoot(t);
|
|
61
61
|
|
|
62
62
|
// All three of these contain a .git *directory*, but the scan must skip them.
|
|
63
|
-
for (const excluded of ["node_modules", ".gsd", "target"]) {
|
|
63
|
+
for (const excluded of ["node_modules", ".gsd", ".bg-shell", "target"]) {
|
|
64
64
|
const inside = join(root, excluded, "vendored-pkg");
|
|
65
65
|
mkdirSync(join(inside, ".git"), { recursive: true });
|
|
66
66
|
}
|
|
@@ -73,6 +73,13 @@ test("#2616: findNestedGitDirs skips excluded directories (node_modules, .gsd, t
|
|
|
73
73
|
);
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
+
test("#2616: findNestedGitDirs ignores normal missing child .git probes", (t) => {
|
|
77
|
+
const root = makeRoot(t);
|
|
78
|
+
mkdirSync(join(root, "plain-dir"), { recursive: true });
|
|
79
|
+
|
|
80
|
+
assert.deepEqual(findNestedGitDirs(root), []);
|
|
81
|
+
});
|
|
82
|
+
|
|
76
83
|
test("#2616: findNestedGitDirs finds deeply nested repos", (t) => {
|
|
77
84
|
const root = makeRoot(t);
|
|
78
85
|
const deep = join(root, "a", "b", "c", "scaffolded");
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// GSD-2 worktree-isolation write gate (#5199).
|
|
2
|
+
//
|
|
3
|
+
// Regression coverage for shouldBlockWorktreeWrite — the helper that prevents
|
|
4
|
+
// the LLM from authoring code at the project root when `git.isolation: worktree`
|
|
5
|
+
// is configured but auto-mode (and its post-unit commit pipeline) hasn't run.
|
|
6
|
+
// Without this gate, writes silently orphan outside git history.
|
|
7
|
+
//
|
|
8
|
+
// Test setup creates a fresh temp project for each isolation case, writes a
|
|
9
|
+
// `.gsd/PREFERENCES.md` with `isolation: "worktree"`, and exercises the helper
|
|
10
|
+
// against the 9 scenarios listed in the issue. No source-grep tests — every
|
|
11
|
+
// assertion exercises the real predicate.
|
|
12
|
+
|
|
13
|
+
import { test, describe, beforeEach, afterEach } from "node:test";
|
|
14
|
+
import assert from "node:assert/strict";
|
|
15
|
+
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
16
|
+
import { tmpdir } from "node:os";
|
|
17
|
+
import { join } from "node:path";
|
|
18
|
+
|
|
19
|
+
import { shouldBlockWorktreeWrite } from "../bootstrap/write-gate.js";
|
|
20
|
+
import { invalidateAllCaches } from "../cache.js";
|
|
21
|
+
|
|
22
|
+
function makeProject(isolation: "none" | "worktree" | "branch" | null): string {
|
|
23
|
+
const root = mkdtempSync(join(tmpdir(), "wt-write-gate-"));
|
|
24
|
+
if (isolation !== null) {
|
|
25
|
+
mkdirSync(join(root, ".gsd"), { recursive: true });
|
|
26
|
+
writeFileSync(
|
|
27
|
+
join(root, ".gsd", "PREFERENCES.md"),
|
|
28
|
+
`---\ngit:\n isolation: "${isolation}"\n---\n`,
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
invalidateAllCaches();
|
|
32
|
+
return root;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const PLANNING_WRITE_TOOLS = ["write", "edit", "multi_edit", "notebook_edit"];
|
|
36
|
+
|
|
37
|
+
describe("shouldBlockWorktreeWrite (#5199)", () => {
|
|
38
|
+
let projectRoot: string;
|
|
39
|
+
let prevDisableEnv: string | undefined;
|
|
40
|
+
|
|
41
|
+
beforeEach(() => {
|
|
42
|
+
prevDisableEnv = process.env.GSD_DISABLE_WORKTREE_WRITE_GUARD;
|
|
43
|
+
delete process.env.GSD_DISABLE_WORKTREE_WRITE_GUARD;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
afterEach(() => {
|
|
47
|
+
if (projectRoot) {
|
|
48
|
+
try { rmSync(projectRoot, { recursive: true, force: true }); } catch { /* best-effort */ }
|
|
49
|
+
}
|
|
50
|
+
if (prevDisableEnv === undefined) {
|
|
51
|
+
delete process.env.GSD_DISABLE_WORKTREE_WRITE_GUARD;
|
|
52
|
+
} else {
|
|
53
|
+
process.env.GSD_DISABLE_WORKTREE_WRITE_GUARD = prevDisableEnv;
|
|
54
|
+
}
|
|
55
|
+
invalidateAllCaches();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test("Case 1: every PLANNING_WRITE_TOOLS variant writing to <root>/app.js is blocked", () => {
|
|
59
|
+
projectRoot = makeProject("worktree");
|
|
60
|
+
for (const tool of PLANNING_WRITE_TOOLS) {
|
|
61
|
+
const result = shouldBlockWorktreeWrite(
|
|
62
|
+
tool,
|
|
63
|
+
join(projectRoot, "app.js"),
|
|
64
|
+
projectRoot,
|
|
65
|
+
/* isAutoLive */ false,
|
|
66
|
+
/* unitType */ null,
|
|
67
|
+
);
|
|
68
|
+
assert.equal(result.block, true, `tool ${tool} should be blocked`);
|
|
69
|
+
assert.match(result.reason ?? "", /HARD BLOCK/);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test("Case 2: write to <root>/.gsd/PROJECT.md is allowed", () => {
|
|
74
|
+
projectRoot = makeProject("worktree");
|
|
75
|
+
const result = shouldBlockWorktreeWrite(
|
|
76
|
+
"write",
|
|
77
|
+
join(projectRoot, ".gsd", "PROJECT.md"),
|
|
78
|
+
projectRoot,
|
|
79
|
+
false,
|
|
80
|
+
null,
|
|
81
|
+
);
|
|
82
|
+
assert.equal(result.block, false);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test("Case 3: write inside <root>/.gsd/worktrees/M001/ is allowed", () => {
|
|
86
|
+
projectRoot = makeProject("worktree");
|
|
87
|
+
const target = join(projectRoot, ".gsd", "worktrees", "M001", "src", "app.js");
|
|
88
|
+
const result = shouldBlockWorktreeWrite("edit", target, projectRoot, false, null);
|
|
89
|
+
assert.equal(result.block, false);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test("Case 4: write to <root>/.gsd/worktrees-extra/M001/app.js (prefix trick) is blocked", () => {
|
|
93
|
+
projectRoot = makeProject("worktree");
|
|
94
|
+
const target = join(projectRoot, ".gsd", "worktrees-extra", "M001", "app.js");
|
|
95
|
+
const result = shouldBlockWorktreeWrite("write", target, projectRoot, false, null);
|
|
96
|
+
assert.equal(result.block, true);
|
|
97
|
+
assert.match(result.reason ?? "", /HARD BLOCK/);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test("Case 5: isolation=none → allow", () => {
|
|
101
|
+
projectRoot = makeProject("none");
|
|
102
|
+
const result = shouldBlockWorktreeWrite(
|
|
103
|
+
"write",
|
|
104
|
+
join(projectRoot, "app.js"),
|
|
105
|
+
projectRoot,
|
|
106
|
+
false,
|
|
107
|
+
null,
|
|
108
|
+
);
|
|
109
|
+
assert.equal(result.block, false);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test("Case 6: isolation=worktree, auto active, effectiveBasePath inside worktree → allow", () => {
|
|
113
|
+
projectRoot = makeProject("worktree");
|
|
114
|
+
const inside = join(projectRoot, ".gsd", "worktrees", "M001");
|
|
115
|
+
mkdirSync(inside, { recursive: true });
|
|
116
|
+
const result = shouldBlockWorktreeWrite(
|
|
117
|
+
"write",
|
|
118
|
+
join(inside, "src", "app.js"),
|
|
119
|
+
inside,
|
|
120
|
+
/* isAutoLive */ true,
|
|
121
|
+
null,
|
|
122
|
+
);
|
|
123
|
+
assert.equal(result.block, false);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
test("Case 7: isolation=worktree, auto active, effectiveBasePath is project root (cwd never flipped) → block", () => {
|
|
127
|
+
projectRoot = makeProject("worktree");
|
|
128
|
+
const result = shouldBlockWorktreeWrite(
|
|
129
|
+
"write",
|
|
130
|
+
join(projectRoot, "app.js"),
|
|
131
|
+
projectRoot,
|
|
132
|
+
/* isAutoLive */ true,
|
|
133
|
+
null,
|
|
134
|
+
);
|
|
135
|
+
assert.equal(result.block, true);
|
|
136
|
+
assert.match(result.reason ?? "", /HARD BLOCK/);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test("Case 8: bootstrap unit type active → allow", () => {
|
|
140
|
+
projectRoot = makeProject("worktree");
|
|
141
|
+
for (const unitType of ["discuss-milestone", "plan-milestone", "init"]) {
|
|
142
|
+
const result = shouldBlockWorktreeWrite(
|
|
143
|
+
"write",
|
|
144
|
+
join(projectRoot, "app.js"),
|
|
145
|
+
projectRoot,
|
|
146
|
+
false,
|
|
147
|
+
unitType,
|
|
148
|
+
);
|
|
149
|
+
assert.equal(result.block, false, `unit ${unitType} should bypass the guard`);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
test("Case 9: GSD_DISABLE_WORKTREE_WRITE_GUARD=1 → allow", () => {
|
|
154
|
+
projectRoot = makeProject("worktree");
|
|
155
|
+
process.env.GSD_DISABLE_WORKTREE_WRITE_GUARD = "1";
|
|
156
|
+
const result = shouldBlockWorktreeWrite(
|
|
157
|
+
"write",
|
|
158
|
+
join(projectRoot, "app.js"),
|
|
159
|
+
projectRoot,
|
|
160
|
+
false,
|
|
161
|
+
null,
|
|
162
|
+
);
|
|
163
|
+
assert.equal(result.block, false);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test("non-planning tools (read/grep/bash) pass through unconditionally", () => {
|
|
167
|
+
projectRoot = makeProject("worktree");
|
|
168
|
+
for (const tool of ["read", "grep", "bash", "ls"]) {
|
|
169
|
+
const result = shouldBlockWorktreeWrite(
|
|
170
|
+
tool,
|
|
171
|
+
join(projectRoot, "app.js"),
|
|
172
|
+
projectRoot,
|
|
173
|
+
false,
|
|
174
|
+
null,
|
|
175
|
+
);
|
|
176
|
+
assert.equal(result.block, false, `tool ${tool} must not be gated`);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Shared Context Mode tool result helpers.
|
|
3
|
+
|
|
4
|
+
export interface ToolExecutionResult {
|
|
5
|
+
content: Array<{ type: "text"; text: string }>;
|
|
6
|
+
details: Record<string, unknown>;
|
|
7
|
+
isError?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type ContextModeToolName = "gsd_exec" | "gsd_exec_search" | "gsd_resume";
|
|
11
|
+
|
|
12
|
+
export function contextModeDisabledResult(operation: ContextModeToolName): ToolExecutionResult {
|
|
13
|
+
return {
|
|
14
|
+
content: [
|
|
15
|
+
{
|
|
16
|
+
type: "text",
|
|
17
|
+
text:
|
|
18
|
+
`${operation} is disabled by \`context_mode.enabled: false\` in preferences. ` +
|
|
19
|
+
"Remove that override or set it to true to re-enable Context Mode tools.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
details: { operation, error: "context_mode_disabled" },
|
|
23
|
+
isError: true,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
// re-discover past runs without re-executing. Read-only; no DB writes.
|
|
5
5
|
|
|
6
6
|
import { searchExecHistory, type ExecSearchOptions } from "../exec-history.js";
|
|
7
|
+
import { isContextModeEnabled, type ContextModeConfig } from "../preferences-types.js";
|
|
8
|
+
import { contextModeDisabledResult, type ToolExecutionResult } from "./context-mode-tool-result.js";
|
|
7
9
|
|
|
8
10
|
export interface ExecSearchToolParams {
|
|
9
11
|
query?: string;
|
|
@@ -12,16 +14,14 @@ export interface ExecSearchToolParams {
|
|
|
12
14
|
limit?: number;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
export interface ToolExecutionResult {
|
|
16
|
-
content: Array<{ type: "text"; text: string }>;
|
|
17
|
-
details: Record<string, unknown>;
|
|
18
|
-
isError?: boolean;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
17
|
export function executeExecSearch(
|
|
22
18
|
params: ExecSearchToolParams,
|
|
23
|
-
opts: { baseDir: string },
|
|
19
|
+
opts: { baseDir: string; preferences?: { context_mode?: ContextModeConfig } | null },
|
|
24
20
|
): ToolExecutionResult {
|
|
21
|
+
if (!isContextModeEnabled(opts.preferences)) {
|
|
22
|
+
return contextModeDisabledResult("gsd_exec_search");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
25
|
const searchOpts: ExecSearchOptions = {
|
|
26
26
|
query: typeof params.query === "string" ? params.query : undefined,
|
|
27
27
|
runtime: params.runtime,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
type ExecSandboxResult,
|
|
13
13
|
} from "../exec-sandbox.js";
|
|
14
14
|
import { isContextModeEnabled, type ContextModeConfig } from "../preferences-types.js";
|
|
15
|
+
import { contextModeDisabledResult, type ToolExecutionResult } from "./context-mode-tool-result.js";
|
|
15
16
|
|
|
16
17
|
export interface ExecToolParams {
|
|
17
18
|
runtime: ExecSandboxRequest["runtime"];
|
|
@@ -20,17 +21,12 @@ export interface ExecToolParams {
|
|
|
20
21
|
timeout_ms?: number;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
export interface ToolExecutionResult {
|
|
24
|
-
content: Array<{ type: "text"; text: string }>;
|
|
25
|
-
details: Record<string, unknown>;
|
|
26
|
-
isError?: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
24
|
export interface ExecToolDeps {
|
|
30
25
|
baseDir: string;
|
|
31
26
|
preferences: { context_mode?: ContextModeConfig } | null;
|
|
32
27
|
/** Optional override for testing. */
|
|
33
28
|
run?: (req: ExecSandboxRequest, opts: ExecSandboxOptions) => Promise<ExecSandboxResult>;
|
|
29
|
+
env?: NodeJS.ProcessEnv;
|
|
34
30
|
now?: () => Date;
|
|
35
31
|
generateId?: () => string;
|
|
36
32
|
}
|
|
@@ -77,21 +73,6 @@ function isEnabled(prefs: ExecToolDeps["preferences"]): boolean {
|
|
|
77
73
|
return isContextModeEnabled(prefs);
|
|
78
74
|
}
|
|
79
75
|
|
|
80
|
-
function disabledResult(): ToolExecutionResult {
|
|
81
|
-
return {
|
|
82
|
-
content: [
|
|
83
|
-
{
|
|
84
|
-
type: "text",
|
|
85
|
-
text:
|
|
86
|
-
"gsd_exec is disabled by `context_mode.enabled: false` in preferences. Remove that " +
|
|
87
|
-
"override (or set it to true) to re-enable sandboxed tool-output execution.",
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
details: { operation: "gsd_exec", error: "context_mode_disabled" },
|
|
91
|
-
isError: true,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
76
|
function paramError(message: string): ToolExecutionResult {
|
|
96
77
|
return {
|
|
97
78
|
content: [{ type: "text", text: `Error: ${message}` }],
|
|
@@ -104,7 +85,7 @@ export async function executeGsdExec(
|
|
|
104
85
|
params: ExecToolParams,
|
|
105
86
|
deps: ExecToolDeps,
|
|
106
87
|
): Promise<ToolExecutionResult> {
|
|
107
|
-
if (!isEnabled(deps.preferences)) return
|
|
88
|
+
if (!isEnabled(deps.preferences)) return contextModeDisabledResult("gsd_exec");
|
|
108
89
|
|
|
109
90
|
const runtime = params.runtime;
|
|
110
91
|
if (runtime !== "bash" && runtime !== "node" && runtime !== "python") {
|
|
@@ -121,7 +102,7 @@ export async function executeGsdExec(
|
|
|
121
102
|
const opts = buildExecOptions(
|
|
122
103
|
deps.baseDir,
|
|
123
104
|
deps.preferences?.context_mode,
|
|
124
|
-
{ now: deps.now, generateId: deps.generateId },
|
|
105
|
+
{ env: deps.env, now: deps.now, generateId: deps.generateId },
|
|
125
106
|
);
|
|
126
107
|
const run = deps.run ?? runExecSandbox;
|
|
127
108
|
|
|
@@ -308,6 +308,7 @@ function includeSupersededMemories(rankedActive: Memory[]): Memory[] {
|
|
|
308
308
|
scope: (row["scope"] as string) ?? "project",
|
|
309
309
|
tags,
|
|
310
310
|
structured_fields: structuredFields,
|
|
311
|
+
last_hit_at: (row["last_hit_at"] as string | null) ?? null,
|
|
311
312
|
};
|
|
312
313
|
});
|
|
313
314
|
} catch {
|
|
@@ -18,6 +18,7 @@ import { renderAllProjections } from "../workflow-projections.js";
|
|
|
18
18
|
import { writeManifest } from "../workflow-manifest.js";
|
|
19
19
|
import { appendEvent } from "../workflow-events.js";
|
|
20
20
|
import { logWarning } from "../workflow-logger.js";
|
|
21
|
+
import { validatePlanningPathScope } from "../planning-path-scope.js";
|
|
21
22
|
|
|
22
23
|
export interface PlanSliceTaskInput {
|
|
23
24
|
taskId: string;
|
|
@@ -141,6 +142,18 @@ export async function handlePlanSlice(
|
|
|
141
142
|
return { error: `validation failed: ${(err as Error).message}` };
|
|
142
143
|
}
|
|
143
144
|
|
|
145
|
+
const pathScopeError = validatePlanningPathScope(
|
|
146
|
+
basePath,
|
|
147
|
+
params.tasks.flatMap((task, index) => [
|
|
148
|
+
{ field: `tasks[${index}].files`, values: task.files },
|
|
149
|
+
{ field: `tasks[${index}].inputs`, values: task.inputs },
|
|
150
|
+
{ field: `tasks[${index}].expectedOutput`, values: task.expectedOutput },
|
|
151
|
+
]),
|
|
152
|
+
);
|
|
153
|
+
if (pathScopeError) {
|
|
154
|
+
return { error: `validation failed: ${pathScopeError}` };
|
|
155
|
+
}
|
|
156
|
+
|
|
144
157
|
// ── Guards + DB writes inside a single transaction (prevents TOCTOU) ───
|
|
145
158
|
// Guards must be inside the transaction so the state they check cannot
|
|
146
159
|
// change between the read and the write (#2723).
|
|
@@ -8,6 +8,7 @@ import { renderAllProjections } from "../workflow-projections.js";
|
|
|
8
8
|
import { writeManifest } from "../workflow-manifest.js";
|
|
9
9
|
import { appendEvent } from "../workflow-events.js";
|
|
10
10
|
import { logWarning } from "../workflow-logger.js";
|
|
11
|
+
import { validatePlanningPathScope } from "../planning-path-scope.js";
|
|
11
12
|
|
|
12
13
|
export interface PlanTaskParams {
|
|
13
14
|
milestoneId: string;
|
|
@@ -66,6 +67,15 @@ export async function handlePlanTask(
|
|
|
66
67
|
return { error: `validation failed: ${(err as Error).message}` };
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
const pathScopeError = validatePlanningPathScope(basePath, [
|
|
71
|
+
{ field: "files", values: params.files },
|
|
72
|
+
{ field: "inputs", values: params.inputs },
|
|
73
|
+
{ field: "expectedOutput", values: params.expectedOutput },
|
|
74
|
+
]);
|
|
75
|
+
if (pathScopeError) {
|
|
76
|
+
return { error: `validation failed: ${pathScopeError}` };
|
|
77
|
+
}
|
|
78
|
+
|
|
69
79
|
// ── Guards + DB writes inside a single transaction (prevents TOCTOU) ───
|
|
70
80
|
// Guards must be inside the transaction so the state they check cannot
|
|
71
81
|
// change between the read and the write (#2723).
|