@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
|
@@ -817,6 +817,7 @@ function mergePreferences(base: GSDPreferences, override: GSDPreferences): GSDPr
|
|
|
817
817
|
: undefined,
|
|
818
818
|
post_unit_hooks: mergePostUnitHooks(base.post_unit_hooks, override.post_unit_hooks),
|
|
819
819
|
pre_dispatch_hooks: mergePreDispatchHooks(base.pre_dispatch_hooks, override.pre_dispatch_hooks),
|
|
820
|
+
planning_subagents: mergePlanningSubagents(base.planning_subagents, override.planning_subagents),
|
|
820
821
|
dynamic_routing: (base.dynamic_routing || override.dynamic_routing)
|
|
821
822
|
? { ...(base.dynamic_routing ?? {}), ...(override.dynamic_routing ?? {}) } as DynamicRoutingConfig
|
|
822
823
|
: undefined,
|
|
@@ -943,6 +944,30 @@ function mergePreDispatchHooks(
|
|
|
943
944
|
return merged.length > 0 ? merged : undefined;
|
|
944
945
|
}
|
|
945
946
|
|
|
947
|
+
function mergePlanningSubagents(
|
|
948
|
+
base?: GSDPreferences["planning_subagents"],
|
|
949
|
+
override?: GSDPreferences["planning_subagents"],
|
|
950
|
+
): GSDPreferences["planning_subagents"] | undefined {
|
|
951
|
+
if (!base && !override) return undefined;
|
|
952
|
+
const merged: NonNullable<GSDPreferences["planning_subagents"]> = {};
|
|
953
|
+
const unitTypes = new Set([
|
|
954
|
+
...Object.keys(base ?? {}),
|
|
955
|
+
...Object.keys(override ?? {}),
|
|
956
|
+
]);
|
|
957
|
+
|
|
958
|
+
for (const unitType of unitTypes) {
|
|
959
|
+
const allowed = mergeStringLists(
|
|
960
|
+
base?.[unitType as keyof NonNullable<GSDPreferences["planning_subagents"]>]?.allowed,
|
|
961
|
+
override?.[unitType as keyof NonNullable<GSDPreferences["planning_subagents"]>]?.allowed,
|
|
962
|
+
);
|
|
963
|
+
if (allowed?.length) {
|
|
964
|
+
merged[unitType as keyof NonNullable<GSDPreferences["planning_subagents"]>] = { allowed };
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
969
|
+
}
|
|
970
|
+
|
|
946
971
|
// ─── System Prompt Rendering ──────────────────────────────────────────────────
|
|
947
972
|
|
|
948
973
|
export function renderPreferencesForSystemPrompt(
|
|
@@ -66,12 +66,12 @@ Then:
|
|
|
66
66
|
**Web apps:** when inlined Web App UAT guidance is present, follow it for Playwright scaffolding and browser-capable verification commands.
|
|
67
67
|
4. For non-trivial slices, plan observability / proof level / integration closure, threat surface, and requirement impact. Omit entirely for simple slices.
|
|
68
68
|
5. Decompose the slice into tasks that fit one context window each. Every task passed to `gsd_plan_slice` must use the exact keys `taskId`, `title`, `description`, `estimate`, `files`, `verify`, `inputs`, `expectedOutput`, and optional `observabilityImpact`. Put Why / Do / Done-when detail in `description`. `files`, `inputs`, and `expectedOutput` must be JSON arrays of strings, even for one path (for example, `"expectedOutput": ["src/index.ts"]`, never `"expectedOutput": "src/index.ts"`). `expectedOutput` is path-only: list only files the task creates or overwrites, and use `[]` for pure verification tasks. Never list GSD planning artifacts — anything under `.gsd/`, `.planning/`, or `.audits/`, or artifact names like `M001-CONTEXT.md` / `S01-PLAN.md` — in `inputs`, `files`, or `expectedOutput`: their content is preloaded as context, and they are written by workflow tools, not by tasks.
|
|
69
|
-
6. **Persist planning state through `gsd_plan_slice`.** Call it with the full payload. The tool writes to the DB and renders `{{outputPath}}`
|
|
69
|
+
6. **Persist planning state through `gsd_plan_slice`.** Call it with the full payload. The tool writes to the DB and renders `{{outputPath}}` with embedded task planning automatically. Do NOT rely on direct `PLAN.md` writes.
|
|
70
70
|
7. **Self-audit the plan.** If every task were completed exactly as written, the slice goal/demo should be true. Every must-have maps to a task. Inputs and Expected Output are backtick-wrapped file paths.
|
|
71
71
|
8. If refinement produced structural decisions that diverge from the sketch, call `gsd_decision_save` for each; the tool persists the decision and regenerates `.gsd/DECISIONS.md`.
|
|
72
72
|
9. {{commitInstruction}}
|
|
73
73
|
|
|
74
|
-
The slice
|
|
74
|
+
The slice plan path already exists. Do NOT mkdir.
|
|
75
75
|
|
|
76
76
|
**Autonomous execution:** Do not call `ask_user_questions` or `secure_env_collect`. Document assumptions in the plan.
|
|
77
77
|
|
|
@@ -24,18 +24,18 @@ Roadmap, slice summaries, assessments, requirements, decisions, and project cont
|
|
|
24
24
|
|
|
25
25
|
### Step 1 - Dispatch Parallel Reviewers
|
|
26
26
|
|
|
27
|
-
The Inlined Context above already preloads the evidence reviewers need — the roadmap, per-slice SUMMARY/ASSESSMENT excerpts, requirements, and verification classes. **Embed the relevant preloaded evidence directly into each reviewer's task prompt** so reviewers work from it instead of re-reading the same artifacts from disk. Each reviewer should read a full file only when its excerpt is missing, truncated, or internally inconsistent — never as a routine first step. This avoids three reviewers independently re-surveying artifacts the orchestrator already holds.
|
|
27
|
+
The Inlined Context above already preloads the evidence reviewers need — the roadmap, per-slice SUMMARY/ASSESSMENT excerpts, requirements, and verification classes. **Embed the relevant preloaded evidence directly into each reviewer's task prompt** so reviewers work from it instead of re-reading the same artifacts from disk. Each reviewer should read a full file only when its excerpt is missing, truncated, or internally inconsistent — never as a routine first step. When a reviewer needs a full artifact, use only explicit file paths from the On-demand Validation Artifacts / On-demand Milestone Context blocks or discover files with `find .gsd -type f`; never pass a phase, slice, `tasks/`, or `slices/` directory to `read` or `readFileSync`. This avoids three reviewers independently re-surveying artifacts the orchestrator already holds.
|
|
28
28
|
|
|
29
29
|
Call `subagent` with `tasks: [...]` containing ALL THREE reviewers simultaneously:
|
|
30
30
|
|
|
31
31
|
**Reviewer A - Requirements Coverage**
|
|
32
|
-
Prompt: "Review milestone {{milestoneId}} requirements coverage. Working directory: {{workingDirectory}}. Use the preloaded requirements and slice SUMMARY evidence embedded in this task — do not re-read them from disk. For each requirement, mark COVERED, PARTIAL, or MISSING against that evidence. Read a full SUMMARY
|
|
32
|
+
Prompt: "Review milestone {{milestoneId}} requirements coverage. Working directory: {{workingDirectory}}. Use the preloaded requirements and slice SUMMARY evidence embedded in this task — do not re-read them from disk. For each requirement, mark COVERED, PARTIAL, or MISSING against that evidence. Read a full SUMMARY only from an explicit file path in the On-demand Validation Artifacts list, or discover candidates with `find .gsd -type f -name '*-SUMMARY.md'`; never read a directory path. Output table: Requirement | Status | Evidence. End with one-line verdict: PASS if all covered, NEEDS-ATTENTION if partials exist, FAIL if any missing."
|
|
33
33
|
|
|
34
34
|
**Reviewer B - Cross-Slice Integration**
|
|
35
|
-
Prompt: "Review milestone {{milestoneId}} cross-slice integration. Working directory: {{workingDirectory}}. Use the preloaded roadmap and slice SUMMARY evidence embedded in this task — do not re-read them from disk. Find the boundary map (produces/consumes contracts) in the roadmap. For each boundary, confirm producer SUMMARY produced the artifact and consumer SUMMARY consumed it. Read `{{roadmapPath}}` or a full SUMMARY only if the preloaded evidence is missing, truncated, or inconsistent. Output table: Boundary | Producer Summary | Consumer Summary | Status. End with one-line verdict: PASS if all boundaries honored, NEEDS-ATTENTION if any gaps."
|
|
35
|
+
Prompt: "Review milestone {{milestoneId}} cross-slice integration. Working directory: {{workingDirectory}}. Use the preloaded roadmap and slice SUMMARY evidence embedded in this task — do not re-read them from disk. Find the boundary map (produces/consumes contracts) in the roadmap. For each boundary, confirm producer SUMMARY produced the artifact and consumer SUMMARY consumed it. Read `{{roadmapPath}}` or a full SUMMARY from the On-demand Validation Artifacts list only if the preloaded evidence is missing, truncated, or inconsistent; never read a directory path. Output table: Boundary | Producer Summary | Consumer Summary | Status. End with one-line verdict: PASS if all boundaries honored, NEEDS-ATTENTION if any gaps."
|
|
36
36
|
|
|
37
37
|
**Reviewer C - Assessment & Acceptance Criteria**
|
|
38
|
-
Prompt: "Review milestone {{milestoneId}} assessment evidence and acceptance criteria. Working directory: {{workingDirectory}}. Use the preloaded milestone context, slice SUMMARY, and ASSESSMENT evidence embedded in this task — do not re-read them from disk. Read
|
|
38
|
+
Prompt: "Review milestone {{milestoneId}} assessment evidence and acceptance criteria. Working directory: {{workingDirectory}}. Use the preloaded milestone context, slice SUMMARY, and ASSESSMENT evidence embedded in this task — do not re-read them from disk. Read the milestone context from the On-demand Milestone Context file path, and read full SUMMARY or ASSESSMENT files only from explicit paths in the On-demand Validation Artifacts list, if the preloaded excerpt is missing, truncated, or inconsistent. UAT files are specs, not evidence. Verify each criterion maps to passing evidence. Then review the inlined `Verification Classes (from planning)` table. For every planned row in that table, output a `Verification Classes` table with columns `Class | Planned Check | Evidence | Verdict`. Preserve every planned non-empty class row; do not summarize, rename, combine, or omit planned classes. The first cell of each row must be exactly `Contract`, `Integration`, `Operational`, or `UAT` when that class is present in planning. If a planned class lacks evidence, still include its canonical row and mark the verdict NEEDS-ATTENTION or FAIL. If a planned browser/UAT class has no ASSESSMENT with browser/runtime actions and assertions, return NEEDS-ATTENTION. If no verification classes were planned, say that explicitly. Output sections `Acceptance Criteria` with checklist `[ ] Criterion | Evidence`, and `Verification Classes` with the table. End with one-line verdict: PASS if all criteria and classes are covered by evidence, NEEDS-ATTENTION if gaps exist."
|
|
39
39
|
|
|
40
40
|
### Step 2 - Synthesize Findings
|
|
41
41
|
|
|
@@ -85,6 +85,6 @@ If verdict is `needs-remediation`:
|
|
|
85
85
|
|
|
86
86
|
**You MUST call `gsd_validate_milestone` before finishing. Do not manually write `{{validationPath}}`.**
|
|
87
87
|
|
|
88
|
-
**File system safety:** When scanning milestone directories, use `
|
|
88
|
+
**File system safety:** When scanning milestone directories, use `find .gsd -type f` first and read only files. In flat-phase projects, `.gsd/phases/<NN>-<slug>/` is a directory, not an artifact. Never pass a directory path such as a phase directory, `tasks/`, or `slices/` directly to `read`, `readFile`, or `readFileSync`.
|
|
89
89
|
|
|
90
90
|
When done, say: "Milestone {{milestoneId}} validation complete — verdict: <verdict>." Say this exactly once — if you already said it in a prior message, do not repeat it.
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* Provider Payload Policy - ordered shaping of provider request payloads.
|
|
3
3
|
*
|
|
4
4
|
* The order is intentional:
|
|
5
|
-
* 1.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* 1. superseded GSD context injections (memory/guided/forensics) are removed,
|
|
6
|
+
* keeping only the latest, for every mode,
|
|
7
|
+
* 2. observation budgeting masks old tool results in auto-mode,
|
|
8
|
+
* 3. display truncation caps tool-result text for every mode,
|
|
9
|
+
* 4. the protected Source Context Block is appended after truncation,
|
|
10
|
+
* 5. supported models receive the configured service tier.
|
|
9
11
|
*/
|
|
10
12
|
|
|
11
13
|
import type { ContextManagementConfig } from "./preferences-types.js";
|
|
@@ -14,6 +16,8 @@ import type { ServiceTierSetting } from "./service-tier.js";
|
|
|
14
16
|
import {
|
|
15
17
|
createObservationMask,
|
|
16
18
|
createResponsesInputObservationMask,
|
|
19
|
+
filterSupersededContextInjections,
|
|
20
|
+
filterSupersededResponsesContextInjections,
|
|
17
21
|
truncateContextResultMessages,
|
|
18
22
|
truncateResponsesInputResultItems,
|
|
19
23
|
} from "./context-masker.js";
|
|
@@ -80,10 +84,20 @@ function applyContextManagement(
|
|
|
80
84
|
deps: ProviderPayloadPolicyDeps,
|
|
81
85
|
): void {
|
|
82
86
|
const config = deps.loadContextManagementConfig();
|
|
87
|
+
applyContextInjectionFilter(payload);
|
|
83
88
|
applyObservationBudget(payload, config, deps.isAutoActive());
|
|
84
89
|
applyDisplayTruncation(payload, config);
|
|
85
90
|
}
|
|
86
91
|
|
|
92
|
+
function applyContextInjectionFilter(payload: Record<string, unknown>): void {
|
|
93
|
+
if (Array.isArray(payload.messages)) {
|
|
94
|
+
payload.messages = filterSupersededContextInjections(payload.messages as MessagePayload);
|
|
95
|
+
}
|
|
96
|
+
if (Array.isArray(payload.input)) {
|
|
97
|
+
payload.input = filterSupersededResponsesContextInjections(payload.input as ResponsesInputPayload);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
87
101
|
function applyObservationBudget(
|
|
88
102
|
payload: Record<string, unknown>,
|
|
89
103
|
config: ContextManagementConfig | undefined,
|
|
@@ -14,7 +14,7 @@ interface DestructivePattern {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const DESTRUCTIVE_PATTERNS: readonly DestructivePattern[] = [
|
|
17
|
-
{ pattern: /\brm\s+(
|
|
17
|
+
{ pattern: /\brm\s+((?:-(?!-)[^\s]*[rR][^\s]*|--recursive)\s+|.*\s+(?:-(?!-)[^\s]*[rR][^\s]*|--recursive)(?:\s|$))/, label: "recursive delete" },
|
|
18
18
|
{ pattern: /\bgit\s+push\s+.*--force/, label: "force push" },
|
|
19
19
|
{ pattern: /\bgit\s+push\s+-f\b/, label: "force push" },
|
|
20
20
|
{ pattern: /\bgit\s+reset\s+--hard/, label: "hard reset" },
|
|
@@ -232,7 +232,7 @@ export function recordToolCall(toolCallId: string, toolName: string, input: Reco
|
|
|
232
232
|
toolCallId,
|
|
233
233
|
// gsd_exec / gsd_uat_exec carry the script body in `script` (or `code`);
|
|
234
234
|
// bash-style tools use `command`/`cmd`; gsd_exec_search uses `query`.
|
|
235
|
-
command:
|
|
235
|
+
command: formatExecutionEvidenceCommand(toolName, input),
|
|
236
236
|
exitCode: -1,
|
|
237
237
|
outputSnippet: "",
|
|
238
238
|
timestamp: Date.now(),
|
|
@@ -254,6 +254,33 @@ export function recordToolCall(toolCallId: string, toolName: string, input: Reco
|
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
+
function pickString(input: Record<string, unknown>, ...keys: string[]): string {
|
|
258
|
+
for (const key of keys) {
|
|
259
|
+
const value = input[key];
|
|
260
|
+
if (typeof value === "string" && value.trim().length > 0) return value.trim();
|
|
261
|
+
}
|
|
262
|
+
return "";
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function canonicalExecutionToolLabel(toolName: string): string {
|
|
266
|
+
const normalized = toolName.trim().toLowerCase();
|
|
267
|
+
const mcpMatch = normalized.match(/^mcp__.+__(gsd_(?:uat_)?exec(?:_search)?)$/);
|
|
268
|
+
return mcpMatch?.[1] ?? normalized;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function formatExecutionEvidenceCommand(toolName: string, input: Record<string, unknown>): string {
|
|
272
|
+
const body = pickString(input, "command", "script", "cmd", "code", "query");
|
|
273
|
+
const tool = canonicalExecutionToolLabel(toolName);
|
|
274
|
+
const purpose = pickString(input, "purpose");
|
|
275
|
+
const runtime = pickString(input, "runtime").toLowerCase();
|
|
276
|
+
const label = purpose && (tool === "gsd_exec" || tool === "gsd_uat_exec")
|
|
277
|
+
? `${tool}${runtime ? ` ${runtime}` : ""}: ${purpose}`
|
|
278
|
+
: "";
|
|
279
|
+
|
|
280
|
+
if (label && body) return `${label}\n${body}`;
|
|
281
|
+
return body || label;
|
|
282
|
+
}
|
|
283
|
+
|
|
257
284
|
/**
|
|
258
285
|
* Record a tool execution result. Matches the entry by toolCallId (assigned
|
|
259
286
|
* at dispatch time) and fills in exit code + output. Prior versions matched
|
|
@@ -161,9 +161,18 @@ function findMatches(
|
|
|
161
161
|
): BashEvidence[] {
|
|
162
162
|
const normalized = claimedCommand.trim();
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
const exact = bashCalls.filter((b) => b.command.trim() === normalized);
|
|
165
|
+
|
|
166
|
+
// When an exact run exists, also consider wrapper-equivalent reruns (e.g.
|
|
167
|
+
// `cd ... && <command>`) so a newer pass is not shadowed by a stale exact
|
|
168
|
+
// failure. Do not merge arbitrary containing scripts: their exit code may
|
|
169
|
+
// belong to later work, not to the claimed verification command.
|
|
170
|
+
const scriptWrapped = bashCalls.filter((b) => {
|
|
171
|
+
const command = b.command.trim();
|
|
172
|
+
if (command.length === 0 || command === normalized) return false;
|
|
173
|
+
return isWrapperEquivalentCommand(command, normalized);
|
|
174
|
+
});
|
|
175
|
+
if (exact.length > 0) return [...exact, ...scriptWrapped];
|
|
167
176
|
|
|
168
177
|
// Substring match: claimed is contained in actual or actual in claimed.
|
|
169
178
|
// A claimed verification command typically appears verbatim inside a
|
|
@@ -171,7 +180,7 @@ function findMatches(
|
|
|
171
180
|
// script-containing-claim is the common direction. Blank-command entries
|
|
172
181
|
// must be excluded — `"x".includes("")` is true, so they'd match anything.
|
|
173
182
|
const substring = bashCalls.filter(
|
|
174
|
-
b => b.command.trim().length > 0 &&
|
|
183
|
+
(b) => b.command.trim().length > 0 &&
|
|
175
184
|
(b.command.includes(normalized) || normalized.includes(b.command)),
|
|
176
185
|
);
|
|
177
186
|
if (substring.length > 0) return substring;
|
|
@@ -199,6 +208,23 @@ function findMatches(
|
|
|
199
208
|
|
|
200
209
|
function latestMatch(matches: readonly BashEvidence[]): BashEvidence {
|
|
201
210
|
return matches.reduce((latest, match) => (
|
|
202
|
-
match.timestamp
|
|
211
|
+
match.timestamp >= latest.timestamp ? match : latest
|
|
203
212
|
));
|
|
204
213
|
}
|
|
214
|
+
|
|
215
|
+
/** True when `actual` is the same command with only shell wrapper noise. */
|
|
216
|
+
function isWrapperEquivalentCommand(actual: string, claimed: string): boolean {
|
|
217
|
+
const claimIndex = actual.lastIndexOf(claimed);
|
|
218
|
+
if (claimIndex < 0) return false;
|
|
219
|
+
|
|
220
|
+
const prefix = actual.slice(0, claimIndex).trim();
|
|
221
|
+
if (prefix.length > 0 && !/^cd\s+.+\s+&&$/.test(prefix)) return false;
|
|
222
|
+
|
|
223
|
+
const suffix = actual.slice(claimIndex + claimed.length).trim();
|
|
224
|
+
return suffix.length === 0 || isBenignWrapperSuffix(suffix);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function isBenignWrapperSuffix(suffix: string): boolean {
|
|
228
|
+
if (/^;\s*echo\s+["']?[A-Z_]*EXIT=\$\?["']?$/.test(suffix)) return true;
|
|
229
|
+
return /^(?:(?:\d?>>?|&>)\s*\S+|\d?>&\d)(?:\s+(?:(?:\d?>>?|&>)\s*\S+|\d?>&\d))*$/.test(suffix);
|
|
230
|
+
}
|
|
@@ -131,10 +131,23 @@ function resolvePreferredSkillNames(
|
|
|
131
131
|
* to prevent prompt injection via crafted directory names. */
|
|
132
132
|
const SAFE_SKILL_NAME = /^[a-z0-9][a-z0-9-]*$/;
|
|
133
133
|
|
|
134
|
-
function
|
|
134
|
+
function escapeXml(str: string): string {
|
|
135
|
+
return str
|
|
136
|
+
.replace(/&/g, "&")
|
|
137
|
+
.replace(/</g, "<")
|
|
138
|
+
.replace(/>/g, ">")
|
|
139
|
+
.replace(/"/g, """)
|
|
140
|
+
.replace(/'/g, "'");
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function formatSkillActivationBlock(skillNames: string[], skillPaths: Map<string, string>): string {
|
|
135
144
|
const safe = skillNames.filter(name => SAFE_SKILL_NAME.test(name));
|
|
136
145
|
if (safe.length === 0) return "";
|
|
137
|
-
const reads = safe.map(name =>
|
|
146
|
+
const reads = safe.map(name => {
|
|
147
|
+
const path = skillPaths.get(name);
|
|
148
|
+
if (path) return `Read the skill file at \`${escapeXml(path)}\``;
|
|
149
|
+
return `Find '${name}' in <available_skills>, copy its <location> value, and pass that exact path to read`;
|
|
150
|
+
}).join(". ");
|
|
138
151
|
return `<skill_activation>${reads}.</skill_activation>`;
|
|
139
152
|
}
|
|
140
153
|
|
|
@@ -203,6 +216,7 @@ export function buildSkillActivationBlock(params: {
|
|
|
203
216
|
const visibleSkills = loaded;
|
|
204
217
|
const manifestScopedSkills = filterSkillsByManifest(visibleSkills, params.unitType);
|
|
205
218
|
const installedNames = new Set(visibleSkills.map(skill => normalizeSkillReference(skill.name)));
|
|
219
|
+
const installedSkillPaths = new Map(visibleSkills.map(skill => [normalizeSkillReference(skill.name), skill.filePath]));
|
|
206
220
|
warnIfManifestHasMissingSkills(params.unitType, installedNames);
|
|
207
221
|
const avoided = new Set(resolvePreferenceSkillNames(prefs?.avoid_skills ?? [], params.base));
|
|
208
222
|
const matched = new Set<string>();
|
|
@@ -252,7 +266,7 @@ export function buildSkillActivationBlock(params: {
|
|
|
252
266
|
const ordered = [...matched]
|
|
253
267
|
.filter(name => installedNames.has(name) && !avoided.has(name))
|
|
254
268
|
.sort();
|
|
255
|
-
const activationBlock = formatSkillActivationBlock(ordered);
|
|
269
|
+
const activationBlock = formatSkillActivationBlock(ordered, installedSkillPaths);
|
|
256
270
|
|
|
257
271
|
// Omit recommendations when the system catalog is manifest-scoped for this
|
|
258
272
|
// unit — skill names are already listed in <available_skills>.
|
|
@@ -3,18 +3,21 @@
|
|
|
3
3
|
//
|
|
4
4
|
// gsd-pi's DB is canonical, but .gsd/*.md is the inter-tool contract. When
|
|
5
5
|
// gsd-core edits a projection file, this handler detects the sha drift vs the
|
|
6
|
-
// recorded baseline in .gsd/.compat.json and re-imports
|
|
7
|
-
//
|
|
8
|
-
//
|
|
6
|
+
// recorded baseline in .gsd/.compat.json and re-imports from markdown with
|
|
7
|
+
// status authority scoped to the affected milestone ids. The next
|
|
8
|
+
// renderAllFromDb pass re-projects; the write-time invalidation hook then
|
|
9
|
+
// refreshes the marker entry, closing the loop.
|
|
9
10
|
|
|
10
11
|
import { existsSync, readFileSync } from "node:fs";
|
|
11
|
-
import { join } from "node:path";
|
|
12
|
+
import { basename, join } from "node:path";
|
|
12
13
|
|
|
13
14
|
import {
|
|
14
15
|
computeProjectionSha,
|
|
15
16
|
readCompatMarker,
|
|
16
17
|
writeCompatMarker,
|
|
18
|
+
type ProjectionEntry,
|
|
17
19
|
} from "../../compat/compat-marker.js";
|
|
20
|
+
import { _getAdapter } from "../../gsd-db.js";
|
|
18
21
|
import { logWarning } from "../../workflow-logger.js";
|
|
19
22
|
import type { GSDState } from "../../types.js";
|
|
20
23
|
import type { DriftContext, DriftHandler, DriftRecord } from "../types.js";
|
|
@@ -24,6 +27,102 @@ type ExternalMarkdownEditDrift = Extract<
|
|
|
24
27
|
{ kind: "external-markdown-edit" }
|
|
25
28
|
>;
|
|
26
29
|
|
|
30
|
+
type ArtifactContentRow = {
|
|
31
|
+
full_content: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type ProjectionScope = {
|
|
35
|
+
milestoneId: string;
|
|
36
|
+
sliceId: string | null;
|
|
37
|
+
taskId: string | null;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function deepestProjectionScope(entities: readonly string[]): ProjectionScope | null {
|
|
41
|
+
let best: string[] | null = null;
|
|
42
|
+
for (const entity of entities) {
|
|
43
|
+
const parts = entity.split("/").filter(Boolean);
|
|
44
|
+
if (parts.length === 0) continue;
|
|
45
|
+
if (!best || parts.length > best.length) best = parts;
|
|
46
|
+
}
|
|
47
|
+
if (!best) return null;
|
|
48
|
+
return {
|
|
49
|
+
milestoneId: best[0]!,
|
|
50
|
+
sliceId: best[1] ?? null,
|
|
51
|
+
taskId: best[2] ?? null,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function artifactTypeFromProjectionPath(projectionPath: string): string | null {
|
|
56
|
+
const name = basename(projectionPath);
|
|
57
|
+
const match = name.match(/^(?:[A-Za-z]\d+|\d+(?:-\d+)?)-(.+)\.md$/);
|
|
58
|
+
return match?.[1]?.toUpperCase() ?? null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function dbProjectionMatches(
|
|
62
|
+
projectionPath: string,
|
|
63
|
+
entry: ProjectionEntry,
|
|
64
|
+
actualSha: string,
|
|
65
|
+
): boolean {
|
|
66
|
+
const adapter = _getAdapter();
|
|
67
|
+
if (!adapter) return false;
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
const rows: ArtifactContentRow[] = adapter
|
|
71
|
+
.prepare("SELECT full_content FROM artifacts WHERE path = :path")
|
|
72
|
+
.all({ ":path": projectionPath }) as ArtifactContentRow[];
|
|
73
|
+
|
|
74
|
+
const scope = deepestProjectionScope(entry.entities);
|
|
75
|
+
const artifactType = artifactTypeFromProjectionPath(projectionPath);
|
|
76
|
+
if (scope?.taskId) {
|
|
77
|
+
rows.push(
|
|
78
|
+
...(adapter
|
|
79
|
+
.prepare(
|
|
80
|
+
`SELECT full_content
|
|
81
|
+
FROM artifacts
|
|
82
|
+
WHERE milestone_id = :mid AND slice_id = :sid AND task_id = :tid
|
|
83
|
+
AND (:type IS NULL OR artifact_type = :type)`,
|
|
84
|
+
)
|
|
85
|
+
.all({
|
|
86
|
+
":mid": scope.milestoneId,
|
|
87
|
+
":sid": scope.sliceId,
|
|
88
|
+
":tid": scope.taskId,
|
|
89
|
+
":type": artifactType,
|
|
90
|
+
}) as ArtifactContentRow[]),
|
|
91
|
+
);
|
|
92
|
+
} else if (scope?.sliceId) {
|
|
93
|
+
rows.push(
|
|
94
|
+
...(adapter
|
|
95
|
+
.prepare(
|
|
96
|
+
`SELECT full_content
|
|
97
|
+
FROM artifacts
|
|
98
|
+
WHERE milestone_id = :mid AND slice_id = :sid AND task_id IS NULL
|
|
99
|
+
AND (:type IS NULL OR artifact_type = :type)`,
|
|
100
|
+
)
|
|
101
|
+
.all({
|
|
102
|
+
":mid": scope.milestoneId,
|
|
103
|
+
":sid": scope.sliceId,
|
|
104
|
+
":type": artifactType,
|
|
105
|
+
}) as ArtifactContentRow[]),
|
|
106
|
+
);
|
|
107
|
+
} else if (scope) {
|
|
108
|
+
rows.push(
|
|
109
|
+
...(adapter
|
|
110
|
+
.prepare(
|
|
111
|
+
`SELECT full_content
|
|
112
|
+
FROM artifacts
|
|
113
|
+
WHERE milestone_id = :mid AND slice_id IS NULL AND task_id IS NULL
|
|
114
|
+
AND (:type IS NULL OR artifact_type = :type)`,
|
|
115
|
+
)
|
|
116
|
+
.all({ ":mid": scope.milestoneId, ":type": artifactType }) as ArtifactContentRow[]),
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return rows.some((row) => computeProjectionSha(row.full_content) === actualSha);
|
|
121
|
+
} catch {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
27
126
|
/**
|
|
28
127
|
* Detect sha drift between the marker baseline and current file contents.
|
|
29
128
|
*
|
|
@@ -37,16 +136,43 @@ function detectExternalMarkdownEdit(
|
|
|
37
136
|
_state: GSDState,
|
|
38
137
|
ctx: DriftContext,
|
|
39
138
|
): ExternalMarkdownEditDrift[] {
|
|
40
|
-
const marker = readCompatMarker(ctx.basePath
|
|
139
|
+
const marker = readCompatMarker(ctx.basePath, {
|
|
140
|
+
healInvalidKeys: !ctx.dryRun,
|
|
141
|
+
quarantineInvalid: !ctx.dryRun,
|
|
142
|
+
});
|
|
41
143
|
const entries = Object.entries(marker.projections);
|
|
42
144
|
if (entries.length === 0) return [];
|
|
43
145
|
|
|
44
146
|
const records: ExternalMarkdownEditDrift[] = [];
|
|
147
|
+
let markerChanged = false;
|
|
45
148
|
for (const [projectionPath, entry] of entries) {
|
|
46
149
|
const abs = join(ctx.basePath, ".gsd", projectionPath);
|
|
47
150
|
if (!existsSync(abs)) continue;
|
|
48
151
|
const actual = computeProjectionSha(readFileSync(abs, "utf-8"));
|
|
49
152
|
if (actual === entry.sha) continue;
|
|
153
|
+
if (dbProjectionMatches(projectionPath, entry, actual)) {
|
|
154
|
+
if (!ctx.dryRun) {
|
|
155
|
+
marker.projections[projectionPath] = {
|
|
156
|
+
sha: actual,
|
|
157
|
+
entities: entry.entities,
|
|
158
|
+
};
|
|
159
|
+
markerChanged = true;
|
|
160
|
+
logWarning(
|
|
161
|
+
"reconcile",
|
|
162
|
+
`external-markdown-edit: refreshed stale compat marker for ${projectionPath} (expectedSha=${entry.sha}, actualSha=${actual})`,
|
|
163
|
+
);
|
|
164
|
+
} else {
|
|
165
|
+
logWarning(
|
|
166
|
+
"reconcile",
|
|
167
|
+
`external-markdown-edit: stale compat marker for ${projectionPath} (expectedSha=${entry.sha}, actualSha=${actual})`,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
logWarning(
|
|
173
|
+
"reconcile",
|
|
174
|
+
`external-markdown-edit drift for ${projectionPath} (expectedSha=${entry.sha}, actualSha=${actual})`,
|
|
175
|
+
);
|
|
50
176
|
records.push({
|
|
51
177
|
kind: "external-markdown-edit",
|
|
52
178
|
projectionPath,
|
|
@@ -55,14 +181,20 @@ function detectExternalMarkdownEdit(
|
|
|
55
181
|
entities: entry.entities,
|
|
56
182
|
});
|
|
57
183
|
}
|
|
184
|
+
if (markerChanged) {
|
|
185
|
+
marker.lastWriter = "gsd-pi";
|
|
186
|
+
marker.lastProjectedAt = new Date().toISOString();
|
|
187
|
+
writeCompatMarker(ctx.basePath, marker);
|
|
188
|
+
}
|
|
58
189
|
return records;
|
|
59
190
|
}
|
|
60
191
|
|
|
61
192
|
/**
|
|
62
|
-
* Idempotent repair: re-import hierarchy
|
|
63
|
-
* markdown
|
|
64
|
-
*
|
|
65
|
-
*
|
|
193
|
+
* Idempotent repair: re-import the hierarchy from markdown while allowing
|
|
194
|
+
* markdown status authority only for milestones named by the drifted file's
|
|
195
|
+
* marker entities, then update the marker entry so the next detect pass sees
|
|
196
|
+
* the file as expected. migrateHierarchyToDb is itself idempotent (upsert), so
|
|
197
|
+
* re-running this repair after a successful one is a no-op.
|
|
66
198
|
*/
|
|
67
199
|
async function repairExternalMarkdownEdit(
|
|
68
200
|
record: ExternalMarkdownEditDrift,
|
|
@@ -72,13 +204,28 @@ async function repairExternalMarkdownEdit(
|
|
|
72
204
|
// Dynamic imports break a module-init cycle: this handler ← registry ←
|
|
73
205
|
// state.ts ← guided-flow.ts ← md-importer.ts ← (this handler's old static
|
|
74
206
|
// import). Deferring to repair time keeps module load cycle-free.
|
|
75
|
-
const { migrateHierarchyToDb } = await import("../../md-importer.js");
|
|
207
|
+
const { migrateHierarchyToDb, milestoneIdsFromEntities } = await import("../../md-importer.js");
|
|
76
208
|
const { invalidateStateCache } = await import("../../state.js");
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
|
|
209
|
+
// #027: migrateHierarchyToDb walks the whole tree (a cheap upsert), so
|
|
210
|
+
// without scoping every projection rides along with markdown *status*
|
|
211
|
+
// authority. That lets an unrelated file that is stale from gsd-pi's own
|
|
212
|
+
// miss silently revert a reopened slice/milestone. Scope status authority to
|
|
213
|
+
// exactly the milestone(s) this drifted file projects.
|
|
214
|
+
//
|
|
215
|
+
// Step 1: the marker's `entities` are DB ids (`M001`, `M001/S01`,
|
|
216
|
+
// `M001/S01/T01`), so the milestone id is always the first `/`-segment —
|
|
217
|
+
// layout-independent (legacy `milestones/<MID>/…` and flat `phases/NN-slug/…`
|
|
218
|
+
// both resolve the same way), no projectionPath parsing needed. An empty set
|
|
219
|
+
// (no resolvable entities) preserves DB status everywhere: fail toward
|
|
220
|
+
// protecting the DB, not toward markdown authority.
|
|
221
|
+
const statusAuthoritativeMilestones = milestoneIdsFromEntities(record.entities);
|
|
222
|
+
if (statusAuthoritativeMilestones.size === 0) {
|
|
223
|
+
logWarning(
|
|
224
|
+
"reconcile",
|
|
225
|
+
`external-markdown-edit: no milestone scope resolved for ${record.projectionPath}; preserving DB status for all milestones`,
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
migrateHierarchyToDb(ctx.basePath, { statusAuthoritativeMilestones });
|
|
82
229
|
invalidateStateCache();
|
|
83
230
|
} catch (err) {
|
|
84
231
|
logWarning(
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
// Parallel to external-markdown-edit.ts. Detects sha drift between the compat
|
|
4
4
|
// marker's planning.projections/passthrough and current .planning/ files.
|
|
5
5
|
//
|
|
6
|
-
// Modeled files (projections): re-imported via parsePlanningDirectory → DB
|
|
6
|
+
// Modeled files (projections): re-imported via parsePlanningDirectory → DB,
|
|
7
|
+
// with markdown status authority scoped to their marker entity milestone ids.
|
|
7
8
|
// Passthrough files (un-modeled docs): sha refreshed, content untouched.
|
|
8
9
|
|
|
9
10
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -81,7 +82,10 @@ async function detectExternalPlanningEdit(
|
|
|
81
82
|
_state: GSDState,
|
|
82
83
|
ctx: DriftContext,
|
|
83
84
|
): Promise<ExternalPlanningEditDrift[]> {
|
|
84
|
-
const marker = readCompatMarker(ctx.basePath
|
|
85
|
+
const marker = readCompatMarker(ctx.basePath, {
|
|
86
|
+
healInvalidKeys: !ctx.dryRun,
|
|
87
|
+
quarantineInvalid: !ctx.dryRun,
|
|
88
|
+
});
|
|
85
89
|
if (!marker.planning?.active) {
|
|
86
90
|
// Not yet activated. Activation (layout parse + DB import) is owned by
|
|
87
91
|
// capturePlanningCompatIfNeeded, called from reconcileBeforeDispatch when
|
|
@@ -148,13 +152,25 @@ async function repairExternalPlanningEdit(
|
|
|
148
152
|
const { parsePlanningDirectory } = await import("../../migrate/parser.js");
|
|
149
153
|
const { transformToGSD } = await import("../../migrate/transformer.js");
|
|
150
154
|
const { writeGSDDirectory } = await import("../../migrate/writer.js");
|
|
151
|
-
const { migrateHierarchyToDb } = await import("../../md-importer.js");
|
|
155
|
+
const { migrateHierarchyToDb, milestoneIdsFromEntities } = await import("../../md-importer.js");
|
|
152
156
|
const { invalidateStateCache } = await import("../../state.js");
|
|
153
157
|
|
|
154
158
|
const parsed = await parsePlanningDirectory(join(ctx.basePath, ".planning"));
|
|
155
159
|
const gsdProject = transformToGSD(parsed);
|
|
156
160
|
await writeGSDDirectory(gsdProject, ctx.basePath);
|
|
157
|
-
|
|
161
|
+
// #027: scope status authority to the milestone(s) this drifted .planning/
|
|
162
|
+
// file projects (first `/`-segment of its DB entity ids), so a stale
|
|
163
|
+
// checkbox in an unrelated projection can't revert a reopened slice/milestone
|
|
164
|
+
// in the DB. Unseeded files carry no entities → empty set → preserve DB
|
|
165
|
+
// status everywhere (fail toward the DB, log the breadcrumb).
|
|
166
|
+
const statusAuthoritativeMilestones = milestoneIdsFromEntities(record.entities);
|
|
167
|
+
if (statusAuthoritativeMilestones.size === 0) {
|
|
168
|
+
logWarning(
|
|
169
|
+
"reconcile",
|
|
170
|
+
`external-planning-edit: no milestone scope resolved for ${record.projectionPath}; preserving DB status for all milestones`,
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
migrateHierarchyToDb(ctx.basePath, { statusAuthoritativeMilestones });
|
|
158
174
|
invalidateStateCache();
|
|
159
175
|
} catch (err) {
|
|
160
176
|
logWarning(
|
|
@@ -16,7 +16,7 @@ import { renderRoadmapFromDb } from "../../markdown-renderer.js";
|
|
|
16
16
|
import { findMilestoneIds } from "../../milestone-ids.js";
|
|
17
17
|
import { parseRoadmap } from "../../parsers-legacy.js";
|
|
18
18
|
import { resolveMilestoneFile } from "../../paths.js";
|
|
19
|
-
import { isClosedStatus } from "../../status-guards.js";
|
|
19
|
+
import { isClosedStatus, isSkippedForDispatch } from "../../status-guards.js";
|
|
20
20
|
import type { GSDState } from "../../types.js";
|
|
21
21
|
import type { DriftContext, DriftHandler, DriftRecord } from "../types.js";
|
|
22
22
|
|
|
@@ -94,7 +94,9 @@ export function detectRoadmapDivergenceDrift(
|
|
|
94
94
|
for (const milestoneId of findMilestoneIds(ctx.basePath)) {
|
|
95
95
|
// Skip milestones that don't yet have a DB row — that's the
|
|
96
96
|
// unregistered-milestone drift handler's responsibility.
|
|
97
|
-
|
|
97
|
+
const milestone = getMilestone(milestoneId);
|
|
98
|
+
if (!milestone) continue;
|
|
99
|
+
if (isSkippedForDispatch(milestone.status)) continue;
|
|
98
100
|
if (milestoneHasDivergence(ctx.basePath, milestoneId)) {
|
|
99
101
|
drifts.push({ kind: "roadmap-divergence", milestoneId });
|
|
100
102
|
}
|
|
@@ -49,14 +49,14 @@ export type DriftRecord =
|
|
|
49
49
|
projectionPath: string; // relative to basePath, e.g. "m1/plan.md"
|
|
50
50
|
expectedSha: string; // sha recorded in .compat.json
|
|
51
51
|
actualSha: string; // freshly computed from disk
|
|
52
|
-
entities: string[]; // DB entity ids to
|
|
52
|
+
entities: string[]; // DB entity ids used to scope status authority
|
|
53
53
|
}
|
|
54
54
|
| {
|
|
55
55
|
kind: "external-planning-edit";
|
|
56
56
|
projectionPath: string; // relative to .planning/, e.g. "phases/01-foo/01-01-PLAN.md"
|
|
57
57
|
expectedSha: string;
|
|
58
58
|
actualSha: string;
|
|
59
|
-
entities: string[];
|
|
59
|
+
entities: string[]; // DB entity ids used to scope status authority
|
|
60
60
|
passthrough: boolean; // true = content-only, no re-import, just refresh sha
|
|
61
61
|
};
|
|
62
62
|
|