@opengsd/gsd-pi 1.2.0-dev.4c756166 → 1.2.0-dev.5457a158
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.js +1 -1
- package/dist/headless-events.d.ts +4 -2
- package/dist/headless-events.js +7 -29
- 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/bg-shell/utilities.js +5 -2
- package/dist/resources/extensions/claude-code-cli/models.js +9 -0
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +35 -4
- package/dist/resources/extensions/gsd/auto/orchestrator.js +33 -4
- package/dist/resources/extensions/gsd/auto/phases.js +6 -1
- package/dist/resources/extensions/gsd/auto-post-unit.js +19 -8
- package/dist/resources/extensions/gsd/auto-prompts.js +3 -0
- package/dist/resources/extensions/gsd/auto-start.js +12 -14
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +18 -0
- package/dist/resources/extensions/gsd/auto-unit-tool-scope.js +7 -16
- package/dist/resources/extensions/gsd/auto-worktree-repair.js +10 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +35 -352
- package/dist/resources/extensions/gsd/auto.js +8 -20
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +3 -2
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +9 -6
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +86 -6
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +30 -4
- package/dist/resources/extensions/gsd/branch-patterns.js +2 -0
- package/dist/resources/extensions/gsd/captures.js +5 -15
- package/dist/resources/extensions/gsd/closeout-recovery.js +3 -2
- package/dist/resources/extensions/gsd/commands/catalog.js +6 -62
- 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/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/error-classifier.js +9 -0
- 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 +171 -2048
- package/dist/resources/extensions/gsd/guidance.js +98 -0
- package/dist/resources/extensions/gsd/guided-flow.js +51 -5
- package/dist/resources/extensions/gsd/mcp-tool-name.js +5 -13
- package/dist/resources/extensions/gsd/memory-consolidation-scanner.js +1 -1
- package/dist/resources/extensions/gsd/migrate/safety.js +20 -9
- package/dist/resources/extensions/gsd/migration-auto-check.js +24 -3
- 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-merge.js +14 -11
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +11 -7
- 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-models.js +12 -46
- package/dist/resources/extensions/gsd/preferences.js +14 -0
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +1 -1
- package/dist/resources/extensions/gsd/provider-error-guidance.js +1 -5
- 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/recovery-classification.js +41 -87
- 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/state-transition-matrix.js +38 -0
- package/dist/resources/extensions/gsd/state.js +1 -20
- 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/tool-surface-readiness.js +56 -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-slice.js +12 -6
- 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/undo.js +8 -7
- package/dist/resources/extensions/gsd/unit-closeout.js +138 -0
- package/dist/resources/extensions/gsd/unit-context-composer.js +9 -1
- package/dist/resources/extensions/gsd/unit-context-manifest.js +4 -27
- package/dist/resources/extensions/gsd/unit-registry.js +350 -0
- package/dist/resources/extensions/gsd/unit-tool-contracts.js +9 -182
- package/dist/resources/extensions/gsd/workflow-tool-surface.js +1 -1
- 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/skills/gsd-browser/SKILL.md +1 -1
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +9 -9
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- 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 +9 -9
- 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/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/worktree-cli.js +3 -6
- package/dist/worktree-status-banner.js +7 -11
- package/package.json +1 -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/package.json +5 -5
- 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/workflow-tools.d.ts +8 -0
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +46 -21
- 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/models.generated.d.ts +294 -239
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +260 -256
- 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/package.json +2 -2
- package/packages/rpc-client/package.json +2 -2
- package/pkg/package.json +1 -1
- package/src/resources/extensions/bg-shell/utilities.ts +5 -2
- package/src/resources/extensions/claude-code-cli/models.ts +9 -0
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +37 -2
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +28 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +1 -1
- package/src/resources/extensions/gsd/auto/orchestrator.ts +39 -5
- package/src/resources/extensions/gsd/auto/phases.ts +10 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +25 -7
- package/src/resources/extensions/gsd/auto-prompts.ts +3 -0
- package/src/resources/extensions/gsd/auto-start.ts +12 -15
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +19 -0
- package/src/resources/extensions/gsd/auto-unit-tool-scope.ts +10 -17
- package/src/resources/extensions/gsd/auto-worktree-repair.ts +13 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +41 -364
- package/src/resources/extensions/gsd/auto.ts +20 -24
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +3 -5
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +10 -6
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +87 -6
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +29 -3
- package/src/resources/extensions/gsd/branch-patterns.ts +3 -0
- package/src/resources/extensions/gsd/captures.ts +5 -16
- package/src/resources/extensions/gsd/closeout-recovery.ts +2 -1
- package/src/resources/extensions/gsd/commands/catalog.ts +6 -68
- 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/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/error-classifier.ts +11 -0
- 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 +173 -2373
- package/src/resources/extensions/gsd/guidance.ts +139 -0
- package/src/resources/extensions/gsd/guided-flow.ts +50 -5
- package/src/resources/extensions/gsd/mcp-tool-name.ts +6 -11
- package/src/resources/extensions/gsd/memory-consolidation-scanner.ts +1 -1
- package/src/resources/extensions/gsd/migrate/safety.ts +18 -7
- package/src/resources/extensions/gsd/migration-auto-check.ts +28 -3
- 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-merge.ts +12 -9
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +10 -7
- 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-models.ts +10 -46
- package/src/resources/extensions/gsd/preferences.ts +18 -0
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/refine-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/replan-slice.md +1 -1
- package/src/resources/extensions/gsd/provider-error-guidance.ts +4 -9
- 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/recovery-classification.ts +47 -88
- 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/state-transition-matrix.ts +42 -0
- package/src/resources/extensions/gsd/state.ts +4 -21
- 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/tests/auto-loop.test.ts +123 -0
- 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-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/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/commands-verdict.test.ts +8 -7
- package/src/resources/extensions/gsd/tests/evidence-xref-gsd-exec.test.ts +157 -0
- package/src/resources/extensions/gsd/tests/file-change-validator.test.ts +33 -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 +51 -4
- package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +54 -1
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +85 -1
- package/src/resources/extensions/gsd/tests/notification-store.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +193 -1
- package/src/resources/extensions/gsd/tests/provider-error-guidance.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/publication.test.ts +120 -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 +248 -1
- package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +38 -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 +43 -6
- 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/tool-invocation-error-loop-break.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/tool-surface-readiness.test.ts +155 -0
- package/src/resources/extensions/gsd/tests/unit-closeout.test.ts +209 -0
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +23 -2
- package/src/resources/extensions/gsd/tests/unit-registry.test.ts +163 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +41 -4
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +22 -1
- package/src/resources/extensions/gsd/tests/worktree-placement.test.ts +113 -0
- 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/write-gate.test.ts +42 -0
- package/src/resources/extensions/gsd/tool-surface-readiness.ts +76 -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-slice.ts +12 -6
- 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/undo.ts +9 -8
- package/src/resources/extensions/gsd/unit-closeout.ts +201 -0
- package/src/resources/extensions/gsd/unit-context-composer.ts +12 -1
- package/src/resources/extensions/gsd/unit-context-manifest.ts +4 -28
- package/src/resources/extensions/gsd/unit-registry.ts +425 -0
- package/src/resources/extensions/gsd/unit-tool-contracts.ts +27 -192
- package/src/resources/extensions/gsd/workflow-tool-surface.ts +4 -1
- package/src/resources/extensions/gsd/worktree-git-recovery.ts +314 -0
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +10 -1
- 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/skills/gsd-browser/SKILL.md +1 -1
- /package/dist/web/standalone/.next/static/{DUFWcMFRH3iXh7d2fbrOF → 2p9Rv9pQflAxCBbGVI2vb}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{DUFWcMFRH3iXh7d2fbrOF → 2p9Rv9pQflAxCBbGVI2vb}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// Project/App: gsd-pi
|
|
2
|
+
// File Purpose: Unit Closeout module — durable completion pipeline behind one seam (ADR-032).
|
|
3
|
+
//
|
|
4
|
+
// `closeUnit` owns what makes a Unit's completion durable. This pass ships the
|
|
5
|
+
// **Interactive Closeout adapter** path: commit the work and compute the
|
|
6
|
+
// Closeout Git Verdict, failing closed (loudly) instead of silently when a
|
|
7
|
+
// non-`none` `git.isolation` preference was never honoured by the session.
|
|
8
|
+
// Motivating failure (2026-06-10): an interactive session under
|
|
9
|
+
// `git.isolation: worktree` completed a milestone with every source file
|
|
10
|
+
// untracked on the integration branch — no commit, no merge, no warning.
|
|
11
|
+
//
|
|
12
|
+
// The interactive adapter only fires on milestone boundaries — the durability
|
|
13
|
+
// gap is the milestone close, and committing at every task/slice would sweep a
|
|
14
|
+
// developer's unrelated working-tree changes. `closeUnit` itself stays general
|
|
15
|
+
// over all boundaries for the pending Auto Closeout adapter re-seat.
|
|
16
|
+
//
|
|
17
|
+
// The auto loop keeps its existing closeout pipeline for now (the Auto
|
|
18
|
+
// Closeout adapter re-seat is the documented next step in ADR-032); the
|
|
19
|
+
// interactive trigger in bootstrap/register-hooks.ts is a no-op while
|
|
20
|
+
// `isAutoActive()`, so auto-mode behaviour is untouched.
|
|
21
|
+
//
|
|
22
|
+
// Re-entrancy is naturally safe: a re-fired completion commits an already-clean
|
|
23
|
+
// tree, which yields `nothing-to-commit`, and `appendNotification` carries its
|
|
24
|
+
// own dedup window — so `closeUnit` keeps no result cache of its own.
|
|
25
|
+
import { appendNotification } from "./notification-store.js";
|
|
26
|
+
import { readStringField } from "./auto-unit-tool-scope.js";
|
|
27
|
+
import { MILESTONE_BRANCH_PREFIX } from "./branch-patterns.js";
|
|
28
|
+
import { nativeGetCurrentBranch } from "./native-git-bridge.js";
|
|
29
|
+
import { getIsolationMode } from "./preferences.js";
|
|
30
|
+
import { autoCommitCurrentBranch } from "./worktree.js";
|
|
31
|
+
import { logWarning } from "./workflow-logger.js";
|
|
32
|
+
const defaultDeps = {
|
|
33
|
+
isolationMode: (basePath) => getIsolationMode(basePath),
|
|
34
|
+
currentBranch: (basePath) => {
|
|
35
|
+
try {
|
|
36
|
+
return nativeGetCurrentBranch(basePath);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
commit: (basePath, unitType, unitId) => autoCommitCurrentBranch(basePath, unitType, unitId),
|
|
43
|
+
notify: (message, severity) => appendNotification(message, severity),
|
|
44
|
+
};
|
|
45
|
+
export function closeUnit(request, deps = defaultDeps) {
|
|
46
|
+
let commitMessage = null;
|
|
47
|
+
let gitVerdict;
|
|
48
|
+
let notice;
|
|
49
|
+
try {
|
|
50
|
+
commitMessage = deps.commit(request.basePath, request.unitType, request.unitId);
|
|
51
|
+
gitVerdict = commitMessage === null ? "nothing-to-commit" : "committed";
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
gitVerdict = "commit-failed";
|
|
55
|
+
notice = `Unit closeout commit failed for ${request.unitId}: ${err instanceof Error ? err.message : String(err)}`;
|
|
56
|
+
logWarning("engine", notice);
|
|
57
|
+
deps.notify(notice, "error");
|
|
58
|
+
}
|
|
59
|
+
if (request.boundary === "milestone" && gitVerdict !== "commit-failed") {
|
|
60
|
+
const isolation = deps.isolationMode(request.basePath);
|
|
61
|
+
if (isolation !== "none") {
|
|
62
|
+
const branch = deps.currentBranch(request.basePath);
|
|
63
|
+
if (branch?.startsWith(MILESTONE_BRANCH_PREFIX)) {
|
|
64
|
+
gitVerdict = "milestone-branch";
|
|
65
|
+
notice =
|
|
66
|
+
`Milestone ${request.unitId} completed on ${branch}. ` +
|
|
67
|
+
`Merge it to the integration branch with the worktree tooling (/gsd worktree merge).`;
|
|
68
|
+
deps.notify(notice, "info");
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
gitVerdict = "isolation-bypassed";
|
|
72
|
+
notice =
|
|
73
|
+
`Needs attention: milestone ${request.unitId} completed outside a milestone worktree/branch ` +
|
|
74
|
+
`while git.isolation is "${isolation}" — the isolation preference was not honoured this session. ` +
|
|
75
|
+
(commitMessage
|
|
76
|
+
? `Work was committed directly on "${branch ?? "the current branch"}".`
|
|
77
|
+
: `The working tree had nothing left to commit on "${branch ?? "the current branch"}".`);
|
|
78
|
+
logWarning("engine", notice);
|
|
79
|
+
deps.notify(notice, "warning");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return { gitVerdict, commitMessage, notice };
|
|
84
|
+
}
|
|
85
|
+
// ─── Interactive Closeout adapter (tool-observation trigger) ─────────────
|
|
86
|
+
// Canonical closeout tool → boundary. Aliases are canonicalized by the hook.
|
|
87
|
+
// Only the milestone boundary is wired interactively: it is the durability gap
|
|
88
|
+
// that motivated ADR-032, and committing at every task/slice would sweep a
|
|
89
|
+
// developer's unrelated working-tree changes. `closeUnit` still handles every
|
|
90
|
+
// boundary for the pending Auto Closeout adapter re-seat.
|
|
91
|
+
const CLOSEOUT_TOOL_BOUNDARIES = {
|
|
92
|
+
gsd_complete_milestone: "milestone",
|
|
93
|
+
};
|
|
94
|
+
// Commit attribution uses the canonical unit types so interactive closeout
|
|
95
|
+
// commits carry the same GSD-Unit evidence trailers the verification prompts
|
|
96
|
+
// look for.
|
|
97
|
+
const BOUNDARY_UNIT_TYPES = {
|
|
98
|
+
task: "execute-task",
|
|
99
|
+
slice: "complete-slice",
|
|
100
|
+
milestone: "complete-milestone",
|
|
101
|
+
};
|
|
102
|
+
export function isUnitCloseoutTool(canonicalToolName) {
|
|
103
|
+
return canonicalToolName in CLOSEOUT_TOOL_BOUNDARIES;
|
|
104
|
+
}
|
|
105
|
+
function readId(input, camel, snake) {
|
|
106
|
+
const value = readStringField(input, camel, snake);
|
|
107
|
+
return value && value.length > 0 ? value : undefined;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Interactive Closeout adapter entry, called from the host's tool-observation
|
|
111
|
+
* hook for successful closeout tool calls when auto-mode is NOT active.
|
|
112
|
+
* Returns null when the tool input doesn't identify a unit.
|
|
113
|
+
*/
|
|
114
|
+
export function runInteractiveUnitCloseout(args, deps = defaultDeps) {
|
|
115
|
+
const boundary = CLOSEOUT_TOOL_BOUNDARIES[args.canonicalToolName];
|
|
116
|
+
if (!boundary)
|
|
117
|
+
return null;
|
|
118
|
+
const milestoneId = readId(args.input, "milestoneId", "milestone_id");
|
|
119
|
+
if (!milestoneId)
|
|
120
|
+
return null;
|
|
121
|
+
const sliceId = readId(args.input, "sliceId", "slice_id");
|
|
122
|
+
const taskId = readId(args.input, "taskId", "task_id");
|
|
123
|
+
let unitId = milestoneId;
|
|
124
|
+
if (boundary !== "milestone") {
|
|
125
|
+
if (!sliceId)
|
|
126
|
+
return null;
|
|
127
|
+
unitId = boundary === "slice" ? `${milestoneId}/${sliceId}` : `${milestoneId}/${sliceId}/${taskId ?? ""}`;
|
|
128
|
+
if (boundary === "task" && !taskId)
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
return closeUnit({
|
|
132
|
+
basePath: args.basePath,
|
|
133
|
+
unitType: BOUNDARY_UNIT_TYPES[boundary],
|
|
134
|
+
unitId,
|
|
135
|
+
boundary,
|
|
136
|
+
outcome: "complete",
|
|
137
|
+
}, deps);
|
|
138
|
+
}
|
|
@@ -91,6 +91,14 @@ const CONTEXT_MODE_GUIDANCE_BY_LANE = {
|
|
|
91
91
|
orchestration: "Use `gsd_resume` before resuming orchestration, `gsd_exec_search` to reuse prior runs, and `gsd_exec` for noisy coordination checks.",
|
|
92
92
|
docs: "Use `gsd_resume` for prior context, `gsd_exec_search` for saved evidence, and `gsd_exec` for noisy doc validation commands.",
|
|
93
93
|
};
|
|
94
|
+
// Per-unit overrides win over the lane default. run-uat's tool contract
|
|
95
|
+
// forbids `gsd_exec`/`gsd_exec_search` (acceptance evidence must flow through
|
|
96
|
+
// `gsd_uat_exec`) and Claude Code dispatch strips the tools entirely, so the
|
|
97
|
+
// shared verification-lane guidance would steer the agent into calling an
|
|
98
|
+
// unavailable tool.
|
|
99
|
+
const CONTEXT_MODE_GUIDANCE_BY_UNIT = {
|
|
100
|
+
"run-uat": "Use `gsd_uat_exec` for acceptance checks so evidence is typed as UAT-owned, and `gsd_resume` after compaction or resume.",
|
|
101
|
+
};
|
|
94
102
|
/**
|
|
95
103
|
* Render the Context Mode instruction lane for a unit type. Unknown unit
|
|
96
104
|
* types, disabled config, and explicit `contextMode: "none"` all omit the
|
|
@@ -103,7 +111,7 @@ export function composeContextModeInstructions(unitType, opts) {
|
|
|
103
111
|
if (!manifest || manifest.contextMode === "none")
|
|
104
112
|
return "";
|
|
105
113
|
const lane = CONTEXT_MODE_LANE_LABELS[manifest.contextMode];
|
|
106
|
-
const guidance = CONTEXT_MODE_GUIDANCE_BY_LANE[manifest.contextMode];
|
|
114
|
+
const guidance = CONTEXT_MODE_GUIDANCE_BY_UNIT[unitType] ?? CONTEXT_MODE_GUIDANCE_BY_LANE[manifest.contextMode];
|
|
107
115
|
if (opts.renderMode === "nested") {
|
|
108
116
|
return `Context Mode (${lane} lane): ${guidance}`;
|
|
109
117
|
}
|
|
@@ -118,33 +118,10 @@ const TOOLS_DOCS = {
|
|
|
118
118
|
* enumerates these against `UNIT_MANIFESTS` to catch manifest drift when
|
|
119
119
|
* a new unit type lands.
|
|
120
120
|
*/
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
"validate-milestone",
|
|
126
|
-
"complete-milestone",
|
|
127
|
-
"research-slice",
|
|
128
|
-
"plan-slice",
|
|
129
|
-
"refine-slice",
|
|
130
|
-
"replan-slice",
|
|
131
|
-
"complete-slice",
|
|
132
|
-
"reassess-roadmap",
|
|
133
|
-
"execute-task",
|
|
134
|
-
"reactive-execute",
|
|
135
|
-
"run-uat",
|
|
136
|
-
"gate-evaluate",
|
|
137
|
-
"rewrite-docs",
|
|
138
|
-
// Sidecar units (triage, quick-task)
|
|
139
|
-
"triage-captures",
|
|
140
|
-
"quick-task",
|
|
141
|
-
// Deep planning mode (project-level) units
|
|
142
|
-
"workflow-preferences",
|
|
143
|
-
"discuss-project",
|
|
144
|
-
"discuss-requirements",
|
|
145
|
-
"research-decision",
|
|
146
|
-
"research-project",
|
|
147
|
-
];
|
|
121
|
+
// Unit-type vocabulary is owned by the Unit Registry (ADR-033); re-exported
|
|
122
|
+
// here so established import paths keep working.
|
|
123
|
+
import { KNOWN_UNIT_TYPES } from "./unit-registry.js";
|
|
124
|
+
export { KNOWN_UNIT_TYPES };
|
|
148
125
|
export const UNIT_MANIFESTS = {
|
|
149
126
|
// ─── Milestone-scoped ────────────────────────────────────────────────
|
|
150
127
|
"research-milestone": {
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
// Project/App: gsd-pi
|
|
2
|
+
// File Purpose: Unit Registry — the single declaration point for what a Unit type is (ADR-033).
|
|
3
|
+
//
|
|
4
|
+
// One Unit Descriptor per Unit type. The previously independent tables —
|
|
5
|
+
// `KNOWN_UNIT_TYPES`/`UnitType` (unit-context-manifest.ts), `UNIT_TOOL_CONTRACTS`
|
|
6
|
+
// (unit-tool-contracts.ts), the scope-class Sets (auto-unit-tool-scope.ts), and
|
|
7
|
+
// the unit→phase switch (preferences-models.ts) — are derived views over this
|
|
8
|
+
// registry. Import paths stay stable: each former home re-exports its view
|
|
9
|
+
// (the `gsd-db.ts` barrel discipline).
|
|
10
|
+
//
|
|
11
|
+
// Behaviour-neutral by construction. The registry preserves the asymmetries the
|
|
12
|
+
// old tables had drifted into, explicitly instead of accidentally:
|
|
13
|
+
// - `discuss-slice` and `execute-task-simple` had tool contracts and scope-Set
|
|
14
|
+
// membership but were absent from `KNOWN_UNIT_TYPES` → declared here as
|
|
15
|
+
// `kind: "variant"` (excluded from the derived `KNOWN_UNIT_TYPES`/`UnitType`).
|
|
16
|
+
// - `triage-captures` and `quick-task` had manifests but no tool contract and
|
|
17
|
+
// no phase routing → `toolContract: null`, `phaseChain: null`.
|
|
18
|
+
// The parity test (tests/unit-registry.test.ts) pins every derived view to the
|
|
19
|
+
// pre-registry values.
|
|
20
|
+
//
|
|
21
|
+
// Not yet declared here (remaining ADR-033 steps): the manifest data
|
|
22
|
+
// (`UNIT_MANIFESTS` stays in unit-context-manifest.ts, already type-enforced
|
|
23
|
+
// against the registry's `UnitType`) and prompt-template association (still
|
|
24
|
+
// implicit in auto-prompts.ts builders).
|
|
25
|
+
// ─── Shared tool-name constants (used by registry rows) ──────────────────
|
|
26
|
+
export const RUN_UAT_WORKFLOW_TOOL_NAMES = [
|
|
27
|
+
"gsd_uat_exec",
|
|
28
|
+
"gsd_uat_result_save",
|
|
29
|
+
"gsd_resume",
|
|
30
|
+
"gsd_milestone_status",
|
|
31
|
+
"gsd_journal_query",
|
|
32
|
+
];
|
|
33
|
+
export const RUN_UAT_READ_ONLY_TOOL_NAMES = [
|
|
34
|
+
"find",
|
|
35
|
+
"glob",
|
|
36
|
+
"grep",
|
|
37
|
+
"ls",
|
|
38
|
+
"read",
|
|
39
|
+
];
|
|
40
|
+
export const RUN_UAT_BROWSER_TOOL_NAMES = [
|
|
41
|
+
"browser_navigate",
|
|
42
|
+
"browser_click",
|
|
43
|
+
"browser_type",
|
|
44
|
+
"browser_fill_form",
|
|
45
|
+
"browser_click_ref",
|
|
46
|
+
"browser_fill_ref",
|
|
47
|
+
"browser_wait_for",
|
|
48
|
+
"browser_assert",
|
|
49
|
+
"browser_verify",
|
|
50
|
+
"browser_screenshot",
|
|
51
|
+
"browser_snapshot_refs",
|
|
52
|
+
"browser_find",
|
|
53
|
+
"browser_get_console_logs",
|
|
54
|
+
"browser_get_network_logs",
|
|
55
|
+
"browser_evaluate",
|
|
56
|
+
"browser_reload",
|
|
57
|
+
"browser_batch",
|
|
58
|
+
"browser_act",
|
|
59
|
+
];
|
|
60
|
+
// ─── The registry ─────────────────────────────────────────────────────────
|
|
61
|
+
export const UNIT_REGISTRY = {
|
|
62
|
+
"research-milestone": {
|
|
63
|
+
kind: "primary",
|
|
64
|
+
scopeClass: "standard",
|
|
65
|
+
phaseChain: ["research"],
|
|
66
|
+
toolContract: {
|
|
67
|
+
allowedGsdTools: ["gsd_summary_save", "gsd_decision_save"],
|
|
68
|
+
requiredWorkflowTools: ["gsd_summary_save"],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
"plan-milestone": {
|
|
72
|
+
kind: "primary",
|
|
73
|
+
scopeClass: "standard",
|
|
74
|
+
phaseChain: ["planning"],
|
|
75
|
+
toolContract: {
|
|
76
|
+
allowedGsdTools: [
|
|
77
|
+
"gsd_milestone_status",
|
|
78
|
+
"gsd_plan_milestone",
|
|
79
|
+
"gsd_plan_slice",
|
|
80
|
+
"gsd_decision_save",
|
|
81
|
+
"gsd_requirement_update",
|
|
82
|
+
],
|
|
83
|
+
requiredWorkflowTools: ["gsd_milestone_status", "gsd_plan_milestone", "gsd_plan_slice"],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
"discuss-milestone": {
|
|
87
|
+
kind: "primary",
|
|
88
|
+
scopeClass: "standard",
|
|
89
|
+
phaseChain: ["discuss", "planning"],
|
|
90
|
+
toolContract: {
|
|
91
|
+
allowedGsdTools: [
|
|
92
|
+
"gsd_summary_save",
|
|
93
|
+
"gsd_decision_save",
|
|
94
|
+
"gsd_requirement_save",
|
|
95
|
+
"gsd_requirement_update",
|
|
96
|
+
"gsd_plan_milestone",
|
|
97
|
+
"gsd_milestone_generate_id",
|
|
98
|
+
],
|
|
99
|
+
requiredWorkflowTools: [
|
|
100
|
+
"ask_user_questions",
|
|
101
|
+
"gsd_summary_save",
|
|
102
|
+
"gsd_requirement_save",
|
|
103
|
+
"gsd_requirement_update",
|
|
104
|
+
"gsd_plan_milestone",
|
|
105
|
+
"gsd_milestone_generate_id",
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
"discuss-slice": {
|
|
110
|
+
kind: "variant",
|
|
111
|
+
scopeClass: "standard",
|
|
112
|
+
phaseChain: ["discuss", "planning"],
|
|
113
|
+
toolContract: {
|
|
114
|
+
allowedGsdTools: ["gsd_summary_save", "gsd_decision_save"],
|
|
115
|
+
requiredWorkflowTools: ["ask_user_questions", "gsd_summary_save"],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
"validate-milestone": {
|
|
119
|
+
kind: "primary",
|
|
120
|
+
scopeClass: "section-close",
|
|
121
|
+
phaseChain: ["validation", "planning"],
|
|
122
|
+
toolContract: {
|
|
123
|
+
allowedGsdTools: ["gsd_milestone_status", "gsd_validate_milestone", "gsd_reassess_roadmap", "subagent"],
|
|
124
|
+
requiredWorkflowTools: ["gsd_milestone_status", "gsd_validate_milestone", "gsd_reassess_roadmap"],
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
"complete-milestone": {
|
|
128
|
+
kind: "primary",
|
|
129
|
+
scopeClass: "standard",
|
|
130
|
+
phaseChain: ["completion"],
|
|
131
|
+
toolContract: {
|
|
132
|
+
allowedGsdTools: [
|
|
133
|
+
"gsd_milestone_status",
|
|
134
|
+
"gsd_requirement_update",
|
|
135
|
+
"gsd_summary_save",
|
|
136
|
+
"gsd_complete_milestone",
|
|
137
|
+
"subagent",
|
|
138
|
+
],
|
|
139
|
+
requiredWorkflowTools: [
|
|
140
|
+
"gsd_milestone_status",
|
|
141
|
+
"gsd_requirement_update",
|
|
142
|
+
"gsd_summary_save",
|
|
143
|
+
"gsd_complete_milestone",
|
|
144
|
+
],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
"research-slice": {
|
|
148
|
+
kind: "primary",
|
|
149
|
+
scopeClass: "standard",
|
|
150
|
+
phaseChain: ["research"],
|
|
151
|
+
toolContract: {
|
|
152
|
+
allowedGsdTools: ["gsd_summary_save", "gsd_decision_save"],
|
|
153
|
+
requiredWorkflowTools: ["gsd_summary_save"],
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
"plan-slice": {
|
|
157
|
+
kind: "primary",
|
|
158
|
+
scopeClass: "standard",
|
|
159
|
+
phaseChain: ["planning"],
|
|
160
|
+
toolContract: {
|
|
161
|
+
allowedGsdTools: ["gsd_plan_slice", "gsd_reassess_roadmap", "gsd_decision_save"],
|
|
162
|
+
requiredWorkflowTools: ["gsd_plan_slice", "gsd_reassess_roadmap"],
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
"refine-slice": {
|
|
166
|
+
kind: "primary",
|
|
167
|
+
scopeClass: "standard",
|
|
168
|
+
phaseChain: ["planning"],
|
|
169
|
+
toolContract: {
|
|
170
|
+
allowedGsdTools: ["gsd_plan_slice", "gsd_decision_save"],
|
|
171
|
+
requiredWorkflowTools: ["gsd_plan_slice"],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
"replan-slice": {
|
|
175
|
+
kind: "primary",
|
|
176
|
+
scopeClass: "standard",
|
|
177
|
+
phaseChain: ["planning"],
|
|
178
|
+
toolContract: {
|
|
179
|
+
allowedGsdTools: ["gsd_replan_slice", "gsd_decision_save"],
|
|
180
|
+
requiredWorkflowTools: ["gsd_replan_slice"],
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
"complete-slice": {
|
|
184
|
+
kind: "primary",
|
|
185
|
+
scopeClass: "section-close",
|
|
186
|
+
phaseChain: ["completion"],
|
|
187
|
+
toolContract: {
|
|
188
|
+
allowedGsdTools: [
|
|
189
|
+
"gsd_slice_complete",
|
|
190
|
+
"gsd_task_reopen",
|
|
191
|
+
"gsd_replan_slice",
|
|
192
|
+
"gsd_decision_save",
|
|
193
|
+
"gsd_requirement_update",
|
|
194
|
+
"gsd_summary_save",
|
|
195
|
+
"subagent",
|
|
196
|
+
],
|
|
197
|
+
requiredWorkflowTools: [
|
|
198
|
+
"gsd_slice_complete",
|
|
199
|
+
"gsd_task_reopen",
|
|
200
|
+
"gsd_replan_slice",
|
|
201
|
+
"gsd_requirement_update",
|
|
202
|
+
"gsd_summary_save",
|
|
203
|
+
],
|
|
204
|
+
forbiddenGsdTools: {
|
|
205
|
+
gsd_uat_result_save: "Run UAT owns persisted UAT Assessment.",
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
"reassess-roadmap": {
|
|
210
|
+
kind: "primary",
|
|
211
|
+
scopeClass: "standard",
|
|
212
|
+
phaseChain: ["validation", "planning"],
|
|
213
|
+
toolContract: {
|
|
214
|
+
allowedGsdTools: ["gsd_milestone_status", "gsd_reassess_roadmap"],
|
|
215
|
+
requiredWorkflowTools: ["gsd_milestone_status", "gsd_reassess_roadmap"],
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
"execute-task": {
|
|
219
|
+
kind: "primary",
|
|
220
|
+
scopeClass: "execute-task",
|
|
221
|
+
phaseChain: ["execution"],
|
|
222
|
+
toolContract: {
|
|
223
|
+
allowedGsdTools: ["gsd_task_complete", "gsd_decision_save"],
|
|
224
|
+
requiredWorkflowTools: ["gsd_task_complete"],
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
"execute-task-simple": {
|
|
228
|
+
kind: "variant",
|
|
229
|
+
scopeClass: "execute-task",
|
|
230
|
+
phaseChain: ["execution_simple", "execution"],
|
|
231
|
+
toolContract: {
|
|
232
|
+
allowedGsdTools: ["gsd_task_complete", "gsd_decision_save"],
|
|
233
|
+
requiredWorkflowTools: ["gsd_task_complete"],
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
"reactive-execute": {
|
|
237
|
+
kind: "primary",
|
|
238
|
+
scopeClass: "execute-task",
|
|
239
|
+
phaseChain: ["execution"],
|
|
240
|
+
toolContract: {
|
|
241
|
+
allowedGsdTools: ["gsd_task_complete", "gsd_summary_save", "gsd_decision_save"],
|
|
242
|
+
requiredWorkflowTools: ["gsd_task_complete", "gsd_summary_save"],
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
"run-uat": {
|
|
246
|
+
kind: "primary",
|
|
247
|
+
scopeClass: "standard",
|
|
248
|
+
phaseChain: ["uat", "completion"],
|
|
249
|
+
toolContract: {
|
|
250
|
+
allowedGsdTools: [...RUN_UAT_WORKFLOW_TOOL_NAMES, "subagent"],
|
|
251
|
+
requiredWorkflowTools: [...RUN_UAT_WORKFLOW_TOOL_NAMES],
|
|
252
|
+
forbiddenGsdTools: {
|
|
253
|
+
gsd_exec: "Use gsd_uat_exec so acceptance evidence is typed as UAT-owned.",
|
|
254
|
+
gsd_save_gate_result: "gsd_uat_result_save owns the aggregate UAT gate.",
|
|
255
|
+
gsd_summary_save: "gsd_uat_result_save owns persisted UAT Assessment writes.",
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
"gate-evaluate": {
|
|
260
|
+
kind: "primary",
|
|
261
|
+
scopeClass: "standard",
|
|
262
|
+
phaseChain: ["validation", "planning"],
|
|
263
|
+
toolContract: {
|
|
264
|
+
allowedGsdTools: ["gsd_save_gate_result"],
|
|
265
|
+
requiredWorkflowTools: ["gsd_save_gate_result"],
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
"rewrite-docs": {
|
|
269
|
+
kind: "primary",
|
|
270
|
+
scopeClass: "standard",
|
|
271
|
+
phaseChain: ["validation", "planning"],
|
|
272
|
+
toolContract: {
|
|
273
|
+
allowedGsdTools: ["gsd_summary_save", "gsd_decision_save"],
|
|
274
|
+
requiredWorkflowTools: [],
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
// Sidecar units (triage, quick-task) — manifests exist, but no scoped tool
|
|
278
|
+
// contract and no phase routing (today's behaviour, preserved explicitly).
|
|
279
|
+
"triage-captures": {
|
|
280
|
+
kind: "primary",
|
|
281
|
+
scopeClass: "standard",
|
|
282
|
+
phaseChain: null,
|
|
283
|
+
toolContract: null,
|
|
284
|
+
},
|
|
285
|
+
"quick-task": {
|
|
286
|
+
kind: "primary",
|
|
287
|
+
scopeClass: "standard",
|
|
288
|
+
phaseChain: null,
|
|
289
|
+
toolContract: null,
|
|
290
|
+
},
|
|
291
|
+
// Deep planning mode (project-level) units
|
|
292
|
+
"workflow-preferences": {
|
|
293
|
+
kind: "primary",
|
|
294
|
+
scopeClass: "standard",
|
|
295
|
+
phaseChain: ["discuss", "planning"],
|
|
296
|
+
toolContract: {
|
|
297
|
+
allowedGsdTools: ["gsd_summary_save"],
|
|
298
|
+
requiredWorkflowTools: [],
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
"discuss-project": {
|
|
302
|
+
kind: "primary",
|
|
303
|
+
scopeClass: "standard",
|
|
304
|
+
phaseChain: ["discuss", "planning"],
|
|
305
|
+
toolContract: {
|
|
306
|
+
allowedGsdTools: ["gsd_summary_save", "gsd_decision_save", "gsd_requirement_save"],
|
|
307
|
+
requiredWorkflowTools: ["ask_user_questions", "gsd_summary_save"],
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
"discuss-requirements": {
|
|
311
|
+
kind: "primary",
|
|
312
|
+
scopeClass: "standard",
|
|
313
|
+
phaseChain: ["discuss", "planning"],
|
|
314
|
+
toolContract: {
|
|
315
|
+
allowedGsdTools: ["gsd_requirement_save", "gsd_summary_save"],
|
|
316
|
+
requiredWorkflowTools: ["ask_user_questions", "gsd_requirement_save", "gsd_summary_save"],
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
"research-decision": {
|
|
320
|
+
kind: "primary",
|
|
321
|
+
scopeClass: "standard",
|
|
322
|
+
phaseChain: ["discuss", "planning"],
|
|
323
|
+
toolContract: {
|
|
324
|
+
allowedGsdTools: ["gsd_summary_save"],
|
|
325
|
+
requiredWorkflowTools: ["ask_user_questions"],
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
"research-project": {
|
|
329
|
+
kind: "primary",
|
|
330
|
+
scopeClass: "standard",
|
|
331
|
+
phaseChain: ["research"],
|
|
332
|
+
toolContract: {
|
|
333
|
+
allowedGsdTools: ["gsd_summary_save", "gsd_decision_save"],
|
|
334
|
+
requiredWorkflowTools: [],
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
};
|
|
338
|
+
const ALL_UNIT_KEYS = Object.keys(UNIT_REGISTRY);
|
|
339
|
+
export const KNOWN_UNIT_TYPES = Object.freeze(ALL_UNIT_KEYS.filter((t) => UNIT_REGISTRY[t].kind === "primary"));
|
|
340
|
+
export const EXECUTE_TASK_UNIT_TYPES = new Set(ALL_UNIT_KEYS.filter((t) => UNIT_REGISTRY[t].scopeClass === "execute-task"));
|
|
341
|
+
// Execute-task units close gates via summary sections too, so the section-close
|
|
342
|
+
// gate Set is every non-"standard" scope class.
|
|
343
|
+
export const SECTION_CLOSE_GATE_UNIT_TYPES = new Set(ALL_UNIT_KEYS.filter((t) => UNIT_REGISTRY[t].scopeClass !== "standard"));
|
|
344
|
+
export function getUnitDescriptor(unitType) {
|
|
345
|
+
return UNIT_REGISTRY[unitType];
|
|
346
|
+
}
|
|
347
|
+
/** Phase-bucket fallback chain for a unit type, or null when the registry has no routing for it. */
|
|
348
|
+
export function getUnitPhaseChain(unitType) {
|
|
349
|
+
return getUnitDescriptor(unitType)?.phaseChain ?? null;
|
|
350
|
+
}
|