gsd-pi 2.73.1 → 2.74.0-dev.6e23363
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-web-branch.d.ts +4 -3
- package/dist/cli-web-branch.js +10 -7
- package/dist/cli.js +184 -206
- package/dist/headless-query.js +4 -1
- package/dist/help-text.js +23 -0
- package/dist/logo.d.ts +1 -1
- package/dist/logo.js +1 -1
- package/dist/onboarding.js +59 -53
- package/dist/resource-loader.js +2 -2
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +68 -4
- package/dist/resources/extensions/gsd/activity-log.js +16 -0
- package/dist/resources/extensions/gsd/auto/detect-stuck.js +11 -4
- package/dist/resources/extensions/gsd/auto/loop.js +147 -10
- package/dist/resources/extensions/gsd/auto/phases.js +173 -13
- package/dist/resources/extensions/gsd/auto/session.js +10 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +22 -4
- package/dist/resources/extensions/gsd/auto-model-selection.js +105 -16
- package/dist/resources/extensions/gsd/auto-post-unit.js +254 -15
- package/dist/resources/extensions/gsd/auto-prompts.js +12 -0
- package/dist/resources/extensions/gsd/auto-start.js +23 -6
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +13 -0
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +18 -0
- package/dist/resources/extensions/gsd/auto-verification.js +186 -3
- package/dist/resources/extensions/gsd/auto.js +65 -12
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +21 -8
- package/dist/resources/extensions/gsd/commands/catalog.js +26 -1
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +20 -0
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +68 -9
- package/dist/resources/extensions/gsd/commands-add-tests.js +111 -0
- package/dist/resources/extensions/gsd/commands-backlog.js +140 -0
- package/dist/resources/extensions/gsd/commands-do.js +79 -0
- package/dist/resources/extensions/gsd/commands-handlers.js +8 -2
- package/dist/resources/extensions/gsd/commands-maintenance.js +6 -6
- package/dist/resources/extensions/gsd/commands-pr-branch.js +180 -0
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +1 -1
- package/dist/resources/extensions/gsd/commands-session-report.js +82 -0
- package/dist/resources/extensions/gsd/commands-ship.js +187 -0
- package/dist/resources/extensions/gsd/db-writer.js +3 -5
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +15 -2
- package/dist/resources/extensions/gsd/git-service.js +49 -1
- package/dist/resources/extensions/gsd/graph-context.js +157 -0
- package/dist/resources/extensions/gsd/gsd-db.js +581 -2
- package/dist/resources/extensions/gsd/guided-flow.js +23 -0
- package/dist/resources/extensions/gsd/index.js +15 -2
- package/dist/resources/extensions/gsd/init-wizard.js +1 -0
- package/dist/resources/extensions/gsd/journal.js +27 -0
- package/dist/resources/extensions/gsd/md-importer.js +3 -4
- package/dist/resources/extensions/gsd/memory-store.js +19 -51
- package/dist/resources/extensions/gsd/metrics.js +19 -0
- package/dist/resources/extensions/gsd/milestone-validation-gates.js +13 -12
- package/dist/resources/extensions/gsd/native-git-bridge.js +7 -4
- package/dist/resources/extensions/gsd/notification-widget.js +2 -2
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +33 -1
- package/dist/resources/extensions/gsd/preferences-models.js +63 -3
- package/dist/resources/extensions/gsd/preferences-types.js +2 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +130 -2
- package/dist/resources/extensions/gsd/preferences.js +26 -0
- package/dist/resources/extensions/gsd/prompts/add-tests.md +35 -0
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +12 -2
- package/dist/resources/extensions/gsd/state.js +66 -15
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +18 -0
- package/dist/resources/extensions/gsd/tools/complete-slice.js +20 -0
- package/dist/resources/extensions/gsd/tools/validate-milestone.js +39 -4
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +3 -14
- package/dist/resources/extensions/gsd/triage-resolution.js +2 -5
- package/dist/resources/extensions/gsd/unit-ownership.js +1 -1
- package/dist/resources/extensions/gsd/uok/audit-toggle.js +7 -0
- package/dist/resources/extensions/gsd/uok/audit.js +40 -0
- package/dist/resources/extensions/gsd/uok/contracts.js +1 -0
- package/dist/resources/extensions/gsd/uok/execution-graph.js +179 -0
- package/dist/resources/extensions/gsd/uok/flags.js +29 -0
- package/dist/resources/extensions/gsd/uok/gate-runner.js +109 -0
- package/dist/resources/extensions/gsd/uok/gitops.js +53 -0
- package/dist/resources/extensions/gsd/uok/kernel.js +80 -0
- package/dist/resources/extensions/gsd/uok/loop-adapter.js +133 -0
- package/dist/resources/extensions/gsd/uok/model-policy.js +66 -0
- package/dist/resources/extensions/gsd/uok/plan-v2.js +132 -0
- package/dist/resources/extensions/gsd/workflow-logger.js +22 -0
- package/dist/resources/extensions/gsd/workflow-manifest.js +8 -69
- package/dist/resources/extensions/gsd/workflow-migration.js +21 -22
- package/dist/resources/extensions/gsd/workflow-projections.js +4 -1
- package/dist/resources/extensions/gsd/workflow-reconcile.js +14 -11
- package/dist/resources/extensions/ttsr/ttsr-manager.js +3 -1
- package/dist/tsconfig.extensions.tsbuildinfo +1 -0
- package/dist/update-check.d.ts +1 -0
- package/dist/update-check.js +13 -5
- package/dist/update-cmd.js +4 -3
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +5 -5
- 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 +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +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/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 +2 -2
- 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 +2 -2
- 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 +4 -4
- 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 +4 -4
- 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 +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- 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 +5 -5
- package/dist/web/standalone/.next/server/chunks/63.js +3 -3
- package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
- package/dist/web/standalone/.next/server/middleware.js +2 -2
- package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
- 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/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/server.js +1 -1
- package/package.json +3 -3
- package/packages/daemon/package.json +2 -2
- package/packages/mcp-server/dist/index.d.ts +3 -0
- package/packages/mcp-server/dist/index.d.ts.map +1 -1
- package/packages/mcp-server/dist/index.js +3 -0
- package/packages/mcp-server/dist/index.js.map +1 -1
- package/packages/mcp-server/dist/readers/graph.d.ts +87 -0
- package/packages/mcp-server/dist/readers/graph.d.ts.map +1 -0
- package/packages/mcp-server/dist/readers/graph.js +548 -0
- package/packages/mcp-server/dist/readers/graph.js.map +1 -0
- package/packages/mcp-server/dist/readers/index.d.ts +2 -0
- package/packages/mcp-server/dist/readers/index.d.ts.map +1 -1
- package/packages/mcp-server/dist/readers/index.js +1 -0
- package/packages/mcp-server/dist/readers/index.js.map +1 -1
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +65 -0
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/package.json +2 -2
- package/packages/mcp-server/src/index.ts +15 -0
- package/packages/mcp-server/src/readers/graph.test.ts +426 -0
- package/packages/mcp-server/src/readers/graph.ts +708 -0
- package/packages/mcp-server/src/readers/index.ts +12 -0
- package/packages/mcp-server/src/server.ts +83 -0
- package/packages/mcp-server/tsconfig.json +1 -0
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -0
- package/packages/native/package.json +2 -2
- package/packages/native/tsconfig.tsbuildinfo +1 -0
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-agent-core/tsconfig.json +1 -0
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -0
- package/packages/pi-ai/dist/index.d.ts +1 -0
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +1 -0
- package/packages/pi-ai/dist/index.js.map +1 -1
- package/packages/pi-ai/dist/utils/overflow.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/overflow.js +12 -0
- package/packages/pi-ai/dist/utils/overflow.js.map +1 -1
- package/packages/pi-ai/dist/utils/tests/overflow.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/tests/overflow.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/tests/overflow.test.js +50 -0
- package/packages/pi-ai/dist/utils/tests/overflow.test.js.map +1 -0
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/src/index.ts +4 -0
- package/packages/pi-ai/src/utils/overflow.ts +14 -1
- package/packages/pi-ai/src/utils/tests/overflow.test.ts +58 -0
- package/packages/pi-ai/tsconfig.json +1 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +433 -8
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.js +5 -5
- package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.js +45 -0
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-env-fallback.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-registry-env-fallback.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-env-fallback.test.js +52 -0
- package/packages/pi-coding-agent/dist/core/model-registry-env-fallback.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +2 -2
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +12 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +61 -28
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +2 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +9 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.js +52 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +142 -20
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +11 -3
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +521 -8
- package/packages/pi-coding-agent/src/core/compaction/utils.ts +5 -5
- package/packages/pi-coding-agent/src/core/compaction-utils.test.ts +50 -0
- package/packages/pi-coding-agent/src/core/model-registry-env-fallback.test.ts +59 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +2 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +74 -32
- package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.test.ts +73 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.ts +9 -3
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +166 -25
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +11 -3
- package/packages/pi-coding-agent/src/types/ambient-modules.d.ts +69 -0
- package/packages/pi-coding-agent/tsconfig.json +3 -2
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -0
- package/packages/pi-tui/dist/__tests__/tui.test.js +60 -1
- package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
- package/packages/pi-tui/dist/tui.d.ts +8 -0
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +32 -3
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/pi-tui/src/__tests__/tui.test.ts +76 -1
- package/packages/pi-tui/src/tui.ts +31 -3
- package/packages/pi-tui/tsconfig.json +1 -0
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -0
- package/packages/rpc-client/package.json +1 -1
- package/packages/rpc-client/tsconfig.json +1 -0
- package/packages/rpc-client/tsconfig.tsbuildinfo +1 -0
- package/pkg/package.json +1 -1
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +107 -5
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +111 -2
- package/src/resources/extensions/gsd/activity-log.ts +21 -0
- package/src/resources/extensions/gsd/auto/detect-stuck.ts +12 -4
- package/src/resources/extensions/gsd/auto/loop-deps.ts +10 -0
- package/src/resources/extensions/gsd/auto/loop.ts +159 -10
- package/src/resources/extensions/gsd/auto/phases.ts +213 -13
- package/src/resources/extensions/gsd/auto/session.ts +10 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +26 -10
- package/src/resources/extensions/gsd/auto-model-selection.ts +151 -16
- package/src/resources/extensions/gsd/auto-post-unit.ts +278 -16
- package/src/resources/extensions/gsd/auto-prompts.ts +13 -0
- package/src/resources/extensions/gsd/auto-start.ts +30 -6
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +17 -0
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +25 -1
- package/src/resources/extensions/gsd/auto-verification.ts +225 -3
- package/src/resources/extensions/gsd/auto.ts +72 -16
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +24 -8
- package/src/resources/extensions/gsd/commands/catalog.ts +26 -1
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +20 -0
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +74 -9
- package/src/resources/extensions/gsd/commands-add-tests.ts +137 -0
- package/src/resources/extensions/gsd/commands-backlog.ts +182 -0
- package/src/resources/extensions/gsd/commands-do.ts +109 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +8 -2
- package/src/resources/extensions/gsd/commands-maintenance.ts +6 -6
- package/src/resources/extensions/gsd/commands-pr-branch.ts +234 -0
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +1 -1
- package/src/resources/extensions/gsd/commands-session-report.ts +101 -0
- package/src/resources/extensions/gsd/commands-ship.ts +219 -0
- package/src/resources/extensions/gsd/db-writer.ts +3 -5
- package/src/resources/extensions/gsd/docs/preferences-reference.md +15 -2
- package/src/resources/extensions/gsd/git-service.ts +68 -0
- package/src/resources/extensions/gsd/graph-context.ts +212 -0
- package/src/resources/extensions/gsd/gsd-db.ts +788 -3
- package/src/resources/extensions/gsd/guided-flow.ts +32 -0
- package/src/resources/extensions/gsd/index.ts +18 -2
- package/src/resources/extensions/gsd/init-wizard.ts +3 -2
- package/src/resources/extensions/gsd/journal.ts +30 -0
- package/src/resources/extensions/gsd/md-importer.ts +3 -5
- package/src/resources/extensions/gsd/memory-store.ts +31 -62
- package/src/resources/extensions/gsd/metrics.ts +26 -0
- package/src/resources/extensions/gsd/milestone-validation-gates.ts +13 -14
- package/src/resources/extensions/gsd/native-git-bridge.ts +11 -12
- package/src/resources/extensions/gsd/notification-widget.ts +2 -2
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +40 -1
- package/src/resources/extensions/gsd/preferences-models.ts +61 -3
- package/src/resources/extensions/gsd/preferences-types.ts +44 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +130 -2
- package/src/resources/extensions/gsd/preferences.ts +28 -0
- package/src/resources/extensions/gsd/prompts/add-tests.md +35 -0
- package/src/resources/extensions/gsd/session-lock.ts +14 -2
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +20 -1
- package/src/resources/extensions/gsd/state.ts +80 -17
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +18 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +9 -5
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/auto-post-unit-step-message.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/auto-project-root-env.test.ts +7 -3
- package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +51 -2
- package/src/resources/extensions/gsd/tests/cold-resume-db-reopen.test.ts +6 -2
- package/src/resources/extensions/gsd/tests/commands-backlog.test.ts +158 -0
- package/src/resources/extensions/gsd/tests/commands-do.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/commands-pr-branch.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/commands-session-report.test.ts +82 -0
- package/src/resources/extensions/gsd/tests/commands-ship.test.ts +71 -0
- package/src/resources/extensions/gsd/tests/commands-workflow-custom.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/complete-milestone-false-merge.test.ts +142 -0
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/completed-at-reconcile.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/derive-state-crossval.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +68 -8
- package/src/resources/extensions/gsd/tests/derive-state.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/extension-bootstrap-isolation.test.ts +154 -0
- package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +10 -7
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +137 -1
- package/src/resources/extensions/gsd/tests/graph-context.test.ts +337 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/integration/state-machine-edge-cases.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +68 -1
- package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -2
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -3
- package/src/resources/extensions/gsd/tests/model-isolation.test.ts +91 -2
- package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +79 -1
- package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +40 -1
- package/src/resources/extensions/gsd/tests/preferences.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/single-writer-invariant.test.ts +180 -0
- package/src/resources/extensions/gsd/tests/state-machine-full-walkthrough.test.ts +5 -7
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +9 -6
- package/src/resources/extensions/gsd/tests/uok-audit-unified.test.ts +101 -0
- package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +85 -0
- package/src/resources/extensions/gsd/tests/uok-execution-graph.test.ts +69 -0
- package/src/resources/extensions/gsd/tests/uok-flags.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/uok-gate-runner.test.ts +70 -0
- package/src/resources/extensions/gsd/tests/uok-gitops-turn-action.test.ts +85 -0
- package/src/resources/extensions/gsd/tests/uok-gitops-wiring.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/uok-model-policy.test.ts +89 -0
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +167 -0
- package/src/resources/extensions/gsd/tests/uok-preferences.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +179 -0
- package/src/resources/extensions/gsd/tests/validate-milestone-write-order.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +223 -0
- package/src/resources/extensions/gsd/tools/complete-slice.ts +26 -0
- package/src/resources/extensions/gsd/tools/validate-milestone.ts +48 -3
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +3 -11
- package/src/resources/extensions/gsd/triage-resolution.ts +2 -7
- package/src/resources/extensions/gsd/types.ts +1 -1
- package/src/resources/extensions/gsd/unit-ownership.ts +2 -2
- package/src/resources/extensions/gsd/uok/audit-toggle.ts +9 -0
- package/src/resources/extensions/gsd/uok/audit.ts +51 -0
- package/src/resources/extensions/gsd/uok/contracts.ts +135 -0
- package/src/resources/extensions/gsd/uok/execution-graph.ts +241 -0
- package/src/resources/extensions/gsd/uok/flags.ts +45 -0
- package/src/resources/extensions/gsd/uok/gate-runner.ts +146 -0
- package/src/resources/extensions/gsd/uok/gitops.ts +75 -0
- package/src/resources/extensions/gsd/uok/kernel.ts +105 -0
- package/src/resources/extensions/gsd/uok/loop-adapter.ts +162 -0
- package/src/resources/extensions/gsd/uok/model-policy.ts +112 -0
- package/src/resources/extensions/gsd/uok/plan-v2.ts +156 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +25 -0
- package/src/resources/extensions/gsd/workflow-manifest.ts +9 -104
- package/src/resources/extensions/gsd/workflow-migration.ts +21 -29
- package/src/resources/extensions/gsd/workflow-projections.ts +8 -1
- package/src/resources/extensions/gsd/workflow-reconcile.ts +15 -15
- package/src/resources/extensions/ttsr/ttsr-manager.ts +10 -5
- package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
- /package/dist/web/standalone/.next/static/{Qr27MOHx0lxRGnJvlhxxu → bc2gRVFTgD7j--BsJE7vP}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{Qr27MOHx0lxRGnJvlhxxu → bc2gRVFTgD7j--BsJE7vP}/_ssgManifest.js +0 -0
|
@@ -691,7 +691,7 @@ describe("transition boundary failures", () => {
|
|
|
691
691
|
);
|
|
692
692
|
});
|
|
693
693
|
|
|
694
|
-
test("blocked state: all slices have unmet deps →
|
|
694
|
+
test("blocked state: all slices have unmet deps → fallback picks slice", async () => {
|
|
695
695
|
base = makeTempDir();
|
|
696
696
|
const mDir = join(base, ".gsd", "milestones", "M001");
|
|
697
697
|
mkdirSync(join(mDir, "slices", "S01", "tasks"), { recursive: true });
|
|
@@ -736,7 +736,9 @@ describe("transition boundary failures", () => {
|
|
|
736
736
|
|
|
737
737
|
invalidateAllCaches();
|
|
738
738
|
const state = await deriveStateFromDb(base);
|
|
739
|
-
|
|
739
|
+
// With partial-dep fallback, circular deps no longer block — fallback picks first eligible slice
|
|
740
|
+
assert.equal(state.phase, "planning", "circular deps: fallback picks a slice instead of blocking");
|
|
741
|
+
assert.ok(state.activeSlice !== null, "activeSlice set via fallback");
|
|
740
742
|
});
|
|
741
743
|
});
|
|
742
744
|
|
|
@@ -92,6 +92,7 @@ function makeMockDeps(
|
|
|
92
92
|
getPriorSliceCompletionBlocker: () => null,
|
|
93
93
|
getMainBranch: () => "main",
|
|
94
94
|
closeoutUnit: async () => {},
|
|
95
|
+
autoCommitUnit: async () => null,
|
|
95
96
|
recordOutcome: () => {},
|
|
96
97
|
writeLock: () => {},
|
|
97
98
|
captureAvailableSkills: () => {},
|
|
@@ -567,7 +568,15 @@ test("unit-end event contains errorContext when unit is cancelled with structure
|
|
|
567
568
|
const { resolveAgentEndCancelled, _resetPendingResolve } = await import("../auto-loop.js");
|
|
568
569
|
_resetPendingResolve();
|
|
569
570
|
|
|
570
|
-
|
|
571
|
+
let pauseCalls = 0;
|
|
572
|
+
let commitCalls = 0;
|
|
573
|
+
const deps = makeMockDeps(capture, {
|
|
574
|
+
pauseAuto: async () => { pauseCalls++; },
|
|
575
|
+
autoCommitUnit: async () => {
|
|
576
|
+
commitCalls++;
|
|
577
|
+
return "commit";
|
|
578
|
+
},
|
|
579
|
+
});
|
|
571
580
|
const ic = makeIC(deps);
|
|
572
581
|
const iterData: IterationData = {
|
|
573
582
|
unitType: "execute-task",
|
|
@@ -593,10 +602,68 @@ test("unit-end event contains errorContext when unit is cancelled with structure
|
|
|
593
602
|
// Transient timeout cancellations pause (recoverable) instead of hard-stopping
|
|
594
603
|
assert.equal(result.action, "break");
|
|
595
604
|
assert.equal((result as any).reason, "session-timeout");
|
|
605
|
+
assert.equal(pauseCalls, 1, "timeout cancellations should pause auto-mode exactly once");
|
|
606
|
+
assert.equal(commitCalls, 1, "timeout cancellations should flush a unit auto-commit once");
|
|
596
607
|
|
|
597
608
|
// Verify error classification used structured errorContext on the window entry
|
|
598
609
|
const entry = loopState.recentUnits[loopState.recentUnits.length - 1];
|
|
599
610
|
assert.ok(entry.error, "window entry must have error set");
|
|
600
611
|
assert.ok(entry.error!.startsWith("timeout:"), "error must start with category from errorContext");
|
|
601
612
|
assert.ok(entry.error!.includes("Hard timeout error"), "error must include the errorContext message");
|
|
613
|
+
|
|
614
|
+
const endEvents = capture.events.filter(e => e.eventType === "unit-end");
|
|
615
|
+
assert.equal(endEvents.length, 1, "timeout cancellations should still emit unit-end");
|
|
616
|
+
assert.equal((endEvents[0].data as any).status, "cancelled");
|
|
617
|
+
assert.equal((endEvents[0].data as any).artifactVerified, false);
|
|
618
|
+
assert.equal((endEvents[0].data as any).errorContext.category, "timeout");
|
|
619
|
+
});
|
|
620
|
+
|
|
621
|
+
test("session-failed cancellations close out and emit unit-end before hard stop", async () => {
|
|
622
|
+
const capture = createEventCapture();
|
|
623
|
+
const { resolveAgentEndCancelled, _resetPendingResolve } = await import("../auto-loop.js");
|
|
624
|
+
_resetPendingResolve();
|
|
625
|
+
|
|
626
|
+
let closeoutCalls = 0;
|
|
627
|
+
let commitCalls = 0;
|
|
628
|
+
let stopCalls = 0;
|
|
629
|
+
const deps = makeMockDeps(capture, {
|
|
630
|
+
closeoutUnit: async () => { closeoutCalls++; },
|
|
631
|
+
autoCommitUnit: async () => {
|
|
632
|
+
commitCalls++;
|
|
633
|
+
return "commit";
|
|
634
|
+
},
|
|
635
|
+
stopAuto: async () => { stopCalls++; },
|
|
636
|
+
});
|
|
637
|
+
const ic = makeIC(deps);
|
|
638
|
+
const iterData: IterationData = {
|
|
639
|
+
unitType: "execute-task",
|
|
640
|
+
unitId: "M001/S01/T01",
|
|
641
|
+
prompt: "do stuff",
|
|
642
|
+
finalPrompt: "do stuff",
|
|
643
|
+
pauseAfterUatDispatch: false,
|
|
644
|
+
state: { phase: "executing", activeMilestone: { id: "M001" }, activeSlice: { id: "S01" }, registry: [], blockers: [] } as any,
|
|
645
|
+
mid: "M001",
|
|
646
|
+
midTitle: "Test",
|
|
647
|
+
isRetry: false,
|
|
648
|
+
previousTier: undefined,
|
|
649
|
+
};
|
|
650
|
+
const loopState: LoopState = { recentUnits: [{ key: "execute-task/M001/S01/T01" }], stuckRecoveryAttempts: 0, consecutiveFinalizeTimeouts: 0 };
|
|
651
|
+
|
|
652
|
+
const unitPromise = runUnitPhase(ic, iterData, loopState);
|
|
653
|
+
await new Promise(r => setTimeout(r, 50));
|
|
654
|
+
|
|
655
|
+
resolveAgentEndCancelled({ message: "session bootstrap exploded", category: "session-failed", isTransient: false });
|
|
656
|
+
|
|
657
|
+
const result = await unitPromise;
|
|
658
|
+
assert.equal(result.action, "break");
|
|
659
|
+
assert.equal((result as any).reason, "session-failed");
|
|
660
|
+
assert.equal(closeoutCalls, 1, "session-failed cancellations should close out the unit before stopping");
|
|
661
|
+
assert.equal(commitCalls, 1, "session-failed cancellations should try one auto-commit flush");
|
|
662
|
+
assert.equal(stopCalls, 1, "session-failed cancellations should hard-stop auto-mode");
|
|
663
|
+
|
|
664
|
+
const endEvents = capture.events.filter(e => e.eventType === "unit-end");
|
|
665
|
+
assert.equal(endEvents.length, 1, "session-failed cancellations should emit unit-end");
|
|
666
|
+
assert.equal((endEvents[0].data as any).status, "cancelled");
|
|
667
|
+
assert.equal((endEvents[0].data as any).artifactVerified, false);
|
|
668
|
+
assert.equal((endEvents[0].data as any).errorContext.category, "session-failed");
|
|
602
669
|
});
|
|
@@ -363,7 +363,7 @@ test('md-importer: schema v1→v2 migration', () => {
|
|
|
363
363
|
openDatabase(':memory:');
|
|
364
364
|
const adapter = _getAdapter();
|
|
365
365
|
const version = adapter?.prepare('SELECT MAX(version) as v FROM schema_version').get();
|
|
366
|
-
assert.deepStrictEqual(version?.v,
|
|
366
|
+
assert.deepStrictEqual(version?.v, 15, 'new DB should be at schema version 15');
|
|
367
367
|
|
|
368
368
|
// Artifacts table should exist
|
|
369
369
|
const tableCheck = adapter?.prepare("SELECT count(*) as c FROM sqlite_master WHERE type='table' AND name='artifacts'").get();
|
|
@@ -413,4 +413,3 @@ test('md-importer: round-trip fidelity', () => {
|
|
|
413
413
|
});
|
|
414
414
|
|
|
415
415
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
416
|
-
|
|
@@ -323,10 +323,9 @@ test('memory-store: schema includes memories table', () => {
|
|
|
323
323
|
const viewCount = adapter.prepare('SELECT count(*) as cnt FROM active_memories').get();
|
|
324
324
|
assert.deepStrictEqual(viewCount?.['cnt'], 0, 'active_memories view should exist');
|
|
325
325
|
|
|
326
|
-
// Verify schema version is
|
|
326
|
+
// Verify schema version is 15 (UOK gate/git/audit projection tables included)
|
|
327
327
|
const version = adapter.prepare('SELECT MAX(version) as v FROM schema_version').get();
|
|
328
|
-
assert.deepStrictEqual(version?.['v'],
|
|
328
|
+
assert.deepStrictEqual(version?.['v'], 15, 'schema version should be 15');
|
|
329
329
|
|
|
330
330
|
closeDatabase();
|
|
331
331
|
});
|
|
332
|
-
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tests for model config isolation between concurrent instances (#650, #1065)
|
|
3
|
-
*
|
|
2
|
+
* Tests for model config isolation between concurrent instances (#650, #1065),
|
|
3
|
+
* session-scoped model precedence behavior including manual session override,
|
|
4
|
+
* GSD preferences override of settings.json defaults (#3517), and custom
|
|
5
|
+
* provider precedence over PREFERENCES.md when set via `/gsd model` (#4122).
|
|
4
6
|
*/
|
|
5
7
|
|
|
6
8
|
import { describe, it, beforeEach, afterEach } from "node:test";
|
|
@@ -214,3 +216,90 @@ describe("manual session model override precedence", () => {
|
|
|
214
216
|
"should be null when no model source is available");
|
|
215
217
|
});
|
|
216
218
|
});
|
|
219
|
+
|
|
220
|
+
// ─── Custom provider session model wins over PREFERENCES.md (#4122) ─────────
|
|
221
|
+
|
|
222
|
+
describe("custom provider session model overrides PREFERENCES.md (#4122)", () => {
|
|
223
|
+
// Mirrors the auto-start.ts logic:
|
|
224
|
+
// sessionProviderIsCustom && ctx.model
|
|
225
|
+
// ? ctx.model
|
|
226
|
+
// : (preferredModel ?? ctx.model ?? null)
|
|
227
|
+
function selectStartModel(args: {
|
|
228
|
+
ctxModel: { provider: string; id: string } | null;
|
|
229
|
+
preferredModel: { provider: string; id: string } | undefined;
|
|
230
|
+
sessionProviderIsCustom: boolean;
|
|
231
|
+
}): { provider: string; id: string } | null {
|
|
232
|
+
const { ctxModel, preferredModel, sessionProviderIsCustom } = args;
|
|
233
|
+
if (sessionProviderIsCustom && ctxModel) {
|
|
234
|
+
return { provider: ctxModel.provider, id: ctxModel.id };
|
|
235
|
+
}
|
|
236
|
+
return preferredModel
|
|
237
|
+
?? (ctxModel ? { provider: ctxModel.provider, id: ctxModel.id } : null);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
it("custom provider from /gsd model wins over PREFERENCES.md built-in default", () => {
|
|
241
|
+
// User runs `/gsd model ollama/llama3.1:8b`, then `/gsd auto`.
|
|
242
|
+
// PREFERENCES.md still has the project-template claude-code default.
|
|
243
|
+
const ctxModel = { provider: "ollama", id: "llama3.1:8b" };
|
|
244
|
+
const preferredModel = { provider: "claude-code", id: "claude-sonnet-4-6" };
|
|
245
|
+
|
|
246
|
+
const snapshot = selectStartModel({
|
|
247
|
+
ctxModel,
|
|
248
|
+
preferredModel,
|
|
249
|
+
sessionProviderIsCustom: true,
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
assert.equal(snapshot?.provider, "ollama",
|
|
253
|
+
"custom-provider session model must win over PREFERENCES.md");
|
|
254
|
+
assert.equal(snapshot?.id, "llama3.1:8b",
|
|
255
|
+
"custom-provider session model id must be preserved");
|
|
256
|
+
assert.notEqual(snapshot?.provider, "claude-code",
|
|
257
|
+
"claude-code from PREFERENCES.md must NOT be selected when session is custom");
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
it("built-in session provider still defers to PREFERENCES.md (#3517 preserved)", () => {
|
|
261
|
+
// ctx.model is a built-in provider (claude-code) but PREFERENCES.md has
|
|
262
|
+
// an explicit openai-codex preference. PREFERENCES.md should still win.
|
|
263
|
+
const ctxModel = { provider: "claude-code", id: "claude-sonnet-4-6" };
|
|
264
|
+
const preferredModel = { provider: "openai-codex", id: "gpt-5.4" };
|
|
265
|
+
|
|
266
|
+
const snapshot = selectStartModel({
|
|
267
|
+
ctxModel,
|
|
268
|
+
preferredModel,
|
|
269
|
+
sessionProviderIsCustom: false,
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
assert.equal(snapshot?.provider, "openai-codex",
|
|
273
|
+
"PREFERENCES.md must still win when session provider is built-in");
|
|
274
|
+
assert.equal(snapshot?.id, "gpt-5.4");
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it("custom provider with no PREFERENCES.md still uses ctx.model", () => {
|
|
278
|
+
const ctxModel = { provider: "vllm", id: "qwen2.5-coder:32b" };
|
|
279
|
+
|
|
280
|
+
const snapshot = selectStartModel({
|
|
281
|
+
ctxModel,
|
|
282
|
+
preferredModel: undefined,
|
|
283
|
+
sessionProviderIsCustom: true,
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
assert.equal(snapshot?.provider, "vllm");
|
|
287
|
+
assert.equal(snapshot?.id, "qwen2.5-coder:32b");
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
it("null ctx.model with custom flag falls through to preferredModel", () => {
|
|
291
|
+
// Defensive: sessionProviderIsCustom can only be true if ctx.model exists,
|
|
292
|
+
// but verify the guard works if that invariant is ever broken.
|
|
293
|
+
const preferredModel = { provider: "claude-code", id: "claude-sonnet-4-6" };
|
|
294
|
+
|
|
295
|
+
const snapshot = selectStartModel({
|
|
296
|
+
ctxModel: null,
|
|
297
|
+
preferredModel,
|
|
298
|
+
sessionProviderIsCustom: true,
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
assert.equal(snapshot?.provider, "claude-code",
|
|
302
|
+
"should fall back to preferredModel when ctx.model is null");
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// native-git-bridge-exec-fallback.test.ts — regression for #4180
|
|
2
|
+
//
|
|
3
|
+
// nativeCommit, nativeIsRepo, and nativeResetHard used execSync() (string
|
|
4
|
+
// command) in their fallback paths. On Windows, execSync spawns cmd.exe which
|
|
5
|
+
// cannot resolve git when Git for Windows is installed via MSYS2/bash but not
|
|
6
|
+
// in cmd.exe's PATH. All other fallback paths in this file use execFileSync()
|
|
7
|
+
// which invokes the binary directly — these three must do the same.
|
|
8
|
+
//
|
|
9
|
+
// Static-analysis tests fail before the fix (source still has execSync calls)
|
|
10
|
+
// and pass after (replaced with execFileSync). Integration tests verify the
|
|
11
|
+
// fallback functions behave correctly on all platforms.
|
|
12
|
+
|
|
13
|
+
import { describe, test, beforeEach, afterEach } from "node:test";
|
|
14
|
+
import assert from "node:assert/strict";
|
|
15
|
+
import { mkdtempSync, writeFileSync, readFileSync, rmSync } from "node:fs";
|
|
16
|
+
import { join } from "node:path";
|
|
17
|
+
import { tmpdir } from "node:os";
|
|
18
|
+
import { execFileSync } from "node:child_process";
|
|
19
|
+
import { nativeIsRepo, nativeCommit, nativeResetHard } from "../native-git-bridge.js";
|
|
20
|
+
|
|
21
|
+
// ─── Static analysis ──────────────────────────────────────────────────────
|
|
22
|
+
// Verify the fallback paths of the three affected functions do not call the
|
|
23
|
+
// raw execSync() string-command variant. Replacing all execFileSync( tokens
|
|
24
|
+
// first ensures we match only the bare execSync( form.
|
|
25
|
+
|
|
26
|
+
const SRC_PATH = join(import.meta.dirname, "..", "native-git-bridge.ts");
|
|
27
|
+
|
|
28
|
+
function extractFunctionBody(src: string, fnName: string): string {
|
|
29
|
+
const idx = src.indexOf(`export function ${fnName}`);
|
|
30
|
+
if (idx === -1) throw new Error(`${fnName} not found in source`);
|
|
31
|
+
return src.slice(idx, idx + 1500);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function hasRawExecSync(body: string): boolean {
|
|
35
|
+
const withoutFileSync = body.replace(/execFileSync\(/g, "__FILESYNC__");
|
|
36
|
+
return withoutFileSync.includes("execSync(");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
describe("native-git-bridge #4180: fallback paths use execFileSync not execSync", () => {
|
|
40
|
+
const src = readFileSync(SRC_PATH, "utf-8");
|
|
41
|
+
|
|
42
|
+
test("nativeIsRepo fallback does not use raw execSync", () => {
|
|
43
|
+
const body = extractFunctionBody(src, "nativeIsRepo");
|
|
44
|
+
assert.equal(
|
|
45
|
+
hasRawExecSync(body),
|
|
46
|
+
false,
|
|
47
|
+
"nativeIsRepo fallback must use execFileSync to avoid cmd.exe PATH failures on Windows",
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test("nativeCommit fallback does not use raw execSync", () => {
|
|
52
|
+
const body = extractFunctionBody(src, "nativeCommit");
|
|
53
|
+
assert.equal(
|
|
54
|
+
hasRawExecSync(body),
|
|
55
|
+
false,
|
|
56
|
+
"nativeCommit fallback must use execFileSync to avoid cmd.exe PATH failures on Windows",
|
|
57
|
+
);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test("nativeResetHard fallback does not use raw execSync", () => {
|
|
61
|
+
const body = extractFunctionBody(src, "nativeResetHard");
|
|
62
|
+
assert.equal(
|
|
63
|
+
hasRawExecSync(body),
|
|
64
|
+
false,
|
|
65
|
+
"nativeResetHard fallback must use execFileSync to avoid cmd.exe PATH failures on Windows",
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// ─── Integration tests ────────────────────────────────────────────────────
|
|
71
|
+
// Verify correct runtime behaviour through the fallback path (native module
|
|
72
|
+
// is disabled by default in tests — GSD_ENABLE_NATIVE_GSD_GIT is not set).
|
|
73
|
+
|
|
74
|
+
function git(args: string[], cwd: string): string {
|
|
75
|
+
return execFileSync("git", args, { cwd, stdio: ["ignore", "pipe", "pipe"], encoding: "utf-8" }).trim();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
describe("native-git-bridge #4180: fallback runtime behaviour", () => {
|
|
79
|
+
let repo: string;
|
|
80
|
+
|
|
81
|
+
beforeEach(() => {
|
|
82
|
+
repo = mkdtempSync(join(tmpdir(), "ngb4180-"));
|
|
83
|
+
git(["init"], repo);
|
|
84
|
+
git(["config", "user.email", "test@test.com"], repo);
|
|
85
|
+
git(["config", "user.name", "Test"], repo);
|
|
86
|
+
writeFileSync(join(repo, "file.txt"), "initial\n");
|
|
87
|
+
git(["add", "."], repo);
|
|
88
|
+
git(["commit", "-m", "init"], repo);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
afterEach(() => {
|
|
92
|
+
rmSync(repo, { recursive: true, force: true });
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test("nativeIsRepo returns true for a valid git repository", () => {
|
|
96
|
+
assert.equal(nativeIsRepo(repo), true);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test("nativeIsRepo returns false for a plain directory", (t) => {
|
|
100
|
+
const dir = mkdtempSync(join(tmpdir(), "ngb4180-notrepo-"));
|
|
101
|
+
t.after(() => rmSync(dir, { recursive: true, force: true }));
|
|
102
|
+
assert.equal(nativeIsRepo(dir), false);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test("nativeCommit commits staged changes and returns non-null output", () => {
|
|
106
|
+
writeFileSync(join(repo, "file.txt"), "modified\n");
|
|
107
|
+
git(["add", "."], repo);
|
|
108
|
+
|
|
109
|
+
const result = nativeCommit(repo, "test: regression commit #4180");
|
|
110
|
+
assert.ok(result !== null, "should return output string for a successful commit");
|
|
111
|
+
|
|
112
|
+
const subject = git(["log", "-1", "--format=%s"], repo);
|
|
113
|
+
assert.equal(subject, "test: regression commit #4180");
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test("nativeCommit returns null when nothing is staged", () => {
|
|
117
|
+
const result = nativeCommit(repo, "test: nothing staged");
|
|
118
|
+
assert.equal(result, null);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test("nativeCommit respects the allowEmpty option", () => {
|
|
122
|
+
const result = nativeCommit(repo, "test: empty commit #4180", { allowEmpty: true });
|
|
123
|
+
assert.ok(result !== null, "allow-empty commit should return output");
|
|
124
|
+
|
|
125
|
+
const subject = git(["log", "-1", "--format=%s"], repo);
|
|
126
|
+
assert.equal(subject, "test: empty commit #4180");
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
test("nativeResetHard discards unstaged working tree changes", () => {
|
|
130
|
+
writeFileSync(join(repo, "file.txt"), "dirty content\n");
|
|
131
|
+
|
|
132
|
+
const statusBefore = git(["status", "--short"], repo);
|
|
133
|
+
assert.ok(statusBefore.length > 0, "repo should be dirty before reset");
|
|
134
|
+
|
|
135
|
+
nativeResetHard(repo);
|
|
136
|
+
|
|
137
|
+
const content = readFileSync(join(repo, "file.txt"), "utf-8");
|
|
138
|
+
assert.equal(content, "initial\n", "file should be restored to HEAD content after hard reset");
|
|
139
|
+
});
|
|
140
|
+
});
|
|
@@ -14,7 +14,7 @@ import { join } from "node:path";
|
|
|
14
14
|
|
|
15
15
|
import { runPostUnitVerification, type VerificationContext } from "../auto-verification.ts";
|
|
16
16
|
import { AutoSession } from "../auto/session.ts";
|
|
17
|
-
import { openDatabase, closeDatabase, insertMilestone, insertSlice, insertTask } from "../gsd-db.ts";
|
|
17
|
+
import { openDatabase, closeDatabase, insertMilestone, insertSlice, insertTask, _getAdapter } from "../gsd-db.ts";
|
|
18
18
|
import { invalidateAllCaches } from "../cache.ts";
|
|
19
19
|
import { _clearGsdRootCache } from "../paths.ts";
|
|
20
20
|
|
|
@@ -140,6 +140,43 @@ function createBasicTask(): void {
|
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
function createPostExecFailureTask(): void {
|
|
144
|
+
insertMilestone({ id: "M001" });
|
|
145
|
+
insertSlice({
|
|
146
|
+
id: "S01",
|
|
147
|
+
milestoneId: "M001",
|
|
148
|
+
title: "Test Slice",
|
|
149
|
+
risk: "low",
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
const srcDir = join(tempDir, "src");
|
|
153
|
+
mkdirSync(srcDir, { recursive: true });
|
|
154
|
+
writeFileSync(
|
|
155
|
+
join(srcDir, "broken.ts"),
|
|
156
|
+
"import { missing } from './does-not-exist.js';\nexport const ok = 1;\n",
|
|
157
|
+
"utf-8",
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
insertTask({
|
|
161
|
+
id: "T01",
|
|
162
|
+
sliceId: "S01",
|
|
163
|
+
milestoneId: "M001",
|
|
164
|
+
title: "Task with broken import",
|
|
165
|
+
status: "pending",
|
|
166
|
+
keyFiles: ["src/broken.ts"],
|
|
167
|
+
planning: {
|
|
168
|
+
description: "Task that introduces an unresolved import in key files",
|
|
169
|
+
estimate: "1h",
|
|
170
|
+
files: ["src/broken.ts"],
|
|
171
|
+
verify: "echo pass",
|
|
172
|
+
inputs: [],
|
|
173
|
+
expectedOutput: [],
|
|
174
|
+
observabilityImpact: "",
|
|
175
|
+
},
|
|
176
|
+
sequence: 0,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
143
180
|
// ─── Tests ───────────────────────────────────────────────────────────────────
|
|
144
181
|
|
|
145
182
|
describe("Post-execution blocking failure retry bypass", () => {
|
|
@@ -249,6 +286,47 @@ describe("Post-execution blocking failure retry bypass", () => {
|
|
|
249
286
|
// This test mainly confirms the wiring is correct
|
|
250
287
|
assert.equal(result, "continue");
|
|
251
288
|
});
|
|
289
|
+
|
|
290
|
+
test("uok gate runner persists post-execution gate failures when enabled", async () => {
|
|
291
|
+
createPostExecFailureTask();
|
|
292
|
+
writePreferences({
|
|
293
|
+
enhanced_verification: true,
|
|
294
|
+
enhanced_verification_post: true,
|
|
295
|
+
verification_auto_fix: true,
|
|
296
|
+
verification_max_retries: 2,
|
|
297
|
+
uok: {
|
|
298
|
+
enabled: true,
|
|
299
|
+
gates: { enabled: true },
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
const ctx = makeMockCtx();
|
|
304
|
+
const pi = makeMockPi();
|
|
305
|
+
const pauseAutoMock = mock.fn(async () => {});
|
|
306
|
+
const s = makeMockSession(tempDir, { type: "execute-task", id: "M001/S01/T01" });
|
|
307
|
+
const vctx: VerificationContext = { s, ctx, pi };
|
|
308
|
+
|
|
309
|
+
const result = await runPostUnitVerification(vctx, pauseAutoMock);
|
|
310
|
+
|
|
311
|
+
assert.equal(result, "pause");
|
|
312
|
+
assert.equal(pauseAutoMock.mock.callCount(), 1);
|
|
313
|
+
|
|
314
|
+
const adapter = _getAdapter();
|
|
315
|
+
const row = adapter
|
|
316
|
+
?.prepare(
|
|
317
|
+
`SELECT gate_id, outcome, failure_class
|
|
318
|
+
FROM gate_runs
|
|
319
|
+
WHERE gate_id = 'post-execution-checks'
|
|
320
|
+
ORDER BY id DESC
|
|
321
|
+
LIMIT 1`,
|
|
322
|
+
)
|
|
323
|
+
.get() as { gate_id: string; outcome: string; failure_class: string } | undefined;
|
|
324
|
+
|
|
325
|
+
assert.ok(row, "post-execution gate run should be persisted when uok.gates is enabled");
|
|
326
|
+
assert.equal(row?.gate_id, "post-execution-checks");
|
|
327
|
+
assert.equal(row?.outcome, "fail");
|
|
328
|
+
assert.equal(row?.failure_class, "artifact");
|
|
329
|
+
});
|
|
252
330
|
});
|
|
253
331
|
|
|
254
332
|
describe("Post-execution retry behavior", () => {
|
|
@@ -21,7 +21,8 @@ test("postUnitPreVerification rebuilds STATE.md before worktree sync", () => {
|
|
|
21
21
|
const fnStart = source.indexOf("export async function postUnitPreVerification");
|
|
22
22
|
assert.ok(fnStart > 0, "postUnitPreVerification should exist");
|
|
23
23
|
|
|
24
|
-
const
|
|
24
|
+
const fnEnd = source.indexOf("export async function postUnitPostVerification", fnStart);
|
|
25
|
+
const section = source.slice(fnStart, fnEnd > fnStart ? fnEnd : undefined);
|
|
25
26
|
const rebuildIdx = section.indexOf('await runSafely("postUnit", "state-rebuild"');
|
|
26
27
|
const syncIdx = section.indexOf('await runSafely("postUnit", "worktree-sync"');
|
|
27
28
|
|
|
@@ -17,7 +17,7 @@ import { join } from "node:path";
|
|
|
17
17
|
|
|
18
18
|
import { postUnitPostVerification, type PostUnitContext } from "../auto-post-unit.ts";
|
|
19
19
|
import { AutoSession } from "../auto/session.ts";
|
|
20
|
-
import { openDatabase, closeDatabase, insertMilestone, insertSlice, insertTask } from "../gsd-db.ts";
|
|
20
|
+
import { openDatabase, closeDatabase, insertMilestone, insertSlice, insertTask, _getAdapter } from "../gsd-db.ts";
|
|
21
21
|
import { invalidateAllCaches } from "../cache.ts";
|
|
22
22
|
import { _clearGsdRootCache } from "../paths.ts";
|
|
23
23
|
|
|
@@ -454,4 +454,43 @@ describe("Pre-execution checks → pauseAuto wiring", () => {
|
|
|
454
454
|
"postUnitPostVerification should return 'continue' when pre-execution checks are disabled"
|
|
455
455
|
);
|
|
456
456
|
});
|
|
457
|
+
|
|
458
|
+
test("uok gate runner persists pre-execution gate outcomes when enabled", async () => {
|
|
459
|
+
writePreferences({
|
|
460
|
+
enhanced_verification: true,
|
|
461
|
+
enhanced_verification_pre: true,
|
|
462
|
+
enhanced_verification_strict: true,
|
|
463
|
+
uok: {
|
|
464
|
+
enabled: true,
|
|
465
|
+
gates: { enabled: true },
|
|
466
|
+
},
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
createFailingTasks();
|
|
470
|
+
|
|
471
|
+
const ctx = makeMockCtx();
|
|
472
|
+
const pi = makeMockPi();
|
|
473
|
+
const pauseAutoMock = mock.fn(async () => {});
|
|
474
|
+
const s = makeMockSession(tempDir, { type: "plan-slice", id: "M001/S01" });
|
|
475
|
+
const pctx = makePostUnitContext(s, ctx, pi, pauseAutoMock);
|
|
476
|
+
|
|
477
|
+
const result = await postUnitPostVerification(pctx);
|
|
478
|
+
assert.equal(result, "stopped");
|
|
479
|
+
|
|
480
|
+
const adapter = _getAdapter();
|
|
481
|
+
const row = adapter
|
|
482
|
+
?.prepare(
|
|
483
|
+
`SELECT gate_id, outcome, failure_class
|
|
484
|
+
FROM gate_runs
|
|
485
|
+
WHERE gate_id = 'pre-execution-checks'
|
|
486
|
+
ORDER BY id DESC
|
|
487
|
+
LIMIT 1`,
|
|
488
|
+
)
|
|
489
|
+
.get() as { gate_id: string; outcome: string; failure_class: string } | undefined;
|
|
490
|
+
|
|
491
|
+
assert.ok(row, "pre-execution gate run should be persisted when uok.gates is enabled");
|
|
492
|
+
assert.equal(row?.gate_id, "pre-execution-checks");
|
|
493
|
+
assert.equal(row?.outcome, "fail");
|
|
494
|
+
assert.equal(row?.failure_class, "input");
|
|
495
|
+
});
|
|
457
496
|
});
|
|
@@ -134,6 +134,53 @@ test("invalid value types produce errors and fall back to undefined", () => {
|
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
+
test("flat_rate_providers: accepts string array", () => {
|
|
138
|
+
const { errors, preferences } = validatePreferences({
|
|
139
|
+
flat_rate_providers: ["my-proxy", "private-cli"],
|
|
140
|
+
});
|
|
141
|
+
assert.equal(errors.length, 0);
|
|
142
|
+
assert.deepEqual(preferences.flat_rate_providers, ["my-proxy", "private-cli"]);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test("flat_rate_providers: trims whitespace and drops empty entries", () => {
|
|
146
|
+
const { errors, preferences } = validatePreferences({
|
|
147
|
+
flat_rate_providers: [" my-proxy ", "", " ", "private-cli"],
|
|
148
|
+
});
|
|
149
|
+
assert.equal(errors.length, 0);
|
|
150
|
+
assert.deepEqual(preferences.flat_rate_providers, ["my-proxy", "private-cli"]);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
test("flat_rate_providers: non-array rejected", () => {
|
|
154
|
+
const { errors } = validatePreferences({
|
|
155
|
+
flat_rate_providers: "my-proxy" as any,
|
|
156
|
+
});
|
|
157
|
+
assert.ok(
|
|
158
|
+
errors.some(e => e.includes("flat_rate_providers")),
|
|
159
|
+
"should error on non-array value",
|
|
160
|
+
);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
test("flat_rate_providers: non-string elements rejected", () => {
|
|
164
|
+
const { errors } = validatePreferences({
|
|
165
|
+
flat_rate_providers: ["ok", 123 as any, "also-ok"],
|
|
166
|
+
});
|
|
167
|
+
assert.ok(
|
|
168
|
+
errors.some(e => e.includes("flat_rate_providers")),
|
|
169
|
+
"should error when array contains non-strings",
|
|
170
|
+
);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
test("flat_rate_providers is a recognized preference key (no warning)", () => {
|
|
174
|
+
const { warnings } = validatePreferences({
|
|
175
|
+
flat_rate_providers: ["my-proxy"],
|
|
176
|
+
});
|
|
177
|
+
assert.equal(
|
|
178
|
+
warnings.filter(w => w.includes("flat_rate_providers")).length,
|
|
179
|
+
0,
|
|
180
|
+
"flat_rate_providers must be in KNOWN_PREFERENCE_KEYS",
|
|
181
|
+
);
|
|
182
|
+
});
|
|
183
|
+
|
|
137
184
|
test("valid values pass through correctly", () => {
|
|
138
185
|
const { preferences: p1 } = validatePreferences({ budget_enforcement: "halt" });
|
|
139
186
|
assert.equal(p1.budget_enforcement, "halt");
|