gsd-pi 2.71.0-dev.977c553 → 2.71.0-dev.d4d916a
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/cli.js +12 -3
- package/dist/headless-events.d.ts +2 -0
- package/dist/headless-events.js +7 -0
- package/dist/headless.js +16 -3
- package/dist/mcp-server.js +6 -6
- package/dist/provider-migrations.d.ts +10 -0
- package/dist/provider-migrations.js +12 -0
- package/dist/resource-loader.js +139 -13
- package/dist/resources/GSD-WORKFLOW.md +1 -1
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +10 -4
- package/dist/resources/extensions/gsd/auto/infra-errors.js +34 -0
- package/dist/resources/extensions/gsd/auto/loop.js +32 -1
- package/dist/resources/extensions/gsd/auto/phases.js +1 -1
- package/dist/resources/extensions/gsd/auto/session.js +11 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +22 -16
- package/dist/resources/extensions/gsd/auto-model-selection.js +10 -2
- package/dist/resources/extensions/gsd/auto-start.js +31 -7
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +1 -1
- package/dist/resources/extensions/gsd/auto-worktree.js +1 -1
- package/dist/resources/extensions/gsd/auto.js +52 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +2 -0
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +63 -51
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +6 -0
- package/dist/resources/extensions/gsd/commands/context.js +15 -6
- package/dist/resources/extensions/gsd/commands/dispatcher.js +12 -2
- package/dist/resources/extensions/gsd/commands/handlers/auto.js +10 -33
- package/dist/resources/extensions/gsd/commands/handlers/core.js +56 -11
- package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +15 -6
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +4 -10
- package/dist/resources/extensions/gsd/dashboard-overlay.js +8 -3
- package/dist/resources/extensions/gsd/dispatch-guard.js +18 -1
- package/dist/resources/extensions/gsd/error-classifier.js +1 -1
- package/dist/resources/extensions/gsd/forensics.js +19 -6
- package/dist/resources/extensions/gsd/guided-flow.js +5 -10
- package/dist/resources/extensions/gsd/metrics.js +1 -0
- package/dist/resources/extensions/gsd/milestone-actions.js +10 -4
- package/dist/resources/extensions/gsd/notification-overlay.js +42 -13
- package/dist/resources/extensions/gsd/notification-store.js +56 -5
- package/dist/resources/extensions/gsd/notification-widget.js +5 -13
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +8 -3
- package/dist/resources/extensions/gsd/pre-execution-checks.js +35 -2
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/discuss.md +2 -0
- package/dist/resources/extensions/gsd/prompts/execute-task.md +20 -19
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
- package/dist/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
- package/dist/resources/extensions/gsd/prompts/queue.md +3 -2
- package/dist/resources/extensions/gsd/prompts/system.md +1 -0
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +2 -1
- package/dist/resources/extensions/gsd/session-model-override.js +25 -0
- package/dist/resources/extensions/gsd/shortcut-defs.js +40 -0
- package/dist/resources/extensions/ollama/index.js +13 -5
- package/dist/resources/skills/create-skill/SKILL.md +2 -0
- package/dist/startup-model-validation.d.ts +0 -1
- package/dist/startup-model-validation.js +6 -2
- 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 +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/required-server-files.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/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 +14 -14
- package/dist/web/standalone/.next/server/middleware-build-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/server.js +1 -1
- package/package.json +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +21 -11
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +110 -0
- package/packages/mcp-server/src/workflow-tools.ts +31 -11
- package/packages/pi-ai/dist/providers/amazon-bedrock.js +11 -2
- package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +20 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +4 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +8 -3
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js +44 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +2 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +7 -4
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +11 -0
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/src/providers/amazon-bedrock.ts +13 -1
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +32 -0
- package/packages/pi-ai/src/providers/anthropic-shared.test.ts +55 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +14 -3
- package/packages/pi-ai/src/providers/anthropic.ts +8 -4
- package/packages/pi-ai/src/providers/openai-completions.ts +14 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js +61 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js.map +1 -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 +2 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +10 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +27 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js +85 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js +64 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +22 -18
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts +8 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.js +75 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +38 -5
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.js +71 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js +13 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +24 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
- 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/tool-execution.d.ts +4 -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 +43 -0
- 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 +7 -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/model-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js +6 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js.map +1 -1
- 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 +4 -3
- 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.js +4 -2
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-renderable-tools.test.ts +70 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +2 -1
- package/packages/pi-coding-agent/src/core/auth-storage.test.ts +108 -0
- package/packages/pi-coding-agent/src/core/auth-storage.ts +30 -0
- package/packages/pi-coding-agent/src/core/model-resolver-initial-model-auth.test.ts +78 -0
- package/packages/pi-coding-agent/src/core/model-resolver.test.ts +85 -0
- package/packages/pi-coding-agent/src/core/model-resolver.ts +22 -18
- package/packages/pi-coding-agent/src/core/sdk.test.ts +89 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +45 -9
- package/packages/pi-coding-agent/src/index.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/login-dialog.test.ts +24 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +30 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +15 -6
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +47 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +7 -2
- package/packages/pi-coding-agent/src/modes/interactive/controllers/model-controller.ts +6 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +4 -3
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +4 -2
- package/src/resources/GSD-WORKFLOW.md +1 -1
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +13 -5
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +56 -4
- package/src/resources/extensions/gsd/auto/infra-errors.ts +38 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +2 -0
- package/src/resources/extensions/gsd/auto/loop.ts +45 -1
- package/src/resources/extensions/gsd/auto/phases.ts +2 -0
- package/src/resources/extensions/gsd/auto/session.ts +11 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +29 -18
- package/src/resources/extensions/gsd/auto-model-selection.ts +9 -1
- package/src/resources/extensions/gsd/auto-start.ts +38 -7
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +1 -1
- package/src/resources/extensions/gsd/auto-worktree.ts +1 -1
- package/src/resources/extensions/gsd/auto.ts +68 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +2 -0
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +79 -60
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +7 -0
- package/src/resources/extensions/gsd/commands/context.ts +16 -5
- package/src/resources/extensions/gsd/commands/dispatcher.ts +14 -2
- package/src/resources/extensions/gsd/commands/handlers/auto.ts +10 -36
- package/src/resources/extensions/gsd/commands/handlers/core.ts +58 -11
- package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +17 -7
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +4 -10
- package/src/resources/extensions/gsd/dashboard-overlay.ts +10 -3
- package/src/resources/extensions/gsd/dispatch-guard.ts +18 -1
- package/src/resources/extensions/gsd/error-classifier.ts +1 -1
- package/src/resources/extensions/gsd/forensics.ts +23 -7
- package/src/resources/extensions/gsd/guided-flow.ts +5 -10
- package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
- package/src/resources/extensions/gsd/metrics.ts +12 -1
- package/src/resources/extensions/gsd/milestone-actions.ts +10 -3
- package/src/resources/extensions/gsd/notification-overlay.ts +47 -14
- package/src/resources/extensions/gsd/notification-store.ts +54 -5
- package/src/resources/extensions/gsd/notification-widget.ts +5 -14
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +10 -3
- package/src/resources/extensions/gsd/pre-execution-checks.ts +39 -2
- package/src/resources/extensions/gsd/prompts/complete-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/discuss.md +2 -0
- package/src/resources/extensions/gsd/prompts/execute-task.md +20 -19
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
- package/src/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
- package/src/resources/extensions/gsd/prompts/queue.md +3 -2
- package/src/resources/extensions/gsd/prompts/system.md +1 -0
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +2 -1
- package/src/resources/extensions/gsd/session-model-override.ts +36 -0
- package/src/resources/extensions/gsd/shortcut-defs.ts +56 -0
- package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +25 -9
- package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +28 -0
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/complete-slice-prompt-task-summary-layout.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/execute-task-prompt-existing-artifact-guard.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/format-shortcut.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/gsd-no-project-error.test.ts +73 -0
- package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +180 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +66 -1
- package/src/resources/extensions/gsd/tests/model-isolation.test.ts +36 -51
- package/src/resources/extensions/gsd/tests/notification-store.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/notification-widget.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/register-shortcuts.test.ts +63 -5
- package/src/resources/extensions/gsd/tests/session-model-override.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts +18 -0
- package/src/resources/extensions/ollama/index.ts +13 -3
- package/src/resources/extensions/ollama/ollama-status-indicator.test.ts +28 -0
- package/src/resources/skills/create-skill/SKILL.md +2 -0
- /package/dist/web/standalone/.next/static/{4xyaXTn7-shVHaGMcl75o → IRnpNeY-_eO7SxKBIkTbL}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{4xyaXTn7-shVHaGMcl75o → IRnpNeY-_eO7SxKBIkTbL}/_ssgManifest.js +0 -0
|
@@ -32,29 +32,30 @@ Then:
|
|
|
32
32
|
0. Narrate step transitions, key implementation decisions, and verification outcomes as you work. Keep it terse — one line between tool-call clusters, not between every call — but write complete sentences in user-facing prose, not shorthand notes or scratchpad fragments.
|
|
33
33
|
1. {{skillActivation}} Follow any activated skills before writing code. If no skills match this task, skip this step.
|
|
34
34
|
2. Execute the steps in the inlined task plan, adapting minor local mismatches when the surrounding code differs from the planner's snapshot
|
|
35
|
-
3.
|
|
36
|
-
4.
|
|
37
|
-
5.
|
|
35
|
+
3. Before any `Write` that creates an artifact or output file, check whether that path already exists. If it does, read it first and decide whether the work is already done, should be extended, or truly needs replacement. "Create" in the plan does **not** mean the file is missing — a prior session may already have started it.
|
|
36
|
+
4. Build the real thing. If the task plan says "create login endpoint", build an endpoint that actually authenticates against a real store, not one that returns a hardcoded success response. If the task plan says "create dashboard page", build a page that renders real data from the API, not a component with hardcoded props. Stubs and mocks are for tests, not for the shipped feature.
|
|
37
|
+
5. Write or update tests as part of execution — tests are verification, not an afterthought. If the slice plan defines test files in its Verification section and this is the first task, create them (they should initially fail).
|
|
38
|
+
6. When implementing non-trivial runtime behavior (async flows, API boundaries, background processes, error paths), add or preserve agent-usable observability. Skip this for simple changes where it doesn't apply.
|
|
38
39
|
|
|
39
40
|
**Background process rule:** Never use bare `command &` to run background processes. The shell's `&` operator leaves stdout/stderr attached to the parent, which causes the Bash tool to hang indefinitely waiting for those streams to close. Always redirect output before backgrounding:
|
|
40
41
|
- Correct: `command > /dev/null 2>&1 &` or `nohup command > /dev/null 2>&1 &`
|
|
41
42
|
- Example: `python -m http.server 8080 > /dev/null 2>&1 &` (NOT `python -m http.server 8080 &`)
|
|
42
43
|
- Preferred: use the `bg_shell` tool if available — it manages process lifecycle correctly without stream-inheritance issues
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
7. If the task plan includes a **Failure Modes** section (Q5), implement the error/timeout/malformed handling specified. Verify each dependency's failure path is handled. Skip if the section is absent.
|
|
45
|
+
8. If the task plan includes a **Load Profile** section (Q6), implement protections for the identified 10x breakpoint (connection pooling, rate limiting, pagination, etc.). Skip if absent.
|
|
46
|
+
9. If the task plan includes a **Negative Tests** section (Q7), write the specified negative test cases alongside the happy-path tests — malformed inputs, error paths, and boundary conditions. Skip if absent.
|
|
47
|
+
10. Verify must-haves are met by running concrete checks (tests, commands, observable behaviors)
|
|
48
|
+
11. Run the slice-level verification checks defined in the slice plan's Verification section. Track which pass. On the final task of the slice, all must pass before marking done. On intermediate tasks, partial passes are expected — note which ones pass in the summary.
|
|
49
|
+
12. After the verification gate runs (you'll see gate results in stderr/notify output), populate the `## Verification Evidence` table in your task summary with the check results. Use the `formatEvidenceTable` format: one row per check with command, exit code, verdict (✅ pass / ❌ fail), and duration. If no verification commands were discovered, note that in the section.
|
|
50
|
+
13. If the task touches UI, browser flows, DOM behavior, or user-visible web state:
|
|
50
51
|
- exercise the real flow in the browser
|
|
51
52
|
- prefer `browser_batch` when the next few actions are obvious and sequential
|
|
52
53
|
- prefer `browser_assert` for explicit pass/fail verification of the intended outcome
|
|
53
54
|
- use `browser_diff` when an action's effect is ambiguous
|
|
54
55
|
- use console/network/dialog diagnostics when validating async, stateful, or failure-prone UI
|
|
55
56
|
- record verification in terms of explicit checks passed/failed, not only prose interpretation
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
14. If the task plan includes an Observability Impact section, verify those signals directly. Skip this step if the task plan omits the section.
|
|
58
|
+
15. **If execution is running long or verification fails:**
|
|
58
59
|
|
|
59
60
|
**Context budget:** You have approximately **{{verificationBudget}}** reserved for verification context. If you've used most of your context and haven't finished all steps, stop implementing and prioritize writing the task summary with clear notes on what's done and what remains. A partial summary that enables clean resumption is more valuable than one more half-finished step with no documentation. Never sacrifice summary quality for one more implementation step.
|
|
60
61
|
|
|
@@ -65,13 +66,13 @@ Then:
|
|
|
65
66
|
- Distinguish "I know" from "I assume." Observable facts (the error says X) are strong evidence. Assumptions (this library should work this way) need verification.
|
|
66
67
|
- Know when to stop. If you've tried 3+ fixes without progress, your mental model is probably wrong. Stop. List what you know for certain. List what you've ruled out. Form fresh hypotheses from there.
|
|
67
68
|
- Don't fix symptoms. Understand *why* something fails before changing code. A test that passes after a change you don't understand is luck, not a fix.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
16. **Blocker discovery:** If execution reveals that the remaining slice plan is fundamentally invalid — not just a bug or minor deviation, but a plan-invalidating finding like a wrong API, missing capability, or architectural mismatch — set `blocker_discovered: true` in the task summary frontmatter and describe the blocker clearly in the summary narrative. Do NOT set `blocker_discovered: true` for ordinary debugging, minor deviations, or issues that can be fixed within the current task or the remaining plan. This flag triggers an automatic replan of the slice.
|
|
70
|
+
17. If you made an architectural, pattern, library, or observability decision during this task that downstream work should know about, append it to `.gsd/DECISIONS.md` (read the template at `~/.gsd/agent/extensions/gsd/templates/decisions.md` if the file doesn't exist yet). Not every task produces decisions — only append when a meaningful choice was made.
|
|
71
|
+
18. If you discover a non-obvious rule, recurring gotcha, or useful pattern during execution, append it to `.gsd/KNOWLEDGE.md`. Only add entries that would save future agents from repeating your investigation. Don't add obvious things.
|
|
72
|
+
19. Read the template at `~/.gsd/agent/extensions/gsd/templates/task-summary.md`
|
|
73
|
+
20. Use that template to prepare the completion content you will pass to `gsd_complete_task` using the camelCase fields `milestoneId`, `sliceId`, `taskId`, `oneLiner`, `narrative`, `verification`, and `verificationEvidence`. Do **not** manually write `{{taskSummaryPath}}` — the DB-backed tool is the canonical write path and renders the summary file for you.
|
|
74
|
+
21. Call `gsd_complete_task` with milestoneId, sliceId, taskId, and the completion fields derived from the template. This is your final required step — do NOT manually edit PLAN.md checkboxes. The tool marks the task complete, updates the DB, renders `{{taskSummaryPath}}`, and updates PLAN.md automatically.
|
|
75
|
+
22. Do not run git commands — the system reads your task summary after completion and creates a meaningful commit from it (type inferred from title, message from your one-liner, key files from frontmatter). Write a clear, specific one-liner in the summary — it becomes the commit message.
|
|
75
76
|
|
|
76
77
|
All work stays in your working directory: `{{workingDirectory}}`.
|
|
77
78
|
|
|
@@ -32,6 +32,8 @@ Ask **1–3 questions per round**. Keep each question focused on one of:
|
|
|
32
32
|
- **The biggest technical unknowns / risks** — what could fail, what hasn't been proven
|
|
33
33
|
- **What external systems/services this touches** — APIs, databases, third-party services
|
|
34
34
|
|
|
35
|
+
**Never fabricate or simulate user input.** Never generate fake transcript markers like `[User]`, `[Human]`, or `User:`. Ask one question round, then wait for the user's actual response before continuing.
|
|
36
|
+
|
|
35
37
|
**If `{{structuredQuestionsAvailable}}` is `true`:** use `ask_user_questions` for each round. 1–3 questions per call, each as a separate question object. Keep option labels short (3–5 words). Always include a freeform "Other / let me explain" option. When the user picks that option or writes a long freeform answer, switch to plain text follow-up for that thread before resuming structured questions. **IMPORTANT: Call `ask_user_questions` exactly once per turn. Never make multiple calls with the same or overlapping questions — wait for the user's response before asking the next round.**
|
|
36
38
|
|
|
37
39
|
**If `{{structuredQuestionsAvailable}}` is `false`:** ask questions in plain text. Keep each round to 1–3 focused questions. Wait for answers before asking the next round.
|
|
@@ -22,6 +22,8 @@ Do **not** go deep — just enough that your questions reflect what's actually t
|
|
|
22
22
|
|
|
23
23
|
### Question rounds
|
|
24
24
|
|
|
25
|
+
**Never fabricate or simulate user input.** Never generate fake transcript markers like `[User]`, `[Human]`, or `User:`. Ask one question round, then wait for the user's actual response before continuing.
|
|
26
|
+
|
|
25
27
|
**If `{{structuredQuestionsAvailable}}` is `true`:** Ask **1–3 questions per round** using `ask_user_questions`. **Call `ask_user_questions` exactly once per turn — never make multiple calls with the same or overlapping questions. Wait for the user's response before asking the next round.**
|
|
26
28
|
**If `{{structuredQuestionsAvailable}}` is `false`:** Ask **1–3 questions per round** in plain text. Number them and wait for the user's response before asking the next round.
|
|
27
29
|
Keep each question focused on one of:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Resume interrupted work. Find the continue file (`{{sliceId}}-CONTINUE.md` or `continue.md`) in slice {{sliceId}} of milestone {{milestoneId}}, read it, and use it as the recovery contract for where to pick up. Do **not** delete the continue file immediately. Keep it until the task is successfully completed or you have written a newer summary/continue artifact that clearly supersedes it. If the resumed attempt fails again, update or replace the continue file so no recovery context is lost. {{skillActivation}}
|
|
1
|
+
Resume interrupted work. Find the continue file (`{{sliceId}}-CONTINUE.md` or `continue.md`) in slice {{sliceId}} of milestone {{milestoneId}}, read it, and use it as the recovery contract for where to pick up. Before you create any expected artifact or output file, check whether it already exists and read it first — a prior session may already have started or completed that work. Do **not** delete the continue file immediately. Keep it until the task is successfully completed or you have written a newer summary/continue artifact that clearly supersedes it. If the resumed attempt fails again, update or replace the continue file so no recovery context is lost. {{skillActivation}}
|
|
@@ -18,6 +18,7 @@ Say exactly: "What do you want to add?" — nothing else. Wait for the user's an
|
|
|
18
18
|
## Discussion Phase
|
|
19
19
|
|
|
20
20
|
After they describe it, your job is to understand the new work deeply enough to create context files that a future planning session can use.
|
|
21
|
+
Never fabricate or simulate user input during this discussion. Never generate fake transcript markers like `[User]`, `[Human]`, or `User:`. Ask one question round, then wait for the user's actual response before continuing.
|
|
21
22
|
|
|
22
23
|
**If the user provides a file path or pastes a large document** (spec, design doc, product plan, chat export), read it fully before asking questions. Use it as the starting point — don't ask them to re-explain what's already in the document. Your questions should fill gaps and resolve ambiguities the document doesn't cover.
|
|
23
24
|
|
|
@@ -36,11 +37,11 @@ Don't go deep — just enough that your next question reflects what's actually t
|
|
|
36
37
|
- How the new work relates to existing milestones — overlap, dependencies, prerequisites
|
|
37
38
|
- If `.gsd/REQUIREMENTS.md` exists: which unmet Active or Deferred requirements this queued work advances
|
|
38
39
|
|
|
39
|
-
**Then use ask_user_questions** to dig into gray areas — scope boundaries, proof expectations, integration choices, tech preferences when they materially matter, and what's in vs out. 1-3 questions per round.
|
|
40
|
+
**Then use ask_user_questions** to dig into gray areas — scope boundaries, proof expectations, integration choices, tech preferences when they materially matter, and what's in vs out. Ask 1-3 questions per round, then wait for the user's response before asking the next round.
|
|
40
41
|
|
|
41
42
|
If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during discuss/planning work, but do not let it override the required discuss flow or artifact requirements.
|
|
42
43
|
|
|
43
|
-
**Self-regulate:** Do **not** ask a meta "ready to queue?" question after every round. Keep going until you have enough depth to write the context well, then use a single wrap-up prompt if needed.
|
|
44
|
+
**Self-regulate:** Do **not** ask a meta "ready to queue?" question after every round. Keep going until you have enough depth to write the context well, then use a single wrap-up prompt if needed. Do not infer permission to continue from silence or from partial prior answers — each new round requires an actual user response.
|
|
44
45
|
|
|
45
46
|
## Existing Milestone Awareness
|
|
46
47
|
|
|
@@ -35,6 +35,7 @@ GSD ships with bundled skills. Load the relevant skill file with the `read` tool
|
|
|
35
35
|
- Read before edit.
|
|
36
36
|
- Reproduce before fix when possible.
|
|
37
37
|
- Work is not done until the relevant verification has passed.
|
|
38
|
+
- **Never fabricate, simulate, or role-play user responses.** Never generate markers like `[User]`, `[Human]`, `User:`, or similar to represent user input inside your own output. Ask one question round (1-3 questions), then stop and wait for the user's actual response before continuing. If `ask_user_questions` is available, treat its returned response as the only valid structured user input for that round.
|
|
38
39
|
- Never print, echo, log, or restate secrets or credentials. Report only key names and applied/skipped status.
|
|
39
40
|
- Never ask the user to edit `.env` files or set secrets manually. Use `secure_env_collect`.
|
|
40
41
|
- In enduring files, write current state only unless the file is explicitly historical.
|
|
@@ -31,7 +31,7 @@ Prompt: "Review milestone {{milestoneId}} requirements coverage. Working directo
|
|
|
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
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
|
|
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. Then review the inlined milestone verification classes from planning. For each non-empty planned class, output a markdown table: Class | Planned Check | Evidence | Verdict. Use the exact class names `Contract`, `Integration`, `Operational`, and `UAT` whenever those classes are present. If no verification classes were planned, say that explicitly. Output two sections: `Acceptance Criteria` with a checklist `[ ] Criterion | Evidence`, and `Verification Classes` with the table. End with a one-line verdict: PASS if all criteria and verification classes are covered, NEEDS-ATTENTION if gaps exist."
|
|
35
35
|
|
|
36
36
|
### Step 2 — Synthesize Findings
|
|
37
37
|
|
|
@@ -70,6 +70,7 @@ reviewers: 3
|
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
Call `gsd_validate_milestone` with the camelCase fields `milestoneId`, `verdict`, `remediationRound`, `successCriteriaChecklist`, `sliceDeliveryAudit`, `crossSliceIntegration`, `requirementCoverage`, `verdictRationale`, and `remediationPlan` when needed. If you include verification-class analysis, pass it in `verificationClasses`.
|
|
73
|
+
Extract the `Verification Classes` subsection from Reviewer C and pass it verbatim in `verificationClasses` so the persisted validation output uses the canonical class names `Contract`, `Integration`, `Operational`, and `UAT`.
|
|
73
74
|
|
|
74
75
|
**DB access safety:** Do NOT query `.gsd/gsd.db` directly via `sqlite3` or `node -e require('better-sqlite3')` — the engine owns the WAL connection. Use `gsd_milestone_status` to read milestone and slice state. All data you need is already inlined in the context above or accessible via the `gsd_*` tools. Direct DB access corrupts the WAL and bypasses tool-level validation.
|
|
75
76
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface SessionModelOverride {
|
|
2
|
+
provider: string;
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const sessionOverrides = new Map<string, SessionModelOverride>();
|
|
7
|
+
|
|
8
|
+
function normalizeSessionId(sessionId: string): string {
|
|
9
|
+
return typeof sessionId === "string" ? sessionId.trim() : "";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function setSessionModelOverride(
|
|
13
|
+
sessionId: string,
|
|
14
|
+
override: SessionModelOverride,
|
|
15
|
+
): void {
|
|
16
|
+
const key = normalizeSessionId(sessionId);
|
|
17
|
+
if (!key) return;
|
|
18
|
+
sessionOverrides.set(key, {
|
|
19
|
+
provider: override.provider,
|
|
20
|
+
id: override.id,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function getSessionModelOverride(
|
|
25
|
+
sessionId: string,
|
|
26
|
+
): SessionModelOverride | undefined {
|
|
27
|
+
const key = normalizeSessionId(sessionId);
|
|
28
|
+
if (!key) return undefined;
|
|
29
|
+
return sessionOverrides.get(key);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function clearSessionModelOverride(sessionId: string): void {
|
|
33
|
+
const key = normalizeSessionId(sessionId);
|
|
34
|
+
if (!key) return;
|
|
35
|
+
sessionOverrides.delete(key);
|
|
36
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Canonical GSD shortcut definitions used by registration, help text, and overlays.
|
|
2
|
+
|
|
3
|
+
import { formatShortcut } from "./files.js";
|
|
4
|
+
|
|
5
|
+
export type GSDShortcutId = "dashboard" | "notifications" | "parallel";
|
|
6
|
+
|
|
7
|
+
type GSDShortcutDef = {
|
|
8
|
+
key: "g" | "n" | "p";
|
|
9
|
+
action: string;
|
|
10
|
+
command: string;
|
|
11
|
+
/** Whether the Ctrl+Shift fallback is registered (false when it conflicts with an app keybinding). */
|
|
12
|
+
hasFallback: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const GSD_SHORTCUTS: Record<GSDShortcutId, GSDShortcutDef> = {
|
|
16
|
+
dashboard: {
|
|
17
|
+
key: "g",
|
|
18
|
+
action: "Open GSD dashboard",
|
|
19
|
+
command: "/gsd status",
|
|
20
|
+
hasFallback: true,
|
|
21
|
+
},
|
|
22
|
+
notifications: {
|
|
23
|
+
key: "n",
|
|
24
|
+
action: "Open notification history",
|
|
25
|
+
command: "/gsd notifications",
|
|
26
|
+
hasFallback: true,
|
|
27
|
+
},
|
|
28
|
+
parallel: {
|
|
29
|
+
key: "p",
|
|
30
|
+
action: "Open parallel worker monitor",
|
|
31
|
+
command: "/gsd parallel watch",
|
|
32
|
+
hasFallback: false, // Ctrl+Shift+P conflicts with cycleModelBackward
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
function combo(prefix: "Ctrl+Alt+" | "Ctrl+Shift+", key: string): string {
|
|
37
|
+
return `${prefix}${key.toUpperCase()}`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function primaryShortcutCombo(id: GSDShortcutId): string {
|
|
41
|
+
return combo("Ctrl+Alt+", GSD_SHORTCUTS[id].key);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function fallbackShortcutCombo(id: GSDShortcutId): string {
|
|
45
|
+
return combo("Ctrl+Shift+", GSD_SHORTCUTS[id].key);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function shortcutPair(id: GSDShortcutId, formatter: (combo: string) => string = (combo) => combo): string {
|
|
49
|
+
const primary = formatter(primaryShortcutCombo(id));
|
|
50
|
+
if (!GSD_SHORTCUTS[id].hasFallback) return primary;
|
|
51
|
+
return `${primary} / ${formatter(fallbackShortcutCombo(id))}`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function formattedShortcutPair(id: GSDShortcutId): string {
|
|
55
|
+
return shortcutPair(id, formatShortcut);
|
|
56
|
+
}
|
|
@@ -7,9 +7,8 @@ const sourcePath = join(import.meta.dirname, "..", "auto-start.ts");
|
|
|
7
7
|
const source = readFileSync(sourcePath, "utf-8");
|
|
8
8
|
|
|
9
9
|
test("bootstrapAutoSession snapshots ctx.model before guided-flow entry (#2829)", () => {
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
const snapshotIdx = source.indexOf("const startModelSnapshot = preferredModel");
|
|
10
|
+
// The snapshot ordering guarantee still holds: build snapshot before guided-flow.
|
|
11
|
+
const snapshotIdx = source.indexOf("const startModelSnapshot = manualSessionOverride");
|
|
13
12
|
assert.ok(snapshotIdx > -1, "auto-start.ts should snapshot model at bootstrap start");
|
|
14
13
|
|
|
15
14
|
const firstDiscussIdx = source.indexOf('await showSmartEntry(ctx, pi, base, { step: requestedStepMode });');
|
|
@@ -29,8 +28,11 @@ test("bootstrapAutoSession restores autoModeStartModel from the early snapshot (
|
|
|
29
28
|
assert.ok(snapshotRefIdx > -1, "autoModeStartModel should be restored from startModelSnapshot");
|
|
30
29
|
});
|
|
31
30
|
|
|
32
|
-
test("bootstrapAutoSession
|
|
33
|
-
|
|
31
|
+
test("bootstrapAutoSession checks manual session override before preferences", () => {
|
|
32
|
+
const manualIdx = source.indexOf("const manualSessionOverride = getSessionModelOverride(");
|
|
33
|
+
assert.ok(manualIdx > -1, "auto-start.ts should read session model override first");
|
|
34
|
+
|
|
35
|
+
// resolveDefaultSessionModel() should still be called for fallback behavior
|
|
34
36
|
const preferredIdx = source.indexOf("const preferredModel = resolveDefaultSessionModel(");
|
|
35
37
|
assert.ok(preferredIdx > -1, "auto-start.ts should call resolveDefaultSessionModel()");
|
|
36
38
|
|
|
@@ -38,11 +40,25 @@ test("bootstrapAutoSession prefers GSD PREFERENCES.md over settings.json for sta
|
|
|
38
40
|
const withProviderIdx = source.indexOf("resolveDefaultSessionModel(ctx.model?.provider)");
|
|
39
41
|
assert.ok(withProviderIdx > -1, "auto-start.ts should pass ctx.model?.provider for bare ID resolution");
|
|
40
42
|
|
|
41
|
-
const snapshotIdx = source.indexOf("const startModelSnapshot =
|
|
42
|
-
assert.ok(snapshotIdx > -1, "startModelSnapshot should
|
|
43
|
+
const snapshotIdx = source.indexOf("const startModelSnapshot = manualSessionOverride");
|
|
44
|
+
assert.ok(snapshotIdx > -1, "startModelSnapshot should prefer manual session override");
|
|
43
45
|
|
|
44
46
|
assert.ok(
|
|
45
|
-
preferredIdx < snapshotIdx,
|
|
46
|
-
"
|
|
47
|
+
manualIdx < snapshotIdx && preferredIdx < snapshotIdx,
|
|
48
|
+
"manual override and preference fallback must be resolved before building startModelSnapshot",
|
|
47
49
|
);
|
|
48
50
|
});
|
|
51
|
+
|
|
52
|
+
test("bootstrapAutoSession validates preferred model against live registry auth (#unconfigured-models)", () => {
|
|
53
|
+
// The raw PREFERENCES.md value must be validated against getAvailable()
|
|
54
|
+
// before being captured as the snapshot, so an unconfigured provider
|
|
55
|
+
// (no API key / OAuth) can't become autoModeStartModel.
|
|
56
|
+
const validationIdx = source.indexOf("ctx.modelRegistry.getAvailable()");
|
|
57
|
+
assert.ok(validationIdx > -1, "auto-start.ts should validate preferred model against getAvailable()");
|
|
58
|
+
|
|
59
|
+
const resolveModelIdIdx = source.indexOf("resolveModelId");
|
|
60
|
+
assert.ok(resolveModelIdIdx > -1, "auto-start.ts should resolve preferred model against the registry");
|
|
61
|
+
|
|
62
|
+
const warningIdx = source.indexOf("is not configured; falling back to session default");
|
|
63
|
+
assert.ok(warningIdx > -1, "auto-start.ts should warn when preferred model is unconfigured");
|
|
64
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
|
|
4
|
+
import { createTestContext } from "./test-helpers.ts";
|
|
5
|
+
|
|
6
|
+
const { assertTrue, report } = createTestContext();
|
|
7
|
+
|
|
8
|
+
const srcPath = join(import.meta.dirname, "..", "auto-start.ts");
|
|
9
|
+
const src = readFileSync(srcPath, "utf-8");
|
|
10
|
+
|
|
11
|
+
console.log("\n=== #3822: worktree bootstrap uses project DB path ===");
|
|
12
|
+
|
|
13
|
+
const dbLifecycleIdx = src.indexOf("// ── DB lifecycle ──");
|
|
14
|
+
assertTrue(dbLifecycleIdx > 0, "auto-start.ts has a DB lifecycle section");
|
|
15
|
+
|
|
16
|
+
const dbLifecycleRegion = dbLifecycleIdx > 0 ? src.slice(dbLifecycleIdx, dbLifecycleIdx + 600) : "";
|
|
17
|
+
|
|
18
|
+
assertTrue(
|
|
19
|
+
dbLifecycleRegion.includes("const gsdDbPath = resolveProjectRootDbPath(s.basePath);"),
|
|
20
|
+
"DB lifecycle resolves the project-root DB path after worktree entry (#3822)",
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
assertTrue(
|
|
24
|
+
!dbLifecycleRegion.includes('join(s.basePath, ".gsd", "gsd.db")'),
|
|
25
|
+
"DB lifecycle no longer derives gsd.db directly from the worktree path (#3822)",
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
report();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { describe, test } from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
|
|
6
|
+
const systemContextSrc = readFileSync(
|
|
7
|
+
join(import.meta.dirname, "..", "bootstrap", "system-context.ts"),
|
|
8
|
+
"utf-8",
|
|
9
|
+
);
|
|
10
|
+
const registerHooksSrc = readFileSync(
|
|
11
|
+
join(import.meta.dirname, "..", "bootstrap", "register-hooks.ts"),
|
|
12
|
+
"utf-8",
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
describe("bootstrap deriveState DB guards (#3844)", () => {
|
|
16
|
+
test("system-context opens DB before deriveState in resume flows", () => {
|
|
17
|
+
const helperIdx = systemContextSrc.indexOf("const ensureStateDbOpen = async () => {");
|
|
18
|
+
const firstDeriveIdx = systemContextSrc.indexOf("const state = await deriveState(basePath);");
|
|
19
|
+
assert.ok(helperIdx > -1, "system-context should define a DB-open helper for deriveState callers");
|
|
20
|
+
assert.ok(firstDeriveIdx > -1, "system-context should still derive state for resume flows");
|
|
21
|
+
assert.ok(helperIdx < firstDeriveIdx, "system-context should prepare DB opening before deriveState resume calls");
|
|
22
|
+
assert.match(
|
|
23
|
+
systemContextSrc,
|
|
24
|
+
/await ensureStateDbOpen\(\);\s*\n\s*const state = await deriveState\(basePath\);/g,
|
|
25
|
+
"system-context resume flows should open DB before deriveState",
|
|
26
|
+
);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test("register-hooks opens DB before deriveState in session_before_compact", () => {
|
|
30
|
+
const compactIdx = registerHooksSrc.indexOf('pi.on("session_before_compact"');
|
|
31
|
+
assert.ok(compactIdx > -1, "register-hooks should define session_before_compact");
|
|
32
|
+
const compactSection = registerHooksSrc.slice(compactIdx, compactIdx + 1600);
|
|
33
|
+
const ensureIdx = compactSection.indexOf("ensureDbOpen()");
|
|
34
|
+
const deriveIdx = compactSection.indexOf("deriveState(basePath)");
|
|
35
|
+
assert.ok(ensureIdx > -1, "session_before_compact should call ensureDbOpen()");
|
|
36
|
+
assert.ok(deriveIdx > -1, "session_before_compact should derive state");
|
|
37
|
+
assert.ok(ensureIdx < deriveIdx, "session_before_compact should open DB before deriveState");
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
|
|
6
|
+
const promptPath = join(process.cwd(), "src/resources/extensions/gsd/prompts/complete-slice.md");
|
|
7
|
+
const prompt = readFileSync(promptPath, "utf-8");
|
|
8
|
+
|
|
9
|
+
test("complete-slice prompt explains the flat task summary layout", () => {
|
|
10
|
+
assert.match(prompt, /flat file layout/i);
|
|
11
|
+
assert.match(prompt, /T01-SUMMARY\.md/);
|
|
12
|
+
assert.match(prompt, /not inside per-task subdirectories like `tasks\/T01\/SUMMARY\.md`/i);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test("complete-slice prompt forbids the wrong task summary glob", () => {
|
|
16
|
+
assert.match(prompt, /find .*tasks -name "\*-SUMMARY\.md"/i);
|
|
17
|
+
assert.match(prompt, /Never use `tasks\/\*\/SUMMARY\.md`/);
|
|
18
|
+
});
|
|
@@ -145,6 +145,33 @@ test("dispatch guard falls back to positional ordering when no dependencies decl
|
|
|
145
145
|
);
|
|
146
146
|
});
|
|
147
147
|
|
|
148
|
+
test("dispatch guard ignores positionally-earlier reverse dependents for zero-dependency slices (#3720)", (t) => {
|
|
149
|
+
const repo = setupRepo();
|
|
150
|
+
t.after(() => teardownRepo(repo));
|
|
151
|
+
|
|
152
|
+
mkdirSync(join(repo, ".gsd", "milestones", "M015"), { recursive: true });
|
|
153
|
+
|
|
154
|
+
insertMilestone({ id: "M015", title: "Reverse dependency fallback" });
|
|
155
|
+
insertSlice({ id: "S03", milestoneId: "M015", title: "Complete prerequisite", status: "complete", depends: [], sequence: 0 });
|
|
156
|
+
insertSlice({ id: "S04", milestoneId: "M015", title: "Depends on S04A", status: "pending", depends: ["S03", "S04A"], sequence: 0 });
|
|
157
|
+
insertSlice({ id: "S04A", milestoneId: "M015", title: "No explicit deps", status: "pending", depends: [], sequence: 0 });
|
|
158
|
+
|
|
159
|
+
writeFileSync(join(repo, ".gsd", "milestones", "M015", "M015-ROADMAP.md"), "# M015\n");
|
|
160
|
+
|
|
161
|
+
// S04A has no declared dependencies and should not be blocked by S04, because
|
|
162
|
+
// S04 itself depends on S04A. With sequence=0, DB ordering falls back to id.
|
|
163
|
+
assert.equal(
|
|
164
|
+
getPriorSliceCompletionBlocker(repo, "main", "execute-task", "M015/S04A/T02"),
|
|
165
|
+
null,
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
// The reverse direction is still blocked normally.
|
|
169
|
+
assert.equal(
|
|
170
|
+
getPriorSliceCompletionBlocker(repo, "main", "execute-task", "M015/S04/T01"),
|
|
171
|
+
"Cannot dispatch execute-task M015/S04/T01: dependency slice M015/S04A is not complete.",
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
|
|
148
175
|
test("dispatch guard allows slice with all declared dependencies complete", (t) => {
|
|
149
176
|
const repo = setupRepo();
|
|
150
177
|
t.after(() => teardownRepo(repo));
|
package/src/resources/extensions/gsd/tests/execute-task-prompt-existing-artifact-guard.test.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const promptsDir = join(__dirname, "..", "prompts");
|
|
9
|
+
|
|
10
|
+
test("execute-task prompt requires reading existing artifacts before write", () => {
|
|
11
|
+
const prompt = readFileSync(join(promptsDir, "execute-task.md"), "utf-8");
|
|
12
|
+
|
|
13
|
+
assert.match(
|
|
14
|
+
prompt,
|
|
15
|
+
/Before any `Write` that creates an artifact or output file, check whether that path already exists\./,
|
|
16
|
+
"execute-task prompt should require an existence check before creating artifacts",
|
|
17
|
+
);
|
|
18
|
+
assert.match(
|
|
19
|
+
prompt,
|
|
20
|
+
/If it does, read it first and decide whether the work is already done, should be extended, or truly needs replacement\./,
|
|
21
|
+
"execute-task prompt should require reading existing artifacts before replacement",
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("guided resume prompt checks for pre-existing artifacts", () => {
|
|
26
|
+
const prompt = readFileSync(join(promptsDir, "guided-resume-task.md"), "utf-8");
|
|
27
|
+
|
|
28
|
+
assert.match(
|
|
29
|
+
prompt,
|
|
30
|
+
/Before you create any expected artifact or output file, check whether it already exists and read it first/i,
|
|
31
|
+
"guided resume prompt should guard pre-existing artifacts",
|
|
32
|
+
);
|
|
33
|
+
});
|
|
@@ -101,3 +101,65 @@ test("#1943 detectStuckLoops ignores watchdog duplicates but flags real re-dispa
|
|
|
101
101
|
assert.equal(anomalies.length, 1, `expected 1 anomaly (for the 3x dispatched task), got ${anomalies.length}`);
|
|
102
102
|
assert.ok(anomalies[0].summary.includes("3 times"));
|
|
103
103
|
});
|
|
104
|
+
|
|
105
|
+
test("#3760 detectStuckLoops ignores cross-session recovery re-dispatches", () => {
|
|
106
|
+
const anomalies: ForensicAnomaly[] = [];
|
|
107
|
+
|
|
108
|
+
const units: UnitMetrics[] = [
|
|
109
|
+
makeUnit({
|
|
110
|
+
type: "plan-slice",
|
|
111
|
+
id: "M001/S02",
|
|
112
|
+
startedAt: 1000,
|
|
113
|
+
finishedAt: 2000,
|
|
114
|
+
autoSessionKey: "session-a",
|
|
115
|
+
}),
|
|
116
|
+
makeUnit({
|
|
117
|
+
type: "plan-slice",
|
|
118
|
+
id: "M001/S02",
|
|
119
|
+
startedAt: 5000,
|
|
120
|
+
finishedAt: 6000,
|
|
121
|
+
autoSessionKey: "session-b",
|
|
122
|
+
}),
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
detectStuckLoops(units, anomalies);
|
|
126
|
+
|
|
127
|
+
assert.equal(anomalies.length, 0, "cross-session recovery should not be flagged as a stuck loop");
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
test("#3760 detectStuckLoops still flags repeated dispatches within one auto session", () => {
|
|
131
|
+
const anomalies: ForensicAnomaly[] = [];
|
|
132
|
+
|
|
133
|
+
const units: UnitMetrics[] = [
|
|
134
|
+
makeUnit({
|
|
135
|
+
type: "complete-slice",
|
|
136
|
+
id: "M011/S02",
|
|
137
|
+
startedAt: 1000,
|
|
138
|
+
finishedAt: 2000,
|
|
139
|
+
autoSessionKey: "session-a",
|
|
140
|
+
}),
|
|
141
|
+
makeUnit({
|
|
142
|
+
type: "complete-slice",
|
|
143
|
+
id: "M011/S02",
|
|
144
|
+
startedAt: 5000,
|
|
145
|
+
finishedAt: 6000,
|
|
146
|
+
autoSessionKey: "session-a",
|
|
147
|
+
}),
|
|
148
|
+
makeUnit({
|
|
149
|
+
type: "complete-slice",
|
|
150
|
+
id: "M011/S02",
|
|
151
|
+
startedAt: 9000,
|
|
152
|
+
finishedAt: 10000,
|
|
153
|
+
autoSessionKey: "session-b",
|
|
154
|
+
}),
|
|
155
|
+
];
|
|
156
|
+
|
|
157
|
+
detectStuckLoops(units, anomalies);
|
|
158
|
+
|
|
159
|
+
assert.equal(anomalies.length, 1, "within-session retries should still be flagged");
|
|
160
|
+
assert.ok(anomalies[0].summary.includes("2 times"), `summary should reflect the worst same-session loop: ${anomalies[0].summary}`);
|
|
161
|
+
assert.ok(
|
|
162
|
+
anomalies[0].details.includes("Cross-session recovery runs are ignored"),
|
|
163
|
+
`details should explain the session-aware rule: ${anomalies[0].details}`,
|
|
164
|
+
);
|
|
165
|
+
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import test from 'node:test';
|
|
5
5
|
import assert from 'node:assert/strict';
|
|
6
6
|
import { formatShortcut } from '../files.ts';
|
|
7
|
+
import { formattedShortcutPair, primaryShortcutCombo, fallbackShortcutCombo } from '../shortcut-defs.ts';
|
|
7
8
|
|
|
8
9
|
// ─── formatShortcut renders per-platform shortcuts ──────────────────────
|
|
9
10
|
|
|
@@ -67,3 +68,33 @@ test('formatShortcut: passes through plain key names', () => {
|
|
|
67
68
|
assert.strictEqual(formatShortcut('Escape'), 'Escape');
|
|
68
69
|
assert.strictEqual(formatShortcut('Enter'), 'Enter');
|
|
69
70
|
});
|
|
71
|
+
|
|
72
|
+
test("shortcut-defs: exposes canonical dashboard combos", () => {
|
|
73
|
+
assert.equal(primaryShortcutCombo("dashboard"), "Ctrl+Alt+G");
|
|
74
|
+
assert.equal(fallbackShortcutCombo("dashboard"), "Ctrl+Shift+G");
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test("shortcut-defs: formats shortcut pair using platform symbols", () => {
|
|
78
|
+
const pair = formattedShortcutPair("notifications");
|
|
79
|
+
if (process.platform === "darwin") {
|
|
80
|
+
assert.equal(pair, "⌃⌥N / ⌃⇧N");
|
|
81
|
+
} else {
|
|
82
|
+
assert.equal(pair, "Ctrl+Alt+N / Ctrl+Shift+N");
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test("shortcut-defs: parallel shortcut omits fallback (hasFallback: false)", () => {
|
|
87
|
+
const pair = formattedShortcutPair("parallel");
|
|
88
|
+
if (process.platform === "darwin") {
|
|
89
|
+
assert.equal(pair, "⌃⌥P", "parallel should only show primary combo");
|
|
90
|
+
} else {
|
|
91
|
+
assert.equal(pair, "Ctrl+Alt+P", "parallel should only show primary combo");
|
|
92
|
+
}
|
|
93
|
+
// Verify it does NOT contain the fallback separator
|
|
94
|
+
assert.ok(!pair.includes("/"), "parallel pair should not contain fallback separator");
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test("shortcut-defs: dashboard shortcut includes fallback (hasFallback: true)", () => {
|
|
98
|
+
const pair = formattedShortcutPair("dashboard");
|
|
99
|
+
assert.ok(pair.includes("/"), "dashboard pair should contain fallback separator");
|
|
100
|
+
});
|