gsd-pi 2.10.12 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled-extension-paths.d.ts +2 -0
- package/dist/bundled-extension-paths.js +10 -0
- package/dist/loader.js +45 -28
- package/dist/onboarding.js +100 -0
- package/dist/resource-loader.js +12 -3
- package/dist/resources/GSD-WORKFLOW.md +661 -0
- package/dist/resources/agents/researcher.md +29 -0
- package/dist/resources/agents/scout.md +56 -0
- package/dist/resources/agents/worker.md +31 -0
- package/dist/resources/extensions/ask-user-questions.ts +289 -0
- package/dist/resources/extensions/async-jobs/async-bash-tool.ts +211 -0
- package/dist/resources/extensions/async-jobs/await-tool.ts +101 -0
- package/dist/resources/extensions/async-jobs/cancel-job-tool.ts +34 -0
- package/dist/resources/extensions/async-jobs/index.ts +133 -0
- package/dist/resources/extensions/async-jobs/job-manager.ts +211 -0
- package/dist/resources/extensions/bg-shell/index.ts +3179 -0
- package/dist/resources/extensions/browser-tools/BROWSER-TOOLS-V2-PROPOSAL.md +1277 -0
- package/dist/resources/extensions/browser-tools/capture.ts +165 -0
- package/dist/resources/extensions/browser-tools/core.d.ts +205 -0
- package/dist/resources/extensions/browser-tools/core.js +1057 -0
- package/dist/resources/extensions/browser-tools/evaluate-helpers.ts +184 -0
- package/dist/resources/extensions/browser-tools/index.ts +51 -0
- package/dist/resources/extensions/browser-tools/lifecycle.ts +270 -0
- package/dist/resources/extensions/browser-tools/package.json +24 -0
- package/dist/resources/extensions/browser-tools/refs.ts +264 -0
- package/dist/resources/extensions/browser-tools/settle.ts +197 -0
- package/dist/resources/extensions/browser-tools/state.ts +408 -0
- package/dist/resources/extensions/browser-tools/tests/browser-tools-integration.test.mjs +652 -0
- package/dist/resources/extensions/browser-tools/tests/browser-tools-unit.test.cjs +614 -0
- package/dist/resources/extensions/browser-tools/tools/assertions.ts +342 -0
- package/dist/resources/extensions/browser-tools/tools/forms.ts +801 -0
- package/dist/resources/extensions/browser-tools/tools/inspection.ts +492 -0
- package/dist/resources/extensions/browser-tools/tools/intent.ts +614 -0
- package/dist/resources/extensions/browser-tools/tools/interaction.ts +865 -0
- package/dist/resources/extensions/browser-tools/tools/navigation.ts +232 -0
- package/dist/resources/extensions/browser-tools/tools/pages.ts +303 -0
- package/dist/resources/extensions/browser-tools/tools/refs.ts +541 -0
- package/dist/resources/extensions/browser-tools/tools/screenshot.ts +83 -0
- package/dist/resources/extensions/browser-tools/tools/session.ts +400 -0
- package/dist/resources/extensions/browser-tools/tools/wait.ts +247 -0
- package/dist/resources/extensions/browser-tools/utils.ts +660 -0
- package/dist/resources/extensions/context7/index.ts +428 -0
- package/dist/resources/extensions/context7/package.json +11 -0
- package/dist/resources/extensions/get-secrets-from-user.ts +625 -0
- package/dist/resources/extensions/google-search/index.ts +336 -0
- package/dist/resources/extensions/google-search/package.json +9 -0
- package/dist/resources/extensions/gsd/activity-log.ts +116 -0
- package/dist/resources/extensions/gsd/auto.ts +3732 -0
- package/dist/resources/extensions/gsd/commands.ts +544 -0
- package/dist/resources/extensions/gsd/crash-recovery.ts +105 -0
- package/dist/resources/extensions/gsd/dashboard-overlay.ts +564 -0
- package/dist/resources/extensions/gsd/dispatch-guard.ts +78 -0
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +278 -0
- package/dist/resources/extensions/gsd/doctor.ts +766 -0
- package/dist/resources/extensions/gsd/exit-command.ts +18 -0
- package/dist/resources/extensions/gsd/files.ts +857 -0
- package/dist/resources/extensions/gsd/git-service.ts +904 -0
- package/dist/resources/extensions/gsd/gitignore.ts +200 -0
- package/dist/resources/extensions/gsd/guided-flow.ts +1054 -0
- package/dist/resources/extensions/gsd/index.ts +735 -0
- package/dist/resources/extensions/gsd/metrics.ts +374 -0
- package/dist/resources/extensions/gsd/migrate/command.ts +218 -0
- package/dist/resources/extensions/gsd/migrate/index.ts +42 -0
- package/dist/resources/extensions/gsd/migrate/parser.ts +323 -0
- package/dist/resources/extensions/gsd/migrate/parsers.ts +624 -0
- package/dist/resources/extensions/gsd/migrate/preview.ts +48 -0
- package/dist/resources/extensions/gsd/migrate/transformer.ts +346 -0
- package/dist/resources/extensions/gsd/migrate/types.ts +370 -0
- package/dist/resources/extensions/gsd/migrate/validator.ts +55 -0
- package/dist/resources/extensions/gsd/migrate/writer.ts +539 -0
- package/dist/resources/extensions/gsd/native-git-bridge.ts +181 -0
- package/dist/resources/extensions/gsd/native-parser-bridge.ts +135 -0
- package/dist/resources/extensions/gsd/observability-validator.ts +408 -0
- package/dist/resources/extensions/gsd/package.json +11 -0
- package/dist/resources/extensions/gsd/paths.ts +339 -0
- package/dist/resources/extensions/gsd/post-unit-hooks.ts +449 -0
- package/dist/resources/extensions/gsd/preferences.ts +988 -0
- package/dist/resources/extensions/gsd/prompt-loader.ts +92 -0
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +25 -0
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +27 -0
- package/dist/resources/extensions/gsd/prompts/discuss.md +237 -0
- package/dist/resources/extensions/gsd/prompts/doctor-heal.md +29 -0
- package/dist/resources/extensions/gsd/prompts/execute-task.md +63 -0
- package/dist/resources/extensions/gsd/prompts/guided-complete-slice.md +3 -0
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +5 -0
- package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +61 -0
- package/dist/resources/extensions/gsd/prompts/guided-execute-task.md +3 -0
- package/dist/resources/extensions/gsd/prompts/guided-plan-milestone.md +29 -0
- package/dist/resources/extensions/gsd/prompts/guided-plan-slice.md +3 -0
- package/dist/resources/extensions/gsd/prompts/guided-research-slice.md +13 -0
- package/dist/resources/extensions/gsd/prompts/guided-resume-task.md +1 -0
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +78 -0
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +55 -0
- package/dist/resources/extensions/gsd/prompts/queue.md +100 -0
- package/dist/resources/extensions/gsd/prompts/reassess-roadmap.md +48 -0
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +39 -0
- package/dist/resources/extensions/gsd/prompts/research-milestone.md +37 -0
- package/dist/resources/extensions/gsd/prompts/research-slice.md +28 -0
- package/dist/resources/extensions/gsd/prompts/review-migration.md +66 -0
- package/dist/resources/extensions/gsd/prompts/run-uat.md +109 -0
- package/dist/resources/extensions/gsd/prompts/system.md +190 -0
- package/dist/resources/extensions/gsd/prompts/worktree-merge.md +123 -0
- package/dist/resources/extensions/gsd/roadmap-slices.ts +50 -0
- package/dist/resources/extensions/gsd/session-forensics.ts +500 -0
- package/dist/resources/extensions/gsd/skill-discovery.ts +137 -0
- package/dist/resources/extensions/gsd/state.ts +569 -0
- package/dist/resources/extensions/gsd/templates/context.md +76 -0
- package/dist/resources/extensions/gsd/templates/decisions.md +8 -0
- package/dist/resources/extensions/gsd/templates/milestone-summary.md +73 -0
- package/dist/resources/extensions/gsd/templates/plan.md +131 -0
- package/dist/resources/extensions/gsd/templates/preferences.md +23 -0
- package/dist/resources/extensions/gsd/templates/project.md +31 -0
- package/dist/resources/extensions/gsd/templates/reassessment.md +28 -0
- package/dist/resources/extensions/gsd/templates/requirements.md +81 -0
- package/dist/resources/extensions/gsd/templates/research.md +46 -0
- package/dist/resources/extensions/gsd/templates/roadmap.md +118 -0
- package/dist/resources/extensions/gsd/templates/secrets-manifest.md +22 -0
- package/dist/resources/extensions/gsd/templates/slice-context.md +58 -0
- package/dist/resources/extensions/gsd/templates/slice-summary.md +99 -0
- package/dist/resources/extensions/gsd/templates/state.md +19 -0
- package/dist/resources/extensions/gsd/templates/task-plan.md +52 -0
- package/dist/resources/extensions/gsd/templates/task-summary.md +57 -0
- package/dist/resources/extensions/gsd/templates/uat.md +54 -0
- package/dist/resources/extensions/gsd/tests/activity-log-prune.test.ts +297 -0
- package/dist/resources/extensions/gsd/tests/activity-log-save.test.ts +127 -0
- package/dist/resources/extensions/gsd/tests/auto-draft-pause.test.ts +109 -0
- package/dist/resources/extensions/gsd/tests/auto-preflight.test.ts +45 -0
- package/dist/resources/extensions/gsd/tests/auto-secrets-gate.test.ts +196 -0
- package/dist/resources/extensions/gsd/tests/auto-supervisor.test.mjs +53 -0
- package/dist/resources/extensions/gsd/tests/collect-from-manifest.test.ts +469 -0
- package/dist/resources/extensions/gsd/tests/complete-milestone.test.ts +200 -0
- package/dist/resources/extensions/gsd/tests/cost-projection.test.ts +134 -0
- package/dist/resources/extensions/gsd/tests/derive-state-deps.test.ts +312 -0
- package/dist/resources/extensions/gsd/tests/derive-state-draft.test.ts +299 -0
- package/dist/resources/extensions/gsd/tests/derive-state.test.ts +660 -0
- package/dist/resources/extensions/gsd/tests/discuss-prompt.test.ts +27 -0
- package/dist/resources/extensions/gsd/tests/dispatch-guard.test.ts +91 -0
- package/dist/resources/extensions/gsd/tests/doctor-fixlevel.test.ts +170 -0
- package/dist/resources/extensions/gsd/tests/doctor.test.ts +594 -0
- package/dist/resources/extensions/gsd/tests/draft-promotion.test.ts +169 -0
- package/dist/resources/extensions/gsd/tests/exit-command.test.ts +50 -0
- package/dist/resources/extensions/gsd/tests/git-service.test.ts +1788 -0
- package/dist/resources/extensions/gsd/tests/idle-recovery.test.ts +577 -0
- package/dist/resources/extensions/gsd/tests/integration-mixed-milestones.test.ts +580 -0
- package/dist/resources/extensions/gsd/tests/manifest-status.test.ts +283 -0
- package/dist/resources/extensions/gsd/tests/metrics-io.test.ts +176 -0
- package/dist/resources/extensions/gsd/tests/metrics.test.ts +188 -0
- package/dist/resources/extensions/gsd/tests/migrate-command.test.ts +369 -0
- package/dist/resources/extensions/gsd/tests/migrate-parser.test.ts +757 -0
- package/dist/resources/extensions/gsd/tests/migrate-transformer.test.ts +635 -0
- package/dist/resources/extensions/gsd/tests/migrate-validator-parsers.test.ts +414 -0
- package/dist/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +297 -0
- package/dist/resources/extensions/gsd/tests/migrate-writer.test.ts +398 -0
- package/dist/resources/extensions/gsd/tests/must-have-parser.test.ts +291 -0
- package/dist/resources/extensions/gsd/tests/network-error-fallback.test.ts +54 -0
- package/dist/resources/extensions/gsd/tests/next-milestone-id.test.ts +66 -0
- package/dist/resources/extensions/gsd/tests/orphaned-branch.test.ts +353 -0
- package/dist/resources/extensions/gsd/tests/parsers.test.ts +1664 -0
- package/dist/resources/extensions/gsd/tests/plan-milestone.test.ts +133 -0
- package/dist/resources/extensions/gsd/tests/plan-quality-validator.test.ts +363 -0
- package/dist/resources/extensions/gsd/tests/post-unit-hooks.test.ts +297 -0
- package/dist/resources/extensions/gsd/tests/preferences-hooks.test.ts +226 -0
- package/dist/resources/extensions/gsd/tests/queue-draft-detection.test.ts +126 -0
- package/dist/resources/extensions/gsd/tests/reassess-prompt.test.ts +142 -0
- package/dist/resources/extensions/gsd/tests/regex-hardening.test.ts +281 -0
- package/dist/resources/extensions/gsd/tests/remote-questions.test.ts +155 -0
- package/dist/resources/extensions/gsd/tests/remote-status.test.ts +99 -0
- package/dist/resources/extensions/gsd/tests/replan-slice.test.ts +493 -0
- package/dist/resources/extensions/gsd/tests/requirements.test.ts +106 -0
- package/dist/resources/extensions/gsd/tests/resolve-ts-hooks.mjs +35 -0
- package/dist/resources/extensions/gsd/tests/resolve-ts.mjs +11 -0
- package/dist/resources/extensions/gsd/tests/roadmap-slices.test.ts +41 -0
- package/dist/resources/extensions/gsd/tests/run-uat.test.ts +316 -0
- package/dist/resources/extensions/gsd/tests/secure-env-collect.test.ts +185 -0
- package/dist/resources/extensions/gsd/tests/smart-entry-draft.test.ts +123 -0
- package/dist/resources/extensions/gsd/tests/test-helpers.ts +61 -0
- package/dist/resources/extensions/gsd/tests/unique-milestone-ids.test.ts +219 -0
- package/dist/resources/extensions/gsd/tests/unit-runtime.test.ts +234 -0
- package/dist/resources/extensions/gsd/tests/workspace-index.test.ts +75 -0
- package/dist/resources/extensions/gsd/tests/worktree-integration.test.ts +234 -0
- package/dist/resources/extensions/gsd/tests/worktree-manager.test.ts +141 -0
- package/dist/resources/extensions/gsd/tests/worktree.test.ts +597 -0
- package/dist/resources/extensions/gsd/tests/write-gate.test.ts +122 -0
- package/dist/resources/extensions/gsd/types.ts +296 -0
- package/dist/resources/extensions/gsd/unit-runtime.ts +184 -0
- package/dist/resources/extensions/gsd/workspace-index.ts +189 -0
- package/dist/resources/extensions/gsd/worktree-command.ts +845 -0
- package/dist/resources/extensions/gsd/worktree-manager.ts +459 -0
- package/dist/resources/extensions/gsd/{worktree.js → worktree.ts} +92 -61
- package/dist/resources/extensions/mac-tools/index.ts +852 -0
- package/dist/resources/extensions/mac-tools/swift-cli/Package.swift +22 -0
- package/dist/resources/extensions/mac-tools/swift-cli/Sources/main.swift +1318 -0
- package/dist/resources/extensions/mcporter/index.ts +429 -0
- package/dist/resources/extensions/remote-questions/config.ts +81 -0
- package/dist/resources/extensions/remote-questions/discord-adapter.ts +128 -0
- package/dist/resources/extensions/remote-questions/format.ts +163 -0
- package/dist/resources/extensions/remote-questions/manager.ts +192 -0
- package/dist/resources/extensions/remote-questions/remote-command.ts +361 -0
- package/dist/resources/extensions/remote-questions/slack-adapter.ts +92 -0
- package/dist/resources/extensions/remote-questions/status.ts +31 -0
- package/dist/resources/extensions/remote-questions/store.ts +77 -0
- package/dist/resources/extensions/remote-questions/types.ts +75 -0
- package/dist/resources/extensions/search-the-web/cache.ts +78 -0
- package/dist/resources/extensions/search-the-web/command-search-provider.ts +99 -0
- package/dist/resources/extensions/search-the-web/format.ts +258 -0
- package/dist/resources/extensions/search-the-web/http.ts +238 -0
- package/dist/resources/extensions/search-the-web/index.ts +65 -0
- package/dist/resources/extensions/search-the-web/native-search.ts +165 -0
- package/dist/resources/extensions/search-the-web/provider.ts +136 -0
- package/dist/resources/extensions/search-the-web/tavily.ts +116 -0
- package/dist/resources/extensions/search-the-web/tool-fetch-page.ts +581 -0
- package/dist/resources/extensions/search-the-web/tool-llm-context.ts +620 -0
- package/dist/resources/extensions/search-the-web/tool-search.ts +635 -0
- package/dist/resources/extensions/search-the-web/url-utils.ts +91 -0
- package/dist/resources/extensions/shared/bundled-extension-paths.ts +11 -0
- package/dist/resources/extensions/shared/confirm-ui.ts +126 -0
- package/dist/resources/extensions/shared/interview-ui.ts +613 -0
- package/dist/resources/extensions/shared/next-action-ui.ts +197 -0
- package/dist/resources/extensions/shared/progress-widget.ts +282 -0
- package/dist/resources/extensions/shared/terminal.ts +23 -0
- package/dist/resources/extensions/shared/thinking-widget.ts +107 -0
- package/dist/resources/extensions/shared/ui.ts +400 -0
- package/dist/resources/extensions/shared/wizard-ui.ts +551 -0
- package/dist/resources/extensions/slash-commands/audit.ts +88 -0
- package/dist/resources/extensions/slash-commands/clear.ts +10 -0
- package/dist/resources/extensions/slash-commands/create-extension.ts +297 -0
- package/dist/resources/extensions/slash-commands/create-slash-command.ts +234 -0
- package/dist/resources/extensions/slash-commands/index.ts +12 -0
- package/dist/resources/extensions/subagent/agents.ts +126 -0
- package/dist/resources/extensions/subagent/index.ts +1072 -0
- package/dist/resources/extensions/subagent/isolation.ts +498 -0
- package/dist/resources/extensions/ttsr/index.ts +163 -0
- package/dist/resources/extensions/ttsr/rule-loader.ts +121 -0
- package/dist/resources/extensions/ttsr/ttsr-interrupt.md +6 -0
- package/dist/resources/extensions/ttsr/ttsr-manager.ts +430 -0
- package/dist/resources/extensions/universal-config/discovery.ts +78 -0
- package/dist/resources/extensions/universal-config/format.ts +160 -0
- package/dist/resources/extensions/universal-config/index.ts +118 -0
- package/dist/resources/extensions/universal-config/package.json +11 -0
- package/dist/resources/extensions/universal-config/scanners.ts +579 -0
- package/dist/resources/extensions/universal-config/tests/discovery.test.ts +111 -0
- package/dist/resources/extensions/universal-config/tests/format.test.ts +111 -0
- package/dist/resources/extensions/universal-config/tests/scanners.test.ts +438 -0
- package/dist/resources/extensions/universal-config/tools.ts +60 -0
- package/dist/resources/extensions/universal-config/types.ts +116 -0
- package/dist/resources/extensions/voice/index.ts +271 -0
- package/dist/resources/extensions/voice/speech-recognizer.py +504 -0
- package/dist/resources/extensions/voice/speech-recognizer.swift +154 -0
- package/dist/resources/skills/debug-like-expert/SKILL.md +231 -0
- package/dist/resources/skills/debug-like-expert/references/debugging-mindset.md +253 -0
- package/dist/resources/skills/debug-like-expert/references/hypothesis-testing.md +373 -0
- package/dist/resources/skills/debug-like-expert/references/investigation-techniques.md +337 -0
- package/dist/resources/skills/debug-like-expert/references/verification-patterns.md +425 -0
- package/dist/resources/skills/debug-like-expert/references/when-to-research.md +361 -0
- package/dist/resources/skills/frontend-design/SKILL.md +45 -0
- package/dist/resources/skills/github-workflows/SKILL.md +92 -0
- package/dist/resources/skills/github-workflows/references/gh/SKILL.md +255 -0
- package/dist/resources/skills/github-workflows/references/gh/references/issue-stories.md +204 -0
- package/dist/resources/skills/github-workflows/references/gh/references/labels.md +170 -0
- package/dist/resources/skills/github-workflows/references/gh/references/milestones.md +158 -0
- package/dist/resources/skills/github-workflows/references/gh/references/projects-v2.md +177 -0
- package/dist/resources/skills/github-workflows/references/gh/scripts/experiment_cleanup.py +191 -0
- package/dist/resources/skills/github-workflows/references/gh/scripts/github_project_setup.py +799 -0
- package/dist/resources/skills/github-workflows/references/gh/tests/__init__.py +0 -0
- package/dist/resources/skills/github-workflows/references/gh/tests/test_github_project_setup.py +608 -0
- package/dist/resources/skills/swiftui/SKILL.md +208 -0
- package/dist/resources/skills/swiftui/references/animations.md +921 -0
- package/dist/resources/skills/swiftui/references/architecture.md +1561 -0
- package/dist/resources/skills/swiftui/references/layout-system.md +1186 -0
- package/dist/resources/skills/swiftui/references/navigation.md +1492 -0
- package/dist/resources/skills/swiftui/references/networking-async.md +214 -0
- package/dist/resources/skills/swiftui/references/performance.md +1706 -0
- package/dist/resources/skills/swiftui/references/platform-integration.md +204 -0
- package/dist/resources/skills/swiftui/references/state-management.md +1443 -0
- package/dist/resources/skills/swiftui/references/swiftdata.md +297 -0
- package/dist/resources/skills/swiftui/references/testing-debugging.md +247 -0
- package/dist/resources/skills/swiftui/references/uikit-appkit-interop.md +218 -0
- package/dist/resources/skills/swiftui/workflows/add-feature.md +191 -0
- package/dist/resources/skills/swiftui/workflows/build-new-app.md +311 -0
- package/dist/resources/skills/swiftui/workflows/debug-swiftui.md +192 -0
- package/dist/resources/skills/swiftui/workflows/optimize-performance.md +197 -0
- package/dist/resources/skills/swiftui/workflows/ship-app.md +203 -0
- package/dist/resources/skills/swiftui/workflows/write-tests.md +235 -0
- package/dist/wizard.js +1 -0
- package/package.json +8 -6
- package/packages/native/dist/fd/index.d.ts +1 -0
- package/packages/native/dist/fd/index.js +1 -0
- package/packages/native/dist/grep/index.d.ts +2 -1
- package/packages/native/dist/grep/index.js +1 -0
- package/packages/native/src/__tests__/fd.test.mjs +35 -0
- package/packages/native/src/__tests__/grep.test.mjs +26 -9
- package/packages/native/src/fd/index.ts +1 -0
- package/packages/native/src/grep/index.ts +3 -2
- package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +169 -55
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/agent.d.ts +13 -1
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent.js +16 -0
- package/packages/pi-agent-core/dist/agent.js.map +1 -1
- package/packages/pi-agent-core/dist/types.d.ts +91 -1
- package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/types.js.map +1 -1
- package/packages/pi-agent-core/src/agent-loop.ts +273 -63
- package/packages/pi-agent-core/src/agent.ts +24 -0
- package/packages/pi-agent-core/src/types.ts +98 -0
- package/packages/pi-ai/dist/env-api-keys.js +2 -0
- package/packages/pi-ai/dist/env-api-keys.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +314 -0
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +236 -0
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.js +6 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.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 +2 -0
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +1 -1
- package/packages/pi-ai/dist/types.d.ts.map +1 -1
- package/packages/pi-ai/dist/types.js.map +1 -1
- package/packages/pi-ai/src/env-api-keys.ts +2 -0
- package/packages/pi-ai/src/models.generated.ts +236 -0
- package/packages/pi-ai/src/providers/google-gemini-cli.ts +8 -0
- package/packages/pi-ai/src/providers/openai-completions.ts +3 -0
- package/packages/pi-ai/src/types.ts +2 -1
- package/packages/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/cli/args.js +1 -0
- package/packages/pi-coding-agent/dist/cli/args.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +26 -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 +137 -22
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +20 -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 +43 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/fallback-resolver.d.ts +51 -0
- package/packages/pi-coding-agent/dist/core/fallback-resolver.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/fallback-resolver.js +119 -0
- package/packages/pi-coding-agent/dist/core/fallback-resolver.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/fallback-resolver.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/fallback-resolver.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/fallback-resolver.test.js +183 -0
- package/packages/pi-coding-agent/dist/core/fallback-resolver.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/index.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/index.js +1 -0
- package/packages/pi-coding-agent/dist/core/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts +12 -1
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js +37 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/session-manager.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/session-manager.test.js +61 -0
- package/packages/pi-coding-agent/dist/core/session-manager.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +20 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +47 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.js +1 -0
- package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +6 -15
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +18 -1
- 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 +46 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.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 +25 -2
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/src/cli/args.ts +1 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +167 -22
- package/packages/pi-coding-agent/src/core/auth-storage.ts +45 -0
- package/packages/pi-coding-agent/src/core/fallback-resolver.test.ts +229 -0
- package/packages/pi-coding-agent/src/core/fallback-resolver.ts +165 -0
- package/packages/pi-coding-agent/src/core/index.ts +1 -0
- package/packages/pi-coding-agent/src/core/model-resolver.ts +1 -0
- package/packages/pi-coding-agent/src/core/session-manager.test.ts +65 -0
- package/packages/pi-coding-agent/src/core/session-manager.ts +51 -1
- package/packages/pi-coding-agent/src/core/settings-manager.ts +66 -0
- package/packages/pi-coding-agent/src/core/tools/find.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +6 -16
- package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +49 -4
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +28 -2
- package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/packages/pi-tui/dist/autocomplete.js +3 -4
- package/packages/pi-tui/dist/autocomplete.js.map +1 -1
- package/packages/pi-tui/dist/components/editor.d.ts +7 -0
- package/packages/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/editor.js +57 -50
- package/packages/pi-tui/dist/components/editor.js.map +1 -1
- package/packages/pi-tui/src/autocomplete.ts +3 -5
- package/packages/pi-tui/src/components/editor.ts +70 -49
- package/pkg/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/pkg/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/pkg/dist/core/export-html/ansi-to-html.js +249 -0
- package/pkg/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/pkg/dist/core/export-html/index.d.ts +37 -0
- package/pkg/dist/core/export-html/index.d.ts.map +1 -0
- package/pkg/dist/core/export-html/index.js +223 -0
- package/pkg/dist/core/export-html/index.js.map +1 -0
- package/pkg/dist/core/export-html/template.css +971 -0
- package/pkg/dist/core/export-html/template.html +54 -0
- package/pkg/dist/core/export-html/template.js +1583 -0
- package/pkg/dist/core/export-html/tool-renderer.d.ts +38 -0
- package/pkg/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/pkg/dist/core/export-html/tool-renderer.js +70 -0
- package/pkg/dist/core/export-html/tool-renderer.js.map +1 -0
- package/pkg/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/pkg/dist/core/export-html/vendor/marked.min.js +6 -0
- package/scripts/postinstall.js +30 -17
- package/src/resources/extensions/bg-shell/index.ts +51 -7
- package/src/resources/extensions/gsd/activity-log.ts +61 -14
- package/src/resources/extensions/gsd/auto.ts +288 -19
- package/src/resources/extensions/gsd/commands.ts +9 -3
- package/src/resources/extensions/gsd/dashboard-overlay.ts +55 -12
- package/src/resources/extensions/gsd/docs/preferences-reference.md +25 -0
- package/src/resources/extensions/gsd/doctor.ts +60 -3
- package/src/resources/extensions/gsd/files.ts +45 -1
- package/src/resources/extensions/gsd/git-service.ts +46 -41
- package/src/resources/extensions/gsd/guided-flow.ts +81 -9
- package/src/resources/extensions/gsd/index.ts +62 -1
- package/src/resources/extensions/gsd/native-git-bridge.ts +181 -0
- package/src/resources/extensions/gsd/paths.ts +35 -4
- package/src/resources/extensions/gsd/post-unit-hooks.ts +449 -0
- package/src/resources/extensions/gsd/preferences.ts +232 -1
- package/src/resources/extensions/gsd/prompt-loader.ts +45 -3
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -3
- package/src/resources/extensions/gsd/prompts/discuss.md +10 -8
- package/src/resources/extensions/gsd/prompts/execute-task.md +4 -2
- package/src/resources/extensions/gsd/prompts/guided-complete-slice.md +3 -1
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +3 -1
- package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +3 -1
- package/src/resources/extensions/gsd/prompts/guided-execute-task.md +3 -1
- package/src/resources/extensions/gsd/prompts/guided-plan-milestone.md +4 -2
- package/src/resources/extensions/gsd/prompts/guided-plan-slice.md +3 -1
- package/src/resources/extensions/gsd/prompts/guided-research-slice.md +3 -1
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +9 -12
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -3
- package/src/resources/extensions/gsd/prompts/queue.md +3 -1
- package/src/resources/extensions/gsd/prompts/research-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/research-slice.md +1 -1
- package/src/resources/extensions/gsd/state.ts +130 -18
- package/src/resources/extensions/gsd/templates/context.md +1 -1
- package/src/resources/extensions/gsd/templates/state.md +3 -3
- package/src/resources/extensions/gsd/tests/activity-log-save.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +5 -1
- package/src/resources/extensions/gsd/tests/doctor.test.ts +115 -1
- package/src/resources/extensions/gsd/tests/draft-promotion.test.ts +6 -2
- package/src/resources/extensions/gsd/tests/git-service.test.ts +35 -35
- package/src/resources/extensions/gsd/tests/idle-recovery.test.ts +8 -8
- package/src/resources/extensions/gsd/tests/integration-mixed-milestones.test.ts +4 -1
- package/src/resources/extensions/gsd/tests/network-error-fallback.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/orphaned-branch.test.ts +5 -5
- package/src/resources/extensions/gsd/tests/post-unit-hooks.test.ts +297 -0
- package/src/resources/extensions/gsd/tests/preferences-hooks.test.ts +226 -0
- package/src/resources/extensions/gsd/tests/regex-hardening.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/unit-runtime.test.ts +6 -0
- package/src/resources/extensions/gsd/tests/worktree-integration.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/worktree.test.ts +19 -19
- package/src/resources/extensions/gsd/types.ts +109 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +72 -13
- package/src/resources/extensions/gsd/worktree.ts +5 -4
- package/src/resources/extensions/search-the-web/command-search-provider.ts +8 -4
- package/src/resources/extensions/search-the-web/native-search.ts +32 -23
- package/src/resources/extensions/search-the-web/provider.ts +19 -2
- package/src/resources/extensions/search-the-web/tool-fetch-page.ts +62 -0
- package/src/resources/extensions/search-the-web/tool-llm-context.ts +62 -3
- package/src/resources/extensions/search-the-web/tool-search.ts +62 -3
- package/src/resources/extensions/shared/bundled-extension-paths.ts +11 -0
- package/src/resources/extensions/subagent/index.ts +2 -1
- package/src/resources/skills/github-workflows/SKILL.md +5 -0
- package/dist/resources/extensions/gsd/git-service.d.ts +0 -225
- package/dist/resources/extensions/gsd/git-service.js +0 -756
- package/dist/resources/extensions/gsd/preferences.d.ts +0 -122
- package/dist/resources/extensions/gsd/preferences.js +0 -616
- package/dist/resources/extensions/gsd/worktree.d.ts +0 -106
- package/dist/resources/extensions/remote-questions/config.d.ts +0 -14
- package/dist/resources/extensions/remote-questions/config.js +0 -68
- package/dist/resources/extensions/remote-questions/discord-adapter.d.ts +0 -17
- package/dist/resources/extensions/remote-questions/discord-adapter.js +0 -118
- package/dist/resources/extensions/remote-questions/format.d.ts +0 -38
- package/dist/resources/extensions/remote-questions/format.js +0 -119
- package/dist/resources/extensions/remote-questions/manager.d.ts +0 -23
- package/dist/resources/extensions/remote-questions/manager.js +0 -161
- package/dist/resources/extensions/remote-questions/remote-command.d.ts +0 -6
- package/dist/resources/extensions/remote-questions/remote-command.js +0 -358
- package/dist/resources/extensions/remote-questions/slack-adapter.d.ts +0 -15
- package/dist/resources/extensions/remote-questions/slack-adapter.js +0 -82
- package/dist/resources/extensions/remote-questions/status.d.ts +0 -9
- package/dist/resources/extensions/remote-questions/status.js +0 -25
- package/dist/resources/extensions/remote-questions/store.d.ts +0 -11
- package/dist/resources/extensions/remote-questions/store.js +0 -66
- package/dist/resources/extensions/remote-questions/types.d.ts +0 -68
- package/dist/resources/extensions/remote-questions/types.js +0 -4
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
import { mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync, existsSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { execSync } from "node:child_process";
|
|
5
|
+
import {
|
|
6
|
+
resolveExpectedArtifactPath,
|
|
7
|
+
writeBlockerPlaceholder,
|
|
8
|
+
skipExecuteTask,
|
|
9
|
+
verifyExpectedArtifact,
|
|
10
|
+
buildLoopRemediationSteps,
|
|
11
|
+
} from "../auto.ts";
|
|
12
|
+
import { createTestContext } from './test-helpers.ts';
|
|
13
|
+
|
|
14
|
+
const { assertEq, assertTrue, report } = createTestContext();
|
|
15
|
+
function createFixtureBase(): string {
|
|
16
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-idle-recovery-test-"));
|
|
17
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001", "slices", "S01", "tasks"), { recursive: true });
|
|
18
|
+
return base;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function cleanup(base: string): void {
|
|
22
|
+
rmSync(base, { recursive: true, force: true });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// ═══ resolveExpectedArtifactPath ═════════════════════════════════════════════
|
|
26
|
+
|
|
27
|
+
{
|
|
28
|
+
console.log("\n=== resolveExpectedArtifactPath: research-milestone ===");
|
|
29
|
+
const base = createFixtureBase();
|
|
30
|
+
try {
|
|
31
|
+
const result = resolveExpectedArtifactPath("research-milestone", "M001", base);
|
|
32
|
+
assertTrue(result !== null, "should resolve a path");
|
|
33
|
+
assertTrue(result!.endsWith("M001-RESEARCH.md"), `path should end with M001-RESEARCH.md, got ${result}`);
|
|
34
|
+
} finally {
|
|
35
|
+
cleanup(base);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
{
|
|
40
|
+
console.log("\n=== resolveExpectedArtifactPath: plan-milestone ===");
|
|
41
|
+
const base = createFixtureBase();
|
|
42
|
+
try {
|
|
43
|
+
const result = resolveExpectedArtifactPath("plan-milestone", "M001", base);
|
|
44
|
+
assertTrue(result !== null, "should resolve a path");
|
|
45
|
+
assertTrue(result!.endsWith("M001-ROADMAP.md"), `path should end with M001-ROADMAP.md, got ${result}`);
|
|
46
|
+
} finally {
|
|
47
|
+
cleanup(base);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
{
|
|
52
|
+
console.log("\n=== resolveExpectedArtifactPath: research-slice ===");
|
|
53
|
+
const base = createFixtureBase();
|
|
54
|
+
try {
|
|
55
|
+
const result = resolveExpectedArtifactPath("research-slice", "M001/S01", base);
|
|
56
|
+
assertTrue(result !== null, "should resolve a path");
|
|
57
|
+
assertTrue(result!.endsWith("S01-RESEARCH.md"), `path should end with S01-RESEARCH.md, got ${result}`);
|
|
58
|
+
} finally {
|
|
59
|
+
cleanup(base);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
{
|
|
64
|
+
console.log("\n=== resolveExpectedArtifactPath: plan-slice ===");
|
|
65
|
+
const base = createFixtureBase();
|
|
66
|
+
try {
|
|
67
|
+
const result = resolveExpectedArtifactPath("plan-slice", "M001/S01", base);
|
|
68
|
+
assertTrue(result !== null, "should resolve a path");
|
|
69
|
+
assertTrue(result!.endsWith("S01-PLAN.md"), `path should end with S01-PLAN.md, got ${result}`);
|
|
70
|
+
} finally {
|
|
71
|
+
cleanup(base);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
{
|
|
76
|
+
console.log("\n=== resolveExpectedArtifactPath: complete-milestone ===");
|
|
77
|
+
const base = createFixtureBase();
|
|
78
|
+
try {
|
|
79
|
+
const result = resolveExpectedArtifactPath("complete-milestone", "M001", base);
|
|
80
|
+
assertTrue(result !== null, "should resolve a path");
|
|
81
|
+
assertTrue(result!.endsWith("M001-SUMMARY.md"), `path should end with M001-SUMMARY.md, got ${result}`);
|
|
82
|
+
} finally {
|
|
83
|
+
cleanup(base);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
{
|
|
88
|
+
console.log("\n=== resolveExpectedArtifactPath: unknown unit type → null ===");
|
|
89
|
+
const base = createFixtureBase();
|
|
90
|
+
try {
|
|
91
|
+
const result = resolveExpectedArtifactPath("unknown-type", "M001/S01", base);
|
|
92
|
+
assertEq(result, null, "unknown type returns null");
|
|
93
|
+
} finally {
|
|
94
|
+
cleanup(base);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ═══ writeBlockerPlaceholder ═════════════════════════════════════════════════
|
|
99
|
+
|
|
100
|
+
{
|
|
101
|
+
console.log("\n=== writeBlockerPlaceholder: writes file for research-slice ===");
|
|
102
|
+
const base = createFixtureBase();
|
|
103
|
+
try {
|
|
104
|
+
const result = writeBlockerPlaceholder("research-slice", "M001/S01", base, "idle recovery exhausted 2 attempts");
|
|
105
|
+
assertTrue(result !== null, "should return relative path");
|
|
106
|
+
const absPath = resolveExpectedArtifactPath("research-slice", "M001/S01", base)!;
|
|
107
|
+
assertTrue(existsSync(absPath), "file should exist on disk");
|
|
108
|
+
const content = readFileSync(absPath, "utf-8");
|
|
109
|
+
assertTrue(content.includes("BLOCKER"), "should contain BLOCKER heading");
|
|
110
|
+
assertTrue(content.includes("idle recovery exhausted 2 attempts"), "should contain the reason");
|
|
111
|
+
assertTrue(content.includes("research-slice"), "should mention the unit type");
|
|
112
|
+
assertTrue(content.includes("M001/S01"), "should mention the unit ID");
|
|
113
|
+
} finally {
|
|
114
|
+
cleanup(base);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
{
|
|
119
|
+
console.log("\n=== writeBlockerPlaceholder: creates directory if missing ===");
|
|
120
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-idle-recovery-test-"));
|
|
121
|
+
try {
|
|
122
|
+
// Only create milestone dir, not slice dir
|
|
123
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001"), { recursive: true });
|
|
124
|
+
// resolveSlicePath needs the slice dir to exist to resolve, so this should return null
|
|
125
|
+
const result = writeBlockerPlaceholder("research-slice", "M001/S01", base, "test reason");
|
|
126
|
+
// Since the slice dir doesn't exist, resolveExpectedArtifactPath returns null
|
|
127
|
+
assertEq(result, null, "returns null when directory structure doesn't exist");
|
|
128
|
+
} finally {
|
|
129
|
+
cleanup(base);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
{
|
|
134
|
+
console.log("\n=== writeBlockerPlaceholder: writes file for research-milestone ===");
|
|
135
|
+
const base = createFixtureBase();
|
|
136
|
+
try {
|
|
137
|
+
const result = writeBlockerPlaceholder("research-milestone", "M001", base, "hard timeout");
|
|
138
|
+
assertTrue(result !== null, "should return relative path");
|
|
139
|
+
const absPath = resolveExpectedArtifactPath("research-milestone", "M001", base)!;
|
|
140
|
+
assertTrue(existsSync(absPath), "file should exist on disk");
|
|
141
|
+
const content = readFileSync(absPath, "utf-8");
|
|
142
|
+
assertTrue(content.includes("BLOCKER"), "should contain BLOCKER heading");
|
|
143
|
+
assertTrue(content.includes("hard timeout"), "should contain the reason");
|
|
144
|
+
} finally {
|
|
145
|
+
cleanup(base);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
{
|
|
150
|
+
console.log("\n=== writeBlockerPlaceholder: unknown type → null ===");
|
|
151
|
+
const base = createFixtureBase();
|
|
152
|
+
try {
|
|
153
|
+
const result = writeBlockerPlaceholder("unknown-type", "M001/S01", base, "test");
|
|
154
|
+
assertEq(result, null, "unknown type returns null");
|
|
155
|
+
} finally {
|
|
156
|
+
cleanup(base);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// ═══ skipExecuteTask ═════════════════════════════════════════════════════════
|
|
161
|
+
|
|
162
|
+
{
|
|
163
|
+
console.log("\n=== skipExecuteTask: writes summary and checks plan checkbox ===");
|
|
164
|
+
const base = createFixtureBase();
|
|
165
|
+
try {
|
|
166
|
+
const planPath = join(base, ".gsd", "milestones", "M001", "slices", "S01", "S01-PLAN.md");
|
|
167
|
+
writeFileSync(planPath, [
|
|
168
|
+
"# S01: Test Slice",
|
|
169
|
+
"",
|
|
170
|
+
"## Tasks",
|
|
171
|
+
"",
|
|
172
|
+
"- [ ] **T01: First task** `est:10m`",
|
|
173
|
+
" Do the first thing.",
|
|
174
|
+
"- [ ] **T02: Second task** `est:15m`",
|
|
175
|
+
" Do the second thing.",
|
|
176
|
+
].join("\n"), "utf-8");
|
|
177
|
+
|
|
178
|
+
const result = skipExecuteTask(
|
|
179
|
+
base, "M001", "S01", "T01",
|
|
180
|
+
{ summaryExists: false, taskChecked: false },
|
|
181
|
+
"idle", 2,
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
assertTrue(result === true, "should return true");
|
|
185
|
+
|
|
186
|
+
// Check summary was written
|
|
187
|
+
const summaryPath = join(base, ".gsd", "milestones", "M001", "slices", "S01", "tasks", "T01-SUMMARY.md");
|
|
188
|
+
assertTrue(existsSync(summaryPath), "task summary should exist");
|
|
189
|
+
const summaryContent = readFileSync(summaryPath, "utf-8");
|
|
190
|
+
assertTrue(summaryContent.includes("BLOCKER"), "summary should contain BLOCKER");
|
|
191
|
+
assertTrue(summaryContent.includes("T01"), "summary should mention task ID");
|
|
192
|
+
|
|
193
|
+
// Check plan checkbox was marked
|
|
194
|
+
const planContent = readFileSync(planPath, "utf-8");
|
|
195
|
+
assertTrue(planContent.includes("- [x] **T01:"), "T01 should be checked");
|
|
196
|
+
assertTrue(planContent.includes("- [ ] **T02:"), "T02 should remain unchecked");
|
|
197
|
+
} finally {
|
|
198
|
+
cleanup(base);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
{
|
|
203
|
+
console.log("\n=== skipExecuteTask: skips summary if already exists ===");
|
|
204
|
+
const base = createFixtureBase();
|
|
205
|
+
try {
|
|
206
|
+
const planPath = join(base, ".gsd", "milestones", "M001", "slices", "S01", "S01-PLAN.md");
|
|
207
|
+
writeFileSync(planPath, "- [ ] **T01: Task** `est:10m`\n", "utf-8");
|
|
208
|
+
|
|
209
|
+
// Pre-write a summary
|
|
210
|
+
const summaryPath = join(base, ".gsd", "milestones", "M001", "slices", "S01", "tasks", "T01-SUMMARY.md");
|
|
211
|
+
writeFileSync(summaryPath, "# Real summary\nActual work done.", "utf-8");
|
|
212
|
+
|
|
213
|
+
const result = skipExecuteTask(
|
|
214
|
+
base, "M001", "S01", "T01",
|
|
215
|
+
{ summaryExists: true, taskChecked: false },
|
|
216
|
+
"idle", 2,
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
assertTrue(result === true, "should return true");
|
|
220
|
+
|
|
221
|
+
// Summary should be untouched (not overwritten with blocker)
|
|
222
|
+
const content = readFileSync(summaryPath, "utf-8");
|
|
223
|
+
assertTrue(content.includes("Real summary"), "original summary should be preserved");
|
|
224
|
+
assertTrue(!content.includes("BLOCKER"), "should not contain BLOCKER");
|
|
225
|
+
|
|
226
|
+
// Plan checkbox should still be marked
|
|
227
|
+
const planContent = readFileSync(planPath, "utf-8");
|
|
228
|
+
assertTrue(planContent.includes("- [x] **T01:"), "T01 should be checked");
|
|
229
|
+
} finally {
|
|
230
|
+
cleanup(base);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
{
|
|
235
|
+
console.log("\n=== skipExecuteTask: skips checkbox if already checked ===");
|
|
236
|
+
const base = createFixtureBase();
|
|
237
|
+
try {
|
|
238
|
+
const planPath = join(base, ".gsd", "milestones", "M001", "slices", "S01", "S01-PLAN.md");
|
|
239
|
+
writeFileSync(planPath, "- [x] **T01: Task** `est:10m`\n", "utf-8");
|
|
240
|
+
|
|
241
|
+
const result = skipExecuteTask(
|
|
242
|
+
base, "M001", "S01", "T01",
|
|
243
|
+
{ summaryExists: false, taskChecked: true },
|
|
244
|
+
"idle", 2,
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
assertTrue(result === true, "should return true");
|
|
248
|
+
|
|
249
|
+
// Summary should be written (since summaryExists was false)
|
|
250
|
+
const summaryPath = join(base, ".gsd", "milestones", "M001", "slices", "S01", "tasks", "T01-SUMMARY.md");
|
|
251
|
+
assertTrue(existsSync(summaryPath), "task summary should exist");
|
|
252
|
+
|
|
253
|
+
// Plan checkbox should be untouched
|
|
254
|
+
const planContent = readFileSync(planPath, "utf-8");
|
|
255
|
+
assertTrue(planContent.includes("- [x] **T01:"), "T01 should remain checked");
|
|
256
|
+
} finally {
|
|
257
|
+
cleanup(base);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
{
|
|
262
|
+
console.log("\n=== skipExecuteTask: handles special regex chars in task ID ===");
|
|
263
|
+
const base = createFixtureBase();
|
|
264
|
+
try {
|
|
265
|
+
const planPath = join(base, ".gsd", "milestones", "M001", "slices", "S01", "S01-PLAN.md");
|
|
266
|
+
writeFileSync(planPath, "- [ ] **T01.1: Sub-task** `est:10m`\n", "utf-8");
|
|
267
|
+
|
|
268
|
+
const result = skipExecuteTask(
|
|
269
|
+
base, "M001", "S01", "T01.1",
|
|
270
|
+
{ summaryExists: false, taskChecked: false },
|
|
271
|
+
"idle", 2,
|
|
272
|
+
);
|
|
273
|
+
|
|
274
|
+
assertTrue(result === true, "should return true");
|
|
275
|
+
|
|
276
|
+
const planContent = readFileSync(planPath, "utf-8");
|
|
277
|
+
assertTrue(planContent.includes("- [x] **T01.1:"), "T01.1 should be checked (regex chars escaped)");
|
|
278
|
+
} finally {
|
|
279
|
+
cleanup(base);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// ═══ verifyExpectedArtifact: fix-merge ════════════════════════════════════════
|
|
284
|
+
|
|
285
|
+
/** Create a real git repo for fix-merge tests */
|
|
286
|
+
function createGitBase(): string {
|
|
287
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-fixmerge-test-"));
|
|
288
|
+
execSync("git init -b main", { cwd: base, stdio: "ignore" });
|
|
289
|
+
execSync("git config user.email test@test.com", { cwd: base, stdio: "ignore" });
|
|
290
|
+
execSync("git config user.name Test", { cwd: base, stdio: "ignore" });
|
|
291
|
+
writeFileSync(join(base, "README.md"), "init\n", "utf-8");
|
|
292
|
+
execSync("git add -A && git commit -m init", { cwd: base, stdio: "ignore" });
|
|
293
|
+
// Create .gsd structure for the fixture
|
|
294
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001", "slices", "S01", "tasks"), { recursive: true });
|
|
295
|
+
return base;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
{
|
|
299
|
+
console.log("\n=== verifyExpectedArtifact: fix-merge — clean repo returns true ===");
|
|
300
|
+
const base = createGitBase();
|
|
301
|
+
try {
|
|
302
|
+
const result = verifyExpectedArtifact("fix-merge", "M001/S01", base);
|
|
303
|
+
assertTrue(result === true, "clean repo should verify as true");
|
|
304
|
+
} finally {
|
|
305
|
+
cleanup(base);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
{
|
|
310
|
+
console.log("\n=== verifyExpectedArtifact: fix-merge — MERGE_HEAD present returns false ===");
|
|
311
|
+
const base = createGitBase();
|
|
312
|
+
try {
|
|
313
|
+
writeFileSync(join(base, ".git", "MERGE_HEAD"), "abc123\n", "utf-8");
|
|
314
|
+
const result = verifyExpectedArtifact("fix-merge", "M001/S01", base);
|
|
315
|
+
assertTrue(result === false, "MERGE_HEAD present should return false");
|
|
316
|
+
} finally {
|
|
317
|
+
cleanup(base);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
{
|
|
322
|
+
console.log("\n=== verifyExpectedArtifact: fix-merge — SQUASH_MSG present returns false ===");
|
|
323
|
+
const base = createGitBase();
|
|
324
|
+
try {
|
|
325
|
+
writeFileSync(join(base, ".git", "SQUASH_MSG"), "squash msg\n", "utf-8");
|
|
326
|
+
const result = verifyExpectedArtifact("fix-merge", "M001/S01", base);
|
|
327
|
+
assertTrue(result === false, "SQUASH_MSG present should return false");
|
|
328
|
+
} finally {
|
|
329
|
+
cleanup(base);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
{
|
|
334
|
+
console.log("\n=== verifyExpectedArtifact: fix-merge — real UU conflict returns false ===");
|
|
335
|
+
const base = createGitBase();
|
|
336
|
+
try {
|
|
337
|
+
// Create a conflict: modify same file on two branches
|
|
338
|
+
writeFileSync(join(base, "conflict.txt"), "main content\n", "utf-8");
|
|
339
|
+
execSync('git add -A && git commit -m "main change"', { cwd: base, stdio: "ignore" });
|
|
340
|
+
execSync("git checkout -b feature", { cwd: base, stdio: "ignore" });
|
|
341
|
+
writeFileSync(join(base, "conflict.txt"), "feature content\n", "utf-8");
|
|
342
|
+
execSync('git add -A && git commit -m "feature change"', { cwd: base, stdio: "ignore" });
|
|
343
|
+
execSync("git checkout main", { cwd: base, stdio: "ignore" });
|
|
344
|
+
writeFileSync(join(base, "conflict.txt"), "different main content\n", "utf-8");
|
|
345
|
+
execSync('git add -A && git commit -m "diverge"', { cwd: base, stdio: "ignore" });
|
|
346
|
+
try { execSync("git merge feature", { cwd: base, stdio: "ignore" }); } catch { /* expected conflict */ }
|
|
347
|
+
const result = verifyExpectedArtifact("fix-merge", "M001/S01", base);
|
|
348
|
+
assertTrue(result === false, "UU conflict should return false");
|
|
349
|
+
} finally {
|
|
350
|
+
execSync("git reset --hard HEAD", { cwd: base, stdio: "ignore" });
|
|
351
|
+
cleanup(base);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
{
|
|
356
|
+
console.log("\n=== verifyExpectedArtifact: fix-merge — real DU conflict returns false ===");
|
|
357
|
+
const base = createGitBase();
|
|
358
|
+
try {
|
|
359
|
+
writeFileSync(join(base, "deleted.txt"), "content\n", "utf-8");
|
|
360
|
+
execSync('git add -A && git commit -m "add file"', { cwd: base, stdio: "ignore" });
|
|
361
|
+
execSync("git checkout -b feature2", { cwd: base, stdio: "ignore" });
|
|
362
|
+
writeFileSync(join(base, "deleted.txt"), "modified on feature\n", "utf-8");
|
|
363
|
+
execSync('git add -A && git commit -m "modify on feature"', { cwd: base, stdio: "ignore" });
|
|
364
|
+
execSync("git checkout main", { cwd: base, stdio: "ignore" });
|
|
365
|
+
execSync("git rm deleted.txt", { cwd: base, stdio: "ignore" });
|
|
366
|
+
execSync('git commit -m "delete on main"', { cwd: base, stdio: "ignore" });
|
|
367
|
+
try { execSync("git merge feature2", { cwd: base, stdio: "ignore" }); } catch { /* expected conflict */ }
|
|
368
|
+
const result = verifyExpectedArtifact("fix-merge", "M001/S01", base);
|
|
369
|
+
assertTrue(result === false, "DU conflict should return false");
|
|
370
|
+
} finally {
|
|
371
|
+
execSync("git reset --hard HEAD", { cwd: base, stdio: "ignore" });
|
|
372
|
+
cleanup(base);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
{
|
|
377
|
+
console.log("\n=== verifyExpectedArtifact: fix-merge — real AA conflict returns false ===");
|
|
378
|
+
const base = createGitBase();
|
|
379
|
+
try {
|
|
380
|
+
execSync("git checkout -b branch-a", { cwd: base, stdio: "ignore" });
|
|
381
|
+
writeFileSync(join(base, "both.txt"), "branch-a content\n", "utf-8");
|
|
382
|
+
execSync('git add -A && git commit -m "add on branch-a"', { cwd: base, stdio: "ignore" });
|
|
383
|
+
execSync("git checkout main", { cwd: base, stdio: "ignore" });
|
|
384
|
+
execSync("git checkout -b branch-b", { cwd: base, stdio: "ignore" });
|
|
385
|
+
writeFileSync(join(base, "both.txt"), "branch-b content\n", "utf-8");
|
|
386
|
+
execSync('git add -A && git commit -m "add on branch-b"', { cwd: base, stdio: "ignore" });
|
|
387
|
+
try { execSync("git merge branch-a", { cwd: base, stdio: "ignore" }); } catch { /* expected conflict */ }
|
|
388
|
+
const result = verifyExpectedArtifact("fix-merge", "M001/S01", base);
|
|
389
|
+
assertTrue(result === false, "AA conflict should return false");
|
|
390
|
+
} finally {
|
|
391
|
+
execSync("git reset --hard HEAD", { cwd: base, stdio: "ignore" });
|
|
392
|
+
cleanup(base);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// ═══ verifyExpectedArtifact: complete-slice roadmap check ════════════════════
|
|
397
|
+
// Regression for #indefinite-hang: complete-slice must verify roadmap [x] or
|
|
398
|
+
// the idempotency skip loops forever after a crash that wrote SUMMARY+UAT but
|
|
399
|
+
// did not mark the roadmap done.
|
|
400
|
+
|
|
401
|
+
const ROADMAP_INCOMPLETE = `# M001: Test Milestone
|
|
402
|
+
|
|
403
|
+
## Slices
|
|
404
|
+
|
|
405
|
+
- [ ] **S01: Test Slice** \`risk:low\`
|
|
406
|
+
> After this: something works
|
|
407
|
+
`;
|
|
408
|
+
|
|
409
|
+
const ROADMAP_COMPLETE = `# M001: Test Milestone
|
|
410
|
+
|
|
411
|
+
## Slices
|
|
412
|
+
|
|
413
|
+
- [x] **S01: Test Slice** \`risk:low\`
|
|
414
|
+
> After this: something works
|
|
415
|
+
`;
|
|
416
|
+
|
|
417
|
+
{
|
|
418
|
+
console.log("\n=== verifyExpectedArtifact: complete-slice — all artifacts present + roadmap marked [x] returns true ===");
|
|
419
|
+
const base = createFixtureBase();
|
|
420
|
+
try {
|
|
421
|
+
const sliceDir = join(base, ".gsd", "milestones", "M001", "slices", "S01");
|
|
422
|
+
writeFileSync(join(sliceDir, "S01-SUMMARY.md"), "# Summary\n", "utf-8");
|
|
423
|
+
writeFileSync(join(sliceDir, "S01-UAT.md"), "# UAT\n", "utf-8");
|
|
424
|
+
writeFileSync(join(base, ".gsd", "milestones", "M001", "M001-ROADMAP.md"), ROADMAP_COMPLETE, "utf-8");
|
|
425
|
+
const result = verifyExpectedArtifact("complete-slice", "M001/S01", base);
|
|
426
|
+
assertTrue(result === true, "SUMMARY + UAT + roadmap [x] should verify as true");
|
|
427
|
+
} finally {
|
|
428
|
+
cleanup(base);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
{
|
|
433
|
+
console.log("\n=== verifyExpectedArtifact: complete-slice — SUMMARY + UAT present but roadmap NOT marked [x] returns false ===");
|
|
434
|
+
const base = createFixtureBase();
|
|
435
|
+
try {
|
|
436
|
+
const sliceDir = join(base, ".gsd", "milestones", "M001", "slices", "S01");
|
|
437
|
+
writeFileSync(join(sliceDir, "S01-SUMMARY.md"), "# Summary\n", "utf-8");
|
|
438
|
+
writeFileSync(join(sliceDir, "S01-UAT.md"), "# UAT\n", "utf-8");
|
|
439
|
+
writeFileSync(join(base, ".gsd", "milestones", "M001", "M001-ROADMAP.md"), ROADMAP_INCOMPLETE, "utf-8");
|
|
440
|
+
const result = verifyExpectedArtifact("complete-slice", "M001/S01", base);
|
|
441
|
+
assertTrue(result === false, "roadmap not marked [x] should return false (crash recovery scenario)");
|
|
442
|
+
} finally {
|
|
443
|
+
cleanup(base);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
{
|
|
448
|
+
console.log("\n=== verifyExpectedArtifact: complete-slice — SUMMARY present but UAT missing returns false ===");
|
|
449
|
+
const base = createFixtureBase();
|
|
450
|
+
try {
|
|
451
|
+
const sliceDir = join(base, ".gsd", "milestones", "M001", "slices", "S01");
|
|
452
|
+
writeFileSync(join(sliceDir, "S01-SUMMARY.md"), "# Summary\n", "utf-8");
|
|
453
|
+
// no UAT file
|
|
454
|
+
writeFileSync(join(base, ".gsd", "milestones", "M001", "M001-ROADMAP.md"), ROADMAP_COMPLETE, "utf-8");
|
|
455
|
+
const result = verifyExpectedArtifact("complete-slice", "M001/S01", base);
|
|
456
|
+
assertTrue(result === false, "missing UAT should return false");
|
|
457
|
+
} finally {
|
|
458
|
+
cleanup(base);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
{
|
|
463
|
+
console.log("\n=== verifyExpectedArtifact: complete-slice — no roadmap file present is lenient (returns true) ===");
|
|
464
|
+
const base = createFixtureBase();
|
|
465
|
+
try {
|
|
466
|
+
const sliceDir = join(base, ".gsd", "milestones", "M001", "slices", "S01");
|
|
467
|
+
writeFileSync(join(sliceDir, "S01-SUMMARY.md"), "# Summary\n", "utf-8");
|
|
468
|
+
writeFileSync(join(sliceDir, "S01-UAT.md"), "# UAT\n", "utf-8");
|
|
469
|
+
// no roadmap file
|
|
470
|
+
const result = verifyExpectedArtifact("complete-slice", "M001/S01", base);
|
|
471
|
+
assertTrue(result === true, "missing roadmap file should be lenient and return true");
|
|
472
|
+
} finally {
|
|
473
|
+
cleanup(base);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// ═══ buildLoopRemediationSteps ═══════════════════════════════════════════════
|
|
478
|
+
|
|
479
|
+
{
|
|
480
|
+
console.log("\n=== buildLoopRemediationSteps: execute-task returns concrete steps ===");
|
|
481
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-loop-remediation-test-"));
|
|
482
|
+
try {
|
|
483
|
+
mkdirSync(join(base, ".gsd", "milestones", "M002", "slices", "S03", "tasks"), { recursive: true });
|
|
484
|
+
const result = buildLoopRemediationSteps("execute-task", "M002/S03/T01", base);
|
|
485
|
+
assertTrue(result !== null, "should return remediation steps");
|
|
486
|
+
assertTrue(result!.includes("T01-SUMMARY.md"), "steps mention the summary file");
|
|
487
|
+
assertTrue(result!.includes("S03-PLAN.md"), "steps mention the slice plan");
|
|
488
|
+
assertTrue(result!.includes("T01"), "steps mention the task ID");
|
|
489
|
+
assertTrue(result!.includes("gsd doctor"), "steps include gsd doctor command");
|
|
490
|
+
// Exact slice plan checkbox syntax (no trailing **)
|
|
491
|
+
assertTrue(result!.includes('"- [x] **T01:"'), "steps show exact checkbox syntax without trailing **");
|
|
492
|
+
} finally {
|
|
493
|
+
rmSync(base, { recursive: true, force: true });
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
{
|
|
498
|
+
console.log("\n=== buildLoopRemediationSteps: plan-slice returns concrete steps ===");
|
|
499
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-loop-remediation-test-"));
|
|
500
|
+
try {
|
|
501
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001", "slices", "S01"), { recursive: true });
|
|
502
|
+
const result = buildLoopRemediationSteps("plan-slice", "M001/S01", base);
|
|
503
|
+
assertTrue(result !== null, "should return remediation steps for plan-slice");
|
|
504
|
+
assertTrue(result!.includes("S01-PLAN.md"), "steps mention the slice plan file");
|
|
505
|
+
assertTrue(result!.includes("gsd doctor"), "steps include gsd doctor command");
|
|
506
|
+
} finally {
|
|
507
|
+
rmSync(base, { recursive: true, force: true });
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
{
|
|
512
|
+
console.log("\n=== buildLoopRemediationSteps: research-slice returns concrete steps ===");
|
|
513
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-loop-remediation-test-"));
|
|
514
|
+
try {
|
|
515
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001", "slices", "S01"), { recursive: true });
|
|
516
|
+
const result = buildLoopRemediationSteps("research-slice", "M001/S01", base);
|
|
517
|
+
assertTrue(result !== null, "should return remediation steps for research-slice");
|
|
518
|
+
assertTrue(result!.includes("S01-RESEARCH.md"), "steps mention the slice research file");
|
|
519
|
+
assertTrue(result!.includes("gsd doctor"), "steps include gsd doctor command");
|
|
520
|
+
} finally {
|
|
521
|
+
rmSync(base, { recursive: true, force: true });
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
{
|
|
526
|
+
console.log("\n=== buildLoopRemediationSteps: unknown type returns null ===");
|
|
527
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-loop-remediation-test-"));
|
|
528
|
+
try {
|
|
529
|
+
const result = buildLoopRemediationSteps("unknown-type", "M001/S01", base);
|
|
530
|
+
assertEq(result, null, "unknown type returns null");
|
|
531
|
+
} finally {
|
|
532
|
+
rmSync(base, { recursive: true, force: true });
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
{
|
|
537
|
+
console.log("\n=== skipExecuteTask: loop-recovery writes blocker when both summary and checkbox missing ===");
|
|
538
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-loop-recovery-test-"));
|
|
539
|
+
try {
|
|
540
|
+
mkdirSync(join(base, ".gsd", "milestones", "M002", "slices", "S03", "tasks"), { recursive: true });
|
|
541
|
+
const planPath = join(base, ".gsd", "milestones", "M002", "slices", "S03", "S03-PLAN.md");
|
|
542
|
+
writeFileSync(planPath, [
|
|
543
|
+
"# S03: Harden guided session",
|
|
544
|
+
"",
|
|
545
|
+
"## Tasks",
|
|
546
|
+
"",
|
|
547
|
+
"- [ ] **T01: Harden contract usage** `est:30m`",
|
|
548
|
+
" Harden guided session contract usage in desktop flow.",
|
|
549
|
+
].join("\n"), "utf-8");
|
|
550
|
+
|
|
551
|
+
const result = skipExecuteTask(
|
|
552
|
+
base, "M002", "S03", "T01",
|
|
553
|
+
{ summaryExists: false, taskChecked: false },
|
|
554
|
+
"loop-recovery",
|
|
555
|
+
// 3 == MAX_UNIT_DISPATCHES: represents the prevCount when the final
|
|
556
|
+
// reconciliation path runs (loop detected, reconciling before halting).
|
|
557
|
+
3,
|
|
558
|
+
);
|
|
559
|
+
|
|
560
|
+
assertTrue(result === true, "loop-recovery should succeed");
|
|
561
|
+
|
|
562
|
+
// Blocker summary written
|
|
563
|
+
const summaryPath = join(base, ".gsd", "milestones", "M002", "slices", "S03", "tasks", "T01-SUMMARY.md");
|
|
564
|
+
assertTrue(existsSync(summaryPath), "blocker summary should be written");
|
|
565
|
+
const summaryContent = readFileSync(summaryPath, "utf-8");
|
|
566
|
+
assertTrue(summaryContent.includes("BLOCKER"), "summary should be a blocker placeholder");
|
|
567
|
+
assertTrue(summaryContent.includes("loop-recovery"), "summary should mention the recovery reason");
|
|
568
|
+
|
|
569
|
+
// Checkbox marked
|
|
570
|
+
const planContent = readFileSync(planPath, "utf-8");
|
|
571
|
+
assertTrue(planContent.includes("- [x] **T01:"), "T01 checkbox should be marked [x] after loop-recovery");
|
|
572
|
+
} finally {
|
|
573
|
+
rmSync(base, { recursive: true, force: true });
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
report();
|