gsd-pi 2.80.0-dev.3065f7bfa → 2.80.0-dev.488219eb6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/claude-cli-check.d.ts +30 -0
- package/dist/claude-cli-check.js +18 -7
- package/dist/cli.js +0 -19
- package/dist/headless-query.d.ts +10 -0
- package/dist/headless-query.js +6 -4
- package/dist/loader-entrypoint.d.ts +8 -0
- package/dist/loader-entrypoint.js +27 -0
- package/dist/loader.js +2 -11
- package/dist/mcp-server.d.ts +1 -0
- package/dist/mcp-server.js +6 -3
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/claude-code-cli/readiness.js +18 -7
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +29 -0
- package/dist/resources/extensions/github-sync/sync.js +4 -1
- package/dist/resources/extensions/gsd/auto/loop.js +71 -8
- package/dist/resources/extensions/gsd/auto/phases.js +32 -8
- package/dist/resources/extensions/gsd/auto/resolve.js +12 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +3 -1
- package/dist/resources/extensions/gsd/auto/workflow-dispatch-claim.js +33 -1
- package/dist/resources/extensions/gsd/auto/workflow-worker-heartbeat.js +9 -1
- package/dist/resources/extensions/gsd/auto-post-unit.js +81 -76
- package/dist/resources/extensions/gsd/auto-start.js +41 -6
- package/dist/resources/extensions/gsd/auto-worktree.js +98 -80
- package/dist/resources/extensions/gsd/auto.js +84 -29
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +62 -13
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +20 -26
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +29 -12
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +6 -9
- package/dist/resources/extensions/gsd/bootstrap/journal-tools.js +4 -7
- package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +6 -10
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +5 -9
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +1 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +60 -26
- package/dist/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.js +4 -0
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +2 -2
- package/dist/resources/extensions/gsd/commands-config.js +1 -1
- package/dist/resources/extensions/gsd/commands-eval-review.js +2 -2
- package/dist/resources/extensions/gsd/dashboard-overlay.js +1 -1
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +53 -0
- package/dist/resources/extensions/gsd/git-service.js +37 -1
- package/dist/resources/extensions/gsd/guided-flow.js +14 -4
- package/dist/resources/extensions/gsd/init-wizard.js +4 -1
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +6 -4
- package/dist/resources/extensions/gsd/slice-cadence.js +45 -2
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +15 -9
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +6 -7
- package/dist/resources/extensions/gsd/tools/complete-task.js +1 -1
- package/dist/resources/extensions/gsd/worktree-resolver.js +22 -1
- package/dist/resources/skills/web-quality-audit/scripts/analyze.sh +0 -0
- 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 +17 -17
- 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 +2 -2
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +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/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
- 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/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +17 -17
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware.js +3 -3
- 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/8359.e059d86b255fce1c.js +10 -0
- package/dist/web/standalone/.next/static/chunks/app/{page-fab3ebb85b006001.js → page-752f1e2ebdaa3e45.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/{webpack-0481f1221120a7c6.js → webpack-de742b64187e13fe.js} +1 -1
- package/dist/welcome-screen.d.ts +2 -0
- package/dist/welcome-screen.js +9 -7
- package/package.json +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +35 -13
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js +21 -11
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +7 -0
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +9 -7
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js +23 -14
- package/packages/pi-ai/dist/providers/minimax-tool-name.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +48 -21
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js +22 -21
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js +22 -21
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js.map +1 -1
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +39 -25
- package/packages/pi-ai/src/providers/anthropic-bearer-auth.test.ts +26 -22
- package/packages/pi-ai/src/providers/anthropic.ts +22 -9
- package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +34 -21
- package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +56 -22
- package/packages/pi-ai/src/utils/oauth/google-antigravity.test.ts +24 -28
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.test.ts +24 -28
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +3 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +2 -2
- 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/tools/bash-spawn-windows.test.js +22 -56
- package/packages/pi-coding-agent/dist/core/tools/bash-spawn-windows.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.js +12 -1
- package/packages/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.js +14 -6
- package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/grep.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/grep.js +12 -3
- package/packages/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts +2 -1
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.js +1 -0
- package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/ls.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/ls.js +10 -3
- package/packages/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/read.js +3 -1
- package/packages/pi-coding-agent/dist/core/tools/read.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js +7 -62
- package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.js +115 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.d.ts +19 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.js +20 -0
- package/packages/pi-coding-agent/dist/core/tools/tool-target.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/write.d.ts +4 -0
- package/packages/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/write.js +9 -1
- package/packages/pi-coding-agent/dist/core/tools/write.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +89 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +25 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +5 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +153 -8
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +18 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +23 -5
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +19 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js +23 -5
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js.map +1 -1
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +3 -1
- package/packages/pi-coding-agent/src/core/extensions/types.ts +2 -1
- package/packages/pi-coding-agent/src/core/tools/bash-spawn-windows.test.ts +22 -66
- package/packages/pi-coding-agent/src/core/tools/bash.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/edit.ts +13 -1
- package/packages/pi-coding-agent/src/core/tools/find.ts +15 -6
- package/packages/pi-coding-agent/src/core/tools/grep.ts +13 -3
- package/packages/pi-coding-agent/src/core/tools/hashline-read.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/index.ts +8 -0
- package/packages/pi-coding-agent/src/core/tools/ls.ts +11 -3
- package/packages/pi-coding-agent/src/core/tools/read.ts +4 -1
- package/packages/pi-coding-agent/src/core/tools/spawn-shell-windows.test.ts +11 -72
- package/packages/pi-coding-agent/src/core/tools/tool-target-metadata.test.ts +127 -0
- package/packages/pi-coding-agent/src/core/tools/tool-target.ts +48 -0
- package/packages/pi-coding-agent/src/core/tools/write.ts +14 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +119 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +31 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +177 -8
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +24 -5
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +17 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +21 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage-safety-guard.test.ts +25 -8
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/src/resources/extensions/claude-code-cli/readiness.ts +25 -7
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +30 -0
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +26 -0
- package/src/resources/extensions/github-sync/sync.ts +8 -1
- package/src/resources/extensions/github-sync/tests/sync-source.test.ts +6 -18
- package/src/resources/extensions/gsd/auto/loop.ts +84 -8
- package/src/resources/extensions/gsd/auto/phases.ts +43 -8
- package/src/resources/extensions/gsd/auto/resolve.ts +19 -0
- package/src/resources/extensions/gsd/auto/run-unit.ts +3 -0
- package/src/resources/extensions/gsd/auto/workflow-dispatch-claim.ts +63 -1
- package/src/resources/extensions/gsd/auto/workflow-worker-heartbeat.ts +14 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +93 -78
- package/src/resources/extensions/gsd/auto-start.ts +56 -6
- package/src/resources/extensions/gsd/auto-worktree.ts +118 -72
- package/src/resources/extensions/gsd/auto.ts +121 -29
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +76 -12
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +20 -26
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +27 -12
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +7 -9
- package/src/resources/extensions/gsd/bootstrap/journal-tools.ts +4 -7
- package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +6 -10
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +5 -9
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +1 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +64 -26
- package/src/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.ts +4 -0
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +4 -2
- package/src/resources/extensions/gsd/commands-config.ts +1 -1
- package/src/resources/extensions/gsd/commands-eval-review.ts +2 -2
- package/src/resources/extensions/gsd/dashboard-overlay.ts +1 -1
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +66 -0
- package/src/resources/extensions/gsd/git-service.ts +41 -2
- package/src/resources/extensions/gsd/guided-flow.ts +19 -4
- package/src/resources/extensions/gsd/init-wizard.ts +5 -1
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +6 -4
- package/src/resources/extensions/gsd/slice-cadence.ts +49 -2
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +23 -9
- package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +59 -89
- package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +47 -172
- package/src/resources/extensions/gsd/tests/artifacts-table-preserved-on-cache-invalidate.test.ts +0 -35
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +35 -9
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +80 -59
- package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +3 -47
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +76 -18
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +106 -0
- package/src/resources/extensions/gsd/tests/auto-pr-bugs.test.ts +54 -95
- package/src/resources/extensions/gsd/tests/auto-project-root-env.test.ts +67 -26
- package/src/resources/extensions/gsd/tests/auto-remediate-slice-status.test.ts +32 -30
- package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +32 -128
- package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +20 -54
- package/src/resources/extensions/gsd/tests/auto-start-cold-db-bootstrap.test.ts +20 -30
- package/src/resources/extensions/gsd/tests/auto-start-index-lock.test.ts +17 -29
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +138 -0
- package/src/resources/extensions/gsd/tests/auto-start-time-persistence.test.ts +21 -39
- package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +15 -24
- package/src/resources/extensions/gsd/tests/auto-thinking-restore.test.ts +44 -29
- package/src/resources/extensions/gsd/tests/auto-warning-noise-regression.test.ts +39 -51
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +1 -217
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +15 -32
- package/src/resources/extensions/gsd/tests/browser-teardown.test.ts +0 -41
- package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +34 -27
- package/src/resources/extensions/gsd/tests/cmux.test.ts +51 -53
- package/src/resources/extensions/gsd/tests/cold-resume-db-reopen.test.ts +39 -61
- package/src/resources/extensions/gsd/tests/commands-config.test.ts +26 -19
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/complete-task-normalize-lists.test.ts +29 -33
- package/src/resources/extensions/gsd/tests/completed-units-metrics-sync.test.ts +45 -108
- package/src/resources/extensions/gsd/tests/crash-handler-secondary.test.ts +35 -31
- package/src/resources/extensions/gsd/tests/cwd-fallback-hardening.test.ts +138 -0
- package/src/resources/extensions/gsd/tests/dashboard-custom-engine.test.ts +4 -68
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +4 -9
- package/src/resources/extensions/gsd/tests/deferred-milestone-dir-4996.test.ts +14 -65
- package/src/resources/extensions/gsd/tests/discuss-tool-scoping.test.ts +44 -37
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +58 -40
- package/src/resources/extensions/gsd/tests/dispatch-guard-closed-status.test.ts +25 -15
- package/src/resources/extensions/gsd/tests/dispatcher-stuck-planning.test.ts +35 -17
- package/src/resources/extensions/gsd/tests/error-success-mask.test.ts +16 -21
- package/src/resources/extensions/gsd/tests/est-annotation-timeout.test.ts +15 -82
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +2 -20
- package/src/resources/extensions/gsd/tests/frontmatter-parse-noise.test.ts +18 -26
- package/src/resources/extensions/gsd/tests/init-skip-git.test.ts +9 -12
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/integration/commands-eval-review.integration.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/integration/git-locale.test.ts +31 -20
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/integration/milestone-transition-worktree.test.ts +0 -47
- package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +60 -202
- package/src/resources/extensions/gsd/tests/isolation-none-branch-guard.test.ts +13 -59
- package/src/resources/extensions/gsd/tests/lazy-pi-tui-import.test.ts +44 -6
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +21 -35
- package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +79 -98
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +70 -278
- package/src/resources/extensions/gsd/tests/needs-remediation-revalidation.test.ts +37 -30
- package/src/resources/extensions/gsd/tests/note-captures-executed.test.ts +32 -28
- package/src/resources/extensions/gsd/tests/phantom-ghost-detection.test.ts +24 -37
- package/src/resources/extensions/gsd/tests/phantom-milestone-default-queued.test.ts +9 -24
- package/src/resources/extensions/gsd/tests/phases-merge-error-stops-auto.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +36 -22
- package/src/resources/extensions/gsd/tests/pre-exec-backtick-strip.test.ts +36 -30
- package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +74 -4
- package/src/resources/extensions/gsd/tests/preferences-worktree-sync.test.ts +20 -22
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +130 -32
- package/src/resources/extensions/gsd/tests/project-root-cwd-crash.test.ts +18 -36
- package/src/resources/extensions/gsd/tests/projection-no-plan-overwrite.test.ts +35 -73
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +76 -138
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +70 -125
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +59 -161
- package/src/resources/extensions/gsd/tests/query-tools-db-open.test.ts +33 -29
- package/src/resources/extensions/gsd/tests/queue-auto-guard.test.ts +22 -196
- package/src/resources/extensions/gsd/tests/quick-auto-guard.test.ts +23 -93
- package/src/resources/extensions/gsd/tests/quick-turn-end-cleanup.test.ts +50 -79
- package/src/resources/extensions/gsd/tests/reassess-default-optin.test.ts +27 -13
- package/src/resources/extensions/gsd/tests/remote-questions.test.ts +151 -251
- package/src/resources/extensions/gsd/tests/resource-loader-import-path.test.ts +41 -29
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +58 -90
- package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +32 -164
- package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +57 -41
- package/src/resources/extensions/gsd/tests/session-model-override.test.ts +14 -9
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +77 -0
- package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +61 -1
- package/src/resources/extensions/gsd/tests/show-config-command.test.ts +44 -42
- package/src/resources/extensions/gsd/tests/skip-slice-state-rebuild.test.ts +56 -24
- package/src/resources/extensions/gsd/tests/skipped-validation-db-atomicity.test.ts +51 -11
- package/src/resources/extensions/gsd/tests/slice-cadence.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +66 -50
- package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +68 -107
- package/src/resources/extensions/gsd/tests/slice-sequence-insert.test.ts +115 -42
- package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +21 -97
- package/src/resources/extensions/gsd/tests/smart-entry-draft.test.ts +25 -116
- package/src/resources/extensions/gsd/tests/sqlite-unavailable-gate.test.ts +21 -57
- package/src/resources/extensions/gsd/tests/stale-dirlistcache-4648.test.ts +29 -76
- package/src/resources/extensions/gsd/tests/stale-lockfile-recovery.test.ts +33 -24
- package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +39 -30
- package/src/resources/extensions/gsd/tests/status-db-open.test.ts +33 -47
- package/src/resources/extensions/gsd/tests/stop-auto-merge-back.test.ts +48 -46
- package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +14 -102
- package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +78 -232
- package/src/resources/extensions/gsd/tests/sync-worktree-skip-current.test.ts +32 -35
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +84 -309
- package/src/resources/extensions/gsd/tests/triage-dispatch.test.ts +134 -341
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +8 -25
- package/src/resources/extensions/gsd/tests/unit-dispatches.test.ts +50 -1
- package/src/resources/extensions/gsd/tests/unstructured-continue-context-injection.test.ts +6 -101
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +43 -36
- package/src/resources/extensions/gsd/tests/visualizer-data.test.ts +84 -444
- package/src/resources/extensions/gsd/tests/workflow-dispatch-claim.test.ts +142 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +44 -189
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -57
- package/src/resources/extensions/gsd/tests/workflow-worker-heartbeat.test.ts +32 -1
- package/src/resources/extensions/gsd/tests/worktree-db-same-file.test.ts +21 -44
- package/src/resources/extensions/gsd/tests/worktree-expected-warnings.test.ts +27 -26
- package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +14 -13
- package/src/resources/extensions/gsd/tests/worktree-main-branch.test.ts +20 -18
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/zero-slice-roadmap-guided.test.ts +19 -13
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +14 -15
- package/src/resources/extensions/gsd/tools/complete-task.ts +1 -1
- package/src/resources/extensions/gsd/worktree-resolver.ts +34 -1
- package/src/resources/skills/create-gsd-extension/templates/templates.test.ts +86 -40
- package/src/resources/skills/web-quality-audit/scripts/analyze.sh +0 -0
- package/dist/web/standalone/.next/static/chunks/8336.631939fb583761fa.js +0 -10
- /package/dist/web/standalone/.next/static/{O2WvnXROue6l7nAp_4dhC → G68KoLv5claox_Dyd4pZn}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{O2WvnXROue6l7nAp_4dhC → G68KoLv5claox_Dyd4pZn}/_ssgManifest.js +0 -0
|
@@ -1,213 +1,71 @@
|
|
|
1
1
|
// GSD Extension — Interactive Routing Bypass Tests
|
|
2
|
-
// Verifies that dynamic routing is skipped for interactive (guided-flow) dispatches
|
|
3
|
-
// and that model downgrade notifications always fire (#3962).
|
|
4
|
-
// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
|
|
5
2
|
|
|
6
3
|
import test, { describe } from "node:test";
|
|
7
4
|
import assert from "node:assert/strict";
|
|
8
|
-
import {
|
|
9
|
-
import { join
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
join(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// The function signature should include isAutoMode with a default of true
|
|
35
|
-
assert.ok(
|
|
36
|
-
modelSelectionSrc.includes("isAutoMode"),
|
|
37
|
-
"selectAndApplyModel should have isAutoMode parameter",
|
|
38
|
-
);
|
|
39
|
-
assert.ok(
|
|
40
|
-
modelSelectionSrc.includes("isAutoMode = true"),
|
|
41
|
-
"isAutoMode should default to true (auto-mode behavior preserved)",
|
|
42
|
-
);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
test("routing is disabled when isAutoMode is false", () => {
|
|
46
|
-
// The code should disable routing when not in auto-mode
|
|
47
|
-
assert.ok(
|
|
48
|
-
modelSelectionSrc.includes("if (!isAutoMode)"),
|
|
49
|
-
"should check isAutoMode flag to disable routing",
|
|
50
|
-
);
|
|
51
|
-
assert.ok(
|
|
52
|
-
modelSelectionSrc.includes("routingConfig.enabled = false"),
|
|
53
|
-
"should set routingConfig.enabled = false for interactive mode",
|
|
54
|
-
);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
test("resolvePreferredModelConfig skips routing synthesis when isAutoMode is false", () => {
|
|
58
|
-
// resolvePreferredModelConfig should accept isAutoMode and bail early
|
|
59
|
-
// before synthesizing a routing ceiling from tier_models (#3962 codex review)
|
|
60
|
-
assert.ok(
|
|
61
|
-
modelSelectionSrc.includes("function resolvePreferredModelConfig"),
|
|
62
|
-
"resolvePreferredModelConfig should exist",
|
|
63
|
-
);
|
|
64
|
-
// The function should check isAutoMode before routing synthesis
|
|
65
|
-
const fnIdx = modelSelectionSrc.indexOf("function resolvePreferredModelConfig");
|
|
66
|
-
const fnBody = extractSourceRegion(modelSelectionSrc, "function resolvePreferredModelConfig");
|
|
67
|
-
assert.ok(
|
|
68
|
-
fnBody.includes("isAutoMode"),
|
|
69
|
-
"resolvePreferredModelConfig should accept isAutoMode parameter",
|
|
70
|
-
);
|
|
71
|
-
assert.ok(
|
|
72
|
-
fnBody.includes("if (!isAutoMode) return undefined"),
|
|
73
|
-
"should return undefined (skip routing synthesis) when not in auto-mode",
|
|
74
|
-
);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
test("selectAndApplyModel threads isAutoMode to resolvePreferredModelConfig", () => {
|
|
78
|
-
// The call to resolvePreferredModelConfig inside selectAndApplyModel
|
|
79
|
-
// should pass isAutoMode as the third argument
|
|
80
|
-
const callSite = "resolvePreferredModelConfig(unitType, autoModeStartModel, isAutoMode)";
|
|
81
|
-
assert.ok(
|
|
82
|
-
modelSelectionSrc.includes(callSite),
|
|
83
|
-
"selectAndApplyModel should pass isAutoMode to resolvePreferredModelConfig",
|
|
84
|
-
);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
test("guided-flow passes isAutoMode=false", () => {
|
|
88
|
-
// guided-flow.ts should explicitly pass isAutoMode as false
|
|
89
|
-
assert.ok(
|
|
90
|
-
guidedFlowSrc.includes("/* isAutoMode */ false"),
|
|
91
|
-
"guided-flow should pass isAutoMode=false to selectAndApplyModel",
|
|
92
|
-
);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
test("auto/phases.ts does NOT pass isAutoMode=false", () => {
|
|
96
|
-
// auto/phases.ts should use the default (true) — it's auto-mode
|
|
97
|
-
const phasesSrc = readFileSync(
|
|
98
|
-
join(__dirname, "..", "auto", "phases.ts"),
|
|
5
|
+
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
import { tmpdir } from "node:os";
|
|
8
|
+
|
|
9
|
+
import { resolvePreferredModelConfig } from "../auto-model-selection.ts";
|
|
10
|
+
|
|
11
|
+
function withRoutingPrefs<T>(fn: () => T): T {
|
|
12
|
+
const originalCwd = process.cwd();
|
|
13
|
+
const originalGsdHome = process.env.GSD_HOME;
|
|
14
|
+
const tempProject = mkdtempSync(join(tmpdir(), "gsd-interactive-routing-"));
|
|
15
|
+
const tempGsdHome = mkdtempSync(join(tmpdir(), "gsd-interactive-routing-home-"));
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
mkdirSync(join(tempProject, ".gsd"), { recursive: true });
|
|
19
|
+
writeFileSync(
|
|
20
|
+
join(tempProject, ".gsd", "PREFERENCES.md"),
|
|
21
|
+
[
|
|
22
|
+
"---",
|
|
23
|
+
"dynamic_routing:",
|
|
24
|
+
" enabled: true",
|
|
25
|
+
" tier_models:",
|
|
26
|
+
" light: gpt-4o-mini",
|
|
27
|
+
" standard: claude-sonnet-4-6",
|
|
28
|
+
" heavy: claude-opus-4-6",
|
|
29
|
+
"---",
|
|
30
|
+
].join("\n"),
|
|
99
31
|
"utf-8",
|
|
100
32
|
);
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const downgradeBlock = "if (routingResult.wasDowngraded)";
|
|
113
|
-
const downgradeIdx = modelSelectionSrc.indexOf(downgradeBlock);
|
|
114
|
-
assert.ok(downgradeIdx > 0, "downgrade block should exist");
|
|
115
|
-
|
|
116
|
-
// Extract the code between wasDowngraded check and the next routing label assignment
|
|
117
|
-
const afterDowngrade = modelSelectionSrc.slice(
|
|
118
|
-
downgradeIdx,
|
|
119
|
-
modelSelectionSrc.indexOf("routingTierLabel =", downgradeIdx),
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
// The notification calls should NOT be wrapped in `if (verbose)`
|
|
123
|
-
assert.ok(
|
|
124
|
-
!afterDowngrade.includes("if (verbose)"),
|
|
125
|
-
"downgrade notifications should not be gated by verbose flag",
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
// But the notification calls should exist
|
|
129
|
-
assert.ok(
|
|
130
|
-
afterDowngrade.includes('ctx.ui.notify('),
|
|
131
|
-
"downgrade notifications should still fire",
|
|
132
|
-
);
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
test("tier escalation notification is not gated by verbose flag", () => {
|
|
136
|
-
// Extract the escalation block: from "if (escalated)" to its closing
|
|
137
|
-
// and verify the notification is present but `if (verbose)` is not.
|
|
138
|
-
const escalatedIdx = modelSelectionSrc.indexOf("if (escalated)");
|
|
139
|
-
assert.ok(escalatedIdx > 0, "escalation block should exist");
|
|
140
|
-
|
|
141
|
-
// Get the block from "if (escalated)" to the next distinctive marker
|
|
142
|
-
// (the capability-override loading that immediately follows).
|
|
143
|
-
const block = extractSourceRegion(
|
|
144
|
-
modelSelectionSrc,
|
|
145
|
-
"if (escalated)",
|
|
146
|
-
"// Load user capability overrides",
|
|
147
|
-
);
|
|
148
|
-
assert.ok(
|
|
149
|
-
block.includes("Tier escalation:"),
|
|
150
|
-
"escalation block should contain the notification",
|
|
151
|
-
);
|
|
152
|
-
assert.ok(
|
|
153
|
-
!block.includes("if (verbose)"),
|
|
154
|
-
"escalation block should not gate notification behind verbose flag",
|
|
155
|
-
);
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
describe("auto-mode start routing banner (#3962)", () => {
|
|
160
|
-
test("auto-start shows dynamic routing status on startup", () => {
|
|
161
|
-
assert.ok(
|
|
162
|
-
autoStartSrc.includes("Dynamic routing:"),
|
|
163
|
-
"auto-start should display routing status banner",
|
|
164
|
-
);
|
|
165
|
-
assert.ok(
|
|
166
|
-
autoStartSrc.includes("resolveDynamicRoutingConfig"),
|
|
167
|
-
"auto-start should import resolveDynamicRoutingConfig",
|
|
168
|
-
);
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
test("banner shows different messages for enabled vs disabled routing", () => {
|
|
172
|
-
assert.ok(
|
|
173
|
-
autoStartSrc.includes("Dynamic routing: enabled"),
|
|
174
|
-
"should show message when routing is enabled",
|
|
175
|
-
);
|
|
176
|
-
assert.ok(
|
|
177
|
-
autoStartSrc.includes("Dynamic routing: disabled"),
|
|
178
|
-
"should show message when routing is disabled",
|
|
179
|
-
);
|
|
180
|
-
});
|
|
33
|
+
process.env.GSD_HOME = tempGsdHome;
|
|
34
|
+
process.chdir(tempProject);
|
|
35
|
+
return fn();
|
|
36
|
+
} finally {
|
|
37
|
+
process.chdir(originalCwd);
|
|
38
|
+
if (originalGsdHome === undefined) delete process.env.GSD_HOME;
|
|
39
|
+
else process.env.GSD_HOME = originalGsdHome;
|
|
40
|
+
rmSync(tempProject, { recursive: true, force: true });
|
|
41
|
+
rmSync(tempGsdHome, { recursive: true, force: true });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
181
44
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
autoStartSrc.includes("isFlatRateProvider"),
|
|
194
|
-
"banner should check flat-rate provider status",
|
|
195
|
-
);
|
|
196
|
-
assert.ok(
|
|
197
|
-
autoStartSrc.includes("effectivelyEnabled"),
|
|
198
|
-
"banner should compute effective routing state, not just raw config",
|
|
199
|
-
);
|
|
45
|
+
describe("interactive routing bypass (#3962)", () => {
|
|
46
|
+
test("interactive dispatch does not synthesize dynamic routing config", () => {
|
|
47
|
+
withRoutingPrefs(() => {
|
|
48
|
+
const result = resolvePreferredModelConfig(
|
|
49
|
+
"execute-task",
|
|
50
|
+
{ provider: "anthropic", id: "claude-sonnet-4-6" },
|
|
51
|
+
false,
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
assert.equal(result, undefined);
|
|
55
|
+
});
|
|
200
56
|
});
|
|
201
57
|
|
|
202
|
-
test("
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
58
|
+
test("auto-mode dispatch still synthesizes dynamic routing config", () => {
|
|
59
|
+
withRoutingPrefs(() => {
|
|
60
|
+
const result = resolvePreferredModelConfig(
|
|
61
|
+
"execute-task",
|
|
62
|
+
{ provider: "anthropic", id: "claude-sonnet-4-6" },
|
|
63
|
+
true,
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
assert.ok(result);
|
|
67
|
+
assert.equal(result!.primary, "claude-opus-4-6");
|
|
68
|
+
assert.equal(result!.source, "synthesized");
|
|
69
|
+
});
|
|
212
70
|
});
|
|
213
71
|
});
|
|
@@ -1,65 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* When switching from isolation:branch/worktree to isolation:none, HEAD
|
|
5
|
-
* could remain on a milestone/<MID> branch. The fix in auto-start.ts
|
|
6
|
-
* detects this and auto-checks out to the integration branch.
|
|
7
|
-
*
|
|
8
|
-
* This structural test verifies the milestone/ branch check exists
|
|
9
|
-
* in auto-start.ts.
|
|
10
|
-
*/
|
|
1
|
+
import { describe, test } from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
11
3
|
|
|
12
|
-
import {
|
|
13
|
-
import assert from 'node:assert/strict';
|
|
14
|
-
import { readFileSync } from 'node:fs';
|
|
15
|
-
import { fileURLToPath } from 'node:url';
|
|
16
|
-
import { dirname, join } from 'node:path';
|
|
4
|
+
import { resolveIsolationNoneBranchCheckout } from "../auto-start.ts";
|
|
17
5
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
test('checks for milestone/ branch prefix', () => {
|
|
25
|
-
assert.match(source, /startsWith\(["']milestone\//,
|
|
26
|
-
'auto-start should check for milestone/ branch prefix');
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test('imports nativeGetCurrentBranch', () => {
|
|
30
|
-
assert.match(source, /nativeGetCurrentBranch/,
|
|
31
|
-
'auto-start should import nativeGetCurrentBranch');
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
test('imports nativeDetectMainBranch', () => {
|
|
35
|
-
assert.match(source, /nativeDetectMainBranch/,
|
|
36
|
-
'auto-start should import nativeDetectMainBranch');
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test('imports nativeCheckoutBranch', () => {
|
|
40
|
-
assert.match(source, /nativeCheckoutBranch/,
|
|
41
|
-
'auto-start should import nativeCheckoutBranch');
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
test('guard is conditional on isolation mode "none"', () => {
|
|
45
|
-
assert.match(source, /getIsolationMode\([^)]*\)\s*===\s*["']none["']/,
|
|
46
|
-
'guard should only activate when isolation mode is "none"');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
test('calls nativeCheckoutBranch to return to integration branch', () => {
|
|
50
|
-
assert.match(source, /nativeCheckoutBranch\(base,\s*integrationBranch\)/,
|
|
51
|
-
'should checkout to the integration branch');
|
|
6
|
+
describe("isolation:none stale branch guard (#3675)", () => {
|
|
7
|
+
test("returns integration branch for stale milestone branch in isolation:none", () => {
|
|
8
|
+
assert.equal(
|
|
9
|
+
resolveIsolationNoneBranchCheckout("milestone/M001", "main", "none", true),
|
|
10
|
+
"main",
|
|
11
|
+
);
|
|
52
12
|
});
|
|
53
13
|
|
|
54
|
-
test(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// index and break this structural assertion.
|
|
59
|
-
const milestoneIdx = source.indexOf('currentBranch.startsWith("milestone/")');
|
|
60
|
-
assert.ok(milestoneIdx > 0, 'isolation:none guard milestone/ check should exist');
|
|
61
|
-
const before = source.slice(Math.max(0, milestoneIdx - 500), milestoneIdx);
|
|
62
|
-
assert.match(before, /try\s*\{/,
|
|
63
|
-
'milestone branch guard should be inside a try block');
|
|
14
|
+
test("does nothing outside milestone branches, repos, or isolation:none", () => {
|
|
15
|
+
assert.equal(resolveIsolationNoneBranchCheckout("feature", "main", "none", true), null);
|
|
16
|
+
assert.equal(resolveIsolationNoneBranchCheckout("milestone/M001", "main", "worktree", true), null);
|
|
17
|
+
assert.equal(resolveIsolationNoneBranchCheckout("milestone/M001", "main", "none", false), null);
|
|
64
18
|
});
|
|
65
19
|
});
|
|
@@ -1,15 +1,53 @@
|
|
|
1
|
-
//
|
|
2
|
-
// TUI-dependent exports live in shared/tui.ts instead.
|
|
1
|
+
// GSD2 — Shared barrel import behavior without TUI dependency loading
|
|
3
2
|
|
|
4
3
|
import test from "node:test";
|
|
5
4
|
import assert from "node:assert/strict";
|
|
6
|
-
import {
|
|
5
|
+
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
7
6
|
import { join, dirname } from "node:path";
|
|
7
|
+
import { spawnSync } from "node:child_process";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
|
|
10
10
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
11
|
|
|
12
|
-
test("shared/mod.ts
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
test("shared/mod.ts imports without resolving @gsd/pi-tui", () => {
|
|
13
|
+
const tmp = mkdtempSync(join(process.env.TMPDIR ?? "/tmp", "gsd-shared-mod-"));
|
|
14
|
+
const loaderPath = join(tmp, "block-pi-tui-loader.mjs");
|
|
15
|
+
writeFileSync(
|
|
16
|
+
loaderPath,
|
|
17
|
+
[
|
|
18
|
+
"export async function resolve(specifier, context, nextResolve) {",
|
|
19
|
+
" if (specifier === '@gsd/pi-tui') throw new Error('unexpected @gsd/pi-tui import');",
|
|
20
|
+
" return nextResolve(specifier, context);",
|
|
21
|
+
"}",
|
|
22
|
+
"",
|
|
23
|
+
].join("\n"),
|
|
24
|
+
"utf-8",
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const sharedModPath = join(__dirname, "../../shared/mod.ts");
|
|
29
|
+
const resolveTsPath = join(__dirname, "resolve-ts.mjs");
|
|
30
|
+
const result = spawnSync(
|
|
31
|
+
process.execPath,
|
|
32
|
+
[
|
|
33
|
+
"--experimental-strip-types",
|
|
34
|
+
"--import",
|
|
35
|
+
resolveTsPath,
|
|
36
|
+
"--experimental-loader",
|
|
37
|
+
loaderPath,
|
|
38
|
+
"--input-type=module",
|
|
39
|
+
"--eval",
|
|
40
|
+
`await import(${JSON.stringify(sharedModPath)});`,
|
|
41
|
+
],
|
|
42
|
+
{ encoding: "utf-8" },
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
assert.equal(
|
|
46
|
+
result.status,
|
|
47
|
+
0,
|
|
48
|
+
`shared/mod.ts should import without @gsd/pi-tui; stderr:\n${result.stderr}`,
|
|
49
|
+
);
|
|
50
|
+
} finally {
|
|
51
|
+
rmSync(tmp, { recursive: true, force: true });
|
|
52
|
+
}
|
|
15
53
|
});
|
|
@@ -5,16 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, test } from "node:test";
|
|
7
7
|
import assert from "node:assert/strict";
|
|
8
|
-
import { readFileSync } from "node:fs";
|
|
9
|
-
import { join, dirname } from "node:path";
|
|
10
|
-
import { fileURLToPath } from "node:url";
|
|
11
8
|
|
|
12
9
|
import { decideMemoryPressure } from "../auto/workflow-kernel.ts";
|
|
10
|
+
import { completeWorkflowIteration } from "../auto/workflow-iteration-completion.ts";
|
|
13
11
|
import { measureMemoryPressure } from "../auto/workflow-memory-pressure.ts";
|
|
14
12
|
|
|
15
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
|
-
const loopSource = readFileSync(join(__dirname, "..", "auto", "loop.ts"), "utf-8");
|
|
17
|
-
|
|
18
13
|
describe("memory pressure monitoring (#3331)", () => {
|
|
19
14
|
test("measureMemoryPressure reports pressure above threshold", () => {
|
|
20
15
|
const snapshot = measureMemoryPressure({
|
|
@@ -41,10 +36,6 @@ describe("memory pressure monitoring (#3331)", () => {
|
|
|
41
36
|
assert.equal(snapshot.pressured, true);
|
|
42
37
|
});
|
|
43
38
|
|
|
44
|
-
test("memory check runs every MEMORY_CHECK_INTERVAL iterations", () => {
|
|
45
|
-
assert.match(loopSource, /iteration\s*%\s*MEMORY_CHECK_INTERVAL\s*===\s*0/);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
39
|
test("memory pressure triggers graceful stopAuto", () => {
|
|
49
40
|
const decision = decideMemoryPressure({
|
|
50
41
|
pressured: true,
|
|
@@ -60,34 +51,29 @@ describe("memory pressure monitoring (#3331)", () => {
|
|
|
60
51
|
});
|
|
61
52
|
|
|
62
53
|
describe("stuck detection persistence (#3704)", () => {
|
|
63
|
-
test("loadStuckState function exists", () => {
|
|
64
|
-
assert.match(loopSource, /function loadStuckState/);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
test("saveStuckState function exists", () => {
|
|
68
|
-
assert.match(loopSource, /function saveStuckState/);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// Phase C: API changed from (basePath) to (session) — recentUnits is
|
|
72
|
-
// now reconstructed from unit_dispatches and stuckRecoveryAttempts
|
|
73
|
-
// persists in runtime_kv (worker scope).
|
|
74
|
-
test("loopState initialized from persisted state", () => {
|
|
75
|
-
assert.match(loopSource, /loadStuckState\(s\)/);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
test("stuck state saved after each iteration", () => {
|
|
79
|
-
assert.match(loopSource, /saveStuckState\(s,\s*loopState\)/);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
54
|
// Phase C: stuck-state.json file IO deleted; persistence moved to
|
|
83
55
|
// unit_dispatches (recentUnits) + runtime_kv (stuckRecoveryAttempts).
|
|
84
56
|
// The stuck-state-via-db.test.ts suite covers the round-trip.
|
|
85
57
|
|
|
86
|
-
test("
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
58
|
+
test("completeWorkflowIteration saves stuck state while clearing recovery counters (#4382)", () => {
|
|
59
|
+
const calls: string[] = [];
|
|
60
|
+
const state = {
|
|
61
|
+
consecutiveErrors: 2,
|
|
62
|
+
consecutiveCooldowns: 1,
|
|
63
|
+
recentErrorMessages: ["boom"],
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
completeWorkflowIteration(state, {
|
|
67
|
+
emitIterationEnd: () => calls.push("emit"),
|
|
68
|
+
saveStuckState: () => calls.push("save"),
|
|
69
|
+
logIterationComplete: () => calls.push("log"),
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
assert.deepEqual(calls, ["emit", "save", "log"]);
|
|
73
|
+
assert.deepEqual(state, {
|
|
74
|
+
consecutiveErrors: 0,
|
|
75
|
+
consecutiveCooldowns: 0,
|
|
76
|
+
recentErrorMessages: [],
|
|
77
|
+
});
|
|
92
78
|
});
|
|
93
79
|
});
|