@opengsd/gsd-pi 1.2.0-dev.844675c9 → 1.2.0-dev.84c56d87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-style.d.ts +17 -0
- package/dist/cli-style.js +28 -0
- package/dist/cli-web-branch.d.ts +2 -0
- package/dist/cli-web-branch.js +9 -2
- package/dist/cli.js +1 -1
- package/dist/headless-events.d.ts +4 -2
- package/dist/headless-events.js +7 -29
- package/dist/help-text.js +5 -0
- package/dist/models-resolver.d.ts +3 -13
- package/dist/models-resolver.js +3 -22
- package/dist/resource-loader.js +2 -14
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/ask-user-questions.js +78 -23
- package/dist/resources/extensions/bg-shell/utilities.js +5 -2
- package/dist/resources/extensions/browser-tools/engine/managed-gsd-browser.js +209 -88
- package/dist/resources/extensions/browser-tools/engine/selection.js +73 -5
- package/dist/resources/extensions/browser-tools/index.js +69 -12
- package/dist/resources/extensions/claude-code-cli/models.js +9 -0
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +122 -234
- package/dist/resources/extensions/claude-code-cli/turn-assembler.js +224 -0
- package/dist/resources/extensions/github-sync/templates.js +3 -3
- package/dist/resources/extensions/gsd/artifact-projection.js +14 -0
- package/dist/resources/extensions/gsd/auto/loop.js +74 -56
- package/dist/resources/extensions/gsd/auto/orchestrator.js +142 -15
- package/dist/resources/extensions/gsd/auto/phases.js +34 -4
- package/dist/resources/extensions/gsd/auto/run-unit.js +2 -1
- package/dist/resources/extensions/gsd/auto/session.js +3 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +16 -4
- package/dist/resources/extensions/gsd/auto-dispatch.js +6 -5
- package/dist/resources/extensions/gsd/auto-model-selection.js +8 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +23 -11
- package/dist/resources/extensions/gsd/auto-prompts.js +84 -8
- package/dist/resources/extensions/gsd/auto-recovery.js +48 -49
- package/dist/resources/extensions/gsd/auto-runtime-state.js +14 -0
- package/dist/resources/extensions/gsd/auto-start.js +24 -37
- package/dist/resources/extensions/gsd/auto-timers.js +16 -2
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +50 -0
- package/dist/resources/extensions/gsd/auto-unit-tool-scope.js +11 -45
- package/dist/resources/extensions/gsd/auto-verification.js +7 -7
- package/dist/resources/extensions/gsd/auto-worktree-repair.js +10 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +53 -368
- package/dist/resources/extensions/gsd/auto.js +19 -27
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +3 -2
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +28 -37
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +20 -43
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +2 -2
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +19 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +209 -149
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +93 -8
- package/dist/resources/extensions/gsd/branch-patterns.js +2 -0
- package/dist/resources/extensions/gsd/browser-evidence.js +8 -2
- package/dist/resources/extensions/gsd/captures.js +5 -15
- package/dist/resources/extensions/gsd/closeout-consistency-gate.js +21 -4
- package/dist/resources/extensions/gsd/closeout-recovery.js +3 -2
- package/dist/resources/extensions/gsd/codebase-generator.js +8 -4
- package/dist/resources/extensions/gsd/commands/catalog.js +6 -62
- package/dist/resources/extensions/gsd/commands/handlers/auto.js +3 -0
- package/dist/resources/extensions/gsd/commands-handlers.js +20 -0
- package/dist/resources/extensions/gsd/commands-inspect.js +4 -8
- package/dist/resources/extensions/gsd/commands-maintenance.js +61 -41
- package/dist/resources/extensions/gsd/commands-ship.js +2 -2
- package/dist/resources/extensions/gsd/commands-verdict.js +12 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +4 -12
- package/dist/resources/extensions/gsd/db/engine.js +755 -0
- package/dist/resources/extensions/gsd/db/queries.js +372 -0
- package/dist/resources/extensions/gsd/db/sql-constants.js +11 -0
- package/dist/resources/extensions/gsd/db/writers/cascades.js +194 -0
- package/dist/resources/extensions/gsd/db/writers/import-restore.js +182 -0
- package/dist/resources/extensions/gsd/db/writers/memory.js +149 -0
- package/dist/resources/extensions/gsd/db/writers/reconcile.js +458 -0
- package/dist/resources/extensions/gsd/db/writers/status.js +70 -0
- package/dist/resources/extensions/gsd/db-workspace.js +103 -0
- package/dist/resources/extensions/gsd/delegation-policy.js +2 -10
- package/dist/resources/extensions/gsd/discussion-handoff.js +218 -0
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +9 -0
- package/dist/resources/extensions/gsd/doctor-environment.js +5 -11
- package/dist/resources/extensions/gsd/doctor-format.js +9 -6
- package/dist/resources/extensions/gsd/doctor-git-checks.js +4 -3
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +21 -16
- package/dist/resources/extensions/gsd/doctor.js +16 -9
- package/dist/resources/extensions/gsd/error-classifier.js +10 -1
- package/dist/resources/extensions/gsd/git-conflict-state.js +16 -1
- package/dist/resources/extensions/gsd/git-service.js +1 -0
- package/dist/resources/extensions/gsd/gitignore.js +3 -0
- package/dist/resources/extensions/gsd/gsd-db.js +183 -2048
- package/dist/resources/extensions/gsd/guidance.js +98 -0
- package/dist/resources/extensions/gsd/guided-flow.js +83 -471
- package/dist/resources/extensions/gsd/guided-unit-completion.js +225 -0
- package/dist/resources/extensions/gsd/markdown-renderer.js +2 -1
- package/dist/resources/extensions/gsd/mcp-filter.js +4 -20
- package/dist/resources/extensions/gsd/mcp-tool-name.js +18 -0
- package/dist/resources/extensions/gsd/md-importer.js +4 -3
- package/dist/resources/extensions/gsd/memory-consolidation-scanner.js +1 -1
- package/dist/resources/extensions/gsd/migrate/safety.js +22 -11
- package/dist/resources/extensions/gsd/migration-auto-check.js +27 -5
- package/dist/resources/extensions/gsd/milestone-closeout-proof.js +72 -0
- package/dist/resources/extensions/gsd/milestone-closeout.js +12 -4
- package/dist/resources/extensions/gsd/milestone-merge-transaction.js +10 -0
- package/dist/resources/extensions/gsd/milestone-planning-persistence.js +156 -0
- package/dist/resources/extensions/gsd/milestone-readiness.js +77 -0
- package/dist/resources/extensions/gsd/milestone-settlement.js +50 -0
- package/dist/resources/extensions/gsd/milestone-validation-evidence.js +73 -0
- package/dist/resources/extensions/gsd/milestone-validation-verdict.js +57 -0
- package/dist/resources/extensions/gsd/model-cost-table.js +1 -0
- package/dist/resources/extensions/gsd/model-router.js +3 -0
- package/dist/resources/extensions/gsd/notification-store.js +11 -4
- package/dist/resources/extensions/gsd/parallel-eligibility.js +3 -6
- package/dist/resources/extensions/gsd/parallel-merge.js +14 -11
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +11 -7
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +3 -2
- package/dist/resources/extensions/gsd/paths.js +37 -24
- package/dist/resources/extensions/gsd/pre-execution-checks.js +91 -3
- package/dist/resources/extensions/gsd/preferences-diagnostics.js +67 -0
- package/dist/resources/extensions/gsd/preferences-models.js +12 -46
- package/dist/resources/extensions/gsd/preferences.js +161 -29
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -0
- package/dist/resources/extensions/gsd/prompts/execute-task.md +2 -0
- package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +3 -1
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +2 -0
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +2 -1
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +2 -1
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/system.md +1 -1
- package/dist/resources/extensions/gsd/provider-error-guidance.js +1 -5
- package/dist/resources/extensions/gsd/provider-payload-policy.js +83 -0
- package/dist/resources/extensions/gsd/provider-switch-observer.js +1 -1
- package/dist/resources/extensions/gsd/publication.js +87 -0
- package/dist/resources/extensions/gsd/pull-request-process.js +13 -0
- package/dist/resources/extensions/gsd/quality-gate-closure.js +109 -0
- package/dist/resources/extensions/gsd/question-transport.js +86 -0
- package/dist/resources/extensions/gsd/recovery-classification.js +41 -87
- package/dist/resources/extensions/gsd/roadmap-slices.js +8 -2
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +37 -4
- package/dist/resources/extensions/gsd/safety/evidence-cross-ref.js +7 -2
- package/dist/resources/extensions/gsd/safety/file-change-validator.js +10 -0
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +3 -2
- package/dist/resources/extensions/gsd/state-transition-matrix.js +38 -0
- package/dist/resources/extensions/gsd/state.js +14 -25
- package/dist/resources/extensions/gsd/status-guards.js +56 -8
- package/dist/resources/extensions/gsd/stop-notice.js +57 -0
- package/dist/resources/extensions/gsd/templates/plan.md +7 -0
- package/dist/resources/extensions/gsd/templates/project.md +1 -0
- package/dist/resources/extensions/gsd/templates/roadmap.md +1 -1
- package/dist/resources/extensions/gsd/templates/uat.md +5 -1
- package/dist/resources/extensions/gsd/tool-contract.js +52 -8
- package/dist/resources/extensions/gsd/tool-presentation-plan.js +15 -34
- package/dist/resources/extensions/gsd/tool-surface-readiness.js +56 -0
- package/dist/resources/extensions/gsd/tool-surface-snapshot.js +17 -0
- package/dist/resources/extensions/gsd/tools/complete-slice.js +24 -43
- package/dist/resources/extensions/gsd/tools/exec-tool.js +5 -8
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +15 -143
- package/dist/resources/extensions/gsd/tools/plan-slice.js +12 -6
- package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +39 -0
- package/dist/resources/extensions/gsd/tools/reopen-milestone.js +11 -29
- package/dist/resources/extensions/gsd/tools/reopen-slice.js +14 -33
- package/dist/resources/extensions/gsd/tools/skip-slice.js +18 -36
- package/dist/resources/extensions/gsd/tools/validate-milestone.js +15 -78
- package/dist/resources/extensions/gsd/uat-policy.js +17 -10
- package/dist/resources/extensions/gsd/uat-run.js +9 -14
- package/dist/resources/extensions/gsd/undo.js +8 -7
- package/dist/resources/extensions/gsd/unit-closeout.js +138 -0
- package/dist/resources/extensions/gsd/unit-context-composer.js +49 -21
- package/dist/resources/extensions/gsd/unit-context-manifest.js +4 -27
- package/dist/resources/extensions/gsd/unit-registry.js +337 -0
- package/dist/resources/extensions/gsd/unit-runtime.js +3 -2
- package/dist/resources/extensions/gsd/unit-tool-contracts.js +9 -181
- package/dist/resources/extensions/gsd/user-input-boundary.js +23 -0
- package/dist/resources/extensions/gsd/validation-block-guard.js +2 -0
- package/dist/resources/extensions/gsd/web-app-uat.js +117 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +15 -102
- package/dist/resources/extensions/gsd/workflow-reconcile.js +4 -3
- package/dist/resources/extensions/gsd/workflow-tool-surface.js +46 -0
- package/dist/resources/extensions/gsd/workspace-git-guard.js +2 -0
- package/dist/resources/extensions/gsd/worktree-git-recovery.js +293 -0
- package/dist/resources/extensions/gsd/worktree-lifecycle.js +9 -1
- package/dist/resources/extensions/gsd/worktree-manager.js +45 -28
- package/dist/resources/extensions/gsd/worktree-placement.js +59 -0
- package/dist/resources/extensions/gsd/worktree-reentry.js +12 -8
- package/dist/resources/extensions/gsd/worktree-root.js +28 -6
- package/dist/resources/extensions/gsd/worktree-safety.js +8 -5
- package/dist/resources/extensions/gsd/worktree-session-state.js +12 -11
- package/dist/resources/extensions/gsd/worktree-state-projection.js +33 -4
- package/dist/resources/extensions/gsd/worktree-telemetry.js +12 -0
- package/dist/resources/extensions/search-the-web/native-search.js +5 -3
- package/dist/resources/extensions/shared/browser-contract.js +59 -0
- package/dist/resources/extensions/shared/gsd-browser-cli.js +72 -4
- package/dist/resources/extensions/shared/interview-ui.js +2 -2
- package/dist/resources/shared/claude-runtime-floor.js +182 -0
- package/dist/resources/skills/create-skill/references/executable-code.md +1 -1
- package/dist/resources/skills/create-skill/workflows/add-reference.md +8 -3
- package/dist/resources/skills/create-skill/workflows/add-script.md +4 -2
- package/dist/resources/skills/create-skill/workflows/add-template.md +3 -1
- package/dist/resources/skills/create-skill/workflows/add-workflow.md +8 -3
- package/dist/resources/skills/create-skill/workflows/upgrade-to-router.md +10 -5
- package/dist/resources/skills/create-skill/workflows/verify-skill.md +9 -4
- package/dist/resources/skills/gsd-browser/SKILL.md +1 -1
- package/dist/resources/skills/spike-wrap-up/SKILL.md +9 -9
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/update-cmd.js +20 -0
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +6 -6
- 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 +8 -8
- 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.nft.json +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.nft.json +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.nft.json +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.nft.json +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.nft.json +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.nft.json +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.nft.json +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.nft.json +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/mcp-connections/route.js.nft.json +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.nft.json +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.nft.json +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.nft.json +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.nft.json +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/shutdown/route.js.nft.json +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.nft.json +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.nft.json +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.nft.json +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 +6 -6
- package/dist/web/standalone/.next/server/chunks/5124.js +1 -1
- package/dist/web/standalone/.next/server/chunks/{5047.js → 5942.js} +2 -2
- package/dist/web/standalone/.next/server/chunks/8357.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/2659.b7b129ee6a769448.js +1 -0
- package/dist/web/standalone/.next/static/chunks/2772.bfa657f49f955239.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{3616.4113d484a994e411.js → 3616.3c60753b8ffcbd2e.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/4283.e4873b058df143a1.js +2 -0
- package/dist/web/standalone/.next/static/chunks/5826.a46ecdd1cfe8dabc.js +1 -0
- package/dist/web/standalone/.next/static/chunks/796.cf859a427a2cb2ac.js +10 -0
- package/dist/web/standalone/.next/static/chunks/8785.2e5a118797fb2dd2.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-dda80a1ef5587410.js → webpack-fbea77b5f9953368.js} +1 -1
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +1 -1
- package/dist/web/standalone/node_modules/postcss/lib/container.js +18 -26
- package/dist/web/standalone/node_modules/postcss/lib/css-syntax-error.js +14 -47
- package/dist/web/standalone/node_modules/postcss/lib/declaration.js +4 -4
- package/dist/web/standalone/node_modules/postcss/lib/fromJSON.js +3 -3
- package/dist/web/standalone/node_modules/postcss/lib/input.js +29 -54
- package/dist/web/standalone/node_modules/postcss/lib/lazy-result.js +37 -47
- package/dist/web/standalone/node_modules/postcss/lib/map-generator.js +9 -26
- package/dist/web/standalone/node_modules/postcss/lib/no-work-result.js +55 -57
- package/dist/web/standalone/node_modules/postcss/lib/node.js +31 -99
- package/dist/web/standalone/node_modules/postcss/lib/parse.js +1 -1
- package/dist/web/standalone/node_modules/postcss/lib/parser.js +9 -10
- package/dist/web/standalone/node_modules/postcss/lib/postcss.js +12 -12
- package/dist/web/standalone/node_modules/postcss/lib/previous-map.js +11 -30
- package/dist/web/standalone/node_modules/postcss/lib/processor.js +7 -7
- package/dist/web/standalone/node_modules/postcss/lib/result.js +5 -5
- package/dist/web/standalone/node_modules/postcss/lib/rule.js +6 -6
- package/dist/web/standalone/node_modules/postcss/lib/stringifier.js +28 -69
- package/dist/web/standalone/node_modules/postcss/lib/tokenize.js +2 -6
- package/dist/web/standalone/node_modules/postcss/package.json +48 -48
- package/dist/web/standalone/package.json +1 -1
- package/dist/web-mode.d.ts +2 -0
- package/dist/web-mode.js +20 -8
- package/dist/worktree-cli.js +3 -6
- package/dist/worktree-status-banner.js +7 -11
- package/package.json +2 -1
- package/packages/cloud-mcp-gateway/package.json +2 -2
- package/packages/contracts/dist/workflow.d.ts +4 -0
- package/packages/contracts/dist/workflow.d.ts.map +1 -1
- package/packages/contracts/dist/workflow.js.map +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/daemon/package.json +4 -4
- package/packages/gsd-agent-core/dist/session/agent-session-extensions.d.ts +2 -0
- package/packages/gsd-agent-core/dist/session/agent-session-extensions.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/session/agent-session-extensions.js +14 -0
- package/packages/gsd-agent-core/dist/session/agent-session-extensions.js.map +1 -1
- package/packages/gsd-agent-core/package.json +5 -5
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js +3 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +106 -40
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.js +6 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.js.map +1 -1
- package/packages/gsd-agent-modes/package.json +7 -7
- package/packages/mcp-server/dist/cli.js +6 -3
- package/packages/mcp-server/dist/cli.js.map +1 -1
- package/packages/mcp-server/dist/server.d.ts +10 -0
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +8 -0
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts +49 -0
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +48 -22
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +3 -3
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/dist/image-models.generated.d.ts +2 -2
- package/packages/pi-ai/dist/image-models.generated.js +6 -6
- package/packages/pi-ai/dist/image-models.generated.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +455 -546
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +481 -599
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/capability-patches.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/capability-patches.js +3 -1
- package/packages/pi-coding-agent/dist/core/capability-patches.js.map +1 -1
- package/packages/pi-coding-agent/package.json +7 -7
- package/packages/pi-tui/dist/components/input.js +1 -1
- package/packages/pi-tui/dist/components/input.js.map +1 -1
- package/packages/pi-tui/dist/keys.d.ts.map +1 -1
- package/packages/pi-tui/dist/keys.js +39 -30
- package/packages/pi-tui/dist/keys.js.map +1 -1
- package/packages/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
- package/packages/pi-tui/dist/stdin-buffer.js +22 -0
- package/packages/pi-tui/dist/stdin-buffer.js.map +1 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +9 -0
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/package.json +2 -2
- package/packages/rpc-client/package.json +2 -2
- package/pkg/package.json +1 -1
- package/src/resources/extensions/ask-user-questions.ts +87 -24
- package/src/resources/extensions/bg-shell/utilities.ts +5 -2
- package/src/resources/extensions/browser-tools/engine/managed-gsd-browser.ts +265 -98
- package/src/resources/extensions/browser-tools/engine/selection.ts +90 -4
- package/src/resources/extensions/browser-tools/index.ts +71 -13
- package/src/resources/extensions/browser-tools/tests/browser-engine-selection.test.mjs +83 -13
- package/src/resources/extensions/browser-tools/tests/managed-gsd-browser-tools.test.mjs +136 -0
- package/src/resources/extensions/claude-code-cli/models.ts +9 -0
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +148 -285
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +268 -0
- package/src/resources/extensions/claude-code-cli/turn-assembler.ts +287 -0
- package/src/resources/extensions/github-sync/templates.ts +3 -3
- package/src/resources/extensions/github-sync/tests/templates.test.ts +2 -2
- package/src/resources/extensions/gsd/artifact-projection.ts +31 -0
- package/src/resources/extensions/gsd/auto/contracts.ts +32 -2
- package/src/resources/extensions/gsd/auto/loop-deps.ts +3 -1
- package/src/resources/extensions/gsd/auto/loop.ts +83 -61
- package/src/resources/extensions/gsd/auto/orchestrator.ts +164 -17
- package/src/resources/extensions/gsd/auto/phases.ts +45 -4
- package/src/resources/extensions/gsd/auto/run-unit.ts +2 -1
- package/src/resources/extensions/gsd/auto/session.ts +4 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +18 -4
- package/src/resources/extensions/gsd/auto-dispatch.ts +20 -7
- package/src/resources/extensions/gsd/auto-model-selection.ts +8 -0
- package/src/resources/extensions/gsd/auto-post-unit.ts +29 -10
- package/src/resources/extensions/gsd/auto-prompts.ts +110 -9
- package/src/resources/extensions/gsd/auto-recovery.ts +50 -50
- package/src/resources/extensions/gsd/auto-runtime-state.ts +26 -0
- package/src/resources/extensions/gsd/auto-start.ts +29 -35
- package/src/resources/extensions/gsd/auto-timers.ts +16 -2
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +54 -0
- package/src/resources/extensions/gsd/auto-unit-tool-scope.ts +19 -47
- package/src/resources/extensions/gsd/auto-verification.ts +7 -8
- package/src/resources/extensions/gsd/auto-worktree-repair.ts +13 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +68 -384
- package/src/resources/extensions/gsd/auto.ts +35 -32
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +3 -5
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +29 -37
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +20 -43
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +2 -2
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +24 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +251 -161
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +136 -6
- package/src/resources/extensions/gsd/branch-patterns.ts +3 -0
- package/src/resources/extensions/gsd/browser-evidence.ts +18 -2
- package/src/resources/extensions/gsd/captures.ts +5 -16
- package/src/resources/extensions/gsd/closeout-consistency-gate.ts +27 -5
- package/src/resources/extensions/gsd/closeout-recovery.ts +2 -1
- package/src/resources/extensions/gsd/codebase-generator.ts +9 -5
- package/src/resources/extensions/gsd/commands/catalog.ts +6 -68
- package/src/resources/extensions/gsd/commands/handlers/auto.ts +3 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +18 -0
- package/src/resources/extensions/gsd/commands-inspect.ts +7 -8
- package/src/resources/extensions/gsd/commands-maintenance.ts +74 -40
- package/src/resources/extensions/gsd/commands-ship.ts +2 -2
- package/src/resources/extensions/gsd/commands-verdict.ts +19 -2
- package/src/resources/extensions/gsd/crash-recovery.ts +3 -9
- package/src/resources/extensions/gsd/db/engine.ts +809 -0
- package/src/resources/extensions/gsd/db/queries.ts +453 -0
- package/src/resources/extensions/gsd/db/sql-constants.ts +12 -0
- package/src/resources/extensions/gsd/db/writers/cascades.ts +237 -0
- package/src/resources/extensions/gsd/db/writers/import-restore.ts +310 -0
- package/src/resources/extensions/gsd/db/writers/memory.ts +220 -0
- package/src/resources/extensions/gsd/db/writers/reconcile.ts +500 -0
- package/src/resources/extensions/gsd/db/writers/status.ts +88 -0
- package/src/resources/extensions/gsd/db-workspace.ts +170 -0
- package/src/resources/extensions/gsd/delegation-policy.ts +3 -11
- package/src/resources/extensions/gsd/discussion-handoff.ts +276 -0
- package/src/resources/extensions/gsd/docs/preferences-reference.md +9 -0
- package/src/resources/extensions/gsd/doctor-environment.ts +5 -13
- package/src/resources/extensions/gsd/doctor-format.ts +12 -7
- package/src/resources/extensions/gsd/doctor-git-checks.ts +3 -3
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +22 -17
- package/src/resources/extensions/gsd/doctor.ts +15 -5
- package/src/resources/extensions/gsd/error-classifier.ts +12 -1
- package/src/resources/extensions/gsd/git-conflict-state.ts +17 -1
- package/src/resources/extensions/gsd/git-service.ts +1 -0
- package/src/resources/extensions/gsd/gitignore.ts +3 -0
- package/src/resources/extensions/gsd/gsd-db.ts +185 -2373
- package/src/resources/extensions/gsd/guidance.ts +139 -0
- package/src/resources/extensions/gsd/guided-flow.ts +95 -561
- package/src/resources/extensions/gsd/guided-unit-completion.ts +275 -0
- package/src/resources/extensions/gsd/markdown-renderer.ts +2 -1
- package/src/resources/extensions/gsd/mcp-filter.ts +4 -24
- package/src/resources/extensions/gsd/mcp-tool-name.ts +30 -0
- package/src/resources/extensions/gsd/md-importer.ts +3 -3
- package/src/resources/extensions/gsd/memory-consolidation-scanner.ts +1 -1
- package/src/resources/extensions/gsd/migrate/safety.ts +20 -9
- package/src/resources/extensions/gsd/migration-auto-check.ts +30 -5
- package/src/resources/extensions/gsd/milestone-closeout-proof.ts +131 -0
- package/src/resources/extensions/gsd/milestone-closeout.ts +12 -4
- package/src/resources/extensions/gsd/milestone-merge-transaction.ts +47 -0
- package/src/resources/extensions/gsd/milestone-planning-persistence.ts +224 -0
- package/src/resources/extensions/gsd/milestone-readiness.ts +125 -0
- package/src/resources/extensions/gsd/milestone-settlement.ts +81 -0
- package/src/resources/extensions/gsd/milestone-validation-evidence.ts +95 -0
- package/src/resources/extensions/gsd/milestone-validation-verdict.ts +80 -0
- package/src/resources/extensions/gsd/model-cost-table.ts +1 -0
- package/src/resources/extensions/gsd/model-router.ts +3 -0
- package/src/resources/extensions/gsd/notification-store.ts +26 -3
- package/src/resources/extensions/gsd/parallel-eligibility.ts +4 -5
- package/src/resources/extensions/gsd/parallel-merge.ts +12 -9
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +10 -7
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +6 -2
- package/src/resources/extensions/gsd/paths.ts +42 -22
- package/src/resources/extensions/gsd/pre-execution-checks.ts +109 -3
- package/src/resources/extensions/gsd/preferences-diagnostics.ts +98 -0
- package/src/resources/extensions/gsd/preferences-models.ts +10 -46
- package/src/resources/extensions/gsd/preferences-types.ts +16 -0
- package/src/resources/extensions/gsd/preferences.ts +191 -28
- package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -0
- package/src/resources/extensions/gsd/prompts/execute-task.md +2 -0
- package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +3 -1
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +2 -0
- package/src/resources/extensions/gsd/prompts/plan-slice.md +2 -1
- package/src/resources/extensions/gsd/prompts/refine-slice.md +2 -1
- package/src/resources/extensions/gsd/prompts/replan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/system.md +1 -1
- package/src/resources/extensions/gsd/provider-error-guidance.ts +4 -9
- package/src/resources/extensions/gsd/provider-payload-policy.ts +140 -0
- package/src/resources/extensions/gsd/provider-switch-observer.ts +1 -1
- package/src/resources/extensions/gsd/publication.ts +122 -0
- package/src/resources/extensions/gsd/pull-request-process.ts +41 -0
- package/src/resources/extensions/gsd/quality-gate-closure.ts +140 -0
- package/src/resources/extensions/gsd/question-transport.ts +138 -0
- package/src/resources/extensions/gsd/recovery-classification.ts +47 -88
- package/src/resources/extensions/gsd/roadmap-slices.ts +8 -2
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +36 -4
- package/src/resources/extensions/gsd/safety/evidence-cross-ref.ts +7 -2
- package/src/resources/extensions/gsd/safety/file-change-validator.ts +14 -0
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +6 -2
- package/src/resources/extensions/gsd/state-transition-matrix.ts +42 -0
- package/src/resources/extensions/gsd/state.ts +19 -26
- package/src/resources/extensions/gsd/status-guards.ts +59 -8
- package/src/resources/extensions/gsd/stop-notice.ts +75 -0
- package/src/resources/extensions/gsd/templates/plan.md +7 -0
- package/src/resources/extensions/gsd/templates/project.md +1 -0
- package/src/resources/extensions/gsd/templates/roadmap.md +1 -1
- package/src/resources/extensions/gsd/templates/uat.md +5 -1
- package/src/resources/extensions/gsd/tests/ask-user-questions-render.test.ts +92 -0
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +29 -1
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +444 -5
- package/src/resources/extensions/gsd/tests/auto-milestone-target.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/auto-model-selection-tool-poisoning.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +133 -4
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +3 -1
- package/src/resources/extensions/gsd/tests/auto-post-unit-evidence-crossref-4909.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +34 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-registry.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/auto-worktree-repair.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/browser-automation-contract-fixture.ts +39 -0
- package/src/resources/extensions/gsd/tests/browser-contract.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/canonical-milestone-root.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/checkout-branch-stash-guard.test.ts +66 -1
- package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/codebase-generator.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/commands-dispatcher-workspace-git.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/commands-verdict.test.ts +46 -8
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +34 -3
- package/src/resources/extensions/gsd/tests/dispatch-run-uat-browser-tools.test.ts +89 -0
- package/src/resources/extensions/gsd/tests/doctor-scope-db-unavailable.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/evidence-xref-gsd-exec.test.ts +157 -0
- package/src/resources/extensions/gsd/tests/execute-task-rendering.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/extension-bootstrap-isolation.test.ts +35 -1
- package/src/resources/extensions/gsd/tests/file-change-validator.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-no-blockers.md +1 -5
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-with-blockers.md +1 -5
- package/src/resources/extensions/gsd/tests/gate-state-canonicalization.test.ts +48 -1
- package/src/resources/extensions/gsd/tests/guidance.test.ts +125 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +58 -15
- package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +74 -59
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/integration/gsd-integration-fixture.ts +80 -0
- package/src/resources/extensions/gsd/tests/mcp-tool-name.test.ts +34 -0
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +143 -1
- package/src/resources/extensions/gsd/tests/milestone-closeout-proof.test.ts +99 -0
- package/src/resources/extensions/gsd/tests/milestone-closeout.test.ts +25 -0
- package/src/resources/extensions/gsd/tests/milestone-merge-transaction.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/milestone-readiness.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/milestone-validation-evidence.test.ts +41 -0
- package/src/resources/extensions/gsd/tests/milestone-validation-verdict.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/notification-store.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/planning-crossval.test.ts +45 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +193 -1
- package/src/resources/extensions/gsd/tests/preferences-diagnostics.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +183 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/provider-error-guidance.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/provider-payload-policy.test.ts +165 -0
- package/src/resources/extensions/gsd/tests/publication.test.ts +120 -0
- package/src/resources/extensions/gsd/tests/pull-request-process.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/recovery-classification-illegal-transition.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +342 -1
- package/src/resources/extensions/gsd/tests/roadmap-parse-regression.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +26 -1
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +80 -0
- package/src/resources/extensions/gsd/tests/session-switch-clears-pending-autostart.test.ts +108 -0
- package/src/resources/extensions/gsd/tests/single-writer-invariant.test.ts +144 -7
- package/src/resources/extensions/gsd/tests/stale-queued-milestone.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/state-transition-matrix.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/status-guards.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/stop-notice.test.ts +70 -0
- package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/tool-availability-audit.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/tool-naming.test.ts +35 -42
- package/src/resources/extensions/gsd/tests/tool-surface-readiness.test.ts +155 -0
- package/src/resources/extensions/gsd/tests/uat-policy.test.ts +24 -6
- package/src/resources/extensions/gsd/tests/unit-closeout.test.ts +209 -0
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +70 -2
- package/src/resources/extensions/gsd/tests/unit-registry.test.ts +163 -0
- package/src/resources/extensions/gsd/tests/user-input-boundary.test.ts +86 -1
- package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/web-app-uat.test.ts +193 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +128 -11
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/workspace-git-preflight.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +41 -4
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +43 -1
- package/src/resources/extensions/gsd/tests/worktree-placement.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/worktree-projection-writers.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-reentry.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-safety.test.ts +3 -1
- package/src/resources/extensions/gsd/tests/worktree-symlink-removal.test.ts +12 -6
- package/src/resources/extensions/gsd/tests/worktree-teardown-safety.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/worktree-telemetry.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +121 -0
- package/src/resources/extensions/gsd/tool-contract.ts +86 -8
- package/src/resources/extensions/gsd/tool-presentation-plan.ts +16 -33
- package/src/resources/extensions/gsd/tool-surface-readiness.ts +76 -0
- package/src/resources/extensions/gsd/tool-surface-snapshot.ts +47 -0
- package/src/resources/extensions/gsd/tools/complete-slice.ts +23 -58
- package/src/resources/extensions/gsd/tools/exec-tool.ts +5 -8
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +19 -160
- package/src/resources/extensions/gsd/tools/plan-slice.ts +12 -6
- package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +43 -0
- package/src/resources/extensions/gsd/tools/reopen-milestone.ts +11 -38
- package/src/resources/extensions/gsd/tools/reopen-slice.ts +14 -42
- package/src/resources/extensions/gsd/tools/skip-slice.ts +18 -44
- package/src/resources/extensions/gsd/tools/validate-milestone.ts +25 -84
- package/src/resources/extensions/gsd/uat-policy.ts +20 -10
- package/src/resources/extensions/gsd/uat-run.ts +10 -14
- package/src/resources/extensions/gsd/undo.ts +9 -8
- package/src/resources/extensions/gsd/unit-closeout.ts +201 -0
- package/src/resources/extensions/gsd/unit-context-composer.ts +97 -21
- package/src/resources/extensions/gsd/unit-context-manifest.ts +4 -28
- package/src/resources/extensions/gsd/unit-registry.ts +412 -0
- package/src/resources/extensions/gsd/unit-runtime.ts +3 -2
- package/src/resources/extensions/gsd/unit-tool-contracts.ts +27 -191
- package/src/resources/extensions/gsd/user-input-boundary.ts +18 -0
- package/src/resources/extensions/gsd/validation-block-guard.ts +2 -0
- package/src/resources/extensions/gsd/web-app-uat.ts +144 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +22 -110
- package/src/resources/extensions/gsd/workflow-reconcile.ts +3 -3
- package/src/resources/extensions/gsd/workflow-tool-surface.ts +76 -0
- package/src/resources/extensions/gsd/workspace-git-guard.ts +1 -0
- package/src/resources/extensions/gsd/worktree-git-recovery.ts +314 -0
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +17 -17
- package/src/resources/extensions/gsd/worktree-manager.ts +47 -28
- package/src/resources/extensions/gsd/worktree-placement.ts +63 -0
- package/src/resources/extensions/gsd/worktree-reentry.ts +10 -7
- package/src/resources/extensions/gsd/worktree-root.ts +29 -6
- package/src/resources/extensions/gsd/worktree-safety.ts +8 -5
- package/src/resources/extensions/gsd/worktree-session-state.ts +11 -11
- package/src/resources/extensions/gsd/worktree-state-projection.ts +55 -7
- package/src/resources/extensions/gsd/worktree-telemetry.ts +16 -0
- package/src/resources/extensions/search-the-web/native-search.ts +5 -3
- package/src/resources/extensions/shared/browser-contract.ts +66 -0
- package/src/resources/extensions/shared/gsd-browser-cli.ts +88 -4
- package/src/resources/extensions/shared/interview-ui.ts +15 -2
- package/src/resources/shared/claude-runtime-floor.ts +248 -0
- package/src/resources/skills/create-skill/references/executable-code.md +1 -1
- package/src/resources/skills/create-skill/workflows/add-reference.md +8 -3
- package/src/resources/skills/create-skill/workflows/add-script.md +4 -2
- package/src/resources/skills/create-skill/workflows/add-template.md +3 -1
- package/src/resources/skills/create-skill/workflows/add-workflow.md +8 -3
- package/src/resources/skills/create-skill/workflows/upgrade-to-router.md +10 -5
- package/src/resources/skills/create-skill/workflows/verify-skill.md +9 -4
- package/src/resources/skills/gsd-browser/SKILL.md +1 -1
- package/src/resources/skills/spike-wrap-up/SKILL.md +9 -9
- package/dist/web/standalone/.next/static/chunks/2659.feb6499ca863ebfc.js +0 -1
- package/dist/web/standalone/.next/static/chunks/2772.151789db0edea835.js +0 -1
- package/dist/web/standalone/.next/static/chunks/4283.10a065467b5340d8.js +0 -2
- package/dist/web/standalone/.next/static/chunks/5826.960dc4634cc9b0d3.js +0 -1
- package/dist/web/standalone/.next/static/chunks/796.46f811c0fac23aab.js +0 -10
- package/dist/web/standalone/.next/static/chunks/8785.d32f7a61f55c1600.js +0 -1
- /package/dist/web/standalone/.next/static/{Qbr81pQ-pbQXP4bq2VXLv → AOpDeK_gJHU8OZjRo31gQ}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{Qbr81pQ-pbQXP4bq2VXLv → AOpDeK_gJHU8OZjRo31gQ}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression tests for ask_user_questions renderResult when Claude Code MCP
|
|
3
|
+
* omits structuredContent and the chat controller passes details as undefined
|
|
4
|
+
* or an empty object.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import assert from "node:assert/strict";
|
|
8
|
+
import { test } from "node:test";
|
|
9
|
+
import askUserQuestionsExtension from "../../ask-user-questions.ts";
|
|
10
|
+
|
|
11
|
+
const fakeTheme = {
|
|
12
|
+
fg: (_color: string, text: string) => text,
|
|
13
|
+
bold: (text: string) => text,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function getAskUserQuestionsTool() {
|
|
17
|
+
const tools: any[] = [];
|
|
18
|
+
askUserQuestionsExtension({ registerTool: (tool: any) => tools.push(tool) } as any);
|
|
19
|
+
const tool = tools.find((t) => t.name === "ask_user_questions");
|
|
20
|
+
assert.ok(tool, "ask_user_questions should be registered");
|
|
21
|
+
return tool;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function renderText(tool: any, result: unknown, args?: unknown): string {
|
|
25
|
+
const rendered = tool.renderResult(result, {}, fakeTheme, { args });
|
|
26
|
+
return String((rendered as any).content ?? (rendered as any).text ?? rendered);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const depthQuestion = {
|
|
30
|
+
id: "depth_check",
|
|
31
|
+
header: "Depth Check",
|
|
32
|
+
question: "Did I capture the depth right?",
|
|
33
|
+
options: [
|
|
34
|
+
{ label: "Yes, you got it", description: "Proceed" },
|
|
35
|
+
{ label: "Not quite - let me clarify", description: "Clarify" },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
test("ask_user_questions renderResult shows answers when details is undefined (MCP text-only wire)", () => {
|
|
40
|
+
const tool = getAskUserQuestionsTool();
|
|
41
|
+
const contentText = JSON.stringify({
|
|
42
|
+
answers: { depth_check: { answers: ["Yes, you got it"] } },
|
|
43
|
+
});
|
|
44
|
+
const text = renderText(
|
|
45
|
+
tool,
|
|
46
|
+
{
|
|
47
|
+
content: [{ type: "text", text: contentText }],
|
|
48
|
+
details: undefined,
|
|
49
|
+
isError: false,
|
|
50
|
+
},
|
|
51
|
+
{ questions: [depthQuestion] },
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
assert.match(text, /✓/);
|
|
55
|
+
assert.match(text, /Depth Check/);
|
|
56
|
+
assert.match(text, /Yes, you got it/);
|
|
57
|
+
assert.doesNotMatch(text, /Cancelled/i);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test("ask_user_questions renderResult shows answers when details is empty object (#cc-elicitation)", () => {
|
|
61
|
+
const tool = getAskUserQuestionsTool();
|
|
62
|
+
const contentText = JSON.stringify({
|
|
63
|
+
answers: { depth_check: { answers: ["Yes, you got it"] } },
|
|
64
|
+
});
|
|
65
|
+
const text = renderText(
|
|
66
|
+
tool,
|
|
67
|
+
{
|
|
68
|
+
content: [{ type: "text", text: contentText }],
|
|
69
|
+
details: {},
|
|
70
|
+
isError: false,
|
|
71
|
+
},
|
|
72
|
+
{ questions: [depthQuestion] },
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
assert.match(text, /Yes, you got it/);
|
|
76
|
+
assert.doesNotMatch(text, /Cancelled/i);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test("ask_user_questions renderResult still shows Cancelled for explicit cancel payload", () => {
|
|
80
|
+
const tool = getAskUserQuestionsTool();
|
|
81
|
+
const text = renderText(
|
|
82
|
+
tool,
|
|
83
|
+
{
|
|
84
|
+
content: [{ type: "text", text: "ask_user_questions was cancelled before receiving a response" }],
|
|
85
|
+
details: { questions: [depthQuestion], response: null, cancelled: true },
|
|
86
|
+
isError: false,
|
|
87
|
+
},
|
|
88
|
+
{ questions: [depthQuestion] },
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
assert.match(text, /Cancelled/i);
|
|
92
|
+
});
|
|
@@ -29,11 +29,16 @@ import {
|
|
|
29
29
|
_refreshLastCommitForTests,
|
|
30
30
|
_getLastCommitForTests,
|
|
31
31
|
_getLastCommitFetchedAtForTests,
|
|
32
|
+
formatToolSurfaceSnapshot,
|
|
32
33
|
formatRuntimeHealthSignal,
|
|
33
34
|
shouldRenderRoadmapProgress,
|
|
34
35
|
} from "../auto-dashboard.ts";
|
|
35
36
|
import { getAutoDashboardData } from "../auto.ts";
|
|
36
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
autoSession,
|
|
39
|
+
clearAutoToolSurfaceSnapshot,
|
|
40
|
+
recordAutoToolSurfaceSnapshot,
|
|
41
|
+
} from "../auto-runtime-state.ts";
|
|
37
42
|
import { formatRtkSavingsLabel } from "../../shared/rtk-session-stats.ts";
|
|
38
43
|
import {
|
|
39
44
|
openDatabase,
|
|
@@ -530,6 +535,29 @@ test("getAutoDashboardData returns RTK savings in the dashboard payload", () =>
|
|
|
530
535
|
}
|
|
531
536
|
});
|
|
532
537
|
|
|
538
|
+
test("getAutoDashboardData exposes typed tool-surface snapshots", () => {
|
|
539
|
+
autoSession.reset();
|
|
540
|
+
clearAutoToolSurfaceSnapshot();
|
|
541
|
+
autoSession.active = true;
|
|
542
|
+
recordAutoToolSurfaceSnapshot({
|
|
543
|
+
source: "provider-adjustment",
|
|
544
|
+
unitType: "run-uat",
|
|
545
|
+
modelFacingToolNames: ["read"],
|
|
546
|
+
registeredToolNames: ["read", "browser_navigate"],
|
|
547
|
+
scopedToolNames: ["read", "browser_navigate"],
|
|
548
|
+
presentedToolNames: ["browser_navigate"],
|
|
549
|
+
capturedAt: 456,
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
const data = getAutoDashboardData();
|
|
553
|
+
|
|
554
|
+
assert.equal(data.toolSurface?.source, "provider-adjustment");
|
|
555
|
+
assert.equal(formatToolSurfaceSnapshot(data.toolSurface), "run-uat: model 1 / registered 2 / scoped 2 / presented 1");
|
|
556
|
+
|
|
557
|
+
autoSession.reset();
|
|
558
|
+
clearAutoToolSurfaceSnapshot();
|
|
559
|
+
});
|
|
560
|
+
|
|
533
561
|
test("RTK savings label formats the dashboard footer text", () => {
|
|
534
562
|
assert.equal(formatRtkSavingsLabel(null), null);
|
|
535
563
|
assert.equal(
|
|
@@ -23,11 +23,12 @@ import {
|
|
|
23
23
|
import { runUnit, shouldDeferUnitFailsafeTimeout } from "../auto/run-unit.js";
|
|
24
24
|
import { scheduleAutoWakeup, _resetAutoWakeupsForTest } from "../auto/schedule-wakeup.js";
|
|
25
25
|
import { writeUnitRuntimeRecord, readUnitRuntimeRecord } from "../unit-runtime.js";
|
|
26
|
-
import { autoLoop } from "../auto/loop.js";
|
|
27
|
-
import { runDispatch, runUnitPhase } from "../auto/phases.js";
|
|
26
|
+
import { autoLoop as rawAutoLoop } from "../auto/loop.js";
|
|
27
|
+
import { runPreDispatch, runDispatch, runUnitPhase } from "../auto/phases.js";
|
|
28
28
|
import { detectStuck } from "../auto/detect-stuck.js";
|
|
29
|
-
import type { UnitResult, AgentEndEvent } from "../auto/types.js";
|
|
29
|
+
import type { UnitResult, AgentEndEvent, LoopState } from "../auto/types.js";
|
|
30
30
|
import type { LoopDeps } from "../auto/loop-deps.js";
|
|
31
|
+
import type { AutoAdvanceResult, AutoOrchestrationModule, AutoStatus, UnitRef } from "../auto/contracts.js";
|
|
31
32
|
import { WorktreeStateProjection } from "../worktree-state-projection.js";
|
|
32
33
|
import { ModelPolicyDispatchBlockedError } from "../auto-model-selection.js";
|
|
33
34
|
import type { SessionLockStatus } from "../session-lock.js";
|
|
@@ -40,6 +41,17 @@ import { SourceObservationStore } from "../source-observations.js";
|
|
|
40
41
|
|
|
41
42
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
42
43
|
|
|
44
|
+
const ORCHESTRATION_MISSING_REASON =
|
|
45
|
+
"Auto Orchestration Module is not wired; cannot dispatch built-in GSD Unit.";
|
|
46
|
+
|
|
47
|
+
type CapturedAutoSideEffects<T> = {
|
|
48
|
+
result: T;
|
|
49
|
+
stopped: boolean;
|
|
50
|
+
stoppedReason?: string;
|
|
51
|
+
paused: boolean;
|
|
52
|
+
pausedReason?: string;
|
|
53
|
+
};
|
|
54
|
+
|
|
43
55
|
function makeEvent(
|
|
44
56
|
messages: unknown[] = [{ role: "assistant" }],
|
|
45
57
|
): AgentEndEvent {
|
|
@@ -67,12 +79,203 @@ async function waitForMicrotasks(
|
|
|
67
79
|
assert.fail(`Timed out waiting for ${label}`);
|
|
68
80
|
}
|
|
69
81
|
|
|
82
|
+
function makeLoopState(): LoopState {
|
|
83
|
+
return {
|
|
84
|
+
recentUnits: [],
|
|
85
|
+
stuckRecoveryAttempts: 0,
|
|
86
|
+
consecutiveFinalizeTimeouts: 0,
|
|
87
|
+
consecutiveDispatchCount: new Map<string, number>(),
|
|
88
|
+
lastDispatchedKey: null,
|
|
89
|
+
lastDispatchPhase: null,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function createLoopTestOrchestration(
|
|
94
|
+
ctx: any,
|
|
95
|
+
pi: any,
|
|
96
|
+
s: any,
|
|
97
|
+
deps: LoopDeps,
|
|
98
|
+
): AutoOrchestrationModule {
|
|
99
|
+
// Production auto.ts wires the real Auto Orchestration Module before entering
|
|
100
|
+
// autoLoop. These loop-mechanics tests keep their LoopDeps fixtures by
|
|
101
|
+
// adapting the old phase helpers to the public orchestration Interface.
|
|
102
|
+
const loopState = makeLoopState();
|
|
103
|
+
const status: AutoStatus = { phase: "running", transitionCount: 0 };
|
|
104
|
+
let iteration = 0;
|
|
105
|
+
let seq = 0;
|
|
106
|
+
|
|
107
|
+
function nextSeq(): number {
|
|
108
|
+
return ++seq;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function clearActiveUnit(): void {
|
|
112
|
+
status.activeUnit = undefined;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
async function captureAutoSideEffects<T>(
|
|
116
|
+
run: () => Promise<T>,
|
|
117
|
+
): Promise<CapturedAutoSideEffects<T>> {
|
|
118
|
+
const originalStopAuto = deps.stopAuto;
|
|
119
|
+
const originalPauseAuto = deps.pauseAuto;
|
|
120
|
+
let stoppedReason: string | undefined;
|
|
121
|
+
let pausedReason: string | undefined;
|
|
122
|
+
let stopped = false;
|
|
123
|
+
let paused = false;
|
|
124
|
+
|
|
125
|
+
(deps as any).stopAuto = async (...args: Parameters<LoopDeps["stopAuto"]>) => {
|
|
126
|
+
stopped = true;
|
|
127
|
+
stoppedReason = args[2];
|
|
128
|
+
return originalStopAuto(...args);
|
|
129
|
+
};
|
|
130
|
+
(deps as any).pauseAuto = async (...args: Parameters<LoopDeps["pauseAuto"]>) => {
|
|
131
|
+
paused = true;
|
|
132
|
+
const context = args[2] as { message?: string } | undefined;
|
|
133
|
+
pausedReason = context?.message;
|
|
134
|
+
return originalPauseAuto(...args);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
try {
|
|
138
|
+
const result = await run();
|
|
139
|
+
return { result, stopped, stoppedReason, paused, pausedReason };
|
|
140
|
+
} finally {
|
|
141
|
+
(deps as any).stopAuto = originalStopAuto;
|
|
142
|
+
(deps as any).pauseAuto = originalPauseAuto;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function resultForBreak(
|
|
147
|
+
reason: string,
|
|
148
|
+
sideEffects: CapturedAutoSideEffects<unknown>,
|
|
149
|
+
): AutoAdvanceResult {
|
|
150
|
+
clearActiveUnit();
|
|
151
|
+
status.phase = sideEffects.paused && !sideEffects.stopped ? "paused" : "stopped";
|
|
152
|
+
status.transitionCount += 1;
|
|
153
|
+
if (sideEffects.paused && !sideEffects.stopped) {
|
|
154
|
+
return {
|
|
155
|
+
kind: "blocked",
|
|
156
|
+
reason: sideEffects.pausedReason ?? reason,
|
|
157
|
+
action: "pause",
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
kind: "stopped",
|
|
162
|
+
reason: sideEffects.stoppedReason ?? reason,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return {
|
|
167
|
+
async start() {
|
|
168
|
+
status.phase = "running";
|
|
169
|
+
status.transitionCount += 1;
|
|
170
|
+
return { kind: "started" };
|
|
171
|
+
},
|
|
172
|
+
async advance() {
|
|
173
|
+
iteration += 1;
|
|
174
|
+
seq = 0;
|
|
175
|
+
const prefs = deps.loadEffectiveGSDPreferences()?.preferences;
|
|
176
|
+
const ic = {
|
|
177
|
+
ctx,
|
|
178
|
+
pi,
|
|
179
|
+
s,
|
|
180
|
+
deps,
|
|
181
|
+
prefs,
|
|
182
|
+
iteration,
|
|
183
|
+
flowId: `loop-test-orchestration-${iteration}`,
|
|
184
|
+
nextSeq,
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const preDispatch = await captureAutoSideEffects(() => runPreDispatch(ic, loopState));
|
|
188
|
+
const preDispatchResult = preDispatch.result;
|
|
189
|
+
if (preDispatchResult.action === "break") {
|
|
190
|
+
return resultForBreak(preDispatchResult.reason, preDispatch);
|
|
191
|
+
}
|
|
192
|
+
if (preDispatchResult.action === "continue") {
|
|
193
|
+
return { kind: "skipped", reason: "pre-dispatch-skip" };
|
|
194
|
+
}
|
|
195
|
+
if (preDispatchResult.action === "retry") {
|
|
196
|
+
return { kind: "paused", reason: preDispatchResult.reason };
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const dispatch = await captureAutoSideEffects(() =>
|
|
200
|
+
runDispatch(ic, preDispatchResult.data, loopState),
|
|
201
|
+
);
|
|
202
|
+
if (dispatch.result.action === "break") {
|
|
203
|
+
return resultForBreak(dispatch.result.reason, dispatch);
|
|
204
|
+
}
|
|
205
|
+
if (dispatch.result.action === "continue") {
|
|
206
|
+
return {
|
|
207
|
+
kind: "skipped",
|
|
208
|
+
reason: "dispatch-skip",
|
|
209
|
+
stateSnapshot: preDispatchResult.data.state,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
if (dispatch.result.action === "retry") {
|
|
213
|
+
return { kind: "paused", reason: dispatch.result.reason };
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const data = dispatch.result.data;
|
|
217
|
+
const unit: UnitRef = { unitType: data.unitType, unitId: data.unitId };
|
|
218
|
+
s.pendingOrchestrationDispatch = {
|
|
219
|
+
unitType: data.unitType,
|
|
220
|
+
unitId: data.unitId,
|
|
221
|
+
prompt: data.prompt,
|
|
222
|
+
pauseAfterUatDispatch: data.pauseAfterUatDispatch,
|
|
223
|
+
state: data.state,
|
|
224
|
+
mid: data.mid,
|
|
225
|
+
midTitle: data.midTitle,
|
|
226
|
+
};
|
|
227
|
+
status.phase = "running";
|
|
228
|
+
status.activeUnit = unit;
|
|
229
|
+
status.transitionCount += 1;
|
|
230
|
+
return { kind: "advanced", unit, stateSnapshot: data.state };
|
|
231
|
+
},
|
|
232
|
+
async completeActiveUnit() {
|
|
233
|
+
clearActiveUnit();
|
|
234
|
+
},
|
|
235
|
+
async retryActiveUnit() {
|
|
236
|
+
clearActiveUnit();
|
|
237
|
+
},
|
|
238
|
+
async resume() {
|
|
239
|
+
status.phase = "running";
|
|
240
|
+
status.transitionCount += 1;
|
|
241
|
+
return { kind: "resumed" };
|
|
242
|
+
},
|
|
243
|
+
async stop(reason: string) {
|
|
244
|
+
status.phase = "stopped";
|
|
245
|
+
clearActiveUnit();
|
|
246
|
+
status.transitionCount += 1;
|
|
247
|
+
return { kind: "stopped", reason };
|
|
248
|
+
},
|
|
249
|
+
getStatus() {
|
|
250
|
+
return {
|
|
251
|
+
...status,
|
|
252
|
+
activeUnit: status.activeUnit ? { ...status.activeUnit } : undefined,
|
|
253
|
+
};
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
async function autoLoop(
|
|
259
|
+
ctx: any,
|
|
260
|
+
pi: any,
|
|
261
|
+
s: any,
|
|
262
|
+
deps: LoopDeps,
|
|
263
|
+
options?: Parameters<typeof rawAutoLoop>[4],
|
|
264
|
+
): Promise<void> {
|
|
265
|
+
if (!s.orchestration) {
|
|
266
|
+
s.orchestration = createLoopTestOrchestration(ctx, pi, s, deps);
|
|
267
|
+
}
|
|
268
|
+
await rawAutoLoop(ctx, pi, s, deps, options);
|
|
269
|
+
}
|
|
270
|
+
|
|
70
271
|
/**
|
|
71
272
|
* Build a minimal mock AutoSession with controllable newSession behavior.
|
|
72
273
|
*/
|
|
73
274
|
function makeMockSession(opts?: {
|
|
74
275
|
newSessionResult?: { cancelled: boolean };
|
|
75
276
|
newSessionThrows?: string;
|
|
277
|
+
/** Reject newSession() with a specific Error instance (e.g. TypeError). */
|
|
278
|
+
newSessionThrowsError?: Error;
|
|
76
279
|
newSessionDelayMs?: number;
|
|
77
280
|
onNewSessionStart?: (session: any) => void;
|
|
78
281
|
onNewSessionSettle?: (session: any) => void;
|
|
@@ -87,6 +290,9 @@ function makeMockSession(opts?: {
|
|
|
87
290
|
cmdCtx: {
|
|
88
291
|
newSession: (options?: { abortSignal?: AbortSignal; workspaceRoot?: string }) => {
|
|
89
292
|
opts?.onNewSessionStart?.(session);
|
|
293
|
+
if (opts?.newSessionThrowsError) {
|
|
294
|
+
return Promise.reject(opts.newSessionThrowsError);
|
|
295
|
+
}
|
|
90
296
|
if (opts?.newSessionThrows) {
|
|
91
297
|
return Promise.reject(new Error(opts.newSessionThrows));
|
|
92
298
|
}
|
|
@@ -497,6 +703,73 @@ test("runUnit returns cancelled when session creation fails", async () => {
|
|
|
497
703
|
assert.equal(pi.calls.length, 0);
|
|
498
704
|
});
|
|
499
705
|
|
|
706
|
+
test("runUnit: TypeError from newSession is classified as structural (isTransient: false)", async () => {
|
|
707
|
+
// Regression for #572: a TypeError thrown from newSession (e.g. "something is
|
|
708
|
+
// not a function") indicates a programming error, not a transient provider
|
|
709
|
+
// blip. Before the fix it was always classified isTransient: true, causing
|
|
710
|
+
// auto-mode to retry indefinitely instead of surfacing the real problem.
|
|
711
|
+
_resetPendingResolve();
|
|
712
|
+
|
|
713
|
+
const baseCtx = {
|
|
714
|
+
...makeMockCtx(),
|
|
715
|
+
ui: { notify: () => {}, setStatus: () => {}, setWorkingMessage: () => {} },
|
|
716
|
+
sessionManager: { getEntries: () => [] },
|
|
717
|
+
modelRegistry: { getProviderAuthMode: () => undefined, isProviderRequestReady: () => true },
|
|
718
|
+
} as any;
|
|
719
|
+
const pi = makeMockPi();
|
|
720
|
+
const s = makeMockSession({
|
|
721
|
+
newSessionThrowsError: new TypeError("pi.sendMessage is not a function"),
|
|
722
|
+
});
|
|
723
|
+
|
|
724
|
+
const result = await runUnit(baseCtx, pi, s, "task", "T01", "prompt");
|
|
725
|
+
|
|
726
|
+
assert.equal(result.status, "cancelled");
|
|
727
|
+
assert.equal(result.errorContext?.category, "session-failed");
|
|
728
|
+
assert.equal(result.errorContext?.isTransient, false, "TypeError must be non-transient");
|
|
729
|
+
});
|
|
730
|
+
|
|
731
|
+
test("runUnit: 'is not a function' message from newSession is classified as structural", async () => {
|
|
732
|
+
// Regression for #572: the pattern also catches errors where the thrown
|
|
733
|
+
// object is not a TypeError instance but the message contains "is not a function".
|
|
734
|
+
_resetPendingResolve();
|
|
735
|
+
|
|
736
|
+
const baseCtx = {
|
|
737
|
+
...makeMockCtx(),
|
|
738
|
+
ui: { notify: () => {}, setStatus: () => {}, setWorkingMessage: () => {} },
|
|
739
|
+
sessionManager: { getEntries: () => [] },
|
|
740
|
+
modelRegistry: { getProviderAuthMode: () => undefined, isProviderRequestReady: () => true },
|
|
741
|
+
} as any;
|
|
742
|
+
const pi = makeMockPi();
|
|
743
|
+
const s = makeMockSession({ newSessionThrows: "pi.sendMessage is not a function" });
|
|
744
|
+
|
|
745
|
+
const result = await runUnit(baseCtx, pi, s, "task", "T01", "prompt");
|
|
746
|
+
|
|
747
|
+
assert.equal(result.status, "cancelled");
|
|
748
|
+
assert.equal(result.errorContext?.category, "session-failed");
|
|
749
|
+
assert.equal(result.errorContext?.isTransient, false, "'is not a function' errors must be non-transient");
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
test("runUnit: generic network error from newSession remains transient", async () => {
|
|
753
|
+
// Confirm that non-structural session errors (e.g. 429, ECONNREFUSED) are
|
|
754
|
+
// still classified as transient so auto-mode can retry them.
|
|
755
|
+
_resetPendingResolve();
|
|
756
|
+
|
|
757
|
+
const baseCtx = {
|
|
758
|
+
...makeMockCtx(),
|
|
759
|
+
ui: { notify: () => {}, setStatus: () => {}, setWorkingMessage: () => {} },
|
|
760
|
+
sessionManager: { getEntries: () => [] },
|
|
761
|
+
modelRegistry: { getProviderAuthMode: () => undefined, isProviderRequestReady: () => true },
|
|
762
|
+
} as any;
|
|
763
|
+
const pi = makeMockPi();
|
|
764
|
+
const s = makeMockSession({ newSessionThrows: "connection refused" });
|
|
765
|
+
|
|
766
|
+
const result = await runUnit(baseCtx, pi, s, "task", "T01", "prompt");
|
|
767
|
+
|
|
768
|
+
assert.equal(result.status, "cancelled");
|
|
769
|
+
assert.equal(result.errorContext?.category, "session-failed");
|
|
770
|
+
assert.equal(result.errorContext?.isTransient, true, "network errors must remain transient");
|
|
771
|
+
});
|
|
772
|
+
|
|
500
773
|
test("runUnit clears queued switch cancellation when session creation fails", async () => {
|
|
501
774
|
_resetPendingResolve();
|
|
502
775
|
|
|
@@ -1164,6 +1437,34 @@ test("autoLoop exits when s.active is set to false", async (t) => {
|
|
|
1164
1437
|
);
|
|
1165
1438
|
});
|
|
1166
1439
|
|
|
1440
|
+
test("autoLoop pauses visibly when Auto Orchestration Module is not wired", async () => {
|
|
1441
|
+
_resetPendingResolve();
|
|
1442
|
+
|
|
1443
|
+
const ctx = makeMockCtx();
|
|
1444
|
+
ctx.ui.setStatus = () => {};
|
|
1445
|
+
const pi = makeMockPi();
|
|
1446
|
+
const s = makeLoopSession();
|
|
1447
|
+
let pauseContext: unknown;
|
|
1448
|
+
|
|
1449
|
+
const deps = makeMockDeps({
|
|
1450
|
+
pauseAuto: async (_ctx, _pi, errorContext) => {
|
|
1451
|
+
pauseContext = errorContext;
|
|
1452
|
+
deps.callLog.push("pauseAuto");
|
|
1453
|
+
},
|
|
1454
|
+
});
|
|
1455
|
+
|
|
1456
|
+
await rawAutoLoop(ctx, pi, s, deps);
|
|
1457
|
+
|
|
1458
|
+
assert.ok(deps.callLog.includes("pauseAuto"), "missing orchestration should pause auto-mode");
|
|
1459
|
+
assert.equal(
|
|
1460
|
+
(pauseContext as { message?: string } | undefined)?.message,
|
|
1461
|
+
ORCHESTRATION_MISSING_REASON,
|
|
1462
|
+
);
|
|
1463
|
+
assert.equal(deps.callLog.includes("deriveState"), false);
|
|
1464
|
+
assert.equal(deps.callLog.includes("resolveDispatch"), false);
|
|
1465
|
+
assert.equal(s.pendingOrchestrationDispatch, null);
|
|
1466
|
+
});
|
|
1467
|
+
|
|
1167
1468
|
test("autoLoop exits on terminal complete state", async (t) => {
|
|
1168
1469
|
_resetPendingResolve();
|
|
1169
1470
|
|
|
@@ -1990,11 +2291,15 @@ test("autoLoop retries next iteration when orchestration reports paused", async
|
|
|
1990
2291
|
},
|
|
1991
2292
|
});
|
|
1992
2293
|
|
|
2294
|
+
const journalEvents: Array<{ eventType: string; data?: any }> = [];
|
|
1993
2295
|
const deps = makeMockDeps({
|
|
1994
2296
|
resolveDispatch: async () => {
|
|
1995
2297
|
deps.callLog.push("resolveDispatch");
|
|
1996
2298
|
throw new Error("legacy resolveDispatch must not run after orchestration paused");
|
|
1997
2299
|
},
|
|
2300
|
+
emitJournalEvent: (entry: any) => {
|
|
2301
|
+
journalEvents.push(entry);
|
|
2302
|
+
},
|
|
1998
2303
|
});
|
|
1999
2304
|
|
|
2000
2305
|
await autoLoop(ctx, pi, s, deps);
|
|
@@ -2007,6 +2312,11 @@ test("autoLoop retries next iteration when orchestration reports paused", async
|
|
|
2007
2312
|
"orchestration paused must not fall back to legacy dispatch",
|
|
2008
2313
|
);
|
|
2009
2314
|
assert.equal(s.pendingOrchestrationDispatch, null, "no orchestration dispatch should remain pending");
|
|
2315
|
+
|
|
2316
|
+
const pausedIterationEnd = journalEvents.find(
|
|
2317
|
+
(e) => e.eventType === "iteration-end" && e.data?.status === "paused",
|
|
2318
|
+
);
|
|
2319
|
+
assert.ok(pausedIterationEnd, "orchestration paused must emit iteration-end to close the iteration journal");
|
|
2010
2320
|
});
|
|
2011
2321
|
|
|
2012
2322
|
test("autoLoop consumes pending orchestration dispatch without advancing twice", async () => {
|
|
@@ -2094,8 +2404,13 @@ test("autoLoop stops orchestrator complete state through completion surface", as
|
|
|
2094
2404
|
start: async () => ({ kind: "stopped" as const, reason: "unused" }),
|
|
2095
2405
|
advance: async () => ({
|
|
2096
2406
|
kind: "stopped" as const,
|
|
2097
|
-
reason: "
|
|
2407
|
+
reason: "legacy text not used",
|
|
2098
2408
|
stateSnapshot,
|
|
2409
|
+
terminalOutcome: {
|
|
2410
|
+
code: "all-complete" as const,
|
|
2411
|
+
displayReason: "All milestones complete",
|
|
2412
|
+
allMilestonesComplete: true as const,
|
|
2413
|
+
},
|
|
2099
2414
|
}),
|
|
2100
2415
|
completeActiveUnit: async () => {},
|
|
2101
2416
|
retryActiveUnit: async () => {},
|
|
@@ -2121,6 +2436,7 @@ test("autoLoop stops orchestrator complete state through completion surface", as
|
|
|
2121
2436
|
milestoneTitle: "Priority Levels",
|
|
2122
2437
|
allMilestonesComplete: true,
|
|
2123
2438
|
});
|
|
2439
|
+
assert.equal((stopCalls[0]?.options as any)?.terminalOutcome?.code, "all-complete");
|
|
2124
2440
|
assert.equal(
|
|
2125
2441
|
deps.callLog.includes("resolveDispatch"),
|
|
2126
2442
|
false,
|
|
@@ -2960,7 +3276,7 @@ test("autoLoop closes journal iteration on pre-dispatch health-gate break", asyn
|
|
|
2960
3276
|
assert.equal(deps.callLog.includes("pauseAuto"), true);
|
|
2961
3277
|
assert.deepEqual(pauseOptions, { expectedCurrentUnit: null });
|
|
2962
3278
|
assert.ok(
|
|
2963
|
-
journalEvents.some((event) => event.eventType === "iteration-end" && event.data?.reason === "
|
|
3279
|
+
journalEvents.some((event) => event.eventType === "iteration-end" && event.data?.reason === "health-gate-failed"),
|
|
2964
3280
|
"pre-dispatch break must close the started iteration",
|
|
2965
3281
|
);
|
|
2966
3282
|
});
|
|
@@ -5201,6 +5517,129 @@ test("dispatch Worktree Safety wins before stuck detection for execute-task with
|
|
|
5201
5517
|
);
|
|
5202
5518
|
});
|
|
5203
5519
|
|
|
5520
|
+
test("dispatch Worktree Safety honors degraded branch fallback instead of demanding the canonical worktree root", async (t) => {
|
|
5521
|
+
_resetPendingResolve();
|
|
5522
|
+
|
|
5523
|
+
const ctx = makeMockCtx();
|
|
5524
|
+
const pi = makeMockPi();
|
|
5525
|
+
const notifications: string[] = [];
|
|
5526
|
+
ctx.ui.notify = (msg: string) => { notifications.push(msg); };
|
|
5527
|
+
|
|
5528
|
+
// Worktree creation failed and the lifecycle fell back to the milestone
|
|
5529
|
+
// branch in the project root. The safety gate must validate against that
|
|
5530
|
+
// effective branch mode, not the configured worktree mode.
|
|
5531
|
+
const projectRoot = mkdtempSync(join(tmpdir(), "gsd-wt-safety-degraded-"));
|
|
5532
|
+
t.after(() => rmSync(projectRoot, { recursive: true, force: true }));
|
|
5533
|
+
|
|
5534
|
+
const s = makeLoopSession({
|
|
5535
|
+
basePath: projectRoot,
|
|
5536
|
+
originalBasePath: projectRoot,
|
|
5537
|
+
canonicalProjectRoot: projectRoot,
|
|
5538
|
+
isolationDegraded: true,
|
|
5539
|
+
});
|
|
5540
|
+
const deps = makeMockDeps({
|
|
5541
|
+
getIsolationMode: () => "worktree",
|
|
5542
|
+
});
|
|
5543
|
+
const result = await runDispatch(
|
|
5544
|
+
{
|
|
5545
|
+
ctx,
|
|
5546
|
+
pi,
|
|
5547
|
+
s,
|
|
5548
|
+
deps,
|
|
5549
|
+
prefs: undefined,
|
|
5550
|
+
iteration: 1,
|
|
5551
|
+
flowId: "test-flow",
|
|
5552
|
+
nextSeq: () => 1,
|
|
5553
|
+
},
|
|
5554
|
+
{
|
|
5555
|
+
state: {
|
|
5556
|
+
phase: "executing",
|
|
5557
|
+
activeMilestone: { id: "M001", title: "Test", status: "active" },
|
|
5558
|
+
activeSlice: { id: "S01", title: "Slice 1" },
|
|
5559
|
+
activeTask: { id: "T01" },
|
|
5560
|
+
registry: [{ id: "M001", status: "active" }],
|
|
5561
|
+
blockers: [],
|
|
5562
|
+
} as any,
|
|
5563
|
+
mid: "M001",
|
|
5564
|
+
midTitle: "Test",
|
|
5565
|
+
},
|
|
5566
|
+
{
|
|
5567
|
+
recentUnits: [],
|
|
5568
|
+
stuckRecoveryAttempts: 0,
|
|
5569
|
+
consecutiveFinalizeTimeouts: 0,
|
|
5570
|
+
},
|
|
5571
|
+
);
|
|
5572
|
+
|
|
5573
|
+
assert.equal(result.action, "next", "dispatch must proceed under degraded branch isolation");
|
|
5574
|
+
assert.ok(
|
|
5575
|
+
!notifications.some((n) => n.includes("Worktree Safety failed")),
|
|
5576
|
+
"degraded branch fallback must not trip a false invalid-root",
|
|
5577
|
+
);
|
|
5578
|
+
assert.ok(!deps.callLog.includes("stopAuto"), "auto-mode must not stop on the degraded fallback");
|
|
5579
|
+
});
|
|
5580
|
+
|
|
5581
|
+
test("dispatch Worktree Safety honors stranded branch recovery instead of demanding the canonical worktree root", async (t) => {
|
|
5582
|
+
_resetPendingResolve();
|
|
5583
|
+
|
|
5584
|
+
const ctx = makeMockCtx();
|
|
5585
|
+
const pi = makeMockPi();
|
|
5586
|
+
const notifications: string[] = [];
|
|
5587
|
+
ctx.ui.notify = (msg: string) => { notifications.push(msg); };
|
|
5588
|
+
|
|
5589
|
+
// Bootstrap adopted stranded work by checking out the milestone branch in
|
|
5590
|
+
// the project root (strandedRecoveryIsolationMode = "branch"). Isolation is
|
|
5591
|
+
// NOT degraded — the adoption is intentional. The safety gate must validate
|
|
5592
|
+
// against the effective branch mode, not the configured worktree mode.
|
|
5593
|
+
const projectRoot = mkdtempSync(join(tmpdir(), "gsd-wt-safety-stranded-"));
|
|
5594
|
+
t.after(() => rmSync(projectRoot, { recursive: true, force: true }));
|
|
5595
|
+
|
|
5596
|
+
const s = makeLoopSession({
|
|
5597
|
+
basePath: projectRoot,
|
|
5598
|
+
originalBasePath: projectRoot,
|
|
5599
|
+
canonicalProjectRoot: projectRoot,
|
|
5600
|
+
strandedRecoveryIsolationMode: "branch",
|
|
5601
|
+
});
|
|
5602
|
+
const deps = makeMockDeps({
|
|
5603
|
+
getIsolationMode: () => "worktree",
|
|
5604
|
+
});
|
|
5605
|
+
const result = await runDispatch(
|
|
5606
|
+
{
|
|
5607
|
+
ctx,
|
|
5608
|
+
pi,
|
|
5609
|
+
s,
|
|
5610
|
+
deps,
|
|
5611
|
+
prefs: undefined,
|
|
5612
|
+
iteration: 1,
|
|
5613
|
+
flowId: "test-flow",
|
|
5614
|
+
nextSeq: () => 1,
|
|
5615
|
+
},
|
|
5616
|
+
{
|
|
5617
|
+
state: {
|
|
5618
|
+
phase: "executing",
|
|
5619
|
+
activeMilestone: { id: "M001", title: "Test", status: "active" },
|
|
5620
|
+
activeSlice: { id: "S01", title: "Slice 1" },
|
|
5621
|
+
activeTask: { id: "T01" },
|
|
5622
|
+
registry: [{ id: "M001", status: "active" }],
|
|
5623
|
+
blockers: [],
|
|
5624
|
+
} as any,
|
|
5625
|
+
mid: "M001",
|
|
5626
|
+
midTitle: "Test",
|
|
5627
|
+
},
|
|
5628
|
+
{
|
|
5629
|
+
recentUnits: [],
|
|
5630
|
+
stuckRecoveryAttempts: 0,
|
|
5631
|
+
consecutiveFinalizeTimeouts: 0,
|
|
5632
|
+
},
|
|
5633
|
+
);
|
|
5634
|
+
|
|
5635
|
+
assert.equal(result.action, "next", "dispatch must proceed under stranded branch recovery");
|
|
5636
|
+
assert.ok(
|
|
5637
|
+
!notifications.some((n) => n.includes("Worktree Safety failed")),
|
|
5638
|
+
"stranded branch recovery must not trip a false invalid-root",
|
|
5639
|
+
);
|
|
5640
|
+
assert.ok(!deps.callLog.includes("stopAuto"), "auto-mode must not stop on stranded branch recovery");
|
|
5641
|
+
});
|
|
5642
|
+
|
|
5204
5643
|
test("runDispatch runs stuck detection while artifact verification retry is pending (#5719)", async (t) => {
|
|
5205
5644
|
_resetPendingResolve();
|
|
5206
5645
|
|