gsd-pi 2.76.0-dev.fe143342a → 2.77.0-dev.1d17f366c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -35
- package/dist/claude-cli-check.js +32 -3
- package/dist/cli-web-branch.d.ts +1 -0
- package/dist/cli-web-branch.js +3 -0
- package/dist/cli.js +38 -2
- package/dist/extension-discovery.d.ts +6 -0
- package/dist/extension-discovery.js +37 -0
- package/dist/extension-registry.d.ts +3 -0
- package/dist/extension-sort.d.ts +18 -0
- package/dist/extension-sort.js +114 -0
- package/dist/extension-validator.d.ts +47 -0
- package/dist/extension-validator.js +127 -0
- package/dist/loader.js +35 -7
- package/dist/onboarding.js +45 -0
- package/dist/provider-migrations.d.ts +18 -0
- package/dist/provider-migrations.js +14 -0
- package/dist/resources/extensions/claude-code-cli/readiness.js +4 -3
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +78 -59
- package/dist/resources/extensions/cmux/index.js +20 -0
- package/dist/resources/extensions/github-sync/templates.js +103 -0
- package/dist/resources/extensions/google-search/extension-manifest.json +5 -4
- package/dist/resources/extensions/google-search/index.js +3 -375
- package/dist/resources/extensions/gsd/abandon-detect.js +44 -0
- package/dist/resources/extensions/gsd/auto/loop.js +90 -2
- package/dist/resources/extensions/gsd/auto/phases.js +95 -21
- package/dist/resources/extensions/gsd/auto/resolve.js +24 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +48 -4
- package/dist/resources/extensions/gsd/auto/session.js +18 -1
- package/dist/resources/extensions/gsd/auto/turn-epoch.js +95 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +115 -17
- package/dist/resources/extensions/gsd/auto-loop.js +1 -1
- package/dist/resources/extensions/gsd/auto-model-selection.js +1 -1
- package/dist/resources/extensions/gsd/auto-post-unit.js +90 -2
- package/dist/resources/extensions/gsd/auto-prompts.js +14 -0
- package/dist/resources/extensions/gsd/auto-recovery.js +46 -1
- package/dist/resources/extensions/gsd/auto-start.js +45 -39
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +11 -5
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +11 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +109 -61
- package/dist/resources/extensions/gsd/auto.js +97 -31
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +27 -1
- package/dist/resources/extensions/gsd/bootstrap/provider-error-resume.js +4 -2
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +11 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +17 -6
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +11 -6
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +34 -2
- package/dist/resources/extensions/gsd/clean-root-preflight.js +93 -0
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +31 -4
- package/dist/resources/extensions/gsd/commands-cmux.js +9 -6
- package/dist/resources/extensions/gsd/commands-extensions.js +634 -43
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +968 -23
- package/dist/resources/extensions/gsd/dispatch-guard.js +29 -3
- package/dist/resources/extensions/gsd/file-lock.js +49 -9
- package/dist/resources/extensions/gsd/git-service.js +1 -0
- package/dist/resources/extensions/gsd/gitignore.js +2 -0
- package/dist/resources/extensions/gsd/gsd-db.js +90 -30
- package/dist/resources/extensions/gsd/guided-flow-queue.js +4 -1
- package/dist/resources/extensions/gsd/guided-flow.js +212 -9
- package/dist/resources/extensions/gsd/health-widget.js +4 -1
- package/dist/resources/extensions/gsd/journal.js +17 -2
- package/dist/resources/extensions/gsd/key-manager.js +22 -0
- package/dist/resources/extensions/gsd/milestone-actions.js +15 -0
- package/dist/resources/extensions/gsd/milestone-summary-classifier.js +37 -0
- package/dist/resources/extensions/gsd/model-router.js +36 -3
- package/dist/resources/extensions/gsd/notifications.js +30 -16
- package/dist/resources/extensions/gsd/pre-execution-checks.js +31 -6
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +29 -2
- package/dist/resources/extensions/gsd/prompts/discuss.md +29 -2
- package/dist/resources/extensions/gsd/prompts/doctor-heal.md +5 -4
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
- package/dist/resources/extensions/gsd/prompts/system.md +1 -0
- package/dist/resources/extensions/gsd/reports.js +5 -4
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +96 -0
- package/dist/resources/extensions/gsd/safety/file-change-validator.js +12 -4
- package/dist/resources/extensions/gsd/safety/safety-harness.js +5 -1
- package/dist/resources/extensions/gsd/state-transition-matrix.js +118 -0
- package/dist/resources/extensions/gsd/state.js +25 -25
- package/dist/resources/extensions/gsd/token-counter.js +22 -5
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +16 -10
- package/dist/resources/extensions/gsd/tools/complete-slice.js +21 -0
- package/dist/resources/extensions/gsd/tools/complete-task.js +31 -0
- package/dist/resources/extensions/gsd/uok/audit.js +18 -2
- package/dist/resources/extensions/gsd/uok/dispatch-envelope.js +33 -0
- package/dist/resources/extensions/gsd/uok/execution-graph.js +10 -0
- package/dist/resources/extensions/gsd/uok/gitops.js +2 -1
- package/dist/resources/extensions/gsd/uok/loop-adapter.js +37 -10
- package/dist/resources/extensions/gsd/uok/parity-report.js +58 -0
- package/dist/resources/extensions/gsd/uok/plan-v2.js +30 -7
- package/dist/resources/extensions/gsd/uok/writer.js +82 -0
- package/dist/resources/extensions/gsd/workflow-logger.js +10 -2
- package/dist/resources/extensions/gsd/worktree-manager.js +1 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +50 -10
- package/dist/resources/extensions/mcp-client/auth.js +10 -1
- package/dist/resources/extensions/mcp-client/index.js +118 -9
- package/dist/resources/extensions/shared/cmux-events.js +12 -0
- package/dist/resources/extensions/shared/rtk-session-stats.js +1 -2
- package/dist/resources/skills/create-skill/SKILL.md +2 -2
- package/dist/resources/skills/create-skill/references/gsd-skill-ecosystem.md +4 -4
- package/dist/resources/skills/create-skill/workflows/audit-skill.md +4 -4
- package/dist/resources/skills/create-skill/workflows/create-new-skill.md +5 -5
- package/dist/resources/skills/verify-before-complete/SKILL.md +2 -1
- package/dist/resources/skills/write-docs/SKILL.md +2 -1
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +9 -9
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +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 +9 -9
- package/dist/web/standalone/.next/server/chunks/1926.js +1 -0
- package/dist/web/standalone/.next/server/chunks/6897.js +2 -2
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/2826.e9f5195e91f9cad2.js +11 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-5fc74f13a25fa1bb.js → webpack-2e68521d7c82f7c2.js} +1 -1
- package/dist/welcome-screen.js +6 -1
- package/dist/wizard.js +2 -0
- package/package.json +16 -14
- package/packages/daemon/package.json +2 -2
- package/packages/mcp-server/README.md +3 -3
- package/packages/mcp-server/dist/env-writer.d.ts +1 -0
- package/packages/mcp-server/dist/env-writer.d.ts.map +1 -1
- package/packages/mcp-server/dist/env-writer.js +74 -6
- package/packages/mcp-server/dist/env-writer.js.map +1 -1
- package/packages/mcp-server/dist/remote-questions.d.ts +45 -0
- package/packages/mcp-server/dist/remote-questions.d.ts.map +1 -0
- package/packages/mcp-server/dist/remote-questions.js +732 -0
- package/packages/mcp-server/dist/remote-questions.js.map +1 -0
- package/packages/mcp-server/dist/server.d.ts +7 -0
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +95 -10
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/session-manager.d.ts +14 -0
- package/packages/mcp-server/dist/session-manager.d.ts.map +1 -1
- package/packages/mcp-server/dist/session-manager.js +49 -1
- package/packages/mcp-server/dist/session-manager.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +15 -6
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +9 -3
- package/packages/mcp-server/src/env-writer.test.ts +79 -1
- package/packages/mcp-server/src/env-writer.ts +76 -6
- package/packages/mcp-server/src/mcp-server.test.ts +67 -0
- package/packages/mcp-server/src/readers/readers.test.ts +5 -1
- package/packages/mcp-server/src/remote-questions.test.ts +294 -0
- package/packages/mcp-server/src/remote-questions.ts +916 -0
- package/packages/mcp-server/src/server.ts +118 -16
- package/packages/mcp-server/src/session-manager.ts +43 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +44 -0
- package/packages/mcp-server/src/workflow-tools.ts +19 -6
- package/packages/mcp-server/tsconfig.test.json +19 -0
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/package.json +6 -1
- package/packages/native/src/__tests__/clipboard.test.mjs +69 -23
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/package.json +6 -1
- package/packages/pi-agent-core/src/agent-loop.test.ts +220 -15
- package/packages/pi-ai/dist/models/custom.d.ts +38 -0
- package/packages/pi-ai/dist/models/custom.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/custom.js +41 -0
- package/packages/pi-ai/dist/models/custom.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +27 -4
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +8 -3
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js +80 -0
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/simple-options.d.ts +10 -0
- package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.js +16 -1
- package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/packages/pi-ai/package.json +6 -1
- package/packages/pi-ai/src/models/custom.ts +42 -0
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +1 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +26 -5
- package/packages/pi-ai/src/providers/anthropic.ts +9 -3
- package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +98 -0
- package/packages/pi-ai/src/providers/simple-options.ts +17 -1
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +3 -2
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +2 -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 +7 -0
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +25 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +105 -6
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js +230 -28
- package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts +30 -2
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.js +113 -12
- package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js +29 -18
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.js +130 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.js +56 -1
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/discovery-cache.test.js +8 -15
- package/packages/pi-coding-agent/dist/core/discovery-cache.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.d.ts +25 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.js +109 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-registry.d.ts +67 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-registry.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-registry.js +167 -0
- package/packages/pi-coding-agent/dist/core/extensions/extension-registry.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +3 -2
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +24 -8
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +14 -0
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js +11 -0
- package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +2 -2
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.js +203 -0
- package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +14 -0
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.js +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +4 -1
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.test.js +19 -1
- package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.test.js +21 -1
- package/packages/pi-coding-agent/dist/core/session-manager.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +3 -3
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/path-utils.test.js +2 -1
- package/packages/pi-coding-agent/dist/core/tools/path-utils.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/provider-display-name.test.js +15 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/provider-display-name.test.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 +14 -5
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts +7 -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 +31 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +14 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +13 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +6 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +3 -2
- package/packages/pi-coding-agent/src/core/agent-session.ts +11 -0
- package/packages/pi-coding-agent/src/core/compaction/compaction.test.ts +368 -28
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +122 -6
- package/packages/pi-coding-agent/src/core/compaction/utils.ts +111 -13
- package/packages/pi-coding-agent/src/core/compaction-orchestrator.test.ts +154 -0
- package/packages/pi-coding-agent/src/core/compaction-orchestrator.ts +32 -18
- package/packages/pi-coding-agent/src/core/compaction-utils.test.ts +68 -1
- package/packages/pi-coding-agent/src/core/discovery-cache.test.ts +9 -18
- package/packages/pi-coding-agent/src/core/extensions/extension-discovery.ts +119 -0
- package/packages/pi-coding-agent/src/core/extensions/extension-registry.ts +222 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +24 -11
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +2 -0
- package/packages/pi-coding-agent/src/core/extensions/types.ts +15 -0
- package/packages/pi-coding-agent/src/core/lsp/lsp-integration.test.ts +13 -0
- package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +2 -2
- package/packages/pi-coding-agent/src/core/model-registry-custom-caps.test.ts +245 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +16 -0
- package/packages/pi-coding-agent/src/core/resource-loader.ts +1 -1
- package/packages/pi-coding-agent/src/core/sdk.test.ts +25 -1
- package/packages/pi-coding-agent/src/core/sdk.ts +10 -3
- package/packages/pi-coding-agent/src/core/session-manager.test.ts +30 -1
- package/packages/pi-coding-agent/src/core/session-manager.ts +1 -1
- package/packages/pi-coding-agent/src/core/system-prompt.ts +3 -3
- package/packages/pi-coding-agent/src/core/tools/path-utils.test.ts +2 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/provider-display-name.test.ts +17 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +14 -5
- package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +45 -11
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +14 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +13 -1
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js +12 -5
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js.map +1 -1
- package/packages/pi-tui/dist/__tests__/stdin-buffer.test.js +21 -0
- package/packages/pi-tui/dist/__tests__/stdin-buffer.test.js.map +1 -1
- package/packages/pi-tui/dist/stdin-buffer.d.ts +7 -0
- package/packages/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
- package/packages/pi-tui/dist/stdin-buffer.js +20 -0
- package/packages/pi-tui/dist/stdin-buffer.js.map +1 -1
- package/packages/pi-tui/package.json +6 -1
- package/packages/pi-tui/src/__tests__/autocomplete.test.ts +20 -5
- package/packages/pi-tui/src/__tests__/stdin-buffer.test.ts +27 -0
- package/packages/pi-tui/src/stdin-buffer.ts +26 -0
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/package.json +6 -1
- package/pkg/package.json +1 -1
- package/scripts/install.js +512 -0
- package/scripts/lib/workspace-manifest.cjs +86 -0
- package/scripts/link-workspace-packages.cjs +5 -17
- package/scripts/postinstall.js +9 -178
- package/src/resources/extensions/claude-code-cli/readiness.ts +4 -3
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +91 -63
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +114 -12
- package/src/resources/extensions/cmux/index.ts +35 -10
- package/src/resources/extensions/github-sync/templates.ts +151 -0
- package/src/resources/extensions/github-sync/tests/templates.test.ts +59 -0
- package/src/resources/extensions/google-search/extension-manifest.json +5 -4
- package/src/resources/extensions/google-search/index.ts +9 -470
- package/src/resources/extensions/gsd/abandon-detect.ts +62 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +14 -1
- package/src/resources/extensions/gsd/auto/loop.ts +104 -2
- package/src/resources/extensions/gsd/auto/phases.ts +123 -21
- package/src/resources/extensions/gsd/auto/resolve.ts +29 -0
- package/src/resources/extensions/gsd/auto/run-unit.ts +56 -4
- package/src/resources/extensions/gsd/auto/session.ts +28 -1
- package/src/resources/extensions/gsd/auto/turn-epoch.ts +108 -0
- package/src/resources/extensions/gsd/auto/types.ts +1 -1
- package/src/resources/extensions/gsd/auto-dispatch.ts +117 -16
- package/src/resources/extensions/gsd/auto-loop.ts +1 -1
- package/src/resources/extensions/gsd/auto-model-selection.ts +1 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +92 -3
- package/src/resources/extensions/gsd/auto-prompts.ts +28 -1
- package/src/resources/extensions/gsd/auto-recovery.ts +40 -1
- package/src/resources/extensions/gsd/auto-start.ts +48 -52
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +12 -5
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +14 -3
- package/src/resources/extensions/gsd/auto-worktree.ts +122 -68
- package/src/resources/extensions/gsd/auto.ts +105 -35
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +34 -1
- package/src/resources/extensions/gsd/bootstrap/provider-error-resume.ts +6 -2
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +11 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +18 -6
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +13 -9
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +35 -2
- package/src/resources/extensions/gsd/clean-root-preflight.ts +111 -0
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +27 -8
- package/src/resources/extensions/gsd/commands-cmux.ts +10 -6
- package/src/resources/extensions/gsd/commands-extensions.ts +747 -41
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +898 -32
- package/src/resources/extensions/gsd/dispatch-guard.ts +26 -2
- package/src/resources/extensions/gsd/file-lock.ts +84 -11
- package/src/resources/extensions/gsd/git-service.ts +1 -0
- package/src/resources/extensions/gsd/gitignore.ts +2 -1
- package/src/resources/extensions/gsd/gsd-db.ts +92 -32
- package/src/resources/extensions/gsd/guided-flow-queue.ts +4 -1
- package/src/resources/extensions/gsd/guided-flow.ts +259 -10
- package/src/resources/extensions/gsd/health-widget.ts +3 -1
- package/src/resources/extensions/gsd/journal.ts +29 -3
- package/src/resources/extensions/gsd/key-manager.ts +22 -0
- package/src/resources/extensions/gsd/milestone-actions.ts +18 -0
- package/src/resources/extensions/gsd/milestone-summary-classifier.ts +42 -0
- package/src/resources/extensions/gsd/model-router.ts +42 -1
- package/src/resources/extensions/gsd/notifications.ts +27 -15
- package/src/resources/extensions/gsd/pre-execution-checks.ts +33 -7
- package/src/resources/extensions/gsd/preferences-types.ts +8 -0
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +29 -2
- package/src/resources/extensions/gsd/prompts/discuss.md +29 -2
- package/src/resources/extensions/gsd/prompts/doctor-heal.md +5 -4
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
- package/src/resources/extensions/gsd/prompts/system.md +1 -0
- package/src/resources/extensions/gsd/reports.ts +5 -4
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +119 -0
- package/src/resources/extensions/gsd/safety/file-change-validator.ts +16 -3
- package/src/resources/extensions/gsd/safety/safety-harness.ts +9 -0
- package/src/resources/extensions/gsd/state-transition-matrix.ts +152 -0
- package/src/resources/extensions/gsd/state.ts +35 -30
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +238 -4
- package/src/resources/extensions/gsd/tests/auto-mode-guards.test.ts +79 -0
- package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +122 -0
- package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +141 -0
- package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +186 -0
- package/src/resources/extensions/gsd/tests/cmux.test.ts +5 -9
- package/src/resources/extensions/gsd/tests/complete-milestone-false-merge.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +61 -1
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +161 -0
- package/src/resources/extensions/gsd/tests/db-access-guardrails.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/derive-state.test.ts +1 -2
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +14 -9
- package/src/resources/extensions/gsd/tests/dispatch-guard-summary-db-mismatch.test.ts +77 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +25 -0
- package/src/resources/extensions/gsd/tests/dispatch-missing-task-plans.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/double-merge-guard.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/ensure-db-open.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/escalation.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/exec-history.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/execution-entry-missing-context-4671.test.ts +173 -0
- package/src/resources/extensions/gsd/tests/file-change-validator.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/file-lock.test.ts +86 -12
- package/src/resources/extensions/gsd/tests/google-search-stub.test.ts +131 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +296 -1
- package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +117 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/integration/gitignore-tracked-gsd.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/integration/worktree-e2e.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/issue-4540-regressions.test.ts +288 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/key-manager.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/mcp-client-security.test.ts +76 -0
- package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/milestone-status-authoritative.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/milestone-summary-classifier.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/parallel-commit-scope.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/parallel-research-dispatch.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +150 -0
- package/src/resources/extensions/gsd/tests/plan-gate-failed-doctor-heal-hint.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/pre-exec-gate-loop.test.ts +272 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +337 -0
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +39 -25
- package/src/resources/extensions/gsd/tests/queue-auto-guard.test.ts +181 -0
- package/src/resources/extensions/gsd/tests/quick-auto-guard.test.ts +13 -7
- package/src/resources/extensions/gsd/tests/ready-phrase-no-files-4573.test.ts +388 -0
- package/src/resources/extensions/gsd/tests/require-slice-discussion-dispatch.test.ts +170 -0
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +9 -3
- package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +230 -0
- package/src/resources/extensions/gsd/tests/rewrite-docs-abandon-detect.test.ts +195 -0
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +205 -0
- package/src/resources/extensions/gsd/tests/schema-v21-sequence.test.ts +413 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +32 -40
- package/src/resources/extensions/gsd/tests/stale-dirlistcache-4648.test.ts +112 -0
- package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +56 -0
- package/src/resources/extensions/gsd/tests/state-machine-full-walkthrough.test.ts +24 -0
- package/src/resources/extensions/gsd/tests/state-transition-matrix.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/token-counter.test.ts +105 -1
- package/src/resources/extensions/gsd/tests/tool-compatibility.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/triage-resolution.test.ts +50 -2
- package/src/resources/extensions/gsd/tests/turn-epoch.test.ts +162 -0
- package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/uok-execution-graph.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/uok-loop-adapter-writer.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/uok-parity-report.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +42 -2
- package/src/resources/extensions/gsd/tests/uok-writer.test.ts +75 -0
- package/src/resources/extensions/gsd/tests/validate-extension-package.test.ts +168 -0
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +138 -5
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +25 -2
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +65 -2
- package/src/resources/extensions/gsd/tests/worktree-db.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +78 -5
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +64 -0
- package/src/resources/extensions/gsd/token-counter.ts +22 -5
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +15 -9
- package/src/resources/extensions/gsd/tools/complete-slice.ts +38 -0
- package/src/resources/extensions/gsd/tools/complete-task.ts +49 -0
- package/src/resources/extensions/gsd/uok/audit.ts +20 -2
- package/src/resources/extensions/gsd/uok/contracts.ts +65 -0
- package/src/resources/extensions/gsd/uok/dispatch-envelope.ts +56 -0
- package/src/resources/extensions/gsd/uok/execution-graph.ts +22 -0
- package/src/resources/extensions/gsd/uok/gitops.ts +6 -1
- package/src/resources/extensions/gsd/uok/loop-adapter.ts +45 -10
- package/src/resources/extensions/gsd/uok/parity-report.ts +84 -0
- package/src/resources/extensions/gsd/uok/plan-v2.ts +39 -8
- package/src/resources/extensions/gsd/uok/writer.ts +113 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +23 -3
- package/src/resources/extensions/gsd/worktree-manager.ts +1 -0
- package/src/resources/extensions/gsd/worktree-resolver.ts +54 -9
- package/src/resources/extensions/mcp-client/auth.ts +12 -1
- package/src/resources/extensions/mcp-client/index.ts +129 -10
- package/src/resources/extensions/shared/cmux-events.ts +59 -0
- package/src/resources/extensions/shared/rtk-session-stats.ts +1 -2
- package/src/resources/skills/create-skill/SKILL.md +2 -2
- package/src/resources/skills/create-skill/references/gsd-skill-ecosystem.md +4 -4
- package/src/resources/skills/create-skill/workflows/audit-skill.md +4 -4
- package/src/resources/skills/create-skill/workflows/create-new-skill.md +5 -5
- package/src/resources/skills/verify-before-complete/SKILL.md +2 -1
- package/src/resources/skills/write-docs/SKILL.md +2 -1
- package/dist/web/standalone/.next/server/chunks/7461.js +0 -1
- package/dist/web/standalone/.next/static/chunks/2826.e59e8578e2e28639.js +0 -9
- /package/dist/web/standalone/.next/static/{n21VtX2hZlkpdEUO_nU4z → vidAVJkURvTJ0_V2-64ro}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{n21VtX2hZlkpdEUO_nU4z → vidAVJkURvTJ0_V2-64ro}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression tests for auto-mode guards (#4704 Tier 2 / #4712).
|
|
3
|
+
*
|
|
4
|
+
* Validates the defense-in-depth writer asserts in milestone-actions.ts —
|
|
5
|
+
* parkMilestone, unparkMilestone, and discardMilestone must refuse to run
|
|
6
|
+
* while auto-mode is active, regardless of the calling dispatch path.
|
|
7
|
+
*/
|
|
8
|
+
import { describe, test, afterEach } from 'node:test';
|
|
9
|
+
import assert from 'node:assert/strict';
|
|
10
|
+
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
11
|
+
import { join } from 'node:path';
|
|
12
|
+
import { tmpdir } from 'node:os';
|
|
13
|
+
|
|
14
|
+
import { parkMilestone, unparkMilestone, discardMilestone } from '../milestone-actions.ts';
|
|
15
|
+
import { _setAutoActiveForTest } from '../auto.ts';
|
|
16
|
+
|
|
17
|
+
function createFixture(): string {
|
|
18
|
+
const base = mkdtempSync(join(tmpdir(), 'gsd-guard-test-'));
|
|
19
|
+
const mDir = join(base, '.gsd', 'milestones', 'M001');
|
|
20
|
+
mkdirSync(mDir, { recursive: true });
|
|
21
|
+
writeFileSync(join(mDir, 'M001-ROADMAP.md'), '# M001\n', 'utf-8');
|
|
22
|
+
return base;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
describe('auto-mode guards (milestone-actions)', () => {
|
|
26
|
+
afterEach(() => {
|
|
27
|
+
_setAutoActiveForTest(false);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('parkMilestone throws when auto-mode is active', () => {
|
|
31
|
+
const base = createFixture();
|
|
32
|
+
try {
|
|
33
|
+
_setAutoActiveForTest(true);
|
|
34
|
+
assert.throws(
|
|
35
|
+
() => parkMilestone(base, 'M001', 'test'),
|
|
36
|
+
/auto-mode is active/,
|
|
37
|
+
);
|
|
38
|
+
} finally {
|
|
39
|
+
rmSync(base, { recursive: true, force: true });
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('unparkMilestone throws when auto-mode is active', () => {
|
|
44
|
+
const base = createFixture();
|
|
45
|
+
try {
|
|
46
|
+
_setAutoActiveForTest(true);
|
|
47
|
+
assert.throws(
|
|
48
|
+
() => unparkMilestone(base, 'M001'),
|
|
49
|
+
/auto-mode is active/,
|
|
50
|
+
);
|
|
51
|
+
} finally {
|
|
52
|
+
rmSync(base, { recursive: true, force: true });
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('discardMilestone throws when auto-mode is active', () => {
|
|
57
|
+
const base = createFixture();
|
|
58
|
+
try {
|
|
59
|
+
_setAutoActiveForTest(true);
|
|
60
|
+
assert.throws(
|
|
61
|
+
() => discardMilestone(base, 'M001'),
|
|
62
|
+
/auto-mode is active/,
|
|
63
|
+
);
|
|
64
|
+
} finally {
|
|
65
|
+
rmSync(base, { recursive: true, force: true });
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test('parkMilestone proceeds normally when auto-mode is inactive', () => {
|
|
70
|
+
const base = createFixture();
|
|
71
|
+
try {
|
|
72
|
+
_setAutoActiveForTest(false);
|
|
73
|
+
const result = parkMilestone(base, 'M001', 'baseline');
|
|
74
|
+
assert.ok(result, 'park succeeds when auto is inactive');
|
|
75
|
+
} finally {
|
|
76
|
+
rmSync(base, { recursive: true, force: true });
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -39,6 +39,18 @@ test("auto.ts validates milestone before restoring paused session (#1664)", () =
|
|
|
39
39
|
source.includes('resolveMilestoneFile(base, meta.milestoneId, "SUMMARY")'),
|
|
40
40
|
"auto.ts must check for SUMMARY file to detect completed milestones",
|
|
41
41
|
);
|
|
42
|
+
|
|
43
|
+
// Resume path must sanitize paused session file metadata before unlink/recovery.
|
|
44
|
+
assert.ok(
|
|
45
|
+
source.includes("normalizeSessionFilePath(meta.sessionFile ?? null)"),
|
|
46
|
+
"auto.ts must sanitize paused-session metadata sessionFile before using it",
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// Pause path must sanitize live session file path before persisting metadata.
|
|
50
|
+
assert.ok(
|
|
51
|
+
source.includes("normalizeSessionFilePath(ctx?.sessionManager?.getSessionFile() ?? null)"),
|
|
52
|
+
"auto.ts must sanitize sessionManager getSessionFile output before persisting",
|
|
53
|
+
);
|
|
42
54
|
});
|
|
43
55
|
|
|
44
56
|
// ─── Filesystem validation unit tests ───────────────────────────────────────
|
|
@@ -706,6 +706,79 @@ test("verifyExpectedArtifact complete-milestone passes with impl files (#1703)",
|
|
|
706
706
|
}
|
|
707
707
|
});
|
|
708
708
|
|
|
709
|
+
test("verifyExpectedArtifact complete-milestone fails when DB milestone is not complete (#4658)", () => {
|
|
710
|
+
const base = makeGitBase();
|
|
711
|
+
try {
|
|
712
|
+
execFileSync("git", ["checkout", "-b", "feat/ms-db-active"], { cwd: base, stdio: "ignore" });
|
|
713
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001"), { recursive: true });
|
|
714
|
+
writeFileSync(join(base, ".gsd", "milestones", "M001", "M001-SUMMARY.md"), "# Milestone Summary\nverification FAILED — not complete.");
|
|
715
|
+
mkdirSync(join(base, "src"), { recursive: true });
|
|
716
|
+
writeFileSync(join(base, "src", "app.ts"), "console.log('hello');");
|
|
717
|
+
execFileSync("git", ["add", "."], { cwd: base, stdio: "ignore" });
|
|
718
|
+
execFileSync("git", ["commit", "-m", "feat: implementation with failed summary"], { cwd: base, stdio: "ignore" });
|
|
719
|
+
|
|
720
|
+
openDatabase(join(base, ".gsd", "gsd.db"));
|
|
721
|
+
insertMilestone({ id: "M001", title: "Milestone One", status: "active" });
|
|
722
|
+
|
|
723
|
+
const result = verifyExpectedArtifact("complete-milestone", "M001", base);
|
|
724
|
+
assert.equal(result, false, "complete-milestone must fail when DB status is not complete");
|
|
725
|
+
} finally {
|
|
726
|
+
cleanup(base);
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
|
|
730
|
+
test("verifyExpectedArtifact complete-milestone passes when DB milestone is complete (#4658)", () => {
|
|
731
|
+
const base = makeGitBase();
|
|
732
|
+
try {
|
|
733
|
+
execFileSync("git", ["checkout", "-b", "feat/ms-db-complete"], { cwd: base, stdio: "ignore" });
|
|
734
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001"), { recursive: true });
|
|
735
|
+
writeFileSync(join(base, ".gsd", "milestones", "M001", "M001-SUMMARY.md"), "# Milestone Summary\nDone.");
|
|
736
|
+
mkdirSync(join(base, "src"), { recursive: true });
|
|
737
|
+
writeFileSync(join(base, "src", "app.ts"), "console.log('hello');");
|
|
738
|
+
execFileSync("git", ["add", "."], { cwd: base, stdio: "ignore" });
|
|
739
|
+
execFileSync("git", ["commit", "-m", "feat: implementation complete"], { cwd: base, stdio: "ignore" });
|
|
740
|
+
|
|
741
|
+
openDatabase(join(base, ".gsd", "gsd.db"));
|
|
742
|
+
insertMilestone({ id: "M001", title: "Milestone One", status: "complete" });
|
|
743
|
+
|
|
744
|
+
const result = verifyExpectedArtifact("complete-milestone", "M001", base);
|
|
745
|
+
assert.equal(result, true, "complete-milestone should pass when DB status is complete");
|
|
746
|
+
} finally {
|
|
747
|
+
cleanup(base);
|
|
748
|
+
}
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
test("verifyExpectedArtifact complete-milestone tolerates transient DB lag when SUMMARY is canonical success (#4658)", () => {
|
|
752
|
+
const base = makeGitBase();
|
|
753
|
+
try {
|
|
754
|
+
execFileSync("git", ["checkout", "-b", "feat/ms-db-lag-success"], { cwd: base, stdio: "ignore" });
|
|
755
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001"), { recursive: true });
|
|
756
|
+
writeFileSync(
|
|
757
|
+
join(base, ".gsd", "milestones", "M001", "M001-SUMMARY.md"),
|
|
758
|
+
[
|
|
759
|
+
"---",
|
|
760
|
+
"id: M001",
|
|
761
|
+
"status: complete",
|
|
762
|
+
"---",
|
|
763
|
+
"",
|
|
764
|
+
"# M001: Success",
|
|
765
|
+
].join("\n"),
|
|
766
|
+
);
|
|
767
|
+
mkdirSync(join(base, "src"), { recursive: true });
|
|
768
|
+
writeFileSync(join(base, "src", "app.ts"), "console.log('hello');");
|
|
769
|
+
execFileSync("git", ["add", "."], { cwd: base, stdio: "ignore" });
|
|
770
|
+
execFileSync("git", ["commit", "-m", "feat: implementation with stale db"], { cwd: base, stdio: "ignore" });
|
|
771
|
+
|
|
772
|
+
openDatabase(join(base, ".gsd", "gsd.db"));
|
|
773
|
+
insertMilestone({ id: "M001", title: "Milestone One", status: "active" });
|
|
774
|
+
|
|
775
|
+
const result = verifyExpectedArtifact("complete-milestone", "M001", base);
|
|
776
|
+
assert.equal(result, true, "canonical success SUMMARY should pass verification during transient DB lag");
|
|
777
|
+
} finally {
|
|
778
|
+
cleanup(base);
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
|
|
709
782
|
test("verifyExpectedArtifact checks pending gate-evaluate artifacts without ESM require failures", () => {
|
|
710
783
|
const base = makeTmpProject();
|
|
711
784
|
|
|
@@ -775,6 +848,55 @@ test("#4414: parallel-research sentinel path does not collide with RESEARCH suff
|
|
|
775
848
|
}
|
|
776
849
|
});
|
|
777
850
|
|
|
851
|
+
test("#4068: verifyExpectedArtifact parallel-research treats PARALLEL-BLOCKER as terminal completion", () => {
|
|
852
|
+
// Regression: when a parallel-research unit times out and the timeout-recovery
|
|
853
|
+
// machinery writes a PARALLEL-BLOCKER placeholder, verifyExpectedArtifact must
|
|
854
|
+
// return true so the dispatch loop can advance. Previously it only returned
|
|
855
|
+
// true when every slice had a RESEARCH file — meaning a timeout always left
|
|
856
|
+
// verifyExpectedArtifact returning false, the unit was never cleared from
|
|
857
|
+
// unitDispatchCount, and the dispatch rule re-fired on the next iteration
|
|
858
|
+
// (infinite loop, issue #4068 / #4355).
|
|
859
|
+
const base = makeTmpBase();
|
|
860
|
+
try {
|
|
861
|
+
// Write a minimal roadmap
|
|
862
|
+
writeFileSync(
|
|
863
|
+
join(base, ".gsd", "milestones", "M001", "M001-ROADMAP.md"),
|
|
864
|
+
[
|
|
865
|
+
"# M001: Timeout Test",
|
|
866
|
+
"",
|
|
867
|
+
"## Slices",
|
|
868
|
+
"",
|
|
869
|
+
"- [ ] **S01: Alpha** `risk:low` `depends:[]`",
|
|
870
|
+
"- [ ] **S02: Beta** `risk:low` `depends:[]`",
|
|
871
|
+
"",
|
|
872
|
+
].join("\n"),
|
|
873
|
+
"utf-8",
|
|
874
|
+
);
|
|
875
|
+
|
|
876
|
+
// No RESEARCH files written — subagents timed out
|
|
877
|
+
clearParseCache();
|
|
878
|
+
invalidateAllCaches();
|
|
879
|
+
|
|
880
|
+
// Simulate timeout-recovery writing the PARALLEL-BLOCKER placeholder
|
|
881
|
+
const blockerPath = resolveExpectedArtifactPath("research-slice", "M001/parallel-research", base);
|
|
882
|
+
assert.ok(blockerPath, "PARALLEL-BLOCKER path must resolve for parallel-research unit");
|
|
883
|
+
writeFileSync(blockerPath!, "# BLOCKER — timeout recovery\n\n**Reason**: hard timeout.\n", "utf-8");
|
|
884
|
+
|
|
885
|
+
clearParseCache();
|
|
886
|
+
invalidateAllCaches();
|
|
887
|
+
|
|
888
|
+
// After blocker is written, verifyExpectedArtifact must return true
|
|
889
|
+
// so the dispatch loop treats this unit as complete and moves on.
|
|
890
|
+
assert.equal(
|
|
891
|
+
verifyExpectedArtifact("research-slice", "M001/parallel-research", base),
|
|
892
|
+
true,
|
|
893
|
+
"#4068: PARALLEL-BLOCKER on disk must satisfy verifyExpectedArtifact so the loop does not re-dispatch",
|
|
894
|
+
);
|
|
895
|
+
} finally {
|
|
896
|
+
cleanup(base);
|
|
897
|
+
}
|
|
898
|
+
});
|
|
899
|
+
|
|
778
900
|
test("#4414: verifyExpectedArtifact parallel-research succeeds when all research-ready slices have RESEARCH", () => {
|
|
779
901
|
const base = makeTmpBase();
|
|
780
902
|
try {
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* auto-start-bootstrap-await-3420.test.ts — Regression test for #3420.
|
|
3
|
+
*
|
|
4
|
+
* Bug: In bootstrapAutoSession, when state.phase === "pre-planning" and no
|
|
5
|
+
* context file exists, showSmartEntry is called to dispatch a discuss workflow.
|
|
6
|
+
* showSmartEntry calls dispatchWorkflow which calls pi.sendMessage() — a
|
|
7
|
+
* fire-and-forget call that returns immediately. The LLM discussion runs
|
|
8
|
+
* asynchronously in a separate turn.
|
|
9
|
+
*
|
|
10
|
+
* The bug: after showSmartEntry returns (before the LLM has run), the code
|
|
11
|
+
* immediately calls invalidateAllCaches() + deriveState() + checks postState.
|
|
12
|
+
* Since the discussion hasn't run yet, postState.phase is still "pre-planning"
|
|
13
|
+
* and the context check fails, producing the warning:
|
|
14
|
+
* "Discussion completed but milestone context is still missing. Run /gsd to try again."
|
|
15
|
+
*
|
|
16
|
+
* The discussion never ran — the warning fires immediately.
|
|
17
|
+
*
|
|
18
|
+
* Fix: bootstrapAutoSession must return false (release lock) after showSmartEntry
|
|
19
|
+
* dispatches the workflow. The checkAutoStartAfterDiscuss callback in guided-flow.ts
|
|
20
|
+
* already handles re-entering auto-mode when the discussion completes.
|
|
21
|
+
*
|
|
22
|
+
* This test verifies the fix by asserting that the pre-planning !hasContext block
|
|
23
|
+
* does NOT contain a postState phase check after showSmartEntry — it must
|
|
24
|
+
* return false immediately to let the async dispatch complete.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import test from "node:test";
|
|
28
|
+
import assert from "node:assert/strict";
|
|
29
|
+
import { readFileSync } from "node:fs";
|
|
30
|
+
import { join } from "node:path";
|
|
31
|
+
|
|
32
|
+
const sourcePath = join(import.meta.dirname, "..", "auto-start.ts");
|
|
33
|
+
const source = readFileSync(sourcePath, "utf-8");
|
|
34
|
+
|
|
35
|
+
test("bootstrapAutoSession: pre-planning no-context path does NOT check postState immediately after showSmartEntry (#3420)", () => {
|
|
36
|
+
// Find the pre-planning block that handles the case where context is missing.
|
|
37
|
+
// This block dispatches showSmartEntry which is async (fire-and-forget via pi.sendMessage).
|
|
38
|
+
// After the dispatch, checking postState.phase immediately is premature — the
|
|
39
|
+
// LLM discussion hasn't run yet. The block should return false instead.
|
|
40
|
+
const prePlanningNoContextBlock = source.match(
|
|
41
|
+
/\/\/ Active milestone exists but has no roadmap\s*\n\s*if\s*\(\s*state\.phase\s*===\s*"pre-planning"\s*\)([\s\S]*?)\/\/ Active milestone has CONTEXT-DRAFT/,
|
|
42
|
+
);
|
|
43
|
+
assert.ok(
|
|
44
|
+
!!prePlanningNoContextBlock,
|
|
45
|
+
"auto-start.ts must have the pre-planning handler block before needs-discussion",
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const block = prePlanningNoContextBlock![1];
|
|
49
|
+
|
|
50
|
+
// The block must call showSmartEntry when !hasContext
|
|
51
|
+
assert.ok(
|
|
52
|
+
block.includes("showSmartEntry"),
|
|
53
|
+
"pre-planning !hasContext block must call showSmartEntry to dispatch the discuss workflow",
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
// FAILING ASSERTION (before fix): after showSmartEntry, the block must NOT
|
|
57
|
+
// immediately check postState.phase — that check fires before the LLM runs.
|
|
58
|
+
// Instead, it must return false (release lock) so the async dispatch can complete.
|
|
59
|
+
// The warning "Discussion completed but milestone context is still missing"
|
|
60
|
+
// fires prematurely when this postState check exists.
|
|
61
|
+
assert.ok(
|
|
62
|
+
!block.includes("Discussion completed but milestone context is still missing"),
|
|
63
|
+
"pre-planning !hasContext block must NOT check postState.phase immediately after showSmartEntry — " +
|
|
64
|
+
"the dispatch is async (pi.sendMessage is fire-and-forget) and the discussion hasn't run yet; " +
|
|
65
|
+
"return false instead so checkAutoStartAfterDiscuss can re-enter auto-mode after discussion completes (#3420)",
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test("bootstrapAutoSession: complete/no-milestone path does NOT check postState immediately after showSmartEntry (#3420)", () => {
|
|
70
|
+
// Find the complete/no-milestone block
|
|
71
|
+
const completeBlock = source.match(
|
|
72
|
+
/\/\/ No active work — start a new milestone via discuss flow\s*\n\s*if\s*\(!state\.activeMilestone\s*\|\|\s*state\.phase\s*===\s*"complete"\s*\)([\s\S]*?)\/\/ Active milestone exists but has no roadmap/,
|
|
73
|
+
);
|
|
74
|
+
assert.ok(
|
|
75
|
+
!!completeBlock,
|
|
76
|
+
"auto-start.ts must have the complete/no-milestone handler block",
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const block = completeBlock![1];
|
|
80
|
+
|
|
81
|
+
// The block must call showSmartEntry
|
|
82
|
+
assert.ok(
|
|
83
|
+
block.includes("showSmartEntry"),
|
|
84
|
+
"complete/no-milestone block must call showSmartEntry",
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
// After showSmartEntry dispatches, checking postState.phase is premature —
|
|
88
|
+
// the LLM hasn't had a turn yet. The block should return false.
|
|
89
|
+
// Specifically, the "no milestone context was written" warning fires too early.
|
|
90
|
+
assert.ok(
|
|
91
|
+
!block.includes("Discussion completed but no milestone context was written"),
|
|
92
|
+
"complete/no-milestone block must NOT check postState.phase immediately after showSmartEntry dispatch — " +
|
|
93
|
+
"return false instead so the async LLM turn can complete (#3420)",
|
|
94
|
+
);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test("bootstrapAutoSession: showSmartEntry in pre-planning path is followed by releaseLockAndReturn, not postState check (#3420)", () => {
|
|
98
|
+
// After the fix, the pre-planning !hasContext branch should call showSmartEntry
|
|
99
|
+
// and then immediately return releaseLockAndReturn() — not check postState.
|
|
100
|
+
const prePlanningNoContextBlock = source.match(
|
|
101
|
+
/\/\/ Active milestone exists but has no roadmap\s*\n\s*if\s*\(\s*state\.phase\s*===\s*"pre-planning"\s*\)([\s\S]*?)\/\/ Active milestone has CONTEXT-DRAFT/,
|
|
102
|
+
);
|
|
103
|
+
assert.ok(!!prePlanningNoContextBlock, "pre-planning handler block found");
|
|
104
|
+
|
|
105
|
+
const block = prePlanningNoContextBlock![1];
|
|
106
|
+
|
|
107
|
+
// After the fix, the !hasContext branch ends with releaseLockAndReturn
|
|
108
|
+
assert.ok(
|
|
109
|
+
block.includes("releaseLockAndReturn"),
|
|
110
|
+
"pre-planning !hasContext block must call releaseLockAndReturn() after showSmartEntry dispatch (#3420)",
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
// The showSmartEntry call must appear before releaseLockAndReturn
|
|
114
|
+
const showSmartEntryIdx = block.indexOf("showSmartEntry");
|
|
115
|
+
const releaseLockIdx = block.indexOf("releaseLockAndReturn");
|
|
116
|
+
assert.ok(
|
|
117
|
+
showSmartEntryIdx > -1 && releaseLockIdx > -1,
|
|
118
|
+
"both showSmartEntry and releaseLockAndReturn must appear in the block",
|
|
119
|
+
);
|
|
120
|
+
assert.ok(
|
|
121
|
+
showSmartEntryIdx < releaseLockIdx,
|
|
122
|
+
"showSmartEntry must appear before releaseLockAndReturn in pre-planning !hasContext block",
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
// There must be NO invalidateAllCaches between showSmartEntry and releaseLockAndReturn
|
|
126
|
+
// (invalidateAllCaches + deriveState after showSmartEntry is the buggy premature check)
|
|
127
|
+
const afterShowSmartEntry = block.substring(showSmartEntryIdx);
|
|
128
|
+
const cacheInvalidateIdx = afterShowSmartEntry.indexOf("invalidateAllCaches");
|
|
129
|
+
const releaseFromShowIdx = afterShowSmartEntry.indexOf("releaseLockAndReturn");
|
|
130
|
+
|
|
131
|
+
// If invalidateAllCaches appears, it must appear AFTER releaseLockAndReturn
|
|
132
|
+
// (which is impossible since releaseLockAndReturn returns) — so invalidateAllCaches
|
|
133
|
+
// must not appear at all between showSmartEntry and the end of the !hasContext block.
|
|
134
|
+
if (cacheInvalidateIdx !== -1) {
|
|
135
|
+
assert.ok(
|
|
136
|
+
cacheInvalidateIdx > releaseFromShowIdx,
|
|
137
|
+
"invalidateAllCaches must NOT appear between showSmartEntry and releaseLockAndReturn — " +
|
|
138
|
+
"this is the premature postState check that causes #3420",
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// GSD-2 auto-start regression test: cleanStaleRuntimeUnits is DB-gated (#4663)
|
|
2
|
+
//
|
|
3
|
+
// Source-level structural check that the stale-runtime-cleanup predicate in
|
|
4
|
+
// auto-start.ts consults DB status when available instead of treating a
|
|
5
|
+
// SUMMARY-file on disk as proof of milestone completion. Pairs with #4658 /
|
|
6
|
+
// PR #4660 fix in auto-dispatch + auto-recovery.
|
|
7
|
+
|
|
8
|
+
import { describe, test } from "node:test";
|
|
9
|
+
import assert from "node:assert/strict";
|
|
10
|
+
import { readFileSync } from "node:fs";
|
|
11
|
+
import { join, dirname } from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
|
|
14
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
const sourceFile = join(__dirname, "..", "auto-start.ts");
|
|
16
|
+
|
|
17
|
+
describe("auto-start cleanStaleRuntimeUnits DB gating (#4663)", () => {
|
|
18
|
+
const source = readFileSync(sourceFile, "utf-8");
|
|
19
|
+
|
|
20
|
+
test("imports isClosedStatus for DB-status check", () => {
|
|
21
|
+
assert.match(
|
|
22
|
+
source,
|
|
23
|
+
/import\s*\{\s*isClosedStatus\s*\}\s*from\s*["']\.\/status-guards/,
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test("cleanStaleRuntimeUnits is called after openProjectDbIfPresent", () => {
|
|
28
|
+
const openDbIdx = source.indexOf("await openProjectDbIfPresent(base)");
|
|
29
|
+
assert.ok(openDbIdx > -1, "openProjectDbIfPresent should be called in auto-start");
|
|
30
|
+
const cleanIdx = source.indexOf("cleanStaleRuntimeUnits(", openDbIdx);
|
|
31
|
+
assert.ok(
|
|
32
|
+
cleanIdx > -1,
|
|
33
|
+
"cleanStaleRuntimeUnits must run AFTER openProjectDbIfPresent so predicate can consult DB",
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("cleanStaleRuntimeUnits predicate consults DB status when available", () => {
|
|
38
|
+
const cleanIdx = source.indexOf("cleanStaleRuntimeUnits(");
|
|
39
|
+
assert.ok(cleanIdx > -1);
|
|
40
|
+
const snippet = source.slice(cleanIdx, cleanIdx + 600);
|
|
41
|
+
assert.match(
|
|
42
|
+
snippet,
|
|
43
|
+
/isDbAvailable\(\)/,
|
|
44
|
+
"predicate must branch on DB availability",
|
|
45
|
+
);
|
|
46
|
+
assert.match(
|
|
47
|
+
snippet,
|
|
48
|
+
/isClosedStatus\(/,
|
|
49
|
+
"predicate must check DB status via isClosedStatus",
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test("cleanStaleRuntimeUnits predicate still falls back to SUMMARY-file when DB unavailable", () => {
|
|
54
|
+
const cleanIdx = source.indexOf("cleanStaleRuntimeUnits(");
|
|
55
|
+
assert.ok(cleanIdx > -1);
|
|
56
|
+
const snippet = source.slice(cleanIdx, cleanIdx + 600);
|
|
57
|
+
assert.match(
|
|
58
|
+
snippet,
|
|
59
|
+
/resolveMilestoneFile\(base,\s*mid,\s*["']SUMMARY["']\)/,
|
|
60
|
+
"legacy FS-fallback branch should still use SUMMARY file presence",
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -144,3 +144,26 @@ describe("#3512: pauseAuto and stopAuto must flush queued follow-up messages", (
|
|
|
144
144
|
);
|
|
145
145
|
});
|
|
146
146
|
});
|
|
147
|
+
|
|
148
|
+
describe("#4365: tool_execution_start hook must pass toolName to markToolStart", () => {
|
|
149
|
+
test("tool_execution_start handler passes event.toolName to markToolStart", () => {
|
|
150
|
+
// The tool_execution_start handler must forward toolName so that
|
|
151
|
+
// hasInteractiveToolInFlight() can correctly identify ask_user_questions
|
|
152
|
+
// and prevent the idle watchdog from firing during interactive tool calls.
|
|
153
|
+
const startMarker = 'pi.on("tool_execution_start", async (event) => {';
|
|
154
|
+
const endMarker = 'pi.on("tool_execution_end", async (event) => {';
|
|
155
|
+
const toolExecutionStartSection = registerHooksSrc.slice(
|
|
156
|
+
registerHooksSrc.indexOf(startMarker),
|
|
157
|
+
registerHooksSrc.indexOf(endMarker),
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
assert.ok(
|
|
161
|
+
toolExecutionStartSection.length > 0,
|
|
162
|
+
"Could not locate tool_execution_start handler section",
|
|
163
|
+
);
|
|
164
|
+
assert.ok(
|
|
165
|
+
toolExecutionStartSection.includes("markToolStart(event.toolCallId, event.toolName)"),
|
|
166
|
+
"tool_execution_start handler must pass event.toolName to markToolStart so hasInteractiveToolInFlight() works correctly",
|
|
167
|
+
);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* clean-root-preflight.test.ts — Regression tests for #2909.
|
|
3
|
+
*
|
|
4
|
+
* Tests that preflightCleanRoot warns + stashes on dirty trees,
|
|
5
|
+
* is a no-op on clean trees, and that postflightPopStash restores
|
|
6
|
+
* stashed changes after a merge.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import test from "node:test";
|
|
10
|
+
import assert from "node:assert/strict";
|
|
11
|
+
import { mkdtempSync, mkdirSync, writeFileSync, rmSync, readFileSync, realpathSync } from "node:fs";
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
import { tmpdir } from "node:os";
|
|
14
|
+
import { execSync } from "node:child_process";
|
|
15
|
+
|
|
16
|
+
import { preflightCleanRoot, postflightPopStash } from "../clean-root-preflight.ts";
|
|
17
|
+
|
|
18
|
+
function run(cmd: string, cwd: string): string {
|
|
19
|
+
return execSync(cmd, { cwd, stdio: ["ignore", "pipe", "pipe"], encoding: "utf-8" }).trim();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function createTempRepo(): string {
|
|
23
|
+
const dir = realpathSync(mkdtempSync(join(tmpdir(), "gsd-preflight-test-")));
|
|
24
|
+
run("git init", dir);
|
|
25
|
+
run("git config user.email test@example.com", dir);
|
|
26
|
+
run("git config user.name Test", dir);
|
|
27
|
+
writeFileSync(join(dir, "README.md"), "# test\n");
|
|
28
|
+
mkdirSync(join(dir, ".gsd"), { recursive: true });
|
|
29
|
+
writeFileSync(join(dir, ".gsd", "STATE.md"), "# State\n");
|
|
30
|
+
run("git add .", dir);
|
|
31
|
+
run("git commit -m init", dir);
|
|
32
|
+
run("git branch -M main", dir);
|
|
33
|
+
return dir;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ── Clean tree: fast-path returns immediately without stashing ─────────────
|
|
37
|
+
|
|
38
|
+
test("preflightCleanRoot — clean tree returns stashPushed=false and emits no notifications", () => {
|
|
39
|
+
const repo = createTempRepo();
|
|
40
|
+
try {
|
|
41
|
+
const notifications: Array<{ msg: string; level: string }> = [];
|
|
42
|
+
const result = preflightCleanRoot(repo, "M001", (msg, level) => {
|
|
43
|
+
notifications.push({ msg, level });
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
assert.equal(result.stashPushed, false, "stashPushed must be false for clean tree");
|
|
47
|
+
assert.equal(result.summary, "", "summary must be empty for clean tree");
|
|
48
|
+
assert.equal(notifications.length, 0, "no notifications on clean tree");
|
|
49
|
+
|
|
50
|
+
// Verify no stash was created
|
|
51
|
+
const stashList = run("git stash list", repo);
|
|
52
|
+
assert.equal(stashList, "", "no stash entry on clean tree");
|
|
53
|
+
} finally {
|
|
54
|
+
try { rmSync(repo, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }); } catch { /* ignore */ }
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// ── Dirty tree: warns, stashes, returns stashPushed=true ──────────────────
|
|
59
|
+
|
|
60
|
+
test("preflightCleanRoot — dirty tree warns user and auto-stashes", () => {
|
|
61
|
+
const repo = createTempRepo();
|
|
62
|
+
try {
|
|
63
|
+
// Dirty an existing tracked file
|
|
64
|
+
writeFileSync(join(repo, "README.md"), "# locally modified\n");
|
|
65
|
+
|
|
66
|
+
const notifications: Array<{ msg: string; level: string }> = [];
|
|
67
|
+
const result = preflightCleanRoot(repo, "M002", (msg, level) => {
|
|
68
|
+
notifications.push({ msg, level });
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
assert.equal(result.stashPushed, true, "stashPushed must be true when tree was dirty");
|
|
72
|
+
assert.ok(result.summary.length > 0, "summary must be non-empty when stash was pushed");
|
|
73
|
+
|
|
74
|
+
// A warning notification must have been emitted before stashing
|
|
75
|
+
assert.ok(
|
|
76
|
+
notifications.some(n => n.level === "warning" && n.msg.includes("M002")),
|
|
77
|
+
"warning notification must mention the milestone ID",
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
// Working tree must now be clean (stash pushed)
|
|
81
|
+
const status = run("git status --porcelain", repo);
|
|
82
|
+
assert.equal(status, "", "working tree must be clean after stash push");
|
|
83
|
+
|
|
84
|
+
// The stash entry must exist
|
|
85
|
+
const stashList = run("git stash list", repo);
|
|
86
|
+
assert.ok(stashList.includes("gsd-preflight-stash"), "stash entry must be named gsd-preflight-stash");
|
|
87
|
+
} finally {
|
|
88
|
+
try { rmSync(repo, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }); } catch { /* ignore */ }
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// ── Untracked files are also stashed ─────────────────────────────────────
|
|
93
|
+
|
|
94
|
+
test("preflightCleanRoot — untracked file triggers stash with --include-untracked", () => {
|
|
95
|
+
const repo = createTempRepo();
|
|
96
|
+
try {
|
|
97
|
+
// Add an untracked file
|
|
98
|
+
writeFileSync(join(repo, "untracked.ts"), "export const x = 1;\n");
|
|
99
|
+
|
|
100
|
+
const notifications: Array<{ msg: string; level: string }> = [];
|
|
101
|
+
const result = preflightCleanRoot(repo, "M003", (msg, level) => {
|
|
102
|
+
notifications.push({ msg, level });
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
assert.equal(result.stashPushed, true, "stashPushed must be true for untracked file");
|
|
106
|
+
|
|
107
|
+
const status = run("git status --porcelain", repo);
|
|
108
|
+
assert.equal(status, "", "working tree must be clean after stash push");
|
|
109
|
+
} finally {
|
|
110
|
+
try { rmSync(repo, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }); } catch { /* ignore */ }
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// ── postflightPopStash: restores stashed changes ──────────────────────────
|
|
115
|
+
|
|
116
|
+
test("postflightPopStash — restores stashed changes and emits info notification", () => {
|
|
117
|
+
const repo = createTempRepo();
|
|
118
|
+
try {
|
|
119
|
+
// Dirty the working tree
|
|
120
|
+
writeFileSync(join(repo, "README.md"), "# stash me\n");
|
|
121
|
+
|
|
122
|
+
const preNotifications: Array<{ msg: string; level: string }> = [];
|
|
123
|
+
const preflight = preflightCleanRoot(repo, "M004", (msg, level) => {
|
|
124
|
+
preNotifications.push({ msg, level });
|
|
125
|
+
});
|
|
126
|
+
assert.equal(preflight.stashPushed, true, "preflight must have stashed");
|
|
127
|
+
|
|
128
|
+
// Simulate the merge (just a no-op commit here)
|
|
129
|
+
writeFileSync(join(repo, "merged.ts"), "export const merged = true;\n");
|
|
130
|
+
run("git add .", repo);
|
|
131
|
+
run('git commit -m "simulate merge"', repo);
|
|
132
|
+
|
|
133
|
+
const postNotifications: Array<{ msg: string; level: string }> = [];
|
|
134
|
+
postflightPopStash(repo, "M004", (msg, level) => {
|
|
135
|
+
postNotifications.push({ msg, level });
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// The stashed README.md change must be restored
|
|
139
|
+
const content = readFileSync(join(repo, "README.md"), "utf-8");
|
|
140
|
+
assert.equal(content.replace(/\r\n/g, "\n"), "# stash me\n", "stashed file must be restored");
|
|
141
|
+
|
|
142
|
+
// An info notification must have been emitted
|
|
143
|
+
assert.ok(
|
|
144
|
+
postNotifications.some(n => n.level === "info" && n.msg.includes("M004")),
|
|
145
|
+
"info notification must mention milestone ID after pop",
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
// Stash list must be empty
|
|
149
|
+
const stashList = run("git stash list", repo);
|
|
150
|
+
assert.equal(stashList, "", "stash list must be empty after pop");
|
|
151
|
+
} finally {
|
|
152
|
+
try { rmSync(repo, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }); } catch { /* ignore */ }
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// ── Round-trip: preflight + merge + postflight preserves changes ──────────
|
|
157
|
+
|
|
158
|
+
test("preflight + merge + postflight round-trip preserves uncommitted changes", () => {
|
|
159
|
+
const repo = createTempRepo();
|
|
160
|
+
try {
|
|
161
|
+
const originalContent = "# my local work\n";
|
|
162
|
+
writeFileSync(join(repo, "README.md"), originalContent);
|
|
163
|
+
|
|
164
|
+
// Preflight: stash
|
|
165
|
+
const preflight = preflightCleanRoot(repo, "M005", () => {});
|
|
166
|
+
assert.equal(preflight.stashPushed, true, "must have stashed");
|
|
167
|
+
|
|
168
|
+
// Merge: introduce a new file (no overlap with README.md)
|
|
169
|
+
writeFileSync(join(repo, "feature.ts"), "export const feature = true;\n");
|
|
170
|
+
run("git add feature.ts", repo);
|
|
171
|
+
run('git commit -m "feat: add feature"', repo);
|
|
172
|
+
|
|
173
|
+
// Postflight: pop stash
|
|
174
|
+
postflightPopStash(repo, "M005", () => {});
|
|
175
|
+
|
|
176
|
+
// README.md must still have our local content
|
|
177
|
+
const restored = readFileSync(join(repo, "README.md"), "utf-8");
|
|
178
|
+
assert.equal(restored.replace(/\r\n/g, "\n"), originalContent, "local changes must survive merge");
|
|
179
|
+
|
|
180
|
+
// feature.ts must also exist (the merge commit landed)
|
|
181
|
+
const featureContent = readFileSync(join(repo, "feature.ts"), "utf-8");
|
|
182
|
+
assert.ok(featureContent.includes("feature"), "merged feature must be present");
|
|
183
|
+
} finally {
|
|
184
|
+
try { rmSync(repo, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }); } catch { /* ignore */ }
|
|
185
|
+
}
|
|
186
|
+
});
|