gsd-pi 2.74.0-dev.2b524c3 → 2.74.0-dev.703eabc
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.js +85 -0
- package/dist/headless-query.js +4 -1
- package/dist/help-text.js +23 -0
- 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 +158 -4
- package/dist/resources/extensions/gsd/auto/session.js +10 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +11 -1
- package/dist/resources/extensions/gsd/auto-model-selection.js +51 -5
- package/dist/resources/extensions/gsd/auto-post-unit.js +220 -17
- package/dist/resources/extensions/gsd/auto-prompts.js +12 -0
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +18 -0
- package/dist/resources/extensions/gsd/auto-verification.js +100 -2
- package/dist/resources/extensions/gsd/auto.js +36 -4
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +30 -8
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +45 -4
- package/dist/resources/extensions/gsd/commands/catalog.js +26 -1
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +25 -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-extract-learnings.js +225 -0
- 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 +14 -1
- package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +144 -0
- package/dist/resources/extensions/gsd/ecosystem/loader.js +145 -0
- 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/parallel-orchestrator.js +33 -1
- package/dist/resources/extensions/gsd/preferences-models.js +20 -3
- package/dist/resources/extensions/gsd/preferences-types.js +1 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +108 -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 +5 -1
- 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/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +12 -12
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.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/resize/route.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/stream/route.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +12 -12
- package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
- 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/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/package.json +3 -2
- 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 +655 -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 +604 -0
- package/packages/mcp-server/src/readers/graph.ts +855 -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 -9
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +1 -9
- package/packages/pi-ai/dist/index.js.map +1 -1
- package/packages/pi-ai/dist/models/capability-patches.d.ts +19 -0
- package/packages/pi-ai/dist/models/capability-patches.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/capability-patches.js +36 -0
- package/packages/pi-ai/dist/models/capability-patches.js.map +1 -0
- package/packages/pi-ai/dist/{models.custom.d.ts → models/custom.d.ts} +1 -1
- package/packages/pi-ai/dist/models/custom.d.ts.map +1 -0
- package/packages/pi-ai/dist/{models.custom.js → models/custom.js} +4 -4
- package/packages/pi-ai/dist/models/custom.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts +1482 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js +1484 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts +377 -0
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/anthropic.js +379 -0
- package/packages/pi-ai/dist/models/generated/anthropic.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/azure-openai-responses.d.ts +700 -0
- package/packages/pi-ai/dist/models/generated/azure-openai-responses.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/azure-openai-responses.js +702 -0
- package/packages/pi-ai/dist/models/generated/azure-openai-responses.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/cerebras.d.ts +71 -0
- package/packages/pi-ai/dist/models/generated/cerebras.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/cerebras.js +73 -0
- package/packages/pi-ai/dist/models/generated/cerebras.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/github-copilot.d.ts +590 -0
- package/packages/pi-ai/dist/models/generated/github-copilot.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/github-copilot.js +444 -0
- package/packages/pi-ai/dist/models/generated/github-copilot.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts +156 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.js +158 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-gemini-cli.d.ts +105 -0
- package/packages/pi-ai/dist/models/generated/google-gemini-cli.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-gemini-cli.js +107 -0
- package/packages/pi-ai/dist/models/generated/google-gemini-cli.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-vertex.d.ts +207 -0
- package/packages/pi-ai/dist/models/generated/google-vertex.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-vertex.js +209 -0
- package/packages/pi-ai/dist/models/generated/google-vertex.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/google.d.ts +462 -0
- package/packages/pi-ai/dist/models/generated/google.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/google.js +464 -0
- package/packages/pi-ai/dist/models/generated/google.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/groq.d.ts +309 -0
- package/packages/pi-ai/dist/models/generated/groq.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/groq.js +311 -0
- package/packages/pi-ai/dist/models/generated/groq.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/huggingface.d.ts +383 -0
- package/packages/pi-ai/dist/models/generated/huggingface.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/huggingface.js +347 -0
- package/packages/pi-ai/dist/models/generated/huggingface.js.map +1 -0
- package/packages/pi-ai/dist/{models.generated.d.ts → models/generated/index.d.ts} +1 -1
- package/packages/pi-ai/dist/{models.generated.d.ts.map → models/generated/index.d.ts.map} +1 -1
- package/packages/pi-ai/dist/models/generated/index.js +51 -0
- package/packages/pi-ai/dist/models/generated/index.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/kimi-coding.d.ts +37 -0
- package/packages/pi-ai/dist/models/generated/kimi-coding.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/kimi-coding.js +39 -0
- package/packages/pi-ai/dist/models/generated/kimi-coding.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/minimax-cn.d.ts +105 -0
- package/packages/pi-ai/dist/models/generated/minimax-cn.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/minimax-cn.js +107 -0
- package/packages/pi-ai/dist/models/generated/minimax-cn.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/minimax.d.ts +105 -0
- package/packages/pi-ai/dist/models/generated/minimax.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/minimax.js +107 -0
- package/packages/pi-ai/dist/models/generated/minimax.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/mistral.d.ts +445 -0
- package/packages/pi-ai/dist/models/generated/mistral.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/mistral.js +447 -0
- package/packages/pi-ai/dist/models/generated/mistral.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts +139 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.js +141 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/openai.d.ts +700 -0
- package/packages/pi-ai/dist/models/generated/openai.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/openai.js +702 -0
- package/packages/pi-ai/dist/models/generated/openai.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/opencode-go.d.ts +122 -0
- package/packages/pi-ai/dist/models/generated/opencode-go.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/opencode-go.js +124 -0
- package/packages/pi-ai/dist/models/generated/opencode-go.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/opencode.d.ts +530 -0
- package/packages/pi-ai/dist/models/generated/opencode.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/opencode.js +532 -0
- package/packages/pi-ai/dist/models/generated/opencode.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts +4270 -0
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/openrouter.js +4272 -0
- package/packages/pi-ai/dist/models/generated/openrouter.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/vercel-ai-gateway.d.ts +2604 -0
- package/packages/pi-ai/dist/models/generated/vercel-ai-gateway.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/vercel-ai-gateway.js +2606 -0
- package/packages/pi-ai/dist/models/generated/vercel-ai-gateway.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/xai.d.ts +411 -0
- package/packages/pi-ai/dist/models/generated/xai.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/xai.js +413 -0
- package/packages/pi-ai/dist/models/generated/xai.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/zai.d.ts +276 -0
- package/packages/pi-ai/dist/models/generated/zai.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/zai.js +239 -0
- package/packages/pi-ai/dist/models/generated/zai.js.map +1 -0
- package/packages/pi-ai/dist/models/index.d.ts +27 -0
- package/packages/pi-ai/dist/models/index.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/index.js +80 -0
- package/packages/pi-ai/dist/models/index.js.map +1 -0
- package/packages/pi-ai/dist/models.d.ts +1 -36
- package/packages/pi-ai/dist/models.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.test.js +1 -2
- package/packages/pi-ai/dist/models.generated.test.js.map +1 -1
- package/packages/pi-ai/dist/models.js +3 -112
- package/packages/pi-ai/dist/models.js.map +1 -1
- package/packages/pi-ai/dist/models.test.js +6 -5
- package/packages/pi-ai/dist/models.test.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/scripts/generate-models.ts +74 -40
- package/packages/pi-ai/src/index.ts +1 -9
- package/packages/pi-ai/src/models/capability-patches.ts +40 -0
- package/packages/pi-ai/src/{models.custom.ts → models/custom.ts} +4 -4
- package/packages/pi-ai/src/models/generated/amazon-bedrock.ts +1486 -0
- package/packages/pi-ai/src/models/generated/anthropic.ts +381 -0
- package/packages/pi-ai/src/models/generated/azure-openai-responses.ts +704 -0
- package/packages/pi-ai/src/models/generated/cerebras.ts +75 -0
- package/packages/pi-ai/src/models/generated/github-copilot.ts +446 -0
- package/packages/pi-ai/src/models/generated/google-antigravity.ts +160 -0
- package/packages/pi-ai/src/models/generated/google-gemini-cli.ts +109 -0
- package/packages/pi-ai/src/models/generated/google-vertex.ts +211 -0
- package/packages/pi-ai/src/models/generated/google.ts +466 -0
- package/packages/pi-ai/src/models/generated/groq.ts +313 -0
- package/packages/pi-ai/src/models/generated/huggingface.ts +349 -0
- package/packages/pi-ai/src/models/generated/index.ts +52 -0
- package/packages/pi-ai/src/models/generated/kimi-coding.ts +41 -0
- package/packages/pi-ai/src/models/generated/minimax-cn.ts +109 -0
- package/packages/pi-ai/src/models/generated/minimax.ts +109 -0
- package/packages/pi-ai/src/models/generated/mistral.ts +449 -0
- package/packages/pi-ai/src/models/generated/openai-codex.ts +143 -0
- package/packages/pi-ai/src/models/generated/openai.ts +704 -0
- package/packages/pi-ai/src/models/generated/opencode-go.ts +126 -0
- package/packages/pi-ai/src/models/generated/opencode.ts +534 -0
- package/packages/pi-ai/src/models/generated/openrouter.ts +4274 -0
- package/packages/pi-ai/src/models/generated/vercel-ai-gateway.ts +2608 -0
- package/packages/pi-ai/src/models/generated/xai.ts +415 -0
- package/packages/pi-ai/src/models/generated/zai.ts +241 -0
- package/packages/pi-ai/src/models/index.ts +106 -0
- package/packages/pi-ai/src/models.generated.test.ts +1 -2
- package/packages/pi-ai/src/models.test.ts +6 -5
- package/packages/pi-ai/src/models.ts +3 -153
- package/packages/pi-ai/tsconfig.json +1 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +8 -2
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +472 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- 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/__tests__/tool-execution.test.js +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +1 -0
- 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 +23 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +47 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +51 -8
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +22 -22
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
- 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 +232 -18
- 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-ordering.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js +38 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +13 -0
- 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 +53 -6
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +12 -6
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +612 -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/__tests__/tool-execution.test.ts +19 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +25 -10
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +67 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +66 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +23 -26
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +298 -41
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-ordering.test.ts +44 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +73 -6
- 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/package.json +1 -1
- 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/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 +191 -4
- package/src/resources/extensions/gsd/auto/session.ts +10 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +16 -6
- package/src/resources/extensions/gsd/auto-model-selection.ts +66 -5
- package/src/resources/extensions/gsd/auto-post-unit.ts +238 -18
- package/src/resources/extensions/gsd/auto-prompts.ts +13 -0
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +25 -1
- package/src/resources/extensions/gsd/auto-verification.ts +129 -2
- package/src/resources/extensions/gsd/auto.ts +41 -2
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +38 -8
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +56 -3
- package/src/resources/extensions/gsd/commands/catalog.ts +26 -1
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +25 -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-extract-learnings.ts +304 -0
- 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 +14 -1
- package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +228 -0
- package/src/resources/extensions/gsd/ecosystem/loader.ts +201 -0
- 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/parallel-orchestrator.ts +40 -1
- package/src/resources/extensions/gsd/preferences-models.ts +20 -3
- package/src/resources/extensions/gsd/preferences-types.ts +32 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +107 -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 +9 -2
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +18 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +7 -3
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/auto-project-root-env.test.ts +7 -3
- 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-extract-learnings.test.ts +340 -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-slice.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
- 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/graph-context.test.ts +337 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +1 -1
- 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/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/register-hooks-depth-verification.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/single-writer-invariant.test.ts +180 -0
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +8 -5
- 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-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 +14 -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 +27 -1
- 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/packages/pi-ai/dist/models.custom.d.ts.map +0 -1
- package/packages/pi-ai/dist/models.custom.js.map +0 -1
- package/packages/pi-ai/dist/models.generated.js +0 -14343
- package/packages/pi-ai/dist/models.generated.js.map +0 -1
- package/packages/pi-ai/src/models.generated.ts +0 -14345
- /package/dist/web/standalone/.next/static/{YzIEI9sxJy4t5xgClF08g → 3U-oZ5FT59BM7sm2GInic}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{YzIEI9sxJy4t5xgClF08g → 3U-oZ5FT59BM7sm2GInic}/_ssgManifest.js +0 -0
|
@@ -19,7 +19,7 @@ import { invalidateAllCaches } from "./cache.js";
|
|
|
19
19
|
import { rebuildState } from "./doctor.js";
|
|
20
20
|
import { parseUnitId } from "./unit-id.js";
|
|
21
21
|
import { closeoutUnit } from "./auto-unit-closeout.js";
|
|
22
|
-
import {
|
|
22
|
+
import { runTurnGitAction, } from "./git-service.js";
|
|
23
23
|
import { verifyExpectedArtifact, resolveExpectedArtifactPath, writeBlockerPlaceholder, diagnoseExpectedArtifact, } from "./auto-recovery.js";
|
|
24
24
|
import { regenerateIfMissing } from "./workflow-projections.js";
|
|
25
25
|
import { syncStateToProjectRoot } from "./auto-worktree.js";
|
|
@@ -42,6 +42,9 @@ import { getSliceTasks } from "./gsd-db.js";
|
|
|
42
42
|
import { runPreExecutionChecks } from "./pre-execution-checks.js";
|
|
43
43
|
import { writePreExecutionEvidence } from "./verification-evidence.js";
|
|
44
44
|
import { ensureCodebaseMapFresh } from "./codebase-generator.js";
|
|
45
|
+
import { resolveUokFlags } from "./uok/flags.js";
|
|
46
|
+
import { UokGateRunner } from "./uok/gate-runner.js";
|
|
47
|
+
import { writeTurnGitTransaction } from "./uok/gitops.js";
|
|
45
48
|
/** Maximum verification retry attempts before escalating to blocker placeholder (#2653). */
|
|
46
49
|
const MAX_VERIFICATION_RETRIES = 3;
|
|
47
50
|
/** Enqueue a sidecar item (hook, triage, or quick-task) for the main loop to
|
|
@@ -71,6 +74,7 @@ import { describeNextUnit, } from "./auto-dashboard.js";
|
|
|
71
74
|
import { existsSync, unlinkSync } from "node:fs";
|
|
72
75
|
import { join } from "node:path";
|
|
73
76
|
import { _resetHasChangesCache } from "./native-git-bridge.js";
|
|
77
|
+
import { autoCommitCurrentBranch } from "./worktree.js";
|
|
74
78
|
/**
|
|
75
79
|
* Detect summary files written directly to disk without the LLM calling
|
|
76
80
|
* the completion tool. A "rogue" file is one that exists on disk but has
|
|
@@ -189,6 +193,57 @@ export function buildStepCompleteMessage(nextState) {
|
|
|
189
193
|
return `Step complete. Next: ${next.label}\n`
|
|
190
194
|
+ `Run /clear, then /gsd to continue (or /gsd auto to run continuously).`;
|
|
191
195
|
}
|
|
196
|
+
export async function autoCommitUnit(basePath, unitType, unitId, ctx) {
|
|
197
|
+
try {
|
|
198
|
+
let taskContext;
|
|
199
|
+
if (unitType === "execute-task") {
|
|
200
|
+
const { milestone: mid, slice: sid, task: tid } = parseUnitId(unitId);
|
|
201
|
+
if (mid && sid && tid) {
|
|
202
|
+
const summaryPath = resolveTaskFile(basePath, mid, sid, tid, "SUMMARY");
|
|
203
|
+
if (summaryPath) {
|
|
204
|
+
try {
|
|
205
|
+
const summaryContent = await loadFile(summaryPath);
|
|
206
|
+
if (summaryContent) {
|
|
207
|
+
const summary = parseSummary(summaryContent);
|
|
208
|
+
let ghIssueNumber;
|
|
209
|
+
try {
|
|
210
|
+
const { getTaskIssueNumberForCommit } = await import("../github-sync/sync.js");
|
|
211
|
+
ghIssueNumber = getTaskIssueNumberForCommit(basePath, mid, sid, tid) ?? undefined;
|
|
212
|
+
}
|
|
213
|
+
catch (err) {
|
|
214
|
+
logWarning("engine", `GitHub issue lookup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
215
|
+
}
|
|
216
|
+
taskContext = {
|
|
217
|
+
taskId: `${sid}/${tid}`,
|
|
218
|
+
taskTitle: summary.title?.replace(/^T\d+:\s*/, "") || tid,
|
|
219
|
+
oneLiner: summary.oneLiner || undefined,
|
|
220
|
+
keyFiles: summary.frontmatter.key_files?.filter(f => !f.includes("{{")) || undefined,
|
|
221
|
+
issueNumber: ghIssueNumber,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
catch (e) {
|
|
226
|
+
debugLog("postUnit", { phase: "task-summary-parse", error: String(e) });
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
_resetHasChangesCache();
|
|
232
|
+
if (LIFECYCLE_ONLY_UNITS.has(unitType)) {
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
const commitMsg = autoCommitCurrentBranch(basePath, unitType, unitId, taskContext);
|
|
236
|
+
if (commitMsg) {
|
|
237
|
+
ctx?.ui.notify(`Committed: ${commitMsg.split("\n")[0]}`, "info");
|
|
238
|
+
}
|
|
239
|
+
return commitMsg;
|
|
240
|
+
}
|
|
241
|
+
catch (e) {
|
|
242
|
+
debugLog("postUnit", { phase: "auto-commit", error: String(e) });
|
|
243
|
+
ctx?.ui.notify(`Auto-commit failed: ${String(e).split("\n")[0]}`, "warning");
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
192
247
|
/**
|
|
193
248
|
* Pre-verification processing: parallel worker signal check, cache invalidation,
|
|
194
249
|
* auto-commit, doctor run, state rebuild, worktree sync, artifact verification.
|
|
@@ -221,12 +276,19 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
221
276
|
if (!opts?.skipSettleDelay) {
|
|
222
277
|
await new Promise(r => setTimeout(r, 100));
|
|
223
278
|
}
|
|
224
|
-
|
|
279
|
+
const prefs = loadEffectiveGSDPreferences()?.preferences;
|
|
280
|
+
const uokFlags = resolveUokFlags(prefs);
|
|
281
|
+
// Turn-level git action (commit | snapshot | status-only)
|
|
225
282
|
if (s.currentUnit) {
|
|
226
283
|
const unit = s.currentUnit;
|
|
284
|
+
const turnAction = uokFlags.gitops ? uokFlags.gitopsTurnAction : "commit";
|
|
285
|
+
const traceId = s.currentTraceId ?? `turn:${unit.startedAt}`;
|
|
286
|
+
const turnId = s.currentTurnId ?? `${unit.type}/${unit.id}/${unit.startedAt}`;
|
|
287
|
+
s.lastGitActionFailure = null;
|
|
288
|
+
s.lastGitActionStatus = null;
|
|
227
289
|
try {
|
|
228
290
|
let taskContext;
|
|
229
|
-
if (s.currentUnit.type === "execute-task") {
|
|
291
|
+
if (turnAction === "commit" && s.currentUnit.type === "execute-task") {
|
|
230
292
|
const { milestone: mid, slice: sid, task: tid } = parseUnitId(s.currentUnit.id);
|
|
231
293
|
if (mid && sid && tid) {
|
|
232
294
|
const summaryPath = resolveTaskFile(s.basePath, mid, sid, tid, "SUMMARY");
|
|
@@ -266,19 +328,101 @@ export async function postUnitPreVerification(pctx, opts) {
|
|
|
266
328
|
// code files only in the working tree where they are destroyed by
|
|
267
329
|
// `git worktree remove --force` during teardown.
|
|
268
330
|
_resetHasChangesCache();
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
331
|
+
const skipLifecycleCommit = turnAction === "commit" && LIFECYCLE_ONLY_UNITS.has(s.currentUnit.type);
|
|
332
|
+
if (skipLifecycleCommit) {
|
|
333
|
+
debugLog("postUnit", {
|
|
334
|
+
phase: "git-action-skipped",
|
|
335
|
+
reason: "lifecycle-only-unit",
|
|
336
|
+
unitType: s.currentUnit.type,
|
|
337
|
+
unitId: s.currentUnit.id,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
const gitResult = runTurnGitAction({
|
|
342
|
+
basePath: s.basePath,
|
|
343
|
+
action: turnAction,
|
|
344
|
+
unitType: s.currentUnit.type,
|
|
345
|
+
unitId: s.currentUnit.id,
|
|
346
|
+
taskContext,
|
|
347
|
+
});
|
|
348
|
+
if (uokFlags.gitops) {
|
|
349
|
+
writeTurnGitTransaction({
|
|
350
|
+
basePath: s.basePath,
|
|
351
|
+
traceId,
|
|
352
|
+
turnId,
|
|
353
|
+
unitType: unit.type,
|
|
354
|
+
unitId: unit.id,
|
|
355
|
+
stage: "publish",
|
|
356
|
+
action: turnAction,
|
|
357
|
+
push: uokFlags.gitopsTurnPush,
|
|
358
|
+
status: gitResult.status,
|
|
359
|
+
error: gitResult.error,
|
|
360
|
+
metadata: {
|
|
361
|
+
dirty: gitResult.dirty,
|
|
362
|
+
commitMessage: gitResult.commitMessage,
|
|
363
|
+
snapshotLabel: gitResult.snapshotLabel,
|
|
364
|
+
},
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
if (gitResult.status === "failed") {
|
|
368
|
+
s.lastGitActionFailure = gitResult.error ?? `git ${turnAction} failed`;
|
|
369
|
+
s.lastGitActionStatus = "failed";
|
|
370
|
+
if (uokFlags.gitops && uokFlags.gates) {
|
|
371
|
+
const parsed = parseUnitId(unit.id);
|
|
372
|
+
const gateRunner = new UokGateRunner();
|
|
373
|
+
gateRunner.register({
|
|
374
|
+
id: "closeout-git-action",
|
|
375
|
+
type: "closeout",
|
|
376
|
+
execute: async () => ({
|
|
377
|
+
outcome: "fail",
|
|
378
|
+
failureClass: "git",
|
|
379
|
+
rationale: `turn git action "${turnAction}" failed`,
|
|
380
|
+
findings: gitResult.error ?? "unknown git failure",
|
|
381
|
+
}),
|
|
382
|
+
});
|
|
383
|
+
await gateRunner.run("closeout-git-action", {
|
|
384
|
+
basePath: s.basePath,
|
|
385
|
+
traceId,
|
|
386
|
+
turnId,
|
|
387
|
+
milestoneId: parsed.milestone ?? undefined,
|
|
388
|
+
sliceId: parsed.slice ?? undefined,
|
|
389
|
+
taskId: parsed.task ?? undefined,
|
|
390
|
+
unitType: unit.type,
|
|
391
|
+
unitId: unit.id,
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
const failureMsg = `Git ${turnAction} failed: ${(gitResult.error ?? "unknown error").split("\n")[0]}`;
|
|
395
|
+
if (uokFlags.gitops) {
|
|
396
|
+
ctx.ui.notify(failureMsg, "error");
|
|
397
|
+
await pauseAuto(ctx, pi);
|
|
398
|
+
return "dispatched";
|
|
399
|
+
}
|
|
400
|
+
ctx.ui.notify(failureMsg, "warning");
|
|
401
|
+
debugLog("postUnit", {
|
|
402
|
+
phase: "git-action-failed-nonblocking",
|
|
403
|
+
action: turnAction,
|
|
404
|
+
error: gitResult.error ?? "unknown error",
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
s.lastGitActionStatus = "ok";
|
|
408
|
+
if (turnAction === "commit" && gitResult.commitMessage) {
|
|
409
|
+
ctx.ui.notify(`Committed: ${gitResult.commitMessage.split("\n")[0]}`, "info");
|
|
410
|
+
}
|
|
411
|
+
else if (turnAction === "snapshot" && gitResult.snapshotLabel) {
|
|
412
|
+
ctx.ui.notify(`Snapshot recorded: ${gitResult.snapshotLabel}`, "info");
|
|
276
413
|
}
|
|
277
414
|
}
|
|
278
415
|
}
|
|
279
416
|
catch (e) {
|
|
280
|
-
|
|
281
|
-
|
|
417
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
418
|
+
s.lastGitActionFailure = message;
|
|
419
|
+
s.lastGitActionStatus = "failed";
|
|
420
|
+
debugLog("postUnit", { phase: "git-action", error: message, action: turnAction });
|
|
421
|
+
ctx.ui.notify(`Git ${turnAction} failed: ${message.split("\n")[0]}`, uokFlags.gitops ? "error" : "warning");
|
|
422
|
+
if (uokFlags.gitops) {
|
|
423
|
+
await pauseAuto(ctx, pi);
|
|
424
|
+
return "dispatched";
|
|
425
|
+
}
|
|
282
426
|
}
|
|
283
427
|
// GitHub sync (non-blocking, opt-in)
|
|
284
428
|
await runSafely("postUnit", "github-sync", async () => {
|
|
@@ -714,11 +858,13 @@ export async function postUnitPostVerification(pctx) {
|
|
|
714
858
|
// ── Pre-execution checks (after plan-slice completes) ──
|
|
715
859
|
if (s.currentUnit &&
|
|
716
860
|
s.currentUnit.type === "plan-slice") {
|
|
861
|
+
const currentUnit = s.currentUnit;
|
|
717
862
|
let preExecPauseNeeded = false;
|
|
718
863
|
await runSafely("postUnitPostVerification", "pre-execution-checks", async () => {
|
|
864
|
+
const prefs = loadEffectiveGSDPreferences()?.preferences;
|
|
865
|
+
const uokFlags = resolveUokFlags(prefs);
|
|
719
866
|
try {
|
|
720
867
|
// Check preferences — respect enhanced_verification and enhanced_verification_pre
|
|
721
|
-
const prefs = loadEffectiveGSDPreferences()?.preferences;
|
|
722
868
|
const enhancedEnabled = prefs?.enhanced_verification !== false; // default true
|
|
723
869
|
const preEnabled = prefs?.enhanced_verification_pre !== false; // default true
|
|
724
870
|
if (!enhancedEnabled || !preEnabled) {
|
|
@@ -730,7 +876,7 @@ export async function postUnitPostVerification(pctx) {
|
|
|
730
876
|
return;
|
|
731
877
|
}
|
|
732
878
|
// Parse the unit ID to get milestone/slice IDs
|
|
733
|
-
const { milestone: mid, slice: sid } = parseUnitId(
|
|
879
|
+
const { milestone: mid, slice: sid } = parseUnitId(currentUnit.id);
|
|
734
880
|
if (!mid || !sid) {
|
|
735
881
|
debugLog("postUnitPostVerification", {
|
|
736
882
|
phase: "pre-execution-checks",
|
|
@@ -749,6 +895,7 @@ export async function postUnitPostVerification(pctx) {
|
|
|
749
895
|
});
|
|
750
896
|
return;
|
|
751
897
|
}
|
|
898
|
+
const strictMode = prefs?.enhanced_verification_strict === true;
|
|
752
899
|
// Run pre-execution checks
|
|
753
900
|
const result = await runPreExecutionChecks(tasks, s.basePath);
|
|
754
901
|
// Log summary to stderr in existing verification output format
|
|
@@ -764,10 +911,43 @@ export async function postUnitPostVerification(pctx) {
|
|
|
764
911
|
if (slicePath) {
|
|
765
912
|
writePreExecutionEvidence(result, slicePath, mid, sid);
|
|
766
913
|
}
|
|
767
|
-
|
|
914
|
+
if (uokFlags.gates) {
|
|
915
|
+
const failedChecks = result.checks
|
|
916
|
+
.filter((check) => !check.passed)
|
|
917
|
+
.map((check) => `[${check.category}] ${check.target}: ${check.message}`);
|
|
918
|
+
const warnEscalated = result.status === "warn" && strictMode;
|
|
919
|
+
const blockingFailure = result.status === "fail" || warnEscalated;
|
|
920
|
+
const gateRunner = new UokGateRunner();
|
|
921
|
+
gateRunner.register({
|
|
922
|
+
id: "pre-execution-checks",
|
|
923
|
+
type: "input",
|
|
924
|
+
execute: async () => ({
|
|
925
|
+
outcome: blockingFailure ? "fail" : "pass",
|
|
926
|
+
failureClass: result.status === "fail" ? "input" : warnEscalated ? "policy" : "none",
|
|
927
|
+
rationale: blockingFailure
|
|
928
|
+
? `pre-execution checks ${result.status}${warnEscalated ? " (strict)" : ""}`
|
|
929
|
+
: "pre-execution checks passed",
|
|
930
|
+
findings: failedChecks.join("\n"),
|
|
931
|
+
}),
|
|
932
|
+
});
|
|
933
|
+
await gateRunner.run("pre-execution-checks", {
|
|
934
|
+
basePath: s.basePath,
|
|
935
|
+
traceId: `pre-execution:${currentUnit.id}`,
|
|
936
|
+
turnId: currentUnit.id,
|
|
937
|
+
milestoneId: mid,
|
|
938
|
+
sliceId: sid,
|
|
939
|
+
unitType: currentUnit.type,
|
|
940
|
+
unitId: currentUnit.id,
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
// Notify UI — surface actionable details (#4259)
|
|
768
944
|
if (result.status === "fail") {
|
|
769
|
-
const
|
|
770
|
-
|
|
945
|
+
const blockingChecks = result.checks.filter(c => !c.passed && c.blocking);
|
|
946
|
+
const blockingCount = blockingChecks.length;
|
|
947
|
+
const details = blockingChecks.slice(0, 3).map(c => ` \u2022 ${c.message}`).join("\n");
|
|
948
|
+
const suffix = blockingChecks.length > 3 ? `\n \u2022 ...and ${blockingChecks.length - 3} more` : "";
|
|
949
|
+
const evidenceNote = `\nSee ${sid}-PRE-EXEC-VERIFY.json for full details.`;
|
|
950
|
+
ctx.ui.notify(`Pre-execution checks failed: ${blockingCount} blocking issue${blockingCount === 1 ? "" : "s"} found\n${details}${suffix}${evidenceNote}`, "error");
|
|
771
951
|
preExecPauseNeeded = true;
|
|
772
952
|
}
|
|
773
953
|
else if (result.status === "warn") {
|
|
@@ -794,6 +974,29 @@ export async function postUnitPostVerification(pctx) {
|
|
|
794
974
|
});
|
|
795
975
|
logError("engine", `gsd-pre-exec: Pre-execution checks threw an error: ${errorMessage}`);
|
|
796
976
|
ctx.ui.notify(`Pre-execution checks error: ${errorMessage} — pausing for human review`, "error");
|
|
977
|
+
if (uokFlags.gates && s.currentUnit) {
|
|
978
|
+
const { milestone: mid, slice: sid } = parseUnitId(s.currentUnit.id);
|
|
979
|
+
const gateRunner = new UokGateRunner();
|
|
980
|
+
gateRunner.register({
|
|
981
|
+
id: "pre-execution-checks",
|
|
982
|
+
type: "input",
|
|
983
|
+
execute: async () => ({
|
|
984
|
+
outcome: "manual-attention",
|
|
985
|
+
failureClass: "manual-attention",
|
|
986
|
+
rationale: "pre-execution checks threw before completion",
|
|
987
|
+
findings: errorMessage,
|
|
988
|
+
}),
|
|
989
|
+
});
|
|
990
|
+
await gateRunner.run("pre-execution-checks", {
|
|
991
|
+
basePath: s.basePath,
|
|
992
|
+
traceId: `pre-execution:${s.currentUnit.id}`,
|
|
993
|
+
turnId: s.currentUnit.id,
|
|
994
|
+
milestoneId: mid ?? undefined,
|
|
995
|
+
sliceId: sid ?? undefined,
|
|
996
|
+
unitType: s.currentUnit.type,
|
|
997
|
+
unitId: s.currentUnit.id,
|
|
998
|
+
});
|
|
999
|
+
}
|
|
797
1000
|
preExecPauseNeeded = true;
|
|
798
1001
|
}
|
|
799
1002
|
});
|
|
@@ -20,6 +20,7 @@ import { assertGateCoverage, getGatesForTurn, } from "./gate-registry.js";
|
|
|
20
20
|
import { formatDecisionsCompact, formatRequirementsCompact } from "./structured-data-formatter.js";
|
|
21
21
|
import { readPhaseAnchor, formatAnchorForPrompt } from "./phase-anchor.js";
|
|
22
22
|
import { logWarning } from "./workflow-logger.js";
|
|
23
|
+
import { inlineGraphSubgraph } from "./graph-context.js";
|
|
23
24
|
// ─── Preamble Cap ─────────────────────────────────────────────────────────────
|
|
24
25
|
const MAX_PREAMBLE_CHARS = 30_000;
|
|
25
26
|
function capPreamble(preamble) {
|
|
@@ -1040,6 +1041,10 @@ export async function buildResearchSlicePrompt(mid, _midTitle, sid, sTitle, base
|
|
|
1040
1041
|
const knowledgeInlineRS = await inlineKnowledgeScoped(base, keywords);
|
|
1041
1042
|
if (knowledgeInlineRS)
|
|
1042
1043
|
inlined.push(knowledgeInlineRS);
|
|
1044
|
+
// Knowledge graph: subgraph for this slice (graceful — skipped if no graph.json)
|
|
1045
|
+
const graphBlockRS = await inlineGraphSubgraph(base, `${sid} ${sTitle}`, { budget: 3000 });
|
|
1046
|
+
if (graphBlockRS)
|
|
1047
|
+
inlined.push(graphBlockRS);
|
|
1043
1048
|
inlined.push(inlineTemplate("research", "Research"));
|
|
1044
1049
|
const depContent = await inlineDependencySummaries(mid, sid, base);
|
|
1045
1050
|
const activeOverrides = await loadActiveOverrides(base);
|
|
@@ -1111,6 +1116,10 @@ export async function buildPlanSlicePrompt(mid, _midTitle, sid, sTitle, base, le
|
|
|
1111
1116
|
const knowledgeInlinePS = await inlineKnowledgeScoped(base, keywordsPS);
|
|
1112
1117
|
if (knowledgeInlinePS)
|
|
1113
1118
|
inlined.push(knowledgeInlinePS);
|
|
1119
|
+
// Knowledge graph: subgraph for this slice (graceful — skipped if no graph.json)
|
|
1120
|
+
const graphBlockPS = await inlineGraphSubgraph(base, `${sid} ${sTitle}`, { budget: 3000 });
|
|
1121
|
+
if (graphBlockPS)
|
|
1122
|
+
inlined.push(graphBlockPS);
|
|
1114
1123
|
inlined.push(inlineTemplate("plan", "Slice Plan"));
|
|
1115
1124
|
if (inlineLevel === "full") {
|
|
1116
1125
|
inlined.push(inlineTemplate("task-plan", "Task Plan"));
|
|
@@ -1194,12 +1203,15 @@ export async function buildExecuteTaskPrompt(mid, sid, sTitle, tid, tTitle, base
|
|
|
1194
1203
|
: null;
|
|
1195
1204
|
// Only include if it has content (not a "not found" result)
|
|
1196
1205
|
const knowledgeContent = knowledgeInlineET && !knowledgeInlineET.includes("not found") ? knowledgeInlineET : null;
|
|
1206
|
+
// Knowledge graph: tight subgraph for this task (graceful — skipped if no graph.json)
|
|
1207
|
+
const graphBlockET = await inlineGraphSubgraph(base, `${tid} ${tTitle}`, { budget: 2000 });
|
|
1197
1208
|
const inlinedTemplates = inlineLevel === "minimal"
|
|
1198
1209
|
? inlineTemplate("task-summary", "Task Summary")
|
|
1199
1210
|
: [
|
|
1200
1211
|
inlineTemplate("task-summary", "Task Summary"),
|
|
1201
1212
|
inlineTemplate("decisions", "Decisions"),
|
|
1202
1213
|
...(knowledgeContent ? [knowledgeContent] : []),
|
|
1214
|
+
...(graphBlockET ? [graphBlockET] : []),
|
|
1203
1215
|
].join("\n\n---\n\n");
|
|
1204
1216
|
const taskSummaryPath = join(base, `${relSlicePath(base, mid, sid)}/tasks/${tid}-SUMMARY.md`);
|
|
1205
1217
|
const activeOverrides = await loadActiveOverrides(base);
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { snapshotUnitMetrics } from "./metrics.js";
|
|
7
7
|
import { saveActivityLog } from "./activity-log.js";
|
|
8
8
|
import { logWarning } from "./workflow-logger.js";
|
|
9
|
+
import { writeTurnGitTransaction } from "./uok/gitops.js";
|
|
9
10
|
/**
|
|
10
11
|
* Snapshot metrics, save activity log, and fire-and-forget memory extraction
|
|
11
12
|
* for a completed unit. Returns the activity log file path (if any).
|
|
@@ -28,5 +29,22 @@ export async function closeoutUnit(ctx, basePath, unitType, unitId, startedAt, o
|
|
|
28
29
|
logWarning("engine", `operation failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
29
30
|
}
|
|
30
31
|
}
|
|
32
|
+
if (opts?.traceId && opts.turnId && opts.gitAction && opts.gitStatus) {
|
|
33
|
+
writeTurnGitTransaction({
|
|
34
|
+
basePath,
|
|
35
|
+
traceId: opts.traceId,
|
|
36
|
+
turnId: opts.turnId,
|
|
37
|
+
unitType,
|
|
38
|
+
unitId,
|
|
39
|
+
stage: "record",
|
|
40
|
+
action: opts.gitAction,
|
|
41
|
+
push: opts.gitPush === true,
|
|
42
|
+
status: opts.gitStatus,
|
|
43
|
+
error: opts.gitError,
|
|
44
|
+
metadata: {
|
|
45
|
+
activityFile,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
31
49
|
return activityFile ?? undefined;
|
|
32
50
|
}
|
|
@@ -24,6 +24,8 @@ import { writeVerificationJSON } from "./verification-evidence.js";
|
|
|
24
24
|
import { logWarning } from "./workflow-logger.js";
|
|
25
25
|
import { runPostExecutionChecks } from "./post-execution-checks.js";
|
|
26
26
|
import { join } from "node:path";
|
|
27
|
+
import { resolveUokFlags } from "./uok/flags.js";
|
|
28
|
+
import { UokGateRunner } from "./uok/gate-runner.js";
|
|
27
29
|
function isInfraVerificationFailure(stderr) {
|
|
28
30
|
return /\b(ENOENT|ENOTFOUND|ETIMEDOUT|ECONNRESET|EAI_AGAIN|spawn\s+\S+\s+ENOENT|command not found)\b/i.test(stderr);
|
|
29
31
|
}
|
|
@@ -43,6 +45,31 @@ function isInfraVerificationFailure(stderr) {
|
|
|
43
45
|
*/
|
|
44
46
|
async function runValidateMilestonePostCheck(vctx, pauseAuto) {
|
|
45
47
|
const { s, ctx, pi } = vctx;
|
|
48
|
+
const prefs = loadEffectiveGSDPreferences()?.preferences;
|
|
49
|
+
const uokFlags = resolveUokFlags(prefs);
|
|
50
|
+
const persistMilestoneValidationGate = async (outcome, failureClass, rationale, findings = "", milestoneId) => {
|
|
51
|
+
if (!uokFlags.gates || !s.currentUnit)
|
|
52
|
+
return;
|
|
53
|
+
const gateRunner = new UokGateRunner();
|
|
54
|
+
gateRunner.register({
|
|
55
|
+
id: "milestone-validation-post-check",
|
|
56
|
+
type: "verification",
|
|
57
|
+
execute: async () => ({
|
|
58
|
+
outcome,
|
|
59
|
+
failureClass,
|
|
60
|
+
rationale,
|
|
61
|
+
findings,
|
|
62
|
+
}),
|
|
63
|
+
});
|
|
64
|
+
await gateRunner.run("milestone-validation-post-check", {
|
|
65
|
+
basePath: s.basePath,
|
|
66
|
+
traceId: `validation-post-check:${s.currentUnit.id}`,
|
|
67
|
+
turnId: s.currentUnit.id,
|
|
68
|
+
milestoneId,
|
|
69
|
+
unitType: s.currentUnit.type,
|
|
70
|
+
unitId: s.currentUnit.id,
|
|
71
|
+
});
|
|
72
|
+
};
|
|
46
73
|
if (!s.currentUnit)
|
|
47
74
|
return "continue";
|
|
48
75
|
const { milestone: mid } = parseUnitId(s.currentUnit.id);
|
|
@@ -55,17 +82,22 @@ async function runValidateMilestonePostCheck(vctx, pauseAuto) {
|
|
|
55
82
|
if (!validationContent)
|
|
56
83
|
return "continue";
|
|
57
84
|
const verdict = extractVerdict(validationContent);
|
|
58
|
-
if (verdict !== "needs-remediation")
|
|
85
|
+
if (verdict !== "needs-remediation") {
|
|
86
|
+
await persistMilestoneValidationGate("pass", "none", `milestone validation verdict is ${verdict}; no remediation loop risk`, "", mid);
|
|
59
87
|
return "continue";
|
|
88
|
+
}
|
|
60
89
|
const incompleteSliceCount = await countIncompleteSlices(s.basePath, mid);
|
|
61
90
|
// If any non-closed slices exist, the agent successfully queued remediation
|
|
62
91
|
// work — proceed normally. The state machine will execute those slices and
|
|
63
92
|
// re-validate per the #3596/#3670 fix.
|
|
64
|
-
if (incompleteSliceCount > 0)
|
|
93
|
+
if (incompleteSliceCount > 0) {
|
|
94
|
+
await persistMilestoneValidationGate("pass", "none", `remediation slices present (${incompleteSliceCount}); validation can continue`, "", mid);
|
|
65
95
|
return "continue";
|
|
96
|
+
}
|
|
66
97
|
ctx.ui.notify(`Milestone ${mid} validation returned verdict=needs-remediation but no remediation slices were added. Pausing for human review.`, "error");
|
|
67
98
|
process.stderr.write(`validate-milestone: pausing — verdict=needs-remediation with no incomplete slices for ${mid}. ` +
|
|
68
99
|
`The agent must call gsd_reassess_roadmap to add remediation slices before re-validation.\n`);
|
|
100
|
+
await persistMilestoneValidationGate("manual-attention", "manual-attention", "needs-remediation verdict without queued remediation slices", `No incomplete slices found for ${mid} while verdict=needs-remediation`, mid);
|
|
69
101
|
await pauseAuto(ctx, pi);
|
|
70
102
|
return "pause";
|
|
71
103
|
}
|
|
@@ -122,6 +154,7 @@ export async function runPostUnitVerification(vctx, pauseAuto) {
|
|
|
122
154
|
try {
|
|
123
155
|
const effectivePrefs = loadEffectiveGSDPreferences();
|
|
124
156
|
const prefs = effectivePrefs?.preferences;
|
|
157
|
+
const uokFlags = resolveUokFlags(prefs);
|
|
125
158
|
// Read task plan verify field
|
|
126
159
|
const { milestone: mid, slice: sid, task: tid } = parseUnitId(s.currentUnit.id);
|
|
127
160
|
let taskPlanVerify;
|
|
@@ -153,6 +186,35 @@ export async function runPostUnitVerification(vctx, pauseAuto) {
|
|
|
153
186
|
process.stderr.write(` [${w.severity}] ${w.name}: ${w.title}\n`);
|
|
154
187
|
}
|
|
155
188
|
}
|
|
189
|
+
if (uokFlags.gates) {
|
|
190
|
+
const gateRunner = new UokGateRunner();
|
|
191
|
+
gateRunner.register({
|
|
192
|
+
id: "verification-gate",
|
|
193
|
+
type: "verification",
|
|
194
|
+
execute: async () => ({
|
|
195
|
+
outcome: result.passed ? "pass" : "fail",
|
|
196
|
+
failureClass: result.runtimeErrors?.some((e) => e.blocking)
|
|
197
|
+
? "execution"
|
|
198
|
+
: "verification",
|
|
199
|
+
rationale: result.passed
|
|
200
|
+
? "verification checks passed"
|
|
201
|
+
: "verification checks failed",
|
|
202
|
+
findings: result.passed
|
|
203
|
+
? ""
|
|
204
|
+
: formatFailureContext(result),
|
|
205
|
+
}),
|
|
206
|
+
});
|
|
207
|
+
await gateRunner.run("verification-gate", {
|
|
208
|
+
basePath: s.basePath,
|
|
209
|
+
traceId: `verification:${s.currentUnit.id}`,
|
|
210
|
+
turnId: s.currentUnit.id,
|
|
211
|
+
milestoneId: mid ?? undefined,
|
|
212
|
+
sliceId: sid ?? undefined,
|
|
213
|
+
taskId: tid ?? undefined,
|
|
214
|
+
unitType: s.currentUnit.type,
|
|
215
|
+
unitId: s.currentUnit.id,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
156
218
|
// Auto-fix retry preferences
|
|
157
219
|
const autoFixEnabled = prefs?.verification_auto_fix !== false;
|
|
158
220
|
const maxRetries = typeof prefs?.verification_max_retries === "number"
|
|
@@ -253,6 +315,42 @@ export async function runPostUnitVerification(vctx, pauseAuto) {
|
|
|
253
315
|
: "⚠";
|
|
254
316
|
process.stderr.write(`gsd-post-exec: ${checkEmoji} [${check.category}] ${check.target}: ${check.message}\n`);
|
|
255
317
|
}
|
|
318
|
+
if (uokFlags.gates) {
|
|
319
|
+
const strictMode = prefs?.enhanced_verification_strict === true;
|
|
320
|
+
const warnEscalated = postExecResult.status === "warn" && strictMode;
|
|
321
|
+
const blockingFailure = postExecResult.status === "fail" || warnEscalated;
|
|
322
|
+
const findings = postExecResult.checks
|
|
323
|
+
.filter((check) => !check.passed)
|
|
324
|
+
.map((check) => `[${check.category}] ${check.target}: ${check.message}`)
|
|
325
|
+
.join("\n");
|
|
326
|
+
const gateRunner = new UokGateRunner();
|
|
327
|
+
gateRunner.register({
|
|
328
|
+
id: "post-execution-checks",
|
|
329
|
+
type: "artifact",
|
|
330
|
+
execute: async () => ({
|
|
331
|
+
outcome: blockingFailure ? "fail" : "pass",
|
|
332
|
+
failureClass: postExecResult.status === "fail"
|
|
333
|
+
? "artifact"
|
|
334
|
+
: warnEscalated
|
|
335
|
+
? "policy"
|
|
336
|
+
: "none",
|
|
337
|
+
rationale: blockingFailure
|
|
338
|
+
? `post-execution checks ${postExecResult.status}${warnEscalated ? " (strict)" : ""}`
|
|
339
|
+
: "post-execution checks passed",
|
|
340
|
+
findings,
|
|
341
|
+
}),
|
|
342
|
+
});
|
|
343
|
+
await gateRunner.run("post-execution-checks", {
|
|
344
|
+
basePath: s.basePath,
|
|
345
|
+
traceId: `verification:${s.currentUnit.id}`,
|
|
346
|
+
turnId: s.currentUnit.id,
|
|
347
|
+
milestoneId: mid,
|
|
348
|
+
sliceId: sid,
|
|
349
|
+
taskId: tid,
|
|
350
|
+
unitType: s.currentUnit.type,
|
|
351
|
+
unitId: s.currentUnit.id,
|
|
352
|
+
});
|
|
353
|
+
}
|
|
256
354
|
// Check for blocking failures
|
|
257
355
|
if (postExecResult.status === "fail") {
|
|
258
356
|
postExecBlockingFailure = true;
|
|
@@ -36,7 +36,7 @@ import { captureAvailableSkills, resetSkillTelemetry, } from "./skill-telemetry.
|
|
|
36
36
|
import { getRtkSessionSavings } from "../shared/rtk-session-stats.js";
|
|
37
37
|
import { deactivateGSD } from "../shared/gsd-phase-state.js";
|
|
38
38
|
import { initMetrics, resetMetrics, getLedger, getProjectTotals, formatCost, formatTokenCount, } from "./metrics.js";
|
|
39
|
-
import { logWarning } from "./workflow-logger.js";
|
|
39
|
+
import { setLogBasePath, logWarning } from "./workflow-logger.js";
|
|
40
40
|
import { homedir } from "node:os";
|
|
41
41
|
import { join } from "node:path";
|
|
42
42
|
import { pathToFileURL } from "node:url";
|
|
@@ -61,10 +61,12 @@ import { clearCmuxSidebar, logCmuxEvent, syncCmuxSidebar } from "../cmux/index.j
|
|
|
61
61
|
// ── Extracted modules ──────────────────────────────────────────────────────
|
|
62
62
|
import { startUnitSupervision } from "./auto-timers.js";
|
|
63
63
|
import { runPostUnitVerification } from "./auto-verification.js";
|
|
64
|
-
import { postUnitPreVerification, postUnitPostVerification, } from "./auto-post-unit.js";
|
|
64
|
+
import { autoCommitUnit, postUnitPreVerification, postUnitPostVerification, } from "./auto-post-unit.js";
|
|
65
65
|
import { bootstrapAutoSession, openProjectDbIfPresent } from "./auto-start.js";
|
|
66
66
|
import { initHealthWidget } from "./health-widget.js";
|
|
67
67
|
import { autoLoop, resolveAgentEnd, resolveAgentEndCancelled, _resetPendingResolve, isSessionSwitchInFlight } from "./auto-loop.js";
|
|
68
|
+
import { runAutoLoopWithUok } from "./uok/kernel.js";
|
|
69
|
+
import { resolveUokFlags } from "./uok/flags.js";
|
|
68
70
|
import { WorktreeResolver, } from "./worktree-resolver.js";
|
|
69
71
|
import { reorderForCaching } from "./prompt-ordering.js";
|
|
70
72
|
// ─── Session State ─────────────────────────────────────────────────────────
|
|
@@ -360,10 +362,22 @@ function clearUnitTimeout() {
|
|
|
360
362
|
}
|
|
361
363
|
/** Build snapshot metric opts. */
|
|
362
364
|
function buildSnapshotOpts(_unitType, _unitId) {
|
|
365
|
+
const prefs = loadEffectiveGSDPreferences()?.preferences;
|
|
366
|
+
const uokFlags = resolveUokFlags(prefs);
|
|
363
367
|
return {
|
|
364
368
|
...(s.autoStartTime > 0 ? { autoSessionKey: String(s.autoStartTime) } : {}),
|
|
365
369
|
promptCharCount: s.lastPromptCharCount,
|
|
366
370
|
baselineCharCount: s.lastBaselineCharCount,
|
|
371
|
+
traceId: s.currentTraceId ?? undefined,
|
|
372
|
+
turnId: s.currentTurnId ?? undefined,
|
|
373
|
+
...(uokFlags.gitops
|
|
374
|
+
? {
|
|
375
|
+
gitAction: uokFlags.gitopsTurnAction,
|
|
376
|
+
gitPush: uokFlags.gitopsTurnPush,
|
|
377
|
+
gitStatus: s.lastGitActionStatus ?? undefined,
|
|
378
|
+
gitError: s.lastGitActionFailure ?? undefined,
|
|
379
|
+
}
|
|
380
|
+
: {}),
|
|
367
381
|
...(s.currentUnitRouting ?? {}),
|
|
368
382
|
};
|
|
369
383
|
}
|
|
@@ -884,6 +898,7 @@ function buildLoopDeps() {
|
|
|
884
898
|
getMainBranch,
|
|
885
899
|
// Unit closeout + runtime records
|
|
886
900
|
closeoutUnit,
|
|
901
|
+
autoCommitUnit,
|
|
887
902
|
recordOutcome,
|
|
888
903
|
writeLock,
|
|
889
904
|
captureAvailableSkills,
|
|
@@ -1081,6 +1096,11 @@ export async function startAuto(ctx, pi, base, verboseMode, options) {
|
|
|
1081
1096
|
s.stepMode = requestedStepMode;
|
|
1082
1097
|
s.cmdCtx = ctx;
|
|
1083
1098
|
s.basePath = base;
|
|
1099
|
+
// Ensure the workflow-logger audit log is pinned to the project root
|
|
1100
|
+
// even when auto-mode is entered via a path that bypasses the
|
|
1101
|
+
// bootstrap/dynamic-tools ensureDbOpen() → setLogBasePath() chain
|
|
1102
|
+
// (e.g. /clear resume, hot-reload).
|
|
1103
|
+
setLogBasePath(base);
|
|
1084
1104
|
s.unitDispatchCount.clear();
|
|
1085
1105
|
s.unitLifetimeDispatches.clear();
|
|
1086
1106
|
if (!getLedger())
|
|
@@ -1159,7 +1179,13 @@ export async function startAuto(ctx, pi, base, verboseMode, options) {
|
|
|
1159
1179
|
writeLock(lockBase(), "resuming", s.currentMilestoneId ?? "unknown");
|
|
1160
1180
|
logCmuxEvent(loadEffectiveGSDPreferences()?.preferences, s.stepMode ? "Step-mode resumed." : "Auto-mode resumed.", "progress");
|
|
1161
1181
|
captureProjectRootEnv(s.originalBasePath || s.basePath);
|
|
1162
|
-
await
|
|
1182
|
+
await runAutoLoopWithUok({
|
|
1183
|
+
ctx,
|
|
1184
|
+
pi,
|
|
1185
|
+
s,
|
|
1186
|
+
deps: buildLoopDeps(),
|
|
1187
|
+
runLegacyLoop: autoLoop,
|
|
1188
|
+
});
|
|
1163
1189
|
cleanupAfterLoopExit(ctx);
|
|
1164
1190
|
return;
|
|
1165
1191
|
}
|
|
@@ -1183,7 +1209,13 @@ export async function startAuto(ctx, pi, base, verboseMode, options) {
|
|
|
1183
1209
|
}
|
|
1184
1210
|
logCmuxEvent(loadEffectiveGSDPreferences()?.preferences, requestedStepMode ? "Step-mode started." : "Auto-mode started.", "progress");
|
|
1185
1211
|
// Dispatch the first unit
|
|
1186
|
-
await
|
|
1212
|
+
await runAutoLoopWithUok({
|
|
1213
|
+
ctx,
|
|
1214
|
+
pi,
|
|
1215
|
+
s,
|
|
1216
|
+
deps: buildLoopDeps(),
|
|
1217
|
+
runLegacyLoop: autoLoop,
|
|
1218
|
+
});
|
|
1187
1219
|
cleanupAfterLoopExit(ctx);
|
|
1188
1220
|
}
|
|
1189
1221
|
// ─── Agent End Handler ────────────────────────────────────────────────────────
|