@opengsd/gsd-pi 1.8.1 → 1.9.0-dev.5c1a3ff2
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 +25 -2
- 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-artifact-paths.js +16 -10
- package/dist/resources/extensions/gsd/auto-dispatch.js +74 -19
- package/dist/resources/extensions/gsd/auto-post-unit.js +4 -0
- package/dist/resources/extensions/gsd/auto-prompts.js +125 -18
- package/dist/resources/extensions/gsd/auto-recovery.js +10 -5
- package/dist/resources/extensions/gsd/auto-worktree-cleanup.js +4 -0
- package/dist/resources/extensions/gsd/auto-worktree-teardown.js +1 -1
- package/dist/resources/extensions/gsd/auto.js +5 -1
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +80 -4
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +31 -5
- 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/compat/compat-marker.js +19 -2
- 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 +51 -16
- 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 +3 -6
- package/dist/resources/extensions/gsd/flat-phase-migration.js +156 -21
- package/dist/resources/extensions/gsd/git-service.js +19 -7
- package/dist/resources/extensions/gsd/gsd-db.js +187 -45
- package/dist/resources/extensions/gsd/guided-flow.js +38 -13
- package/dist/resources/extensions/gsd/markdown-renderer.js +17 -13
- 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 +55 -11
- 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/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 +27 -13
- package/dist/resources/extensions/gsd/state-reconciliation/drift/external-planning-edit.js +13 -3
- package/dist/resources/extensions/gsd/stop-notice.js +15 -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 +6 -0
- package/dist/resources/extensions/mac-tools/index.js +31 -9
- 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 +8 -8
- 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 +8 -8
- package/dist/web/standalone/.next/server/chunks/2842.js +4 -4
- 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 +12 -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/dist/cli.d.ts +5 -0
- package/packages/gsd-cloud/dist/cli.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/cli.js +160 -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 +231 -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 +35 -0
- package/packages/gsd-cloud/dist/cloud-runtime.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/cloud-runtime.js +258 -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/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/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 +119 -0
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +107 -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-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-artifact-paths.ts +16 -9
- package/src/resources/extensions/gsd/auto-dispatch.ts +86 -19
- package/src/resources/extensions/gsd/auto-post-unit.ts +4 -0
- package/src/resources/extensions/gsd/auto-prompts.ts +142 -16
- package/src/resources/extensions/gsd/auto-recovery.ts +10 -8
- package/src/resources/extensions/gsd/auto-worktree-cleanup.ts +4 -0
- package/src/resources/extensions/gsd/auto-worktree-teardown.ts +1 -1
- package/src/resources/extensions/gsd/auto.ts +5 -1
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +92 -4
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +39 -10
- 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/compat/compat-marker.ts +21 -4
- 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 +53 -17
- 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 +3 -5
- package/src/resources/extensions/gsd/flat-phase-migration.ts +160 -19
- package/src/resources/extensions/gsd/git-service.ts +19 -6
- package/src/resources/extensions/gsd/gsd-db.ts +255 -52
- package/src/resources/extensions/gsd/guided-flow.ts +48 -12
- package/src/resources/extensions/gsd/markdown-renderer.ts +25 -21
- 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 +62 -11
- 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/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 +30 -13
- package/src/resources/extensions/gsd/state-reconciliation/drift/external-planning-edit.ts +16 -3
- package/src/resources/extensions/gsd/state-reconciliation/types.ts +2 -2
- package/src/resources/extensions/gsd/stop-notice.ts +18 -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-recovery.test.ts +39 -0
- 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/compat-marker.test.ts +104 -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-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/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/external-edit-scoped-import.test.ts +262 -0
- package/src/resources/extensions/gsd/tests/flat-phase-migration.test.ts +202 -0
- package/src/resources/extensions/gsd/tests/gate-storage.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +25 -0
- package/src/resources/extensions/gsd/tests/import-slice-milestone-completion-preserve.test.ts +116 -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 +66 -0
- 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/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/stop-notice.test.ts +17 -0
- 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/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/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/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 +12 -0
- 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/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 → 6YWV7VAPg-jqjfPswrKZb}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{UaXRrOYxBpG9QBINKhZkg → 6YWV7VAPg-jqjfPswrKZb}/_ssgManifest.js +0 -0
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
import { loadFile, parseContinue, parseSummary, loadActiveOverrides, formatOverridesSection } from "./files.js";
|
|
11
11
|
import { extractVerdict } from "./verdict-parser.js";
|
|
12
12
|
import { loadPrompt, inlineTemplate } from "./prompt-loader.js";
|
|
13
|
-
import { resolveMilestoneFile, resolveSliceFile, resolveSlicePath, resolveTasksDir, resolveTaskFiles, resolveTaskFile, relMilestoneFile, relSliceFile, relSlicePath, relMilestonePath, relTaskFile, resolveGsdRootFile, relGsdRootFile, resolveRuntimeFile, } from "./paths.js";
|
|
13
|
+
import { resolveMilestoneFile, resolveSliceFile, resolveSlicePath, resolveTasksDir, resolveTaskFiles, resolveTaskFile, taskIdFromTaskFileName, relMilestoneFile, relSliceFile, relSlicePath, relMilestonePath, relTaskFile, resolveGsdRootFile, relGsdRootFile, resolveRuntimeFile, } from "./paths.js";
|
|
14
14
|
import { resolveInlineLevel, loadEffectiveGSDPreferences } from "./preferences.js";
|
|
15
15
|
import { createRepositoryRegistryFromPreferences } from "./repository-registry.js";
|
|
16
16
|
import { isContextModeEnabled } from "./preferences-types.js";
|
|
17
17
|
import { parseRoadmap } from "./parsers-legacy.js";
|
|
18
|
-
import { join, relative, sep } from "node:path";
|
|
18
|
+
import { join, basename, relative, sep } from "node:path";
|
|
19
19
|
import { existsSync } from "node:fs";
|
|
20
20
|
import { computeBudgets, resolveExecutorContextWindow, truncateAtSectionBoundary } from "./context-budget.js";
|
|
21
|
-
import { getGateResults, getPendingGatesForTurn } from "./gsd-db.js";
|
|
21
|
+
import { getBlockingReworkFindingsForTask, getGateResults, getPendingGatesForTurn } from "./gsd-db.js";
|
|
22
22
|
import { assertGateCoverage, getGatesForTurn, } from "./gate-registry.js";
|
|
23
23
|
import { formatDecisionsCompact, formatRequirementsCompact } from "./structured-data-formatter.js";
|
|
24
24
|
import { readPhaseAnchor, formatAnchorForPrompt } from "./phase-anchor.js";
|
|
@@ -62,13 +62,29 @@ function resolvePromptBudgets() {
|
|
|
62
62
|
const prefs = loadEffectiveGSDPreferences();
|
|
63
63
|
const sessionWindow = prefs?.preferences.context_window_override;
|
|
64
64
|
const windowTokens = resolveExecutorContextWindow(undefined, prefs?.preferences, sessionWindow);
|
|
65
|
-
return computeBudgets(windowTokens);
|
|
65
|
+
return computeBudgets(windowTokens, resolveExecutionProvider(prefs?.preferences));
|
|
66
66
|
}
|
|
67
67
|
catch (e) {
|
|
68
68
|
logWarning("prompt", `resolvePromptBudgets failed: ${e.message}`);
|
|
69
69
|
return computeBudgets(200_000);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Best-effort provider for the chars/token ratio: the executor's configured
|
|
74
|
+
* model profile is the only provider source reachable here (the runtime
|
|
75
|
+
* `sessionProvider` that reaches `formatExecutorConstraints` isn't threaded to
|
|
76
|
+
* `capPreamble`/summary callers). Undefined when no explicit provider is set —
|
|
77
|
+
* `computeBudgets` then uses the 4.0 default, i.e. today's behavior.
|
|
78
|
+
*/
|
|
79
|
+
function resolveExecutionProvider(prefs) {
|
|
80
|
+
const exec = prefs?.models?.execution;
|
|
81
|
+
if (exec && typeof exec === "object" && "provider" in exec) {
|
|
82
|
+
const provider = exec.provider;
|
|
83
|
+
if (typeof provider === "string" && provider)
|
|
84
|
+
return provider;
|
|
85
|
+
}
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
72
88
|
/**
|
|
73
89
|
* Character budget for dependency/prior slice summaries injected into dispatch
|
|
74
90
|
* prompts. Scales with the executor's configured context window (issue #4435).
|
|
@@ -76,6 +92,32 @@ function resolvePromptBudgets() {
|
|
|
76
92
|
function resolveSummaryBudgetChars() {
|
|
77
93
|
return resolvePromptBudgets().summaryBudgetChars;
|
|
78
94
|
}
|
|
95
|
+
function renderBlockingReworkFindingsBlock(mid, sid, tid) {
|
|
96
|
+
const findings = getBlockingReworkFindingsForTask(mid, sid, tid)
|
|
97
|
+
.filter((finding) => finding.status === "pending");
|
|
98
|
+
if (findings.length === 0)
|
|
99
|
+
return "";
|
|
100
|
+
const lines = [
|
|
101
|
+
"## Blocking Rework Findings (non-optional)",
|
|
102
|
+
"",
|
|
103
|
+
"This task has structured blocking rework findings. Address every finding before calling `gsd_task_complete`. Include `reworkResolution` entries with each `findingId`, `status: \"resolved\"`, and concrete evidence. If deferring a finding, use `status: \"deferred-with-override\"` with concrete evidence and `decisionRef`.",
|
|
104
|
+
"",
|
|
105
|
+
];
|
|
106
|
+
for (const finding of findings) {
|
|
107
|
+
lines.push(`### ${finding.finding_id} (${finding.severity})`);
|
|
108
|
+
lines.push(`- Status: ${finding.status}`);
|
|
109
|
+
lines.push(`- Finding: ${finding.description}`);
|
|
110
|
+
lines.push(`- Required fix: ${finding.required_fix}`);
|
|
111
|
+
if (finding.verification_commands.length > 0) {
|
|
112
|
+
lines.push("- Required verification:");
|
|
113
|
+
for (const command of finding.verification_commands) {
|
|
114
|
+
lines.push(` - \`${command}\``);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
lines.push("");
|
|
118
|
+
}
|
|
119
|
+
return lines.join("\n").trim();
|
|
120
|
+
}
|
|
79
121
|
function formatProjectClassificationForPlanning(classification) {
|
|
80
122
|
const sampleFiles = classification.contentFiles.slice(0, 8);
|
|
81
123
|
const sample = sampleFiles.length > 0 ? sampleFiles.map((file) => `\`${file}\``).join(", ") : "(none)";
|
|
@@ -174,7 +216,7 @@ function formatCloseoutReviewInstructions(validationContent, validationRel, curr
|
|
|
174
216
|
`No passing validation artifact was found at \`${validationRel}\`. Use the full closeout review path before completion.`,
|
|
175
217
|
].join("\n");
|
|
176
218
|
}
|
|
177
|
-
function capPreamble(preamble) {
|
|
219
|
+
export function capPreamble(preamble) {
|
|
178
220
|
// Cap inlined context at min(static ceiling, scaled inline budget).
|
|
179
221
|
// The ceiling bounds repeated auto prompt payloads; the scaled
|
|
180
222
|
// budget tightens the cap for small-window users whose true safe limit is
|
|
@@ -184,6 +226,35 @@ function capPreamble(preamble) {
|
|
|
184
226
|
return preamble;
|
|
185
227
|
return truncateAtSectionBoundary(preamble, budget).content;
|
|
186
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* Cap the execute-task inline blocks against one shared budget in priority
|
|
231
|
+
* order. Unlike `capPreamble` (single concatenated preamble), execute-task
|
|
232
|
+
* feeds these blocks into separate, non-contiguous template placeholders, so
|
|
233
|
+
* they can't be joined and re-split — the budget is spent block-by-block.
|
|
234
|
+
*
|
|
235
|
+
* The task plan is the authoritative execution contract: it is never truncated
|
|
236
|
+
* here (it consumes budget first, whole). Remaining budget flows to the slice
|
|
237
|
+
* excerpt, then templates, each truncated at section boundaries so the lowest-
|
|
238
|
+
* priority context drops whole trailing sections first. When the task plan
|
|
239
|
+
* alone meets or exceeds the budget, the trailing blocks are dropped rather
|
|
240
|
+
* than the task plan being cut.
|
|
241
|
+
*/
|
|
242
|
+
function capExecuteTaskInlineBlocks(taskPlan, slicePlan, templates, budgetChars) {
|
|
243
|
+
let remaining = budgetChars - taskPlan.length;
|
|
244
|
+
if (remaining <= 0) {
|
|
245
|
+
return { taskPlan, slicePlan: "", templates: "" };
|
|
246
|
+
}
|
|
247
|
+
const cappedSlice = slicePlan.length <= remaining
|
|
248
|
+
? slicePlan
|
|
249
|
+
: truncateAtSectionBoundary(slicePlan, remaining).content;
|
|
250
|
+
remaining -= cappedSlice.length;
|
|
251
|
+
const cappedTemplates = remaining <= 0
|
|
252
|
+
? ""
|
|
253
|
+
: templates.length <= remaining
|
|
254
|
+
? templates
|
|
255
|
+
: truncateAtSectionBoundary(templates, remaining).content;
|
|
256
|
+
return { taskPlan, slicePlan: cappedSlice, templates: cappedTemplates };
|
|
257
|
+
}
|
|
187
258
|
function trackPromptContext(entries, key, mode, body, reason) {
|
|
188
259
|
entries.push({
|
|
189
260
|
key,
|
|
@@ -227,7 +298,7 @@ function renderContextModeBlockForPrompt(unitType, base, renderMode = "standalon
|
|
|
227
298
|
return `${contextMode}\n\n## Context Snapshot\nSource: \`.gsd/last-snapshot.md\`\n\n${snapshot.trimEnd()}`;
|
|
228
299
|
}
|
|
229
300
|
function prependContextModeToBlock(unitType, base, block, renderMode = "standalone") {
|
|
230
|
-
const toolSurface = composeToolSurfaceInstructions(unitType, { renderMode });
|
|
301
|
+
const toolSurface = composeToolSurfaceInstructions(unitType, { renderMode, basePath: base });
|
|
231
302
|
const contextMode = renderContextModeBlockForPrompt(unitType, base, renderMode);
|
|
232
303
|
const guidance = [toolSurface, contextMode].filter(Boolean).join("\n\n");
|
|
233
304
|
if (!guidance)
|
|
@@ -284,7 +355,7 @@ function formatExecutorConstraints(sessionContextWindow, modelRegistry, sessionP
|
|
|
284
355
|
// so DEFAULT_CONTEXT_WINDOW stays the single source of truth.
|
|
285
356
|
windowTokens = resolveExecutorContextWindow(undefined, undefined, sessionContextWindow, sessionProvider);
|
|
286
357
|
}
|
|
287
|
-
const budgets = computeBudgets(windowTokens);
|
|
358
|
+
const budgets = computeBudgets(windowTokens, sessionProvider);
|
|
288
359
|
const { min, max } = budgets.taskCountRange;
|
|
289
360
|
const execWindowK = Math.round(windowTokens / 1000);
|
|
290
361
|
const perTaskBudgetK = Math.round(budgets.inlineContextBudgetChars / 1000);
|
|
@@ -1219,6 +1290,13 @@ function resolveTaskSummariesLocation(base, mid, sid) {
|
|
|
1219
1290
|
return { dir: tDir, relPrefix: `${sRel}/tasks` };
|
|
1220
1291
|
return { dir: slicePath, relPrefix: sRel };
|
|
1221
1292
|
}
|
|
1293
|
+
function summaryFileBelongsToSlice(fileName, base, mid, sid) {
|
|
1294
|
+
const tid = taskIdFromTaskFileName(fileName, "SUMMARY");
|
|
1295
|
+
if (!tid)
|
|
1296
|
+
return false;
|
|
1297
|
+
const resolved = resolveTaskFile(base, mid, sid, tid, "SUMMARY");
|
|
1298
|
+
return resolved !== null && basename(resolved) === fileName;
|
|
1299
|
+
}
|
|
1222
1300
|
export async function getPriorTaskSummaryPaths(mid, sid, currentTid, base) {
|
|
1223
1301
|
const loc = resolveTaskSummariesLocation(base, mid, sid);
|
|
1224
1302
|
if (!loc)
|
|
@@ -1227,7 +1305,12 @@ export async function getPriorTaskSummaryPaths(mid, sid, currentTid, base) {
|
|
|
1227
1305
|
const currentNum = parseInt(currentTid.replace(/^T/, ""), 10);
|
|
1228
1306
|
return summaryFiles
|
|
1229
1307
|
.filter(f => {
|
|
1230
|
-
|
|
1308
|
+
if (!summaryFileBelongsToSlice(f, base, mid, sid))
|
|
1309
|
+
return false;
|
|
1310
|
+
const tid = taskIdFromTaskFileName(f, "SUMMARY");
|
|
1311
|
+
if (!tid)
|
|
1312
|
+
return false;
|
|
1313
|
+
const num = parseInt(tid.replace(/^T/, ""), 10);
|
|
1231
1314
|
return num < currentNum;
|
|
1232
1315
|
})
|
|
1233
1316
|
.map(f => `${loc.relPrefix}/${f}`);
|
|
@@ -1254,8 +1337,11 @@ export async function getDependencyTaskSummaryPaths(mid, sid, currentTid, depend
|
|
|
1254
1337
|
const depSet = new Set(dependsOn.map((d) => d.toUpperCase()));
|
|
1255
1338
|
return summaryFiles
|
|
1256
1339
|
.filter((f) => {
|
|
1257
|
-
|
|
1258
|
-
|
|
1340
|
+
if (!summaryFileBelongsToSlice(f, base, mid, sid))
|
|
1341
|
+
return false;
|
|
1342
|
+
const tid = taskIdFromTaskFileName(f, "SUMMARY");
|
|
1343
|
+
if (!tid)
|
|
1344
|
+
return false;
|
|
1259
1345
|
return depSet.has(tid);
|
|
1260
1346
|
})
|
|
1261
1347
|
.map((f) => `${loc.relPrefix}/${f}`);
|
|
@@ -2281,7 +2367,7 @@ export async function buildExecuteTaskPrompt(mid, sid, sTitle, tid, tTitle, base
|
|
|
2281
2367
|
// Compute verification budget for the executor's context window (issue #707)
|
|
2282
2368
|
const prefs = loadEffectiveGSDPreferences();
|
|
2283
2369
|
const contextWindow = resolveExecutorContextWindow(opts.modelRegistry, prefs?.preferences, opts.sessionContextWindow, opts.sessionProvider);
|
|
2284
|
-
const budgets = computeBudgets(contextWindow);
|
|
2370
|
+
const budgets = computeBudgets(contextWindow, opts.sessionProvider);
|
|
2285
2371
|
const verificationBudget = `~${Math.round(budgets.verificationBudgetChars / 1000)}K chars`;
|
|
2286
2372
|
// Truncate carry-forward section when it exceeds 40% of inline context budget.
|
|
2287
2373
|
const carryForwardBudget = Math.floor(budgets.inlineContextBudgetChars * 0.4);
|
|
@@ -2319,6 +2405,14 @@ export async function buildExecuteTaskPrompt(mid, sid, sTitle, tid, tTitle, base
|
|
|
2319
2405
|
catch (reopenErr) {
|
|
2320
2406
|
logWarning("prompt", `reopen reason injection failed: ${reopenErr.message}`);
|
|
2321
2407
|
}
|
|
2408
|
+
const reworkFindingsBlock = renderBlockingReworkFindingsBlock(mid, sid, tid);
|
|
2409
|
+
if (reworkFindingsBlock) {
|
|
2410
|
+
const block = reworkFindingsBlock + "\n\n---\n\n";
|
|
2411
|
+
phaseAnchorSection = phaseAnchorSection
|
|
2412
|
+
? `${block}${phaseAnchorSection}`
|
|
2413
|
+
: block;
|
|
2414
|
+
trackPromptContext(contextTelemetry, "rework-findings", "inline", reworkFindingsBlock);
|
|
2415
|
+
}
|
|
2322
2416
|
// ADR-011 Phase 2: inject any resolved-but-unapplied escalation override
|
|
2323
2417
|
// into this task's prompt. Claim is atomic via DB UPDATE WHERE IS NULL, so
|
|
2324
2418
|
// if a parallel build already injected it, we skip. Feature-gated by
|
|
@@ -2375,10 +2469,19 @@ export async function buildExecuteTaskPrompt(mid, sid, sTitle, tid, tTitle, base
|
|
|
2375
2469
|
}
|
|
2376
2470
|
},
|
|
2377
2471
|
});
|
|
2378
|
-
const
|
|
2379
|
-
const
|
|
2472
|
+
const rawTaskPlanInline = requireComposedArtifactBlock(contractedContext.blocks, "execute-task", "task-plan");
|
|
2473
|
+
const rawSlicePlanExcerpt = requireComposedArtifactBlock(contractedContext.blocks, "execute-task", "slice-plan");
|
|
2380
2474
|
const contractedCarryForward = requireComposedArtifactBlock(contractedContext.blocks, "execute-task", "prior-task-summaries");
|
|
2381
|
-
const
|
|
2475
|
+
const rawContractedTemplates = requireComposedArtifactBlock(contractedContext.blocks, "execute-task", "templates");
|
|
2476
|
+
// Cap the static inline blocks against one shared budget so a small-window
|
|
2477
|
+
// executor can't overflow (the sibling builders cap via `capPreamble`;
|
|
2478
|
+
// execute-task's blocks feed separate template slots, so they share a budget
|
|
2479
|
+
// block-by-block). Carry-forward already has its own truncation above.
|
|
2480
|
+
const inlineBudget = Math.min(MAX_PREAMBLE_CHARS, budgets.inlineContextBudgetChars);
|
|
2481
|
+
const { taskPlan: taskPlanInline, slicePlan: slicePlanExcerpt, templates: contractedTemplates } = capExecuteTaskInlineBlocks(rawTaskPlanInline, rawSlicePlanExcerpt, rawContractedTemplates, inlineBudget);
|
|
2482
|
+
const inlineDropped = (rawTaskPlanInline.length + rawSlicePlanExcerpt.length + rawContractedTemplates.length)
|
|
2483
|
+
- (taskPlanInline.length + slicePlanExcerpt.length + contractedTemplates.length);
|
|
2484
|
+
trackPromptContext(contextTelemetry, "inline-cap", inlineDropped > 0 ? "excerpt" : "skipped", null, inlineDropped > 0 ? `dropped ${inlineDropped} chars (budget ${inlineBudget})` : "within budget");
|
|
2382
2485
|
const onDemandResult = renderExecuteTaskOnDemandContext(base, mid, sid, contractedContext.onDemand);
|
|
2383
2486
|
const onDemandContext = onDemandResult.text;
|
|
2384
2487
|
trackPromptContext(contextTelemetry, "slice-research", onDemandContext ? "on-demand" : "skipped", onDemandContext, onDemandContext ? undefined : onDemandResult.skipReason ?? undefined);
|
|
@@ -2463,12 +2566,14 @@ export async function buildCompleteSlicePrompt(mid, midTitle, sid, sTitle, base,
|
|
|
2463
2566
|
trackPromptContext(contextTelemetry, "prior-task-summaries", "skipped", null, "missing tasks dir");
|
|
2464
2567
|
return null;
|
|
2465
2568
|
}
|
|
2466
|
-
const summaryFiles = resolveTaskFiles(loc.dir, "SUMMARY")
|
|
2569
|
+
const summaryFiles = resolveTaskFiles(loc.dir, "SUMMARY")
|
|
2570
|
+
.filter((file) => summaryFileBelongsToSlice(file, base, mid, sid))
|
|
2571
|
+
.sort();
|
|
2467
2572
|
const blocks = [];
|
|
2468
2573
|
for (const file of summaryFiles) {
|
|
2469
2574
|
const absPath = join(loc.dir, file);
|
|
2470
2575
|
const relPath = `${loc.relPrefix}/${file}`;
|
|
2471
|
-
const taskId = file.replace(/-SUMMARY\.md$/i, "");
|
|
2576
|
+
const taskId = taskIdFromTaskFileName(file, "SUMMARY") ?? file.replace(/-SUMMARY\.md$/i, "");
|
|
2472
2577
|
blocks.push(await buildTaskSummaryExcerpt(absPath, relPath, taskId));
|
|
2473
2578
|
}
|
|
2474
2579
|
const body = blocks.length > 0 ? blocks.join("\n\n---\n\n") : null;
|
|
@@ -3038,7 +3143,9 @@ export async function buildReplanSlicePrompt(mid, midTitle, sid, sTitle, base) {
|
|
|
3038
3143
|
let blockerTaskId = "";
|
|
3039
3144
|
const summaryLoc = resolveTaskSummariesLocation(base, mid, sid);
|
|
3040
3145
|
if (summaryLoc) {
|
|
3041
|
-
const summaryFiles = resolveTaskFiles(summaryLoc.dir, "SUMMARY")
|
|
3146
|
+
const summaryFiles = resolveTaskFiles(summaryLoc.dir, "SUMMARY")
|
|
3147
|
+
.filter((file) => summaryFileBelongsToSlice(file, base, mid, sid))
|
|
3148
|
+
.sort();
|
|
3042
3149
|
for (const file of summaryFiles) {
|
|
3043
3150
|
const absPath = join(summaryLoc.dir, file);
|
|
3044
3151
|
const content = await loadFile(absPath);
|
|
@@ -3047,7 +3154,7 @@ export async function buildReplanSlicePrompt(mid, midTitle, sid, sTitle, base) {
|
|
|
3047
3154
|
const summary = parseSummary(content);
|
|
3048
3155
|
const relPath = `${summaryLoc.relPrefix}/${file}`;
|
|
3049
3156
|
if (summary.frontmatter.blocker_discovered) {
|
|
3050
|
-
blockerTaskId = summary.frontmatter.id || file.replace(/-SUMMARY\.md$/i, "");
|
|
3157
|
+
blockerTaskId = summary.frontmatter.id || taskIdFromTaskFileName(file, "SUMMARY") || file.replace(/-SUMMARY\.md$/i, "");
|
|
3051
3158
|
inlined.push(await buildTaskSummaryExcerpt(absPath, relPath, blockerTaskId, { blocker: true }));
|
|
3052
3159
|
}
|
|
3053
3160
|
}
|
|
@@ -17,7 +17,7 @@ import { refreshWorkflowDatabaseFromDisk } from "./db-workspace.js";
|
|
|
17
17
|
import { getErrorMessage } from "./error-utils.js";
|
|
18
18
|
import { logWarning } from "./workflow-logger.js";
|
|
19
19
|
import { isClosedStatus, isInactiveStatus } from "./status-guards.js";
|
|
20
|
-
import { resolveSlicePath,
|
|
20
|
+
import { resolveSlicePath, resolveTaskFile, relMilestoneFile, relSliceFile, clearPathCache, } from "./paths.js";
|
|
21
21
|
import { existsSync, mkdirSync, readFileSync, writeFileSync, } from "node:fs";
|
|
22
22
|
import { dirname } from "node:path";
|
|
23
23
|
import { resolveExpectedArtifactPath, diagnoseExpectedArtifact, } from "./auto-artifact-paths.js";
|
|
@@ -227,10 +227,15 @@ export function writeReactiveExecuteBlocker(unitId, base, reason) {
|
|
|
227
227
|
const slicePath = resolveSlicePath(base, mid, sid);
|
|
228
228
|
if (!slicePath)
|
|
229
229
|
return null;
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const
|
|
230
|
+
// Resolve each batch task's SUMMARY with slice-qualified paths so flat-phase
|
|
231
|
+
// slices that reuse a task id (e.g. two T03s in one phase) don't collide: a
|
|
232
|
+
// sibling slice's summary must never make this slice's task look complete.
|
|
233
|
+
const hasSummary = (tid) => {
|
|
234
|
+
const summaryPath = resolveTaskFile(base, mid, sid, tid, "SUMMARY");
|
|
235
|
+
return summaryPath !== null && existsSync(summaryPath);
|
|
236
|
+
};
|
|
237
|
+
const summaryPresent = batchIds.filter((tid) => hasSummary(tid));
|
|
238
|
+
const summaryMissing = batchIds.filter((tid) => !hasSummary(tid));
|
|
234
239
|
const completedTaskIds = [];
|
|
235
240
|
const skippedTaskIds = [];
|
|
236
241
|
const unchangedTaskIds = [];
|
|
@@ -8,6 +8,7 @@ import { execFileSync } from "node:child_process";
|
|
|
8
8
|
import { existsSync, realpathSync, unlinkSync } from "node:fs";
|
|
9
9
|
import { isAbsolute, join, relative } from "node:path";
|
|
10
10
|
import { gsdRoot } from "./paths.js";
|
|
11
|
+
import { milestoneMetaPath } from "./git-service.js";
|
|
11
12
|
import { logWarning } from "./workflow-logger.js";
|
|
12
13
|
function isSamePath(a, b) {
|
|
13
14
|
try {
|
|
@@ -73,6 +74,9 @@ export function clearProjectRootStateFiles(basePath, milestoneId) {
|
|
|
73
74
|
// worth removing on teardown.
|
|
74
75
|
const transientFiles = [
|
|
75
76
|
join(gsdDir, "STATE.md"),
|
|
77
|
+
// Integration-branch META now lives flat at .gsd/<MID>-META.json (ADR-045).
|
|
78
|
+
milestoneMetaPath(basePath, milestoneId),
|
|
79
|
+
// Legacy location — still cleaned for pre-migration trees.
|
|
76
80
|
join(gsdDir, "milestones", milestoneId, `${milestoneId}-META.json`),
|
|
77
81
|
];
|
|
78
82
|
for (const file of transientFiles) {
|
|
@@ -45,7 +45,7 @@ export function teardownAutoWorktree(originalBasePath, milestoneId, opts = {}) {
|
|
|
45
45
|
throw new GSDError(GSD_IO_ERROR, `Failed to chdir back to ${originalBasePath} during teardown: ${err instanceof Error ? err.message : String(err)}`);
|
|
46
46
|
}
|
|
47
47
|
// Mirror cleanup steps from mergeMilestoneToMain abort path:
|
|
48
|
-
// 1. Remove transient state files (STATE.md, auto.lock, {MID}-META.json).
|
|
48
|
+
// 1. Remove transient state files (STATE.md, auto.lock, .gsd/{MID}-META.json).
|
|
49
49
|
// Non-fatal — must not block teardown.
|
|
50
50
|
try {
|
|
51
51
|
clearProjectRootStateFiles(originalBasePath, milestoneId);
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* next unit type, creates a fresh session, and injects a focused prompt
|
|
12
12
|
* telling the LLM which files to read and what to do.
|
|
13
13
|
*/
|
|
14
|
-
import { deriveState } from "./state.js";
|
|
14
|
+
import { deriveState, invalidateStateCache } from "./state.js";
|
|
15
15
|
import { buildRequirementsBacklogSummaryLines, countUnmappedActiveRequirements, getUnmappedActiveRequirements, } from "./requirements-backlog.js";
|
|
16
16
|
import { parseUnitId } from "./unit-id.js";
|
|
17
17
|
import { assessInterruptedSession, readPausedSessionMetadata, PAUSED_SESSION_KV_KEY, } from "./interrupted-session.js";
|
|
@@ -214,6 +214,9 @@ function captureMilestoneLockEnv(milestoneId) {
|
|
|
214
214
|
else {
|
|
215
215
|
delete process.env.GSD_MILESTONE_LOCK;
|
|
216
216
|
}
|
|
217
|
+
// The derive cache is keyed on basePath only; GSD_MILESTONE_LOCK changes
|
|
218
|
+
// what deriveState computes, so a lock flip must not serve a cached result.
|
|
219
|
+
invalidateStateCache();
|
|
217
220
|
}
|
|
218
221
|
function restoreMilestoneLockEnv() {
|
|
219
222
|
if (!s.milestoneLockEnvCaptured)
|
|
@@ -227,6 +230,7 @@ function restoreMilestoneLockEnv() {
|
|
|
227
230
|
s.previousMilestoneLockEnv = null;
|
|
228
231
|
s.hadMilestoneLockEnv = false;
|
|
229
232
|
s.milestoneLockEnvCaptured = false;
|
|
233
|
+
invalidateStateCache();
|
|
230
234
|
}
|
|
231
235
|
/**
|
|
232
236
|
* Rebuild s.scope from the current s.basePath / s.originalBasePath / s.currentMilestoneId.
|
|
@@ -46,6 +46,8 @@ function registerAlias(pi, toolDef, aliasName, canonicalName) {
|
|
|
46
46
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- toolDef shape matches ToolDefinition but varies by schema
|
|
47
47
|
function registerWorkflowTool(pi, toolDef) {
|
|
48
48
|
pi.registerTool(toolDef);
|
|
49
|
+
if (process.env.GSD_ADVERTISE_TOOL_ALIASES !== "1")
|
|
50
|
+
return; // canonical-only model surface (see plan 035)
|
|
49
51
|
for (const alias of aliasesForWorkflowTool(toolDef.name)) {
|
|
50
52
|
registerAlias(pi, toolDef, alias, toolDef.name);
|
|
51
53
|
}
|
|
@@ -731,12 +733,12 @@ export function registerDbTools(pi) {
|
|
|
731
733
|
const planTaskTool = {
|
|
732
734
|
name: "gsd_plan_task",
|
|
733
735
|
label: "Plan Task",
|
|
734
|
-
description: "Write task planning state to the GSD database, render
|
|
735
|
-
promptSnippet: "Plan a task via DB write +
|
|
736
|
+
description: "Write task planning state to the GSD database, render the slice PLAN from DB, and clear caches after a successful render.",
|
|
737
|
+
promptSnippet: "Plan a task via DB write + slice PLAN render + cache invalidation",
|
|
736
738
|
promptGuidelines: [
|
|
737
|
-
"Use gsd_plan_task for task planning instead of writing
|
|
739
|
+
"Use gsd_plan_task for task planning instead of writing task PLAN files directly.",
|
|
738
740
|
"Keep parameters flat and provide the full task planning payload.",
|
|
739
|
-
"The tool validates input, requires an existing parent slice, writes task planning data, renders the
|
|
741
|
+
"The tool validates input, requires an existing parent slice, writes task planning data, renders the slice PLAN file from DB, and clears both state and parse caches after success.",
|
|
740
742
|
"Use the canonical name gsd_plan_task; gsd_task_plan is only an alias.",
|
|
741
743
|
],
|
|
742
744
|
parameters: Type.Object({
|
|
@@ -812,6 +814,12 @@ export function registerDbTools(pi) {
|
|
|
812
814
|
verdict: Type.String({ description: "Pass/fail verdict (e.g. '✅ pass', '❌ fail')" }),
|
|
813
815
|
durationMs: Type.Number({ description: "Duration of the command in milliseconds" }),
|
|
814
816
|
}), { description: "Array of verification evidence entries (structured objects only)" })),
|
|
817
|
+
reworkResolution: Type.Optional(Type.Array(Type.Object({
|
|
818
|
+
findingId: Type.String({ description: "Rework finding ID being resolved (e.g. F1)" }),
|
|
819
|
+
status: StringEnum(["resolved", "deferred-with-override"], { description: "Resolution status for this finding" }),
|
|
820
|
+
evidence: Type.String({ description: "Concrete evidence that the required fix was completed" }),
|
|
821
|
+
decisionRef: Type.Optional(Type.String({ description: "Decision reference required for deferred-with-override findings" })),
|
|
822
|
+
}), { description: "Resolution evidence for structured rework findings linked to this task" })),
|
|
815
823
|
// Single-writer v3 audit trail (Stream 2): caller-provided actor identity + causation.
|
|
816
824
|
actorName: Type.Optional(Type.String({ description: "Caller-provided actor identity for the audit trail (e.g. 'executor-01', 'gsd-orchestrator')" })),
|
|
817
825
|
triggerReason: Type.Optional(Type.String({ description: "Caller-provided reason this action was triggered (e.g. 'task verified after retry')" })),
|
|
@@ -1084,6 +1092,74 @@ export function registerDbTools(pi) {
|
|
|
1084
1092
|
execute: replanSliceExecute,
|
|
1085
1093
|
};
|
|
1086
1094
|
registerWorkflowTool(pi, replanSliceTool);
|
|
1095
|
+
// ─── gsd_replan_task ───────────────────────────────────────────────────
|
|
1096
|
+
const replanTaskExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
1097
|
+
const { executeReplanTask } = await loadWorkflowExecutors();
|
|
1098
|
+
return executeReplanTask(params, resolveWorkflowToolBasePath(_ctx, params));
|
|
1099
|
+
};
|
|
1100
|
+
const replanTaskTool = {
|
|
1101
|
+
name: "gsd_replan_task",
|
|
1102
|
+
label: "Replan Task",
|
|
1103
|
+
description: "Update one pending task's planning contract after rework without touching sibling tasks. " +
|
|
1104
|
+
"Completed tasks are structurally protected. Re-renders the task/slice PLAN projection and records replan history.",
|
|
1105
|
+
promptSnippet: "Replan one pending GSD task after rework",
|
|
1106
|
+
promptGuidelines: [
|
|
1107
|
+
"Use gsd_replan_task when a reopened pending task needs its title, description, files, verify, inputs, or expectedOutput updated for rework.",
|
|
1108
|
+
"The task must already exist and be pending; completed tasks are rejected.",
|
|
1109
|
+
"Set reworkBriefRef when a structured rework brief triggered the task replan.",
|
|
1110
|
+
],
|
|
1111
|
+
parameters: Type.Object({
|
|
1112
|
+
milestoneId: Type.String({ description: "Milestone ID (e.g. M001)" }),
|
|
1113
|
+
sliceId: Type.String({ description: "Slice ID (e.g. S01)" }),
|
|
1114
|
+
taskId: Type.String({ description: "Task ID (e.g. T01)" }),
|
|
1115
|
+
title: Type.String({ description: "Updated task title" }),
|
|
1116
|
+
description: Type.String({ description: "Updated task description incorporating rework scope" }),
|
|
1117
|
+
estimate: Type.String({ description: "Updated task estimate string" }),
|
|
1118
|
+
files: Type.Array(Type.String(), { description: "Updated files likely touched" }),
|
|
1119
|
+
verify: Type.String({ description: "Updated verification command or block" }),
|
|
1120
|
+
inputs: Type.Array(Type.String(), { description: "Updated input files or references" }),
|
|
1121
|
+
expectedOutput: Type.Array(Type.String(), { description: "Updated files this task creates or overwrites" }),
|
|
1122
|
+
reworkBriefRef: Type.Optional(Type.String({ description: "Rework brief ID/reference that triggered this task replan" })),
|
|
1123
|
+
actorName: Type.Optional(Type.String({ description: "Caller-provided actor identity for the audit trail" })),
|
|
1124
|
+
triggerReason: Type.Optional(Type.String({ description: "Caller-provided reason this action was triggered" })),
|
|
1125
|
+
}),
|
|
1126
|
+
execute: replanTaskExecute,
|
|
1127
|
+
};
|
|
1128
|
+
registerWorkflowTool(pi, replanTaskTool);
|
|
1129
|
+
// ─── gsd_rework_brief_save ─────────────────────────────────────────────
|
|
1130
|
+
const reworkBriefSaveExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
1131
|
+
const { executeReworkBriefSave } = await loadWorkflowExecutors();
|
|
1132
|
+
return executeReworkBriefSave(params, resolveWorkflowToolBasePath(_ctx, params));
|
|
1133
|
+
};
|
|
1134
|
+
const reworkBriefSaveTool = {
|
|
1135
|
+
name: "gsd_rework_brief_save",
|
|
1136
|
+
label: "Save Rework Brief",
|
|
1137
|
+
description: "Persist a structured rework brief for a task. Blocking findings are enforced by gsd_task_complete until resolved with evidence.",
|
|
1138
|
+
promptSnippet: "Persist structured task rework findings",
|
|
1139
|
+
promptGuidelines: [
|
|
1140
|
+
"Use gsd_rework_brief_save when post-unit checks produce task rework findings.",
|
|
1141
|
+
"Use severity 'blocking' for findings that must be resolved before gsd_task_complete succeeds.",
|
|
1142
|
+
"Each finding needs a stable findingId, requiredFix, and verificationCommands.",
|
|
1143
|
+
],
|
|
1144
|
+
parameters: Type.Object({
|
|
1145
|
+
briefId: Type.Optional(Type.String({ description: "Stable brief ID; omitted defaults to RB-<milestone>-<slice>-<task>" })),
|
|
1146
|
+
milestoneId: Type.String({ description: "Milestone ID (e.g. M001)" }),
|
|
1147
|
+
sliceId: Type.String({ description: "Slice ID (e.g. S01)" }),
|
|
1148
|
+
taskId: Type.String({ description: "Task ID (e.g. T01)" }),
|
|
1149
|
+
findings: Type.Array(Type.Object({
|
|
1150
|
+
findingId: Type.String({ description: "Stable finding ID (e.g. F1)" }),
|
|
1151
|
+
severity: StringEnum(["blocking", "advisory"], { description: "Whether this finding blocks task completion" }),
|
|
1152
|
+
description: Type.String({ description: "What was found" }),
|
|
1153
|
+
requiredFix: Type.String({ description: "What must change" }),
|
|
1154
|
+
verificationCommands: Type.Array(Type.String(), { description: "Commands that must pass after the fix" }),
|
|
1155
|
+
status: Type.Optional(StringEnum(["pending", "resolved", "deferred-with-override"], { description: "Finding status; defaults to pending" })),
|
|
1156
|
+
evidence: Type.Optional(Type.String({ description: "Resolution evidence when already resolved" })),
|
|
1157
|
+
decisionRef: Type.Optional(Type.String({ description: "Decision reference for deferred-with-override" })),
|
|
1158
|
+
}), { description: "Structured rework findings for this task" }),
|
|
1159
|
+
}),
|
|
1160
|
+
execute: reworkBriefSaveExecute,
|
|
1161
|
+
};
|
|
1162
|
+
registerWorkflowTool(pi, reworkBriefSaveTool);
|
|
1087
1163
|
// ─── gsd_reassess_roadmap (gsd_roadmap_reassess alias) ─────────────────
|
|
1088
1164
|
const reassessRoadmapExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
1089
1165
|
const { executeReassessRoadmap } = await loadWorkflowExecutors();
|
|
@@ -22,13 +22,14 @@ import { saveActivityLog } from "../activity-log.js";
|
|
|
22
22
|
import { recordToolCall as safetyRecordToolCall, recordToolResult as safetyRecordToolResult, saveEvidenceToDisk } from "../safety/evidence-collector.js";
|
|
23
23
|
import { parseUnitId } from "../unit-id.js";
|
|
24
24
|
import { classifyCommand } from "../safety/destructive-guard.js";
|
|
25
|
-
import { confirmDestructiveCommand, consumeDestructiveConfirmation, isDestructiveConfirmGateId, requestDestructiveConfirmation, } from "../safety/destructive-confirmation.js";
|
|
25
|
+
import { confirmDestructiveCommand, consumeDestructiveConfirmation, isDestructiveConfirmGateId, peekPendingDestructiveCommand, requestDestructiveConfirmation, resetDestructiveConfirmation, } from "../safety/destructive-confirmation.js";
|
|
26
26
|
import { logWarning as safetyLogWarning, setStderrLoggingEnabled } from "../workflow-logger.js";
|
|
27
27
|
import { isUnitCloseoutTool, runInteractiveUnitCloseout } from "../unit-closeout.js";
|
|
28
28
|
import { installNotifyInterceptor } from "./notify-interceptor.js";
|
|
29
29
|
import { initNotificationStore } from "../notification-store.js";
|
|
30
30
|
import { initNotificationWidget } from "../notification-widget.js";
|
|
31
31
|
import { notifyPreferenceDiagnostics } from "../preferences-diagnostics.js";
|
|
32
|
+
import { resolveEffectivePlanningToolsPolicy } from "../planning-subagent-policy.js";
|
|
32
33
|
import { resolveWorktreeProjectRoot } from "../worktree-root.js";
|
|
33
34
|
import { extractSubagentAgentClasses } from "./subagent-input.js";
|
|
34
35
|
import { approvalGateIdForUnit, evaluateAskUserQuestionsRound, formatUnansweredConsentQuestionMessage, isExplicitApprovalResponse, messageHasPendingAskUserQuestionsTool, shouldPauseForQuestion, } from "../consent-question.js";
|
|
@@ -136,6 +137,7 @@ function suppressWelcomeHeader(ctx) {
|
|
|
136
137
|
* are bounded — cleared on activation, session boundaries, and verification.
|
|
137
138
|
*/
|
|
138
139
|
const deferredApprovalGates = new Map();
|
|
140
|
+
const deferredDestructiveConfirmationPauses = new Set();
|
|
139
141
|
export const MINIMAL_GSD_TOOL_NAMES = [
|
|
140
142
|
"gsd_exec",
|
|
141
143
|
"gsd_exec_search",
|
|
@@ -456,6 +458,21 @@ function clearDeferredApprovalGate(basePath) {
|
|
|
456
458
|
deferredApprovalGates.delete(basePath);
|
|
457
459
|
}
|
|
458
460
|
}
|
|
461
|
+
function deferDestructiveConfirmationPause(basePath) {
|
|
462
|
+
deferredDestructiveConfirmationPauses.add(basePath);
|
|
463
|
+
}
|
|
464
|
+
function clearDeferredDestructiveConfirmationPause(basePath) {
|
|
465
|
+
if (!basePath) {
|
|
466
|
+
deferredDestructiveConfirmationPauses.clear();
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
deferredDestructiveConfirmationPauses.delete(basePath);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
function isDestructiveConfirmationBlocking(basePath) {
|
|
473
|
+
return deferredDestructiveConfirmationPauses.has(basePath)
|
|
474
|
+
&& Boolean(peekPendingDestructiveCommand(basePath));
|
|
475
|
+
}
|
|
459
476
|
function deferApprovalGate(gateId, basePath) {
|
|
460
477
|
// Verified-on-disk wins (same adapter policy as activation/re-arm): if the
|
|
461
478
|
// workflow MCP child already verified this gate, deferring would block
|
|
@@ -798,6 +815,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
798
815
|
await applyToolCallLoopGuardConfig(basePath);
|
|
799
816
|
approvalQuestionAbortInFlight = false;
|
|
800
817
|
clearDeferredApprovalGate();
|
|
818
|
+
clearDeferredDestructiveConfirmationPause();
|
|
801
819
|
await resetAskUserQuestionsTurnCache();
|
|
802
820
|
await syncServiceTierStatus(ctx);
|
|
803
821
|
await applyDisabledModelProviderPolicy(ctx);
|
|
@@ -883,6 +901,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
883
901
|
resetToolCallLoopGuard();
|
|
884
902
|
await applyToolCallLoopGuardConfig(basePath);
|
|
885
903
|
clearDeferredApprovalGate();
|
|
904
|
+
clearDeferredDestructiveConfirmationPause();
|
|
886
905
|
await resetAskUserQuestionsTurnCache();
|
|
887
906
|
clearDiscussionFlowState(basePath);
|
|
888
907
|
// /clear or /new destroys the conversation holding a discuss interview, so
|
|
@@ -933,6 +952,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
933
952
|
}
|
|
934
953
|
}
|
|
935
954
|
clearDeferredApprovalGate(beforeAgentBasePath);
|
|
955
|
+
clearDeferredDestructiveConfirmationPause(beforeAgentBasePath);
|
|
936
956
|
// session_start can fire before the active provider has settled. By
|
|
937
957
|
// before_agent_start, Claude Code CLI sessions should get the same
|
|
938
958
|
// project MCP config that /gsd mcp init would write.
|
|
@@ -1010,7 +1030,10 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
1010
1030
|
}
|
|
1011
1031
|
finally {
|
|
1012
1032
|
activateDeferredApprovalGate(agentEndBasePath);
|
|
1033
|
+
const destructiveConfirmationBlocking = isDestructiveConfirmationBlocking(agentEndBasePath);
|
|
1034
|
+
clearDeferredDestructiveConfirmationPause(agentEndBasePath);
|
|
1013
1035
|
await maybePauseAutoForApprovalGate(ctx, pi, isApprovalGateBlocking(agentEndBasePath), "Depth confirmation is waiting for your answer — pausing auto-mode.");
|
|
1036
|
+
await maybePauseAutoForApprovalGate(ctx, pi, destructiveConfirmationBlocking, "Destructive-command confirmation is waiting for your answer — pausing auto-mode.");
|
|
1014
1037
|
}
|
|
1015
1038
|
});
|
|
1016
1039
|
pi.on("message_end", async (event) => {
|
|
@@ -1276,6 +1299,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
1276
1299
|
const activeUnitType = dash.currentUnit?.type ?? guidedUnit?.unitType;
|
|
1277
1300
|
if (activeUnitType) {
|
|
1278
1301
|
const manifest = resolveManifest(activeUnitType);
|
|
1302
|
+
const planningBasePath = dash.basePath || guidedUnit?.basePath || discussionBasePath;
|
|
1279
1303
|
let planningInput = "";
|
|
1280
1304
|
let agentClasses;
|
|
1281
1305
|
if (isToolCallEventType("write", event)) {
|
|
@@ -1291,7 +1315,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
1291
1315
|
// Subagent inputs use { agent }, { tasks: [{ agent }] }, or { chain: [{ agent }] }.
|
|
1292
1316
|
agentClasses = extractSubagentAgentClasses(event.input);
|
|
1293
1317
|
}
|
|
1294
|
-
const planningGuard = shouldBlockPlanningUnit(event.toolName, planningInput,
|
|
1318
|
+
const planningGuard = shouldBlockPlanningUnit(event.toolName, planningInput, planningBasePath, activeUnitType, resolveEffectivePlanningToolsPolicy(activeUnitType, manifest?.tools, planningBasePath), agentClasses, event.input, dash.currentUnit?.id);
|
|
1295
1319
|
if (planningGuard.block)
|
|
1296
1320
|
return planningGuard;
|
|
1297
1321
|
}
|
|
@@ -1373,6 +1397,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
1373
1397
|
// Record the command as pending so an affirmative answer to a
|
|
1374
1398
|
// destructive_confirm gate (handled in tool_result) can confirm it.
|
|
1375
1399
|
requestDestructiveConfirmation(command, guardBasePath);
|
|
1400
|
+
deferDestructiveConfirmationPause(guardBasePath);
|
|
1376
1401
|
const reason = [
|
|
1377
1402
|
"HARD BLOCK: destructive Bash command requires explicit human confirmation.",
|
|
1378
1403
|
`Detected: ${classification.labels.join(", ")}`,
|
|
@@ -1383,9 +1408,6 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
1383
1408
|
safetyLogWarning("safety", `destructive command: ${classification.labels.join(", ")}`, {
|
|
1384
1409
|
command: String(command).slice(0, 200),
|
|
1385
1410
|
});
|
|
1386
|
-
if (ctx) {
|
|
1387
|
-
await maybePauseAutoForApprovalGate(ctx, pi, isAutoActive(), "Destructive-command confirmation is waiting for your answer — pausing auto-mode.");
|
|
1388
|
-
}
|
|
1389
1411
|
return { block: true, reason };
|
|
1390
1412
|
}
|
|
1391
1413
|
}
|
|
@@ -1541,6 +1563,10 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
1541
1563
|
if (isDepthConfirmationAnswer(answer?.selected, question.options)) {
|
|
1542
1564
|
confirmDestructiveCommand(basePath);
|
|
1543
1565
|
}
|
|
1566
|
+
else {
|
|
1567
|
+
resetDestructiveConfirmation(basePath);
|
|
1568
|
+
}
|
|
1569
|
+
clearDeferredDestructiveConfirmationPause(basePath);
|
|
1544
1570
|
break;
|
|
1545
1571
|
}
|
|
1546
1572
|
}
|
|
@@ -18,6 +18,13 @@ import { formatOverridesSection, formatShortcut, loadActiveOverrides, loadFile,
|
|
|
18
18
|
import { toPosixPath } from "../../shared/mod.js";
|
|
19
19
|
import { autoEnableCmuxPreferences } from "../commands-cmux.js";
|
|
20
20
|
import { gsdHome } from "../gsd-home.js";
|
|
21
|
+
import { GSD_CONTEXT_MESSAGE_SENTINEL } from "../constants.js";
|
|
22
|
+
// Single source of truth lives in ../constants.js; re-exported here because
|
|
23
|
+
// buildContextMessage() stamps this marker on every context injection and the
|
|
24
|
+
// provider payload policy (filterSupersededContextInjections in
|
|
25
|
+
// context-masker.ts) matches it to dedupe. Adding a new context customType?
|
|
26
|
+
// Ensure buildContextMessage still prepends this sentinel.
|
|
27
|
+
export { GSD_CONTEXT_MESSAGE_SENTINEL };
|
|
21
28
|
const DEFAULT_CONTEXT_MESSAGE_MAX_CHARS = 4_000;
|
|
22
29
|
const DEFAULT_KNOWLEDGE_MAX_CHARS = 12_000;
|
|
23
30
|
const DEFAULT_CODEBASE_MAX_CHARS = 8_000;
|
|
@@ -385,17 +392,17 @@ export function buildContextMessage(opts) {
|
|
|
385
392
|
const contextCharLimit = getContextMessageCharLimit();
|
|
386
393
|
const memoryContent = markMemoryContextSupplied(opts.memoryBlock.trim());
|
|
387
394
|
if (opts.injection) {
|
|
388
|
-
const content = limitContextMessageContent(memoryContent ? `${memoryContent}\n\n${opts.injection}` : opts.injection
|
|
395
|
+
const content = limitContextMessageContent(`${GSD_CONTEXT_MESSAGE_SENTINEL}\n${memoryContent ? `${memoryContent}\n\n${opts.injection}` : opts.injection}`, contextCharLimit);
|
|
389
396
|
return { customType: "gsd-guided-context", content, display: false };
|
|
390
397
|
}
|
|
391
398
|
if (opts.forensicsInjection) {
|
|
392
|
-
const content = limitContextMessageContent(memoryContent ? `${memoryContent}\n\n${opts.forensicsInjection}` : opts.forensicsInjection
|
|
399
|
+
const content = limitContextMessageContent(`${GSD_CONTEXT_MESSAGE_SENTINEL}\n${memoryContent ? `${memoryContent}\n\n${opts.forensicsInjection}` : opts.forensicsInjection}`, contextCharLimit);
|
|
393
400
|
return { customType: "gsd-forensics", content, display: false };
|
|
394
401
|
}
|
|
395
402
|
if (memoryContent) {
|
|
396
403
|
return {
|
|
397
404
|
customType: "gsd-memory",
|
|
398
|
-
content: limitContextMessageContent(memoryContent
|
|
405
|
+
content: limitContextMessageContent(`${GSD_CONTEXT_MESSAGE_SENTINEL}\n${memoryContent}`, contextCharLimit),
|
|
399
406
|
display: false,
|
|
400
407
|
};
|
|
401
408
|
}
|