@opengsd/gsd-pi 1.8.1 → 1.9.0-dev.97ef11e3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/dist/cli.js +5 -1
- package/dist/headless-events.d.ts +2 -1
- package/dist/headless-events.js +11 -3
- package/dist/headless-milestone-readiness.d.ts +29 -0
- package/dist/headless-milestone-readiness.js +161 -0
- package/dist/headless.js +27 -3
- package/dist/print-mode-exit.d.ts +12 -0
- package/dist/print-mode-exit.js +14 -0
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +18 -49
- package/dist/resources/extensions/browser-tools/capture.js +2 -77
- package/dist/resources/extensions/browser-tools/screenshot-constraints.js +83 -0
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +17 -2
- package/dist/resources/extensions/claude-code-cli/turn-assembler.js +30 -2
- package/dist/resources/extensions/gsd/artifact-verification.js +3 -4
- package/dist/resources/extensions/gsd/auto/loop.js +24 -4
- package/dist/resources/extensions/gsd/auto/run-unit.js +19 -1
- package/dist/resources/extensions/gsd/auto/unit-phase.js +37 -5
- package/dist/resources/extensions/gsd/auto-artifact-paths.js +16 -10
- package/dist/resources/extensions/gsd/auto-dispatch.js +76 -19
- package/dist/resources/extensions/gsd/auto-post-unit.js +4 -0
- package/dist/resources/extensions/gsd/auto-prompts.js +137 -22
- package/dist/resources/extensions/gsd/auto-recovery.js +10 -5
- package/dist/resources/extensions/gsd/auto-runtime-state.js +5 -5
- package/dist/resources/extensions/gsd/auto-start.js +29 -9
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +40 -0
- package/dist/resources/extensions/gsd/auto-worktree-cleanup.js +4 -0
- package/dist/resources/extensions/gsd/auto-worktree-sync.js +7 -3
- package/dist/resources/extensions/gsd/auto-worktree-teardown.js +1 -1
- package/dist/resources/extensions/gsd/auto.js +20 -6
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +80 -4
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +33 -7
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +10 -3
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +88 -50
- package/dist/resources/extensions/gsd/command-feedback.js +16 -12
- package/dist/resources/extensions/gsd/commands-verdict.js +10 -9
- package/dist/resources/extensions/gsd/compat/compat-marker.js +98 -6
- package/dist/resources/extensions/gsd/constants.js +12 -13
- package/dist/resources/extensions/gsd/context-masker.js +97 -21
- package/dist/resources/extensions/gsd/db/command-queue.js +7 -2
- package/dist/resources/extensions/gsd/db/engine.js +56 -18
- package/dist/resources/extensions/gsd/db/writers/cascades.js +5 -1
- package/dist/resources/extensions/gsd/db/writers/status.js +13 -3
- package/dist/resources/extensions/gsd/db-base-schema.js +28 -0
- package/dist/resources/extensions/gsd/db-migration-steps.js +30 -0
- package/dist/resources/extensions/gsd/db-schema-metadata.js +4 -1
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +26 -4
- package/dist/resources/extensions/gsd/doctor-engine-checks.js +24 -8
- package/dist/resources/extensions/gsd/error-classifier.js +12 -2
- package/dist/resources/extensions/gsd/exec-sandbox.js +1 -0
- package/dist/resources/extensions/gsd/flat-phase-migration.js +168 -21
- package/dist/resources/extensions/gsd/git-service.js +19 -7
- package/dist/resources/extensions/gsd/gsd-db.js +262 -76
- package/dist/resources/extensions/gsd/guided-flow.js +40 -15
- package/dist/resources/extensions/gsd/markdown-renderer.js +20 -22
- package/dist/resources/extensions/gsd/md-importer.js +107 -20
- package/dist/resources/extensions/gsd/migrate/command.js +19 -162
- package/dist/resources/extensions/gsd/migrate/execution.js +98 -0
- package/dist/resources/extensions/gsd/migrate/plan.js +49 -0
- package/dist/resources/extensions/gsd/migrate/planning-writer.js +12 -17
- package/dist/resources/extensions/gsd/migrate/presentation.js +64 -0
- package/dist/resources/extensions/gsd/model-cost-table.js +2 -0
- package/dist/resources/extensions/gsd/model-router.js +11 -0
- package/dist/resources/extensions/gsd/parallel-eligibility.js +5 -4
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +28 -43
- package/dist/resources/extensions/gsd/paths.js +70 -16
- package/dist/resources/extensions/gsd/phase-anchor.js +7 -2
- package/dist/resources/extensions/gsd/planning-subagent-policy.js +37 -0
- package/dist/resources/extensions/gsd/planning-subagent-registry.js +25 -0
- package/dist/resources/extensions/gsd/post-execution-checks.js +4 -4
- package/dist/resources/extensions/gsd/preferences-types.js +5 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +48 -1
- package/dist/resources/extensions/gsd/preferences.js +17 -0
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +5 -5
- package/dist/resources/extensions/gsd/provider-payload-policy.js +16 -5
- package/dist/resources/extensions/gsd/safety/destructive-guard.js +1 -1
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +26 -1
- package/dist/resources/extensions/gsd/safety/evidence-cross-ref.js +30 -5
- package/dist/resources/extensions/gsd/skill-activation.js +17 -3
- package/dist/resources/extensions/gsd/state-reconciliation/drift/external-markdown-edit.js +125 -15
- package/dist/resources/extensions/gsd/state-reconciliation/drift/external-planning-edit.js +17 -4
- package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +5 -2
- package/dist/resources/extensions/gsd/stop-notice.js +24 -1
- package/dist/resources/extensions/gsd/sync-lock.js +13 -7
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +5 -0
- package/dist/resources/extensions/gsd/tools/complete-task.js +94 -6
- package/dist/resources/extensions/gsd/tools/plan-task.js +13 -15
- package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +18 -15
- package/dist/resources/extensions/gsd/tools/reopen-milestone.js +14 -5
- package/dist/resources/extensions/gsd/tools/reopen-slice.js +15 -5
- package/dist/resources/extensions/gsd/tools/reopen-task.js +16 -10
- package/dist/resources/extensions/gsd/tools/replan-task.js +128 -0
- package/dist/resources/extensions/gsd/tools/rework-brief.js +74 -0
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +81 -0
- package/dist/resources/extensions/gsd/unit-context-composer.js +28 -5
- package/dist/resources/extensions/gsd/unit-registry.js +4 -0
- package/dist/resources/extensions/gsd/uok/plan-v2.js +19 -3
- package/dist/resources/extensions/gsd/workflow-projections.js +2 -3
- package/dist/resources/extensions/gsd/workspace.js +2 -1
- package/dist/resources/extensions/gsd/worktree-state-projection.js +26 -18
- package/dist/resources/extensions/mac-tools/index.js +31 -9
- package/dist/resources/extensions/shared/interview-ui.js +43 -6
- 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 +7 -7
- 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/required-server-files.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +4 -4
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- 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 +2 -2
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/mcp-connections/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/mcp-connections/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +5 -5
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -5
- 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 +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +7 -7
- package/dist/web/standalone/.next/server/chunks/1991.js +2 -2
- package/dist/web/standalone/.next/server/chunks/2842.js +4 -4
- package/dist/web/standalone/.next/server/chunks/5124.js +1 -1
- package/dist/web/standalone/.next/server/chunks/8357.js +3 -3
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware.js +3 -3
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/app/_not-found/page-a6fb1847f67f167c.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/{layout-b35cbfff38aaf4cf.js → layout-4ae2d68984392bbf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-72a856634ad14c10.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{main-app-590a74400e35f685.js → main-app-90d1d8d5e5d2dc6b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-1115d46ac61b9823.js +1 -0
- package/dist/web/standalone/.next/static/css/3b1ceb7abfb9a230.css +1 -0
- package/dist/web/standalone/node_modules/@gsd/native/package.json +1 -1
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/package.json +0 -1
- package/dist/web/standalone/server.js +1 -1
- package/dist/web-mode.js +31 -3
- package/integrations/hermes/open_gsd_hermes/gsd_client.py +1 -1
- package/integrations/hermes/pyproject.toml +1 -1
- package/package.json +13 -10
- package/packages/cloud-mcp-gateway/package.json +2 -2
- package/packages/contracts/dist/workflow.d.ts +14 -0
- package/packages/contracts/dist/workflow.d.ts.map +1 -1
- package/packages/contracts/dist/workflow.js +16 -0
- package/packages/contracts/dist/workflow.js.map +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/daemon/dist/cloud-config.d.ts +1 -1
- package/packages/daemon/dist/cloud-config.d.ts.map +1 -1
- package/packages/daemon/dist/cloud-config.js +5 -1
- package/packages/daemon/dist/cloud-config.js.map +1 -1
- package/packages/daemon/dist/cloud-config.test.js +51 -1
- package/packages/daemon/dist/cloud-config.test.js.map +1 -1
- package/packages/daemon/dist/local-tool-executor.d.ts.map +1 -1
- package/packages/daemon/dist/local-tool-executor.js +2 -0
- package/packages/daemon/dist/local-tool-executor.js.map +1 -1
- package/packages/daemon/package.json +6 -6
- package/packages/gsd-agent-core/dist/compaction/compaction.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/compaction/compaction.js +36 -4
- package/packages/gsd-agent-core/dist/compaction/compaction.js.map +1 -1
- package/packages/gsd-agent-core/dist/sdk.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/sdk.js +1 -0
- package/packages/gsd-agent-core/dist/sdk.js.map +1 -1
- package/packages/gsd-agent-core/package.json +5 -5
- package/packages/gsd-agent-modes/package.json +7 -7
- package/packages/gsd-cloud/README.md +9 -3
- package/packages/gsd-cloud/dist/background-cli.test.d.ts +2 -0
- package/packages/gsd-cloud/dist/background-cli.test.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/background-cli.test.js +248 -0
- package/packages/gsd-cloud/dist/background-cli.test.js.map +1 -0
- package/packages/gsd-cloud/dist/cli.d.ts +5 -0
- package/packages/gsd-cloud/dist/cli.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/cli.js +266 -0
- package/packages/gsd-cloud/dist/cli.js.map +1 -0
- package/packages/gsd-cloud/dist/cloud-config.d.ts +19 -0
- package/packages/gsd-cloud/dist/cloud-config.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/cloud-config.js +237 -0
- package/packages/gsd-cloud/dist/cloud-config.js.map +1 -0
- package/packages/gsd-cloud/dist/cloud-config.test.d.ts +2 -0
- package/packages/gsd-cloud/dist/cloud-config.test.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/cloud-config.test.js +118 -0
- package/packages/gsd-cloud/dist/cloud-config.test.js.map +1 -0
- package/packages/gsd-cloud/dist/cloud-gateway-lookup.test.d.ts +2 -0
- package/packages/gsd-cloud/dist/cloud-gateway-lookup.test.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/cloud-gateway-lookup.test.js +37 -0
- package/packages/gsd-cloud/dist/cloud-gateway-lookup.test.js.map +1 -0
- package/packages/gsd-cloud/dist/cloud-runtime.d.ts +33 -0
- package/packages/gsd-cloud/dist/cloud-runtime.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/cloud-runtime.js +260 -0
- package/packages/gsd-cloud/dist/cloud-runtime.js.map +1 -0
- package/packages/gsd-cloud/dist/cloud-runtime.test.d.ts +2 -0
- package/packages/gsd-cloud/dist/cloud-runtime.test.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/cloud-runtime.test.js +88 -0
- package/packages/gsd-cloud/dist/cloud-runtime.test.js.map +1 -0
- package/packages/gsd-cloud/dist/cloud-token.d.ts +3 -0
- package/packages/gsd-cloud/dist/cloud-token.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/cloud-token.js +37 -0
- package/packages/gsd-cloud/dist/cloud-token.js.map +1 -0
- package/packages/gsd-cloud/dist/config.d.ts +17 -0
- package/packages/gsd-cloud/dist/config.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/config.js +146 -0
- package/packages/gsd-cloud/dist/config.js.map +1 -0
- package/packages/gsd-cloud/dist/device-flow.d.ts +24 -0
- package/packages/gsd-cloud/dist/device-flow.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/device-flow.js +128 -0
- package/packages/gsd-cloud/dist/device-flow.js.map +1 -0
- package/packages/gsd-cloud/dist/device-flow.test.d.ts +2 -0
- package/packages/gsd-cloud/dist/device-flow.test.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/device-flow.test.js +155 -0
- package/packages/gsd-cloud/dist/device-flow.test.js.map +1 -0
- package/packages/gsd-cloud/dist/executors/claude-executor.d.ts +6 -0
- package/packages/gsd-cloud/dist/executors/claude-executor.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/executors/claude-executor.js +15 -0
- package/packages/gsd-cloud/dist/executors/claude-executor.js.map +1 -0
- package/packages/gsd-cloud/dist/executors/codex-executor.d.ts +6 -0
- package/packages/gsd-cloud/dist/executors/codex-executor.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/executors/codex-executor.js +15 -0
- package/packages/gsd-cloud/dist/executors/codex-executor.js.map +1 -0
- package/packages/gsd-cloud/dist/executors/executor.d.ts +28 -0
- package/packages/gsd-cloud/dist/executors/executor.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/executors/executor.js +11 -0
- package/packages/gsd-cloud/dist/executors/executor.js.map +1 -0
- package/packages/gsd-cloud/dist/executors/gsd-pi-executor.d.ts +34 -0
- package/packages/gsd-cloud/dist/executors/gsd-pi-executor.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/executors/gsd-pi-executor.js +179 -0
- package/packages/gsd-cloud/dist/executors/gsd-pi-executor.js.map +1 -0
- package/packages/gsd-cloud/dist/executors/gsd-pi-executor.test.d.ts +2 -0
- package/packages/gsd-cloud/dist/executors/gsd-pi-executor.test.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/executors/gsd-pi-executor.test.js +44 -0
- package/packages/gsd-cloud/dist/executors/gsd-pi-executor.test.js.map +1 -0
- package/packages/gsd-cloud/dist/executors/index.d.ts +17 -0
- package/packages/gsd-cloud/dist/executors/index.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/executors/index.js +29 -0
- package/packages/gsd-cloud/dist/executors/index.js.map +1 -0
- package/packages/gsd-cloud/dist/executors/mcp-stdio-client.d.ts +36 -0
- package/packages/gsd-cloud/dist/executors/mcp-stdio-client.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/executors/mcp-stdio-client.js +176 -0
- package/packages/gsd-cloud/dist/executors/mcp-stdio-client.js.map +1 -0
- package/packages/gsd-cloud/dist/executors/mcp-stdio-client.test.d.ts +2 -0
- package/packages/gsd-cloud/dist/executors/mcp-stdio-client.test.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/executors/mcp-stdio-client.test.js +34 -0
- package/packages/gsd-cloud/dist/executors/mcp-stdio-client.test.js.map +1 -0
- package/packages/gsd-cloud/dist/index.d.ts +7 -0
- package/packages/gsd-cloud/dist/index.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/index.js +8 -0
- package/packages/gsd-cloud/dist/index.js.map +1 -0
- package/packages/gsd-cloud/dist/inject-gateway.d.ts +16 -0
- package/packages/gsd-cloud/dist/inject-gateway.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/inject-gateway.js +29 -0
- package/packages/gsd-cloud/dist/inject-gateway.js.map +1 -0
- package/packages/gsd-cloud/dist/inject-gateway.test.d.ts +2 -0
- package/packages/gsd-cloud/dist/inject-gateway.test.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/inject-gateway.test.js +41 -0
- package/packages/gsd-cloud/dist/inject-gateway.test.js.map +1 -0
- package/packages/gsd-cloud/dist/logger.d.ts +25 -0
- package/packages/gsd-cloud/dist/logger.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/logger.js +72 -0
- package/packages/gsd-cloud/dist/logger.js.map +1 -0
- package/packages/gsd-cloud/dist/runtime-process.d.ts +27 -0
- package/packages/gsd-cloud/dist/runtime-process.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/runtime-process.js +272 -0
- package/packages/gsd-cloud/dist/runtime-process.js.map +1 -0
- package/packages/gsd-cloud/dist/runtime-process.test.d.ts +2 -0
- package/packages/gsd-cloud/dist/runtime-process.test.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/runtime-process.test.js +97 -0
- package/packages/gsd-cloud/dist/runtime-process.test.js.map +1 -0
- package/packages/gsd-cloud/dist/types.d.ts +51 -0
- package/packages/gsd-cloud/dist/types.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/types.js +9 -0
- package/packages/gsd-cloud/dist/types.js.map +1 -0
- package/packages/gsd-cloud/package.json +3 -3
- package/packages/mcp-server/README.md +15 -2
- package/packages/mcp-server/dist/cli-runner.d.ts +3 -0
- package/packages/mcp-server/dist/cli-runner.d.ts.map +1 -1
- package/packages/mcp-server/dist/cli-runner.js +119 -33
- package/packages/mcp-server/dist/cli-runner.js.map +1 -1
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +5 -5
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts +4 -3
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +64 -2
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +4 -4
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/dist/agent.d.ts +5 -1
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent.js +2 -0
- package/packages/pi-agent-core/dist/agent.js.map +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +136 -0
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +124 -0
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.js +1 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +25 -1
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +103 -0
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-responses.js +1 -1
- package/packages/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/capability-patches.js +1 -1
- package/packages/pi-coding-agent/dist/core/capability-patches.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +11 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +8 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.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/GSD-WORKFLOW.md +18 -49
- package/src/resources/extensions/browser-tools/capture.ts +2 -86
- package/src/resources/extensions/browser-tools/screenshot-constraints.ts +94 -0
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +18 -1
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +108 -0
- package/src/resources/extensions/claude-code-cli/turn-assembler.ts +30 -2
- package/src/resources/extensions/gsd/artifact-verification.ts +3 -8
- package/src/resources/extensions/gsd/auto/loop.ts +48 -4
- package/src/resources/extensions/gsd/auto/run-unit.ts +20 -1
- package/src/resources/extensions/gsd/auto/unit-phase.ts +41 -5
- package/src/resources/extensions/gsd/auto-artifact-paths.ts +16 -9
- package/src/resources/extensions/gsd/auto-dispatch.ts +87 -19
- package/src/resources/extensions/gsd/auto-post-unit.ts +4 -0
- package/src/resources/extensions/gsd/auto-prompts.ts +156 -20
- package/src/resources/extensions/gsd/auto-recovery.ts +10 -8
- package/src/resources/extensions/gsd/auto-runtime-state.ts +12 -7
- package/src/resources/extensions/gsd/auto-start.ts +31 -8
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +56 -0
- package/src/resources/extensions/gsd/auto-worktree-cleanup.ts +4 -0
- package/src/resources/extensions/gsd/auto-worktree-sync.ts +10 -3
- package/src/resources/extensions/gsd/auto-worktree-teardown.ts +1 -1
- package/src/resources/extensions/gsd/auto.ts +25 -8
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +92 -4
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +41 -12
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +11 -3
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +87 -53
- package/src/resources/extensions/gsd/command-feedback.ts +19 -12
- package/src/resources/extensions/gsd/commands-verdict.ts +16 -9
- package/src/resources/extensions/gsd/compat/compat-marker.ts +119 -8
- package/src/resources/extensions/gsd/constants.ts +14 -13
- package/src/resources/extensions/gsd/context-masker.ts +98 -2
- package/src/resources/extensions/gsd/db/command-queue.ts +7 -1
- package/src/resources/extensions/gsd/db/engine.ts +58 -19
- package/src/resources/extensions/gsd/db/writers/cascades.ts +5 -1
- package/src/resources/extensions/gsd/db/writers/status.ts +25 -8
- package/src/resources/extensions/gsd/db-base-schema.ts +30 -0
- package/src/resources/extensions/gsd/db-migration-steps.ts +32 -0
- package/src/resources/extensions/gsd/db-schema-metadata.ts +4 -1
- package/src/resources/extensions/gsd/docs/preferences-reference.md +26 -4
- package/src/resources/extensions/gsd/doctor-engine-checks.ts +30 -7
- package/src/resources/extensions/gsd/error-classifier.ts +13 -2
- package/src/resources/extensions/gsd/exec-sandbox.ts +1 -0
- package/src/resources/extensions/gsd/flat-phase-migration.ts +174 -19
- package/src/resources/extensions/gsd/git-service.ts +19 -6
- package/src/resources/extensions/gsd/gsd-db.ts +340 -85
- package/src/resources/extensions/gsd/guided-flow.ts +50 -14
- package/src/resources/extensions/gsd/markdown-renderer.ts +28 -30
- package/src/resources/extensions/gsd/md-importer.ts +114 -16
- package/src/resources/extensions/gsd/migrate/command.ts +21 -227
- package/src/resources/extensions/gsd/migrate/execution.ts +136 -0
- package/src/resources/extensions/gsd/migrate/plan.ts +101 -0
- package/src/resources/extensions/gsd/migrate/planning-writer.ts +12 -20
- package/src/resources/extensions/gsd/migrate/presentation.ts +83 -0
- package/src/resources/extensions/gsd/model-cost-table.ts +2 -0
- package/src/resources/extensions/gsd/model-router.ts +12 -0
- package/src/resources/extensions/gsd/parallel-eligibility.ts +5 -4
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +37 -40
- package/src/resources/extensions/gsd/paths.ts +77 -16
- package/src/resources/extensions/gsd/phase-anchor.ts +8 -2
- package/src/resources/extensions/gsd/planning-subagent-policy.ts +58 -0
- package/src/resources/extensions/gsd/planning-subagent-registry.ts +31 -0
- package/src/resources/extensions/gsd/post-execution-checks.ts +4 -4
- package/src/resources/extensions/gsd/preferences-types.ts +16 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +62 -0
- package/src/resources/extensions/gsd/preferences.ts +25 -0
- package/src/resources/extensions/gsd/prompts/refine-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +5 -5
- package/src/resources/extensions/gsd/provider-payload-policy.ts +18 -4
- package/src/resources/extensions/gsd/safety/destructive-guard.ts +1 -1
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +28 -1
- package/src/resources/extensions/gsd/safety/evidence-cross-ref.ts +31 -5
- package/src/resources/extensions/gsd/skill-activation.ts +17 -3
- package/src/resources/extensions/gsd/state-reconciliation/drift/external-markdown-edit.ts +162 -15
- package/src/resources/extensions/gsd/state-reconciliation/drift/external-planning-edit.ts +20 -4
- package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +4 -2
- package/src/resources/extensions/gsd/state-reconciliation/types.ts +2 -2
- package/src/resources/extensions/gsd/stop-notice.ts +29 -1
- package/src/resources/extensions/gsd/sync-lock.ts +14 -6
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +5 -0
- package/src/resources/extensions/gsd/tests/auto-artifact-paths.test.ts +7 -7
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +264 -0
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/auto-start-index-lock.test.ts +21 -1
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +74 -1
- package/src/resources/extensions/gsd/tests/before-provider-context-management.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/closeout-git-deferral.test.ts +96 -1
- package/src/resources/extensions/gsd/tests/command-feedback.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/commands-verdict.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/compat-marker.test.ts +129 -0
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +362 -1
- package/src/resources/extensions/gsd/tests/context-masker.test.ts +204 -8
- package/src/resources/extensions/gsd/tests/db-engine-cjs-compat.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/db-engine-migrate-guards.test.ts +186 -0
- package/src/resources/extensions/gsd/tests/db-tools-alias-suppression.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/destructive-confirmation.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/destructive-guard.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/discuss-routing-fixes.test.ts +123 -0
- package/src/resources/extensions/gsd/tests/dispatch-missing-task-plans.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/dispatch-rule-coverage.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/doctor-scope-db-unavailable.test.ts +83 -0
- package/src/resources/extensions/gsd/tests/evidence-cross-ref.test.ts +81 -0
- package/src/resources/extensions/gsd/tests/evidence-xref-gsd-exec.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/external-edit-scoped-import.test.ts +262 -0
- package/src/resources/extensions/gsd/tests/external-markdown-edit.test.ts +38 -1
- package/src/resources/extensions/gsd/tests/flat-phase-migration.test.ts +201 -0
- package/src/resources/extensions/gsd/tests/flat-phase-validation-path.test.ts +20 -1
- package/src/resources/extensions/gsd/tests/gate-storage.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +57 -0
- package/src/resources/extensions/gsd/tests/guided-discuss-milestone-prompt-rendering.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/import-slice-milestone-completion-preserve.test.ts +116 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +13 -0
- package/src/resources/extensions/gsd/tests/integration/paths.test.ts +22 -4
- package/src/resources/extensions/gsd/tests/integration-branch-meta-location.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/markdown-renderer.test.ts +5 -5
- package/src/resources/extensions/gsd/tests/migrate-plan.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/migrate-presentation.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/migrate-safety-audit.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/milestone-leases.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/model-cost-table.test.ts +9 -1
- package/src/resources/extensions/gsd/tests/model-router.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/parallel-eligibility-file-overlap.test.ts +146 -0
- package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +7 -5
- package/src/resources/extensions/gsd/tests/phase-anchor.test.ts +32 -4
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +26 -23
- package/src/resources/extensions/gsd/tests/planning-writer.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +84 -0
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +4 -0
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +121 -1
- package/src/resources/extensions/gsd/tests/reactive-executor.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/reassess-handler.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/register-hooks-loop-guard-auto.test.ts +105 -0
- package/src/resources/extensions/gsd/tests/replan-task-handler.test.ts +103 -0
- package/src/resources/extensions/gsd/tests/rework-brief.test.ts +197 -0
- package/src/resources/extensions/gsd/tests/service-tier.test.ts +4 -0
- package/src/resources/extensions/gsd/tests/single-writer-v3-tool-surface.test.ts +33 -7
- package/src/resources/extensions/gsd/tests/skill-activation.test.ts +20 -16
- package/src/resources/extensions/gsd/tests/skip-slice-cascades-tasks.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +52 -0
- package/src/resources/extensions/gsd/tests/stop-notice.test.ts +38 -1
- package/src/resources/extensions/gsd/tests/sync-lock.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/system-context-message-routing.test.ts +13 -7
- package/src/resources/extensions/gsd/tests/terminated-transient.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/tool-naming.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +73 -0
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +93 -1
- package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/workflow-migration-gates.test.ts +139 -0
- package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/worktree-state-projection.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +60 -0
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +34 -0
- package/src/resources/extensions/gsd/tests/write-gate-seam.test.ts +52 -0
- package/src/resources/extensions/gsd/tools/complete-task.ts +140 -5
- package/src/resources/extensions/gsd/tools/plan-task.ts +14 -16
- package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +18 -17
- package/src/resources/extensions/gsd/tools/reopen-milestone.ts +24 -5
- package/src/resources/extensions/gsd/tools/reopen-slice.ts +25 -5
- package/src/resources/extensions/gsd/tools/reopen-task.ts +23 -9
- package/src/resources/extensions/gsd/tools/replan-task.ts +160 -0
- package/src/resources/extensions/gsd/tools/rework-brief.ts +91 -0
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +92 -0
- package/src/resources/extensions/gsd/types.ts +11 -0
- package/src/resources/extensions/gsd/unit-context-composer.ts +34 -8
- package/src/resources/extensions/gsd/unit-registry.ts +4 -0
- package/src/resources/extensions/gsd/uok/plan-v2.ts +20 -3
- package/src/resources/extensions/gsd/workflow-projections.ts +2 -3
- package/src/resources/extensions/gsd/workspace.ts +2 -1
- package/src/resources/extensions/gsd/worktree-state-projection.ts +33 -24
- package/src/resources/extensions/mac-tools/index.ts +52 -9
- package/src/resources/extensions/mac-tools/tests/mac-screenshot-payload.test.cjs +70 -0
- package/src/resources/extensions/shared/interview-ui.ts +47 -8
- package/src/resources/extensions/shared/tests/interview-ui-border.test.ts +29 -0
- package/dist/web/standalone/.next/static/chunks/app/_not-found/page-49f565245e1e4afe.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/page-bc4c723c6a19c6f0.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ec3eaffc9785ba48.js +0 -1
- package/dist/web/standalone/.next/static/css/18c2fdf261bfc1b7.css +0 -1
- /package/dist/web/standalone/.next/static/{UaXRrOYxBpG9QBINKhZkg → DXD9fZPnqtjZSlT5xdC3v}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{UaXRrOYxBpG9QBINKhZkg → DXD9fZPnqtjZSlT5xdC3v}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, unlinkSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import {
|
|
2
|
+
import { join, relative } from "node:path";
|
|
3
|
+
import { gsdProjectionRoot, gsdRoot, resolveMilestoneFile, resolveMilestonePath, targetMilestoneFile } from "../paths.js";
|
|
4
4
|
import { clearParseCache } from "../files.js";
|
|
5
5
|
import { isClosedStatus } from "../status-guards.js";
|
|
6
6
|
import { isNonEmptyString } from "../validation.js";
|
|
@@ -53,6 +53,14 @@ export interface ReassessRoadmapResult {
|
|
|
53
53
|
roadmapPath: string;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
function assessmentDbPathForRenderedFile(basePath: string, absPath: string): string {
|
|
57
|
+
const projectionRoot = gsdProjectionRoot(basePath);
|
|
58
|
+
const projectionRel = relative(projectionRoot, absPath);
|
|
59
|
+
const root = projectionRel && !projectionRel.startsWith("..") && !projectionRel.startsWith("/")
|
|
60
|
+
? projectionRoot
|
|
61
|
+
: gsdRoot(basePath);
|
|
62
|
+
return `.gsd/${relative(root, absPath).replace(/\\/g, "/")}`;
|
|
63
|
+
}
|
|
56
64
|
|
|
57
65
|
function validateParams(params: ReassessRoadmapParams): ReassessRoadmapParams {
|
|
58
66
|
if (!isNonEmptyString(params?.milestoneId)) throw new Error("milestoneId is required");
|
|
@@ -119,11 +127,6 @@ export async function handleReassessRoadmap(
|
|
|
119
127
|
return { error: `validation failed: ${(err as Error).message}` };
|
|
120
128
|
}
|
|
121
129
|
|
|
122
|
-
// ── Compute assessment artifact path ──────────────────────────────
|
|
123
|
-
// Assessment lives in the completed slice's directory.
|
|
124
|
-
// Use relSliceFile so the path is layout-aware (flat-phase or legacy).
|
|
125
|
-
const assessmentRelPath = relSliceFile(basePath, params.milestoneId, params.completedSliceId, "ASSESSMENT");
|
|
126
|
-
|
|
127
130
|
// ── Guards + DB writes inside a single transaction (prevents TOCTOU) ───
|
|
128
131
|
// Guards must be inside the transaction so the state they check cannot
|
|
129
132
|
// change between the read and the write (#2723).
|
|
@@ -207,16 +210,6 @@ export async function handleReassessRoadmap(
|
|
|
207
210
|
}
|
|
208
211
|
}
|
|
209
212
|
|
|
210
|
-
// Record assessment
|
|
211
|
-
insertAssessment({
|
|
212
|
-
path: assessmentRelPath,
|
|
213
|
-
milestoneId: params.milestoneId,
|
|
214
|
-
sliceId: params.completedSliceId,
|
|
215
|
-
status: params.verdict,
|
|
216
|
-
scope: "roadmap",
|
|
217
|
-
fullContent: params.assessment,
|
|
218
|
-
});
|
|
219
|
-
|
|
220
213
|
// Apply slice modifications
|
|
221
214
|
for (const mod of params.sliceChanges.modified) {
|
|
222
215
|
updateSliceFields(params.milestoneId, mod.sliceId, {
|
|
@@ -282,6 +275,14 @@ export async function handleReassessRoadmap(
|
|
|
282
275
|
assessment: params.assessment,
|
|
283
276
|
completedSliceId: params.completedSliceId,
|
|
284
277
|
});
|
|
278
|
+
insertAssessment({
|
|
279
|
+
path: assessmentDbPathForRenderedFile(basePath, assessmentResult.assessmentPath),
|
|
280
|
+
milestoneId: params.milestoneId,
|
|
281
|
+
sliceId: params.completedSliceId,
|
|
282
|
+
status: params.verdict,
|
|
283
|
+
scope: "roadmap",
|
|
284
|
+
fullContent: params.assessment,
|
|
285
|
+
});
|
|
285
286
|
|
|
286
287
|
// ── Remove stale VALIDATION file from disk (#2957) ────────────
|
|
287
288
|
const hasStructuralChanges =
|
|
@@ -22,7 +22,15 @@ import { logWarning } from "../workflow-logger.js";
|
|
|
22
22
|
import { debugLog } from "../debug-logger.js";
|
|
23
23
|
import { existsSync, unlinkSync } from "node:fs";
|
|
24
24
|
import { join } from "node:path";
|
|
25
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
buildFlatTaskFileName,
|
|
27
|
+
buildTaskFileName,
|
|
28
|
+
legacyMilestonesDir,
|
|
29
|
+
resolveMilestonePath,
|
|
30
|
+
resolveSlicePath,
|
|
31
|
+
resolveTasksDir,
|
|
32
|
+
clearPathCache,
|
|
33
|
+
} from "../paths.js";
|
|
26
34
|
|
|
27
35
|
export interface ReopenMilestoneParams {
|
|
28
36
|
milestoneId: string;
|
|
@@ -69,6 +77,10 @@ export async function handleReopenMilestone(
|
|
|
69
77
|
// auto-corrects entities back to "complete", making reopen a no-op (#3161).
|
|
70
78
|
try {
|
|
71
79
|
const milestoneDir = resolveMilestonePath(basePath, params.milestoneId);
|
|
80
|
+
const legacyBase = legacyMilestonesDir(basePath);
|
|
81
|
+
const isLegacy = !!milestoneDir && (
|
|
82
|
+
milestoneDir.startsWith(legacyBase + "/") || milestoneDir.startsWith(legacyBase + "\\")
|
|
83
|
+
);
|
|
72
84
|
if (milestoneDir) {
|
|
73
85
|
const milestoneSummary = join(milestoneDir, `${params.milestoneId}-SUMMARY.md`);
|
|
74
86
|
if (existsSync(milestoneSummary)) unlinkSync(milestoneSummary);
|
|
@@ -85,10 +97,17 @@ export async function handleReopenMilestone(
|
|
|
85
97
|
}
|
|
86
98
|
|
|
87
99
|
const tasksDir = resolveTasksDir(basePath, params.milestoneId, slice.id);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
100
|
+
const tasks = getSliceTasks(params.milestoneId, slice.id);
|
|
101
|
+
for (const task of tasks) {
|
|
102
|
+
const taskSummaries = isLegacy
|
|
103
|
+
? (tasksDir ? [join(tasksDir, buildTaskFileName(task.id, "SUMMARY"))] : [])
|
|
104
|
+
: milestoneDir
|
|
105
|
+
? [
|
|
106
|
+
join(milestoneDir, buildFlatTaskFileName(slice.id, task.id, "SUMMARY")),
|
|
107
|
+
join(milestoneDir, buildTaskFileName(task.id, "SUMMARY")),
|
|
108
|
+
]
|
|
109
|
+
: [];
|
|
110
|
+
for (const taskSummary of taskSummaries) {
|
|
92
111
|
if (existsSync(taskSummary)) unlinkSync(taskSummary);
|
|
93
112
|
}
|
|
94
113
|
}
|
|
@@ -27,7 +27,15 @@ import { appendEvent } from "../workflow-events.js";
|
|
|
27
27
|
import { logWarning } from "../workflow-logger.js";
|
|
28
28
|
import { existsSync, unlinkSync } from "node:fs";
|
|
29
29
|
import { join } from "node:path";
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
buildFlatTaskFileName,
|
|
32
|
+
buildTaskFileName,
|
|
33
|
+
legacyMilestonesDir,
|
|
34
|
+
resolveMilestonePath,
|
|
35
|
+
resolveTasksDir,
|
|
36
|
+
resolveSlicePath,
|
|
37
|
+
clearPathCache,
|
|
38
|
+
} from "../paths.js";
|
|
31
39
|
|
|
32
40
|
export interface ReopenSliceParams {
|
|
33
41
|
milestoneId: string;
|
|
@@ -80,11 +88,23 @@ export async function handleReopenSlice(
|
|
|
80
88
|
// Without this, the DB-filesystem reconciler sees SUMMARY.md files and
|
|
81
89
|
// auto-corrects tasks back to "complete", making reopen a no-op (#3161).
|
|
82
90
|
try {
|
|
91
|
+
const milestoneDir = resolveMilestonePath(basePath, params.milestoneId);
|
|
92
|
+
const legacyBase = legacyMilestonesDir(basePath);
|
|
93
|
+
const isLegacy = !!milestoneDir && (
|
|
94
|
+
milestoneDir.startsWith(legacyBase + "/") || milestoneDir.startsWith(legacyBase + "\\")
|
|
95
|
+
);
|
|
83
96
|
const tasksDir = resolveTasksDir(basePath, params.milestoneId, params.sliceId);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
97
|
+
const tasks = getSliceTasks(params.milestoneId, params.sliceId);
|
|
98
|
+
for (const task of tasks) {
|
|
99
|
+
const summaryPaths = isLegacy
|
|
100
|
+
? (tasksDir ? [join(tasksDir, buildTaskFileName(task.id, "SUMMARY"))] : [])
|
|
101
|
+
: milestoneDir
|
|
102
|
+
? [
|
|
103
|
+
join(milestoneDir, buildFlatTaskFileName(params.sliceId, task.id, "SUMMARY")),
|
|
104
|
+
join(milestoneDir, buildTaskFileName(task.id, "SUMMARY")),
|
|
105
|
+
]
|
|
106
|
+
: [];
|
|
107
|
+
for (const summaryPath of summaryPaths) {
|
|
88
108
|
if (existsSync(summaryPath)) unlinkSync(summaryPath);
|
|
89
109
|
}
|
|
90
110
|
}
|
|
@@ -25,8 +25,16 @@ import { appendEvent } from "../workflow-events.js";
|
|
|
25
25
|
import { logWarning } from "../workflow-logger.js";
|
|
26
26
|
import { writeReopenReason } from "../reopen-reason.js";
|
|
27
27
|
import { existsSync, unlinkSync } from "node:fs";
|
|
28
|
-
import { join
|
|
29
|
-
import {
|
|
28
|
+
import { join } from "node:path";
|
|
29
|
+
import {
|
|
30
|
+
buildFlatTaskFileName,
|
|
31
|
+
buildTaskFileName,
|
|
32
|
+
legacyMilestonesDir,
|
|
33
|
+
resolveMilestonePath,
|
|
34
|
+
resolveTasksDir,
|
|
35
|
+
resolveSlicePath,
|
|
36
|
+
clearPathCache,
|
|
37
|
+
} from "../paths.js";
|
|
30
38
|
|
|
31
39
|
export interface ReopenTaskParams {
|
|
32
40
|
milestoneId: string;
|
|
@@ -113,13 +121,19 @@ export async function handleReopenTask(
|
|
|
113
121
|
// summary cleanup into tasks/ (#1208).
|
|
114
122
|
try {
|
|
115
123
|
const slicePath = resolveSlicePath(basePath, params.milestoneId, params.sliceId);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
const milestonePath = resolveMilestonePath(basePath, params.milestoneId);
|
|
125
|
+
if (milestonePath) {
|
|
126
|
+
const legacyBase = legacyMilestonesDir(basePath);
|
|
127
|
+
const isLegacy = milestonePath.startsWith(legacyBase + "/") || milestonePath.startsWith(legacyBase + "\\");
|
|
128
|
+
const summaryPaths = isLegacy
|
|
129
|
+
? [join(resolveTasksDir(basePath, params.milestoneId, params.sliceId) ?? slicePath ?? join(milestonePath, "slices", params.sliceId, "tasks"), buildTaskFileName(params.taskId, "SUMMARY"))]
|
|
130
|
+
: [
|
|
131
|
+
join(milestonePath, buildFlatTaskFileName(params.sliceId, params.taskId, "SUMMARY")),
|
|
132
|
+
join(milestonePath, buildTaskFileName(params.taskId, "SUMMARY")),
|
|
133
|
+
];
|
|
134
|
+
for (const summaryPath of summaryPaths) {
|
|
135
|
+
if (existsSync(summaryPath)) unlinkSync(summaryPath);
|
|
136
|
+
}
|
|
123
137
|
}
|
|
124
138
|
} catch (cleanupErr) {
|
|
125
139
|
logWarning("tool", `reopen-task artifact cleanup warning: ${(cleanupErr as Error).message}`);
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { clearParseCache } from "../files.js";
|
|
2
|
+
import {
|
|
3
|
+
getSlice,
|
|
4
|
+
getTask,
|
|
5
|
+
insertReplanHistory,
|
|
6
|
+
transaction,
|
|
7
|
+
upsertTaskPlanning,
|
|
8
|
+
} from "../gsd-db.js";
|
|
9
|
+
import { invalidateStateCache } from "../state.js";
|
|
10
|
+
import { isClosedStatus } from "../status-guards.js";
|
|
11
|
+
import { isNonEmptyString, validateStringArray } from "../validation.js";
|
|
12
|
+
import { renderPlanFromDb, renderTaskPlanFromDb } from "../markdown-renderer.js";
|
|
13
|
+
import { resolveMilestonePath, resolveSlicePath } from "../paths.js";
|
|
14
|
+
import { flushWorkflowProjections } from "../projection-flush.js";
|
|
15
|
+
import { writeManifest } from "../workflow-manifest.js";
|
|
16
|
+
import { appendEvent } from "../workflow-events.js";
|
|
17
|
+
import { logWarning } from "../workflow-logger.js";
|
|
18
|
+
|
|
19
|
+
export interface ReplanTaskParams {
|
|
20
|
+
milestoneId: string;
|
|
21
|
+
sliceId: string;
|
|
22
|
+
taskId: string;
|
|
23
|
+
title: string;
|
|
24
|
+
description: string;
|
|
25
|
+
estimate: string;
|
|
26
|
+
files: string[];
|
|
27
|
+
verify: string;
|
|
28
|
+
inputs: string[];
|
|
29
|
+
expectedOutput: string[];
|
|
30
|
+
reworkBriefRef?: string;
|
|
31
|
+
fullPlanMd?: string;
|
|
32
|
+
actorName?: string;
|
|
33
|
+
triggerReason?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ReplanTaskResult {
|
|
37
|
+
milestoneId: string;
|
|
38
|
+
sliceId: string;
|
|
39
|
+
taskId: string;
|
|
40
|
+
taskPlanPath: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function validateParams(params: ReplanTaskParams): ReplanTaskParams {
|
|
44
|
+
if (!isNonEmptyString(params?.milestoneId)) throw new Error("milestoneId is required");
|
|
45
|
+
if (!isNonEmptyString(params?.sliceId)) throw new Error("sliceId is required");
|
|
46
|
+
if (!isNonEmptyString(params?.taskId)) throw new Error("taskId is required");
|
|
47
|
+
if (!isNonEmptyString(params?.title)) throw new Error("title is required");
|
|
48
|
+
if (!isNonEmptyString(params?.description)) throw new Error("description is required");
|
|
49
|
+
if (!isNonEmptyString(params?.estimate)) throw new Error("estimate is required");
|
|
50
|
+
if (!isNonEmptyString(params?.verify)) throw new Error("verify is required");
|
|
51
|
+
return {
|
|
52
|
+
...params,
|
|
53
|
+
files: validateStringArray(params.files, "files"),
|
|
54
|
+
inputs: validateStringArray(params.inputs, "inputs"),
|
|
55
|
+
expectedOutput: validateStringArray(params.expectedOutput, "expectedOutput"),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function replanSummary(params: ReplanTaskParams): string {
|
|
60
|
+
const ref = params.reworkBriefRef?.trim();
|
|
61
|
+
return ref
|
|
62
|
+
? `Task ${params.taskId} replanned from rework brief ${ref}`
|
|
63
|
+
: `Task ${params.taskId} replanned`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export async function handleReplanTask(
|
|
67
|
+
rawParams: ReplanTaskParams,
|
|
68
|
+
basePath: string,
|
|
69
|
+
): Promise<ReplanTaskResult | { error: string }> {
|
|
70
|
+
let params: ReplanTaskParams;
|
|
71
|
+
try {
|
|
72
|
+
params = validateParams(rawParams);
|
|
73
|
+
} catch (err) {
|
|
74
|
+
return { error: `validation failed: ${(err as Error).message}` };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let guardError: string | null = null;
|
|
78
|
+
try {
|
|
79
|
+
transaction(() => {
|
|
80
|
+
const parentSlice = getSlice(params.milestoneId, params.sliceId);
|
|
81
|
+
if (!parentSlice) {
|
|
82
|
+
guardError = `missing parent slice: ${params.milestoneId}/${params.sliceId}`;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (isClosedStatus(parentSlice.status)) {
|
|
86
|
+
guardError = `cannot replan a task in a closed slice: ${params.sliceId} (status: ${parentSlice.status})`;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const task = getTask(params.milestoneId, params.sliceId, params.taskId);
|
|
91
|
+
if (!task) {
|
|
92
|
+
guardError = `task not found: ${params.milestoneId}/${params.sliceId}/${params.taskId}`;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (isClosedStatus(task.status)) {
|
|
96
|
+
guardError = `cannot replan completed task ${params.taskId} — use gsd_task_reopen first`;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
upsertTaskPlanning(params.milestoneId, params.sliceId, params.taskId, {
|
|
101
|
+
title: params.title,
|
|
102
|
+
description: params.description,
|
|
103
|
+
estimate: params.estimate,
|
|
104
|
+
files: params.files,
|
|
105
|
+
verify: params.verify,
|
|
106
|
+
inputs: params.inputs,
|
|
107
|
+
expectedOutput: params.expectedOutput,
|
|
108
|
+
fullPlanMd: params.fullPlanMd,
|
|
109
|
+
});
|
|
110
|
+
insertReplanHistory({
|
|
111
|
+
milestoneId: params.milestoneId,
|
|
112
|
+
sliceId: params.sliceId,
|
|
113
|
+
taskId: params.taskId,
|
|
114
|
+
summary: replanSummary(params),
|
|
115
|
+
previousArtifactPath: params.reworkBriefRef ?? null,
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
} catch (err) {
|
|
119
|
+
return { error: `db write failed: ${(err as Error).message}` };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (guardError) return { error: guardError };
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
const milestonePath = resolveMilestonePath(basePath, params.milestoneId);
|
|
126
|
+
const slicePath = resolveSlicePath(basePath, params.milestoneId, params.sliceId);
|
|
127
|
+
const isLegacySliceLayout = Boolean(milestonePath && slicePath && slicePath !== milestonePath);
|
|
128
|
+
const renderResult = isLegacySliceLayout
|
|
129
|
+
? await renderTaskPlanFromDb(basePath, params.milestoneId, params.sliceId, params.taskId)
|
|
130
|
+
: await renderPlanFromDb(basePath, params.milestoneId, params.sliceId);
|
|
131
|
+
const taskPlanPath = "taskPlanPath" in renderResult ? renderResult.taskPlanPath : renderResult.planPath;
|
|
132
|
+
|
|
133
|
+
invalidateStateCache();
|
|
134
|
+
clearParseCache();
|
|
135
|
+
|
|
136
|
+
try {
|
|
137
|
+
await flushWorkflowProjections(basePath, { milestoneId: params.milestoneId });
|
|
138
|
+
writeManifest(basePath);
|
|
139
|
+
appendEvent(basePath, {
|
|
140
|
+
cmd: "replan-task",
|
|
141
|
+
params: { milestoneId: params.milestoneId, sliceId: params.sliceId, taskId: params.taskId },
|
|
142
|
+
ts: new Date().toISOString(),
|
|
143
|
+
actor: "agent",
|
|
144
|
+
actor_name: params.actorName,
|
|
145
|
+
trigger_reason: params.triggerReason,
|
|
146
|
+
});
|
|
147
|
+
} catch (hookErr) {
|
|
148
|
+
logWarning("tool", `replan-task post-mutation hook warning: ${(hookErr as Error).message}`);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return {
|
|
152
|
+
milestoneId: params.milestoneId,
|
|
153
|
+
sliceId: params.sliceId,
|
|
154
|
+
taskId: params.taskId,
|
|
155
|
+
taskPlanPath,
|
|
156
|
+
};
|
|
157
|
+
} catch (err) {
|
|
158
|
+
return { error: `render failed: ${(err as Error).message}` };
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { saveReworkBrief, type ReworkBriefFindingInput } from "../gsd-db.js";
|
|
2
|
+
import { isNonEmptyString, validateStringArray } from "../validation.js";
|
|
3
|
+
|
|
4
|
+
export interface ReworkBriefSaveParams {
|
|
5
|
+
briefId?: string;
|
|
6
|
+
milestoneId: string;
|
|
7
|
+
sliceId: string;
|
|
8
|
+
taskId: string;
|
|
9
|
+
findings: ReworkBriefFindingInput[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ReworkBriefSaveResult {
|
|
13
|
+
briefId: string;
|
|
14
|
+
milestoneId: string;
|
|
15
|
+
sliceId: string;
|
|
16
|
+
taskId: string;
|
|
17
|
+
findingCount: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function validateFinding(finding: ReworkBriefFindingInput, index: number): ReworkBriefFindingInput {
|
|
21
|
+
if (!isNonEmptyString(finding?.findingId)) throw new Error(`findings[${index}].findingId is required`);
|
|
22
|
+
if (finding.severity !== "blocking" && finding.severity !== "advisory") {
|
|
23
|
+
throw new Error(`findings[${index}].severity must be blocking or advisory`);
|
|
24
|
+
}
|
|
25
|
+
if (!isNonEmptyString(finding.description)) throw new Error(`findings[${index}].description is required`);
|
|
26
|
+
if (!isNonEmptyString(finding.requiredFix)) throw new Error(`findings[${index}].requiredFix is required`);
|
|
27
|
+
|
|
28
|
+
const status = finding.status ?? "pending";
|
|
29
|
+
if (status !== "pending" && status !== "resolved" && status !== "deferred-with-override") {
|
|
30
|
+
throw new Error(`findings[${index}].status must be pending, resolved, or deferred-with-override`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// A blocking finding is only enforced by gsd_task_complete while it is
|
|
34
|
+
// `pending` (getUnresolvedBlockingReworkFindingsForTask returns pending rows
|
|
35
|
+
// only). Persisting a blocking finding as resolved/deferred-with-override
|
|
36
|
+
// at save time therefore bypasses the completion gate entirely, so require
|
|
37
|
+
// the same justification a reworkResolution would (evidence for `resolved`,
|
|
38
|
+
// evidence + decisionRef for `deferred-with-override`). Advisory findings do
|
|
39
|
+
// not gate completion, so their status is left as-is.
|
|
40
|
+
if (finding.severity === "blocking" && status !== "pending") {
|
|
41
|
+
if (!isNonEmptyString(finding.evidence)) {
|
|
42
|
+
throw new Error(`findings[${index}].evidence is required when a blocking finding is saved as ${status}`);
|
|
43
|
+
}
|
|
44
|
+
if (status === "deferred-with-override" && !isNonEmptyString(finding.decisionRef)) {
|
|
45
|
+
throw new Error(`findings[${index}].decisionRef is required when a blocking finding is saved as deferred-with-override`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
...finding,
|
|
51
|
+
verificationCommands: validateStringArray(finding.verificationCommands, `findings[${index}].verificationCommands`),
|
|
52
|
+
status,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function validateParams(params: ReworkBriefSaveParams): ReworkBriefSaveParams {
|
|
57
|
+
if (!isNonEmptyString(params?.milestoneId)) throw new Error("milestoneId is required");
|
|
58
|
+
if (!isNonEmptyString(params?.sliceId)) throw new Error("sliceId is required");
|
|
59
|
+
if (!isNonEmptyString(params?.taskId)) throw new Error("taskId is required");
|
|
60
|
+
if (!Array.isArray(params.findings) || params.findings.length === 0) {
|
|
61
|
+
throw new Error("findings must be a non-empty array");
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
...params,
|
|
65
|
+
findings: params.findings.map(validateFinding),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export async function handleReworkBriefSave(
|
|
70
|
+
rawParams: ReworkBriefSaveParams,
|
|
71
|
+
): Promise<ReworkBriefSaveResult | { error: string }> {
|
|
72
|
+
let params: ReworkBriefSaveParams;
|
|
73
|
+
try {
|
|
74
|
+
params = validateParams(rawParams);
|
|
75
|
+
} catch (err) {
|
|
76
|
+
return { error: `validation failed: ${(err as Error).message}` };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
const { briefId } = saveReworkBrief(params);
|
|
81
|
+
return {
|
|
82
|
+
briefId,
|
|
83
|
+
milestoneId: params.milestoneId,
|
|
84
|
+
sliceId: params.sliceId,
|
|
85
|
+
taskId: params.taskId,
|
|
86
|
+
findingCount: params.findings.length,
|
|
87
|
+
};
|
|
88
|
+
} catch (err) {
|
|
89
|
+
return { error: `db write failed: ${(err as Error).message}` };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -37,6 +37,10 @@ import type { PlanSliceParams } from "./plan-slice.js";
|
|
|
37
37
|
import { handlePlanSlice } from "./plan-slice.js";
|
|
38
38
|
import type { ReplanSliceParams } from "./replan-slice.js";
|
|
39
39
|
import { handleReplanSlice } from "./replan-slice.js";
|
|
40
|
+
import type { ReplanTaskParams } from "./replan-task.js";
|
|
41
|
+
import { handleReplanTask } from "./replan-task.js";
|
|
42
|
+
import type { ReworkBriefSaveParams } from "./rework-brief.js";
|
|
43
|
+
import { handleReworkBriefSave } from "./rework-brief.js";
|
|
40
44
|
import type { ReopenMilestoneParams } from "./reopen-milestone.js";
|
|
41
45
|
import { handleReopenMilestone } from "./reopen-milestone.js";
|
|
42
46
|
import type { ReopenSliceParams } from "./reopen-slice.js";
|
|
@@ -696,6 +700,8 @@ export type SliceCompleteExecutorParams = CompleteSliceParams;
|
|
|
696
700
|
export type PlanMilestoneExecutorParams = PlanMilestoneParams;
|
|
697
701
|
export type PlanSliceExecutorParams = PlanSliceParams;
|
|
698
702
|
export type ReplanSliceExecutorParams = ReplanSliceParams;
|
|
703
|
+
export type ReplanTaskExecutorParams = ReplanTaskParams;
|
|
704
|
+
export type ReworkBriefSaveExecutorParams = ReworkBriefSaveParams;
|
|
699
705
|
export type ReopenTaskExecutorParams = ReopenTaskParams;
|
|
700
706
|
export type ReopenSliceExecutorParams = ReopenSliceParams;
|
|
701
707
|
export type ReopenMilestoneExecutorParams = ReopenMilestoneParams;
|
|
@@ -1490,6 +1496,92 @@ export async function executePlanSlice(
|
|
|
1490
1496
|
}
|
|
1491
1497
|
}
|
|
1492
1498
|
|
|
1499
|
+
|
|
1500
|
+
export async function executeReplanTask(
|
|
1501
|
+
params: ReplanTaskExecutorParams,
|
|
1502
|
+
basePath: string = process.cwd(),
|
|
1503
|
+
): Promise<ToolExecutionResult> {
|
|
1504
|
+
const dbAvailable = await ensureDbOpen(basePath);
|
|
1505
|
+
if (!dbAvailable) {
|
|
1506
|
+
return {
|
|
1507
|
+
content: [{ type: "text", text: "Error: GSD database is not available. Cannot replan task." }],
|
|
1508
|
+
details: { operation: "replan_task", error: "db_unavailable" },
|
|
1509
|
+
isError: true,
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
try {
|
|
1513
|
+
const result = await handleReplanTask(params, basePath);
|
|
1514
|
+
if ("error" in result) {
|
|
1515
|
+
return {
|
|
1516
|
+
content: [{ type: "text", text: `Error replanning task: ${result.error}` }],
|
|
1517
|
+
details: { operation: "replan_task", error: result.error },
|
|
1518
|
+
isError: true,
|
|
1519
|
+
};
|
|
1520
|
+
}
|
|
1521
|
+
return {
|
|
1522
|
+
content: [{ type: "text", text: `Replanned task ${result.taskId} (${result.sliceId}/${result.milestoneId})` }],
|
|
1523
|
+
details: {
|
|
1524
|
+
operation: "replan_task",
|
|
1525
|
+
milestoneId: result.milestoneId,
|
|
1526
|
+
sliceId: result.sliceId,
|
|
1527
|
+
taskId: result.taskId,
|
|
1528
|
+
taskPlanPath: result.taskPlanPath,
|
|
1529
|
+
},
|
|
1530
|
+
};
|
|
1531
|
+
} catch (err) {
|
|
1532
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1533
|
+
logError("tool", `replan_task tool failed: ${msg}`, { tool: "gsd_replan_task", error: String(err) });
|
|
1534
|
+
return {
|
|
1535
|
+
content: [{ type: "text", text: `Error replanning task: ${msg}` }],
|
|
1536
|
+
details: { operation: "replan_task", error: msg },
|
|
1537
|
+
isError: true,
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
export async function executeReworkBriefSave(
|
|
1543
|
+
params: ReworkBriefSaveExecutorParams,
|
|
1544
|
+
basePath: string = process.cwd(),
|
|
1545
|
+
): Promise<ToolExecutionResult> {
|
|
1546
|
+
const dbAvailable = await ensureDbOpen(basePath);
|
|
1547
|
+
if (!dbAvailable) {
|
|
1548
|
+
return {
|
|
1549
|
+
content: [{ type: "text", text: "Error: GSD database is not available. Cannot save rework brief." }],
|
|
1550
|
+
details: { operation: "rework_brief_save", error: "db_unavailable" },
|
|
1551
|
+
isError: true,
|
|
1552
|
+
};
|
|
1553
|
+
}
|
|
1554
|
+
try {
|
|
1555
|
+
const result = await handleReworkBriefSave(params);
|
|
1556
|
+
if ("error" in result) {
|
|
1557
|
+
return {
|
|
1558
|
+
content: [{ type: "text", text: `Error saving rework brief: ${result.error}` }],
|
|
1559
|
+
details: { operation: "rework_brief_save", error: result.error },
|
|
1560
|
+
isError: true,
|
|
1561
|
+
};
|
|
1562
|
+
}
|
|
1563
|
+
return {
|
|
1564
|
+
content: [{ type: "text", text: `Saved rework brief ${result.briefId} with ${result.findingCount} finding(s)` }],
|
|
1565
|
+
details: {
|
|
1566
|
+
operation: "rework_brief_save",
|
|
1567
|
+
briefId: result.briefId,
|
|
1568
|
+
milestoneId: result.milestoneId,
|
|
1569
|
+
sliceId: result.sliceId,
|
|
1570
|
+
taskId: result.taskId,
|
|
1571
|
+
findingCount: result.findingCount,
|
|
1572
|
+
},
|
|
1573
|
+
};
|
|
1574
|
+
} catch (err) {
|
|
1575
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1576
|
+
logError("tool", `rework_brief_save tool failed: ${msg}`, { tool: "gsd_rework_brief_save", error: String(err) });
|
|
1577
|
+
return {
|
|
1578
|
+
content: [{ type: "text", text: `Error saving rework brief: ${msg}` }],
|
|
1579
|
+
details: { operation: "rework_brief_save", error: msg },
|
|
1580
|
+
isError: true,
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1493
1585
|
export async function executeReplanSlice(
|
|
1494
1586
|
params: ReplanSliceExecutorParams,
|
|
1495
1587
|
basePath: string = process.cwd(),
|
|
@@ -695,6 +695,17 @@ export interface CompleteTaskParams {
|
|
|
695
695
|
verdict: string;
|
|
696
696
|
durationMs: number;
|
|
697
697
|
}>;
|
|
698
|
+
/**
|
|
699
|
+
* Resolution evidence for structured rework findings linked to this task.
|
|
700
|
+
* All blocking findings must be resolved before completion is accepted.
|
|
701
|
+
* @optional
|
|
702
|
+
*/
|
|
703
|
+
reworkResolution?: Array<{
|
|
704
|
+
findingId: string;
|
|
705
|
+
status: "resolved" | "deferred-with-override";
|
|
706
|
+
evidence: string;
|
|
707
|
+
decisionRef?: string;
|
|
708
|
+
}>;
|
|
698
709
|
/**
|
|
699
710
|
* Q5 failure-modes section content (what breaks when dependencies fail).
|
|
700
711
|
* Populated → `pass`; omitted/empty → `omitted`.
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
type ToolsPolicy,
|
|
47
47
|
type UnitContextManifest,
|
|
48
48
|
} from "./unit-context-manifest.js";
|
|
49
|
+
import { resolveEffectivePlanningToolsPolicy } from "./planning-subagent-policy.js";
|
|
49
50
|
import { getUnitToolSurfaceContract } from "./unit-tool-contracts.js";
|
|
50
51
|
import type { UnitPromptContextContract } from "./tool-contract.js";
|
|
51
52
|
|
|
@@ -207,6 +208,7 @@ export function composeContextModeInstructions(
|
|
|
207
208
|
|
|
208
209
|
export interface ComposeToolSurfaceInstructionOptions {
|
|
209
210
|
readonly renderMode: ContextModeRenderMode;
|
|
211
|
+
readonly basePath?: string;
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
const TOOL_SURFACE_GUIDANCE_BY_UNIT: Record<string, string> = {
|
|
@@ -226,16 +228,39 @@ const TOOL_SURFACE_GUIDANCE_BY_UNIT: Record<string, string> = {
|
|
|
226
228
|
"Persist completion only through `gsd_complete_milestone` after verification passes. Do not query `.gsd/gsd.db` directly. Do not write `.gsd/PROJECT.md` or `.gsd/REQUIREMENTS.md` by hand — use `gsd_summary_save` and `gsd_requirement_update`.",
|
|
227
229
|
"replan-slice":
|
|
228
230
|
"Persist replans through `gsd_replan_slice` only. Do not edit `PLAN.md` or task plans directly.",
|
|
229
|
-
"plan-slice":
|
|
230
|
-
"Persist planning through `gsd_plan_slice` only. Dispatch subagents only to **scout** or **planner** for reconnaissance — not implementation agents. Do not edit user source files outside `.gsd/**`.",
|
|
231
|
-
"refine-slice":
|
|
232
|
-
"Persist refinements through `gsd_plan_slice` only. Dispatch subagents only to **scout** or **planner**. Do not edit user source files outside `.gsd/**`.",
|
|
233
|
-
"plan-milestone":
|
|
234
|
-
"Persist milestone planning through `gsd_plan_milestone` / `gsd_plan_slice`. Do not edit user source files outside `.gsd/**`.",
|
|
235
231
|
"research-slice":
|
|
236
232
|
"Dispatch subagents only to **scout** or **planner** for reconnaissance. Do not edit user source files outside `.gsd/**`.",
|
|
237
233
|
};
|
|
238
234
|
|
|
235
|
+
function formatAllowedAgents(agents: readonly string[]): string {
|
|
236
|
+
return agents.map((agent) => `**${agent}**`).join(", ");
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function guidanceForUnitToolsPolicy(unitType: string, policy: ToolsPolicy): string | undefined {
|
|
240
|
+
if (unitType === "plan-slice") {
|
|
241
|
+
const dispatch = policy.mode === "planning-dispatch"
|
|
242
|
+
? ` Dispatch subagents only to ${formatAllowedAgents(policy.allowedSubagents)} for reconnaissance — not implementation agents.`
|
|
243
|
+
: " Do not dispatch subagents.";
|
|
244
|
+
return `Persist planning through \`gsd_plan_slice\` only.${dispatch} Do not edit user source files outside \`.gsd/**\`.`;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (unitType === "refine-slice") {
|
|
248
|
+
const dispatch = policy.mode === "planning-dispatch"
|
|
249
|
+
? ` Dispatch subagents only to ${formatAllowedAgents(policy.allowedSubagents)}.`
|
|
250
|
+
: " Do not dispatch subagents.";
|
|
251
|
+
return `Persist refinements through \`gsd_plan_slice\` only.${dispatch} Do not edit user source files outside \`.gsd/**\`.`;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (unitType === "plan-milestone") {
|
|
255
|
+
const dispatch = policy.mode === "planning-dispatch"
|
|
256
|
+
? ` Dispatch subagents only to ${formatAllowedAgents(policy.allowedSubagents)}.`
|
|
257
|
+
: "";
|
|
258
|
+
return `Persist milestone planning through \`gsd_plan_milestone\` / \`gsd_plan_slice\`.${dispatch} Do not edit user source files outside \`.gsd/**\`.`;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return undefined;
|
|
262
|
+
}
|
|
263
|
+
|
|
239
264
|
function guidanceForToolsPolicy(policy: ToolsPolicy): string | null {
|
|
240
265
|
switch (policy.mode) {
|
|
241
266
|
case "planning":
|
|
@@ -280,8 +305,9 @@ export function composeToolSurfaceInstructions(
|
|
|
280
305
|
const manifest = resolveManifest(unitType);
|
|
281
306
|
if (!manifest) return "";
|
|
282
307
|
|
|
283
|
-
const
|
|
284
|
-
const
|
|
308
|
+
const effectiveTools = resolveEffectivePlanningToolsPolicy(unitType, manifest.tools, opts.basePath) ?? manifest.tools;
|
|
309
|
+
const unitGuidance = guidanceForUnitToolsPolicy(unitType, effectiveTools) ?? TOOL_SURFACE_GUIDANCE_BY_UNIT[unitType];
|
|
310
|
+
const policyGuidance = unitGuidance ? null : guidanceForToolsPolicy(effectiveTools);
|
|
285
311
|
const forbiddenLine = formatForbiddenWorkflowToolsLine(unitType, unitGuidance);
|
|
286
312
|
const parts = [unitGuidance, policyGuidance, forbiddenLine].filter(
|
|
287
313
|
(part): part is string => typeof part === "string" && part.length > 0,
|