gsd-pi 2.80.0-dev.c2213c771 → 2.80.0-dev.c5c38454b
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/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/github-sync/templates.js +39 -8
- package/dist/resources/extensions/gsd/auto/loop.js +16 -9
- package/dist/resources/extensions/gsd/auto/run-unit.js +19 -15
- package/dist/resources/extensions/gsd/auto-dashboard.js +51 -15
- package/dist/resources/extensions/gsd/auto-dispatch.js +10 -0
- package/dist/resources/extensions/gsd/auto-recovery.js +154 -8
- package/dist/resources/extensions/gsd/auto-start.js +2 -3
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +15 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +11 -1
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +129 -1
- package/dist/resources/extensions/gsd/commands-extract-learnings.js +17 -12
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +22 -2
- package/dist/resources/extensions/gsd/db-base-schema.js +14 -0
- package/dist/resources/extensions/gsd/db-migration-steps.js +16 -0
- package/dist/resources/extensions/gsd/graph.js +9 -3
- package/dist/resources/extensions/gsd/gsd-db.js +102 -2
- package/dist/resources/extensions/gsd/guided-flow.js +2 -2
- package/dist/resources/extensions/gsd/pr-evidence.js +57 -16
- package/dist/resources/extensions/gsd/working-output-messages.js +64 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +12 -12
- 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/react-loadable-manifest.json +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.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/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-react-loadable-manifest.js +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/{8336.6f6f30e410419aff.js → 8336.631939fb583761fa.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/{webpack-d82dbee6356c1733.js → webpack-0481f1221120a7c6.js} +1 -1
- package/package.json +7 -3
- package/packages/pi-ai/dist/models/fake-model.d.ts +12 -0
- package/packages/pi-ai/dist/models/fake-model.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/fake-model.js +27 -0
- package/packages/pi-ai/dist/models/fake-model.js.map +1 -0
- package/packages/pi-ai/dist/models/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/index.js +8 -0
- package/packages/pi-ai/dist/models/index.js.map +1 -1
- package/packages/pi-ai/dist/providers/fake.d.ts +42 -0
- package/packages/pi-ai/dist/providers/fake.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/fake.js +319 -0
- package/packages/pi-ai/dist/providers/fake.js.map +1 -0
- package/packages/pi-ai/dist/providers/register-builtins.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/register-builtins.js +24 -0
- package/packages/pi-ai/dist/providers/register-builtins.js.map +1 -1
- package/packages/pi-ai/src/models/fake-model.ts +30 -0
- package/packages/pi-ai/src/models/index.ts +9 -0
- package/packages/pi-ai/src/providers/fake.ts +376 -0
- package/packages/pi-ai/src/providers/register-builtins.ts +23 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +44 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +14 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js +97 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +5 -0
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +4 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +8 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/slash-commands.js +1 -0
- package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js +6 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +54 -15
- 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/adaptive-layout.d.ts +26 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +112 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js +51 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js.map +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.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +10 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +3 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +7 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +16 -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 +106 -17
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.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 +58 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +40 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +3 -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 +23 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +20 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.js +79 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +12 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +13 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +18 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +36 -27
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.d.ts +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.js +18 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +48 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -0
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +51 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.test.ts +108 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +16 -1
- package/packages/pi-coding-agent/src/core/model-registry.ts +4 -0
- package/packages/pi-coding-agent/src/core/settings-manager.ts +12 -0
- package/packages/pi-coding-agent/src/core/slash-commands.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.ts +7 -5
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +78 -15
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.test.ts +59 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +160 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +10 -9
- package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +15 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +10 -9
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +118 -17
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +43 -1
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +73 -1
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-state.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +25 -0
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.test.ts +95 -0
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +24 -1
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.ts +13 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +32 -2
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +36 -27
- package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +65 -0
- package/packages/pi-coding-agent/src/modes/interactive/tui-mode.ts +29 -0
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/style.test.d.ts +2 -0
- package/packages/pi-tui/dist/__tests__/style.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/__tests__/style.test.js +63 -0
- package/packages/pi-tui/dist/__tests__/style.test.js.map +1 -0
- package/packages/pi-tui/dist/__tests__/tui.test.js +24 -3
- package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
- package/packages/pi-tui/dist/index.d.ts +1 -0
- package/packages/pi-tui/dist/index.d.ts.map +1 -1
- package/packages/pi-tui/dist/index.js +2 -0
- package/packages/pi-tui/dist/index.js.map +1 -1
- package/packages/pi-tui/dist/style.d.ts +41 -0
- package/packages/pi-tui/dist/style.d.ts.map +1 -0
- package/packages/pi-tui/dist/style.js +158 -0
- package/packages/pi-tui/dist/style.js.map +1 -0
- package/packages/pi-tui/dist/tui.d.ts +0 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +3 -8
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/__tests__/style.test.ts +76 -0
- package/packages/pi-tui/src/__tests__/tui.test.ts +29 -3
- package/packages/pi-tui/src/index.ts +9 -0
- package/packages/pi-tui/src/style.ts +225 -0
- package/packages/pi-tui/src/tui.ts +3 -8
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts +12 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme-schema.js +13 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +18 -1
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js +36 -27
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/src/resources/extensions/github-sync/templates.ts +38 -8
- package/src/resources/extensions/github-sync/tests/inline-code.test.ts +66 -0
- package/src/resources/extensions/gsd/auto/loop.ts +17 -10
- package/src/resources/extensions/gsd/auto/run-unit.ts +24 -14
- package/src/resources/extensions/gsd/auto-dashboard.ts +57 -8
- package/src/resources/extensions/gsd/auto-dispatch.ts +17 -0
- package/src/resources/extensions/gsd/auto-recovery.ts +153 -7
- package/src/resources/extensions/gsd/auto-start.ts +7 -6
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +16 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +17 -1
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +135 -1
- package/src/resources/extensions/gsd/commands-extract-learnings.ts +17 -12
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +24 -1
- package/src/resources/extensions/gsd/db-base-schema.ts +15 -0
- package/src/resources/extensions/gsd/db-migration-steps.ts +17 -0
- package/src/resources/extensions/gsd/graph.ts +12 -5
- package/src/resources/extensions/gsd/gsd-db.ts +119 -1
- package/src/resources/extensions/gsd/guided-flow.ts +2 -2
- package/src/resources/extensions/gsd/pr-evidence.ts +63 -5
- package/src/resources/extensions/gsd/tests/auto-abort-pause-regression.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +83 -4
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +170 -1
- package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +112 -6
- package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +40 -2
- package/src/resources/extensions/gsd/tests/db-migration-steps.integration.test.ts +428 -0
- package/src/resources/extensions/gsd/tests/db-schema-metadata.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/commands-ship-basic.md +52 -0
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/commands-ship-empty-optionals.md +42 -0
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-no-blockers.md +55 -0
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-with-blockers.md +60 -0
- package/src/resources/extensions/gsd/tests/graph-operations.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/has-pending-deep-stage.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/pr-evidence-equivalence.test.ts +102 -0
- package/src/resources/extensions/gsd/tests/pr-evidence-hardening.test.ts +165 -0
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/working-output-messages.test.ts +93 -0
- package/src/resources/extensions/gsd/tests/worktree-write-gate.test.ts +179 -0
- package/src/resources/extensions/gsd/working-output-messages.ts +120 -0
- /package/dist/web/standalone/.next/static/{HZXiuIbWQmvXjo4Tl3_zk → TCSim36ZpcPu2WgeoC45g}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{HZXiuIbWQmvXjo4Tl3_zk → TCSim36ZpcPu2WgeoC45g}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
7088672cce649c64
|
|
@@ -8,6 +8,37 @@
|
|
|
8
8
|
* for the `gh` CLI body parameters.
|
|
9
9
|
*/
|
|
10
10
|
import { buildPrEvidence } from "../gsd/pr-evidence.js";
|
|
11
|
+
// ─── Helpers ────────────────────────────────────────────────────────────────
|
|
12
|
+
/**
|
|
13
|
+
* Wrap a string in a CommonMark inline-code span, escaping any embedded
|
|
14
|
+
* backticks by selecting a fence longer than the longest backtick run inside
|
|
15
|
+
* the input. If the input begins or ends with a backtick, pad with a single
|
|
16
|
+
* space inside the fence (CommonMark requirement).
|
|
17
|
+
*
|
|
18
|
+
* Empty input returns an empty string (no fence) — there is nothing to render
|
|
19
|
+
* as code, and emitting an empty pair of backticks would produce literal
|
|
20
|
+
* backticks in GitHub-flavored markdown.
|
|
21
|
+
*/
|
|
22
|
+
export function inlineCode(s) {
|
|
23
|
+
if (s.length === 0)
|
|
24
|
+
return "";
|
|
25
|
+
let longestRun = 0;
|
|
26
|
+
let currentRun = 0;
|
|
27
|
+
for (const ch of s) {
|
|
28
|
+
if (ch === "`") {
|
|
29
|
+
currentRun++;
|
|
30
|
+
if (currentRun > longestRun)
|
|
31
|
+
longestRun = currentRun;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
currentRun = 0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const fence = "`".repeat(longestRun + 1);
|
|
38
|
+
const needsPad = s.startsWith("`") || s.endsWith("`");
|
|
39
|
+
const pad = needsPad ? " " : "";
|
|
40
|
+
return `${fence}${pad}${s}${pad}${fence}`;
|
|
41
|
+
}
|
|
11
42
|
export function formatMilestoneIssueBody(data) {
|
|
12
43
|
const lines = [];
|
|
13
44
|
lines.push(`# ${data.id}: ${data.title}`);
|
|
@@ -78,7 +109,7 @@ export function formatTaskIssueBody(data) {
|
|
|
78
109
|
if (data.files?.length) {
|
|
79
110
|
lines.push("### Files");
|
|
80
111
|
for (const file of data.files) {
|
|
81
|
-
lines.push(`-
|
|
112
|
+
lines.push(`- ${inlineCode(file)}`);
|
|
82
113
|
}
|
|
83
114
|
lines.push("");
|
|
84
115
|
}
|
|
@@ -132,15 +163,14 @@ export function formatSwarmLanePRBody(data) {
|
|
|
132
163
|
const summaries = [
|
|
133
164
|
[
|
|
134
165
|
"### Swarm lane",
|
|
135
|
-
`**Lane:**
|
|
136
|
-
`**Branch:**
|
|
166
|
+
`**Lane:** ${inlineCode(laneLabel)}`,
|
|
167
|
+
`**Branch:** ${inlineCode(data.lane.branch)}`,
|
|
137
168
|
data.lane.owner ? `**Owner:** ${data.lane.owner}` : "",
|
|
138
|
-
data.lane.latestCommit ? `**Latest commit:**
|
|
169
|
+
data.lane.latestCommit ? `**Latest commit:** ${inlineCode(data.lane.latestCommit)}` : "",
|
|
139
170
|
].filter(Boolean).join("\n"),
|
|
140
171
|
`### Impact area\n${data.impactArea}`,
|
|
141
172
|
`### Changed contracts\n${checkedList(data.lane.changedContracts, "No shared contracts changed").join("\n")}`,
|
|
142
173
|
`### Transition risks\n${checkedList(data.transitionRisks, "No transition risks identified").join("\n")}`,
|
|
143
|
-
data.lane.blockers?.length ? `### Blockers\n${data.lane.blockers.map((blocker) => `- ${blocker}`).join("\n")}` : "",
|
|
144
174
|
].filter(Boolean);
|
|
145
175
|
return buildPrEvidence({
|
|
146
176
|
milestoneId: laneLabel,
|
|
@@ -150,6 +180,7 @@ export function formatSwarmLanePRBody(data) {
|
|
|
150
180
|
changeType: "refactor",
|
|
151
181
|
linkedIssue: data.linkedIssue ? `Closes #${data.linkedIssue}` : undefined,
|
|
152
182
|
summaries,
|
|
183
|
+
blockers: data.lane.blockers ?? [],
|
|
153
184
|
testsRun: data.lane.testEvidence,
|
|
154
185
|
rollbackNotes: data.rollbackPlan,
|
|
155
186
|
how: "Generated by GSD GitHub Sync swarm routines from lane evidence.",
|
|
@@ -159,7 +190,7 @@ export function formatSwarmReleaseChecklistBody(data) {
|
|
|
159
190
|
const lines = [];
|
|
160
191
|
lines.push(`# UOK Swarm Release Checklist`);
|
|
161
192
|
lines.push("");
|
|
162
|
-
lines.push(`**Integration branch:**
|
|
193
|
+
lines.push(`**Integration branch:** ${inlineCode(data.integrationBranch)}`);
|
|
163
194
|
lines.push("");
|
|
164
195
|
lines.push("## Lane summary");
|
|
165
196
|
lines.push("");
|
|
@@ -167,9 +198,9 @@ export function formatSwarmReleaseChecklistBody(data) {
|
|
|
167
198
|
lines.push("|------|--------|-------|--------|--------|");
|
|
168
199
|
for (const lane of data.lanes) {
|
|
169
200
|
const owner = lane.owner ?? "";
|
|
170
|
-
const commit = lane.latestCommit ?
|
|
201
|
+
const commit = lane.latestCommit ? inlineCode(lane.latestCommit) : "";
|
|
171
202
|
const status = lane.blockers?.length ? "blocked" : "ready";
|
|
172
|
-
lines.push(`|
|
|
203
|
+
lines.push(`| ${inlineCode(SWARM_LANE_LABELS[lane.id])} | ${inlineCode(lane.branch)} | ${owner} | ${commit} | ${status} |`);
|
|
173
204
|
}
|
|
174
205
|
lines.push("");
|
|
175
206
|
lines.push("## Required evidence");
|
|
@@ -268,6 +268,19 @@ export async function autoLoop(ctx, pi, s, deps, options) {
|
|
|
268
268
|
// ── Blanket try/catch: one bad iteration must not kill the session
|
|
269
269
|
const prefs = deps.loadEffectiveGSDPreferences()?.preferences;
|
|
270
270
|
const uokFlags = resolveUokFlags(prefs);
|
|
271
|
+
// ── Check sidecar queue before deriveState ──
|
|
272
|
+
// NOTE: Sidecar dequeue MUST run before validateWorkflowSessionLock so a
|
|
273
|
+
// queued item is popped (and the `sidecar-dequeue` journal event emitted)
|
|
274
|
+
// even when the session lock invalidates this iteration. Inverting this
|
|
275
|
+
// order silently drops queued items on lock-loss. Refs #5308.
|
|
276
|
+
const sidecarItem = await dequeueSidecarItem({
|
|
277
|
+
queue: s.sidecarQueue,
|
|
278
|
+
executionGraphEnabled: uokFlags.executionGraph,
|
|
279
|
+
scheduleQueue: scheduleSidecarQueue,
|
|
280
|
+
warnSchedulingFailure: message => logWarning("dispatch", `sidecar queue scheduling failed: ${message}`),
|
|
281
|
+
logDequeue: payload => debugLog("autoLoop", { phase: "sidecar-dequeue", ...payload }),
|
|
282
|
+
emitDequeue: payload => journalReporter.emit("sidecar-dequeue", payload),
|
|
283
|
+
});
|
|
271
284
|
const sessionLockOutcome = validateWorkflowSessionLock({
|
|
272
285
|
active: s.active,
|
|
273
286
|
iteration,
|
|
@@ -287,17 +300,9 @@ export async function autoLoop(ctx, pi, s, deps, options) {
|
|
|
287
300
|
},
|
|
288
301
|
});
|
|
289
302
|
if (sessionLockOutcome.action === "stop" && sessionLockOutcome.reason === "session-lock-lost") {
|
|
303
|
+
finishTurn("stopped", "manual-attention", sessionLockOutcome.reason);
|
|
290
304
|
break;
|
|
291
305
|
}
|
|
292
|
-
// ── Check sidecar queue before deriveState ──
|
|
293
|
-
const sidecarItem = await dequeueSidecarItem({
|
|
294
|
-
queue: s.sidecarQueue,
|
|
295
|
-
executionGraphEnabled: uokFlags.executionGraph,
|
|
296
|
-
scheduleQueue: scheduleSidecarQueue,
|
|
297
|
-
warnSchedulingFailure: message => logWarning("dispatch", `sidecar queue scheduling failed: ${message}`),
|
|
298
|
-
logDequeue: payload => debugLog("autoLoop", { phase: "sidecar-dequeue", ...payload }),
|
|
299
|
-
emitDequeue: payload => journalReporter.emit("sidecar-dequeue", payload),
|
|
300
|
-
});
|
|
301
306
|
const ic = { ctx, pi, s, deps, prefs, iteration, flowId, nextSeq };
|
|
302
307
|
journalReporter.emit("iteration-start", { iteration });
|
|
303
308
|
let iterData;
|
|
@@ -331,6 +336,7 @@ export async function autoLoop(ctx, pi, s, deps, options) {
|
|
|
331
336
|
isComplete: engineState.isComplete,
|
|
332
337
|
});
|
|
333
338
|
if (engineState.isComplete) {
|
|
339
|
+
finishTurn("completed");
|
|
334
340
|
await deps.stopAuto(ctx, pi, "Workflow complete");
|
|
335
341
|
break;
|
|
336
342
|
}
|
|
@@ -734,6 +740,7 @@ export async function autoLoop(ctx, pi, s, deps, options) {
|
|
|
734
740
|
});
|
|
735
741
|
if (cooldownDecision.action === "stop") {
|
|
736
742
|
ctx.ui.notify(cooldownDecision.notifyMessage, "error");
|
|
743
|
+
finishTurn("stopped", "timeout", msg);
|
|
737
744
|
await deps.stopAuto(ctx, pi, cooldownDecision.stopMessage);
|
|
738
745
|
break;
|
|
739
746
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
* auto/run-unit.ts — Single unit execution: session create → prompt → await agent_end.
|
|
3
|
-
*
|
|
4
|
-
* Imports from: auto/types, auto/resolve
|
|
5
|
-
*/
|
|
1
|
+
// GSD-2 + src/resources/extensions/gsd/auto/run-unit.ts - Runs one GSD auto-mode unit from session creation through agent completion.
|
|
6
2
|
import { NEW_SESSION_TIMEOUT_MS } from "./session.js";
|
|
7
3
|
import { _clearCurrentResolve, _setCurrentResolve, _setSessionSwitchInFlight } from "./resolve.js";
|
|
8
4
|
import { getCurrentTurnGeneration, runWithTurnGeneration, } from "./turn-epoch.js";
|
|
9
5
|
import { debugLog } from "../debug-logger.js";
|
|
10
6
|
import { logWarning } from "../workflow-logger.js";
|
|
11
7
|
import { resolveAutoSupervisorConfig } from "../preferences.js";
|
|
8
|
+
import { formatAutoUnitWorkingMessage } from "../working-output-messages.js";
|
|
12
9
|
// Tracks the latest session-switch attempt so a late timeout settlement from an
|
|
13
10
|
// older runUnit() call cannot clear the guard for a newer one.
|
|
14
11
|
let sessionSwitchGeneration = 0;
|
|
@@ -151,22 +148,29 @@ export async function runUnit(ctx, pi, s, unitType, unitId, prompt) {
|
|
|
151
148
|
// ── Send the prompt ──
|
|
152
149
|
debugLog("runUnit", { phase: "send-message", unitType, unitId });
|
|
153
150
|
const requestDispatchedAt = Date.now();
|
|
154
|
-
|
|
151
|
+
ctx.ui.setWorkingMessage?.(formatAutoUnitWorkingMessage(unitType, unitId));
|
|
155
152
|
// ── Await agent_end with absolute timeout (H4 fix) ──
|
|
156
153
|
// If supervision fails to resolve unitPromise within 30s, treat as cancelled.
|
|
157
154
|
// Without this, a crashed agent that never emits agent_end hangs the loop (#3161).
|
|
158
|
-
debugLog("runUnit", { phase: "awaiting-agent-end", unitType, unitId });
|
|
159
155
|
const supervisor = resolveAutoSupervisorConfig();
|
|
160
156
|
const UNIT_HARD_TIMEOUT_MS = Math.max(30_000, ((supervisor.hard_timeout_minutes ?? 30) * 60 * 1000) + 30_000);
|
|
161
157
|
let unitTimeoutHandle;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
158
|
+
let result;
|
|
159
|
+
try {
|
|
160
|
+
pi.sendMessage({ customType: "gsd-auto", content: prompt, display: s.verbose }, { triggerTurn: true });
|
|
161
|
+
debugLog("runUnit", { phase: "awaiting-agent-end", unitType, unitId });
|
|
162
|
+
const timeoutResult = new Promise((resolve) => {
|
|
163
|
+
unitTimeoutHandle = setTimeout(() => {
|
|
164
|
+
resolve({ status: "cancelled", errorContext: { message: "Unit hard timeout — supervision may have failed", category: "timeout", isTransient: true } });
|
|
165
|
+
}, UNIT_HARD_TIMEOUT_MS);
|
|
166
|
+
});
|
|
167
|
+
result = await runWithTurnGeneration(capturedTurnGen, () => Promise.race([unitPromise, timeoutResult]));
|
|
168
|
+
}
|
|
169
|
+
finally {
|
|
170
|
+
if (unitTimeoutHandle)
|
|
171
|
+
clearTimeout(unitTimeoutHandle);
|
|
172
|
+
ctx.ui.setWorkingMessage?.(undefined);
|
|
173
|
+
}
|
|
170
174
|
debugLog("runUnit", {
|
|
171
175
|
phase: "agent-end-received",
|
|
172
176
|
unitType,
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Auto-mode Dashboard — progress widget rendering, elapsed time formatting,
|
|
3
|
-
* unit description helpers, and slice progress caching.
|
|
4
|
-
*
|
|
5
|
-
* Pure functions that accept specific parameters — no module-level globals
|
|
6
|
-
* or AutoContext dependency. State accessors are passed as callbacks.
|
|
7
|
-
*/
|
|
1
|
+
// GSD-2 + src/resources/extensions/gsd/auto-dashboard.ts - Auto-mode progress widget rendering and dashboard helpers.
|
|
8
2
|
import { getCurrentBranch } from "./worktree.js";
|
|
9
3
|
import { getActiveHook } from "./post-unit-hooks.js";
|
|
10
4
|
import { getLedger, getProjectTotals } from "./metrics.js";
|
|
@@ -25,6 +19,7 @@ import { formatRtkSavingsLabel, getRtkSessionSavings, } from "../shared/rtk-sess
|
|
|
25
19
|
import { logWarning } from "./workflow-logger.js";
|
|
26
20
|
import { formattedShortcutPair } from "./shortcut-defs.js";
|
|
27
21
|
import { homedir } from "node:os";
|
|
22
|
+
import { readUnitRuntimeRecord } from "./unit-runtime.js";
|
|
28
23
|
// ─── UAT Slice Extraction ─────────────────────────────────────────────────────
|
|
29
24
|
/**
|
|
30
25
|
* Extract the target slice ID from a run-uat unit ID (e.g. "M001/S01" → "S01").
|
|
@@ -165,6 +160,30 @@ export function formatWidgetTokens(count) {
|
|
|
165
160
|
return `${(count / 1000000).toFixed(1)}M`;
|
|
166
161
|
return `${Math.round(count / 1000000)}M`;
|
|
167
162
|
}
|
|
163
|
+
export function formatRuntimeHealthSignal(record, now = Date.now()) {
|
|
164
|
+
if (!record)
|
|
165
|
+
return null;
|
|
166
|
+
const idleMs = Math.max(0, now - record.lastProgressAt);
|
|
167
|
+
const idleMinutes = Math.floor(idleMs / 60_000);
|
|
168
|
+
if ((record.recoveryAttempts ?? 0) > 0 || record.phase === "recovered" || record.lastProgressKind.includes("recovery")) {
|
|
169
|
+
return {
|
|
170
|
+
level: "yellow",
|
|
171
|
+
summary: "Recovering",
|
|
172
|
+
detail: `retry ${record.recoveryAttempts ?? 1} after ${record.lastRecoveryReason ?? "idle"} stall`,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
if (record.progressCount === 0 && idleMs >= 60_000) {
|
|
176
|
+
return {
|
|
177
|
+
level: "yellow",
|
|
178
|
+
summary: "Waiting on provider",
|
|
179
|
+
detail: `no output for ${idleMinutes}m`,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
export function shouldRenderRoadmapProgress(progress) {
|
|
185
|
+
return !!progress && progress.total > 0;
|
|
186
|
+
}
|
|
168
187
|
// ─── ETA Estimation ──────────────────────────────────────────────────────────
|
|
169
188
|
/**
|
|
170
189
|
* Estimate remaining time based on average unit duration from the metrics ledger.
|
|
@@ -499,6 +518,7 @@ export function updateProgressWidget(ctx, unitType, unitId, state, accessors, ti
|
|
|
499
518
|
let cachedLines;
|
|
500
519
|
let cachedWidth;
|
|
501
520
|
let cachedRtkLabel;
|
|
521
|
+
let cachedRuntimeRecord = null;
|
|
502
522
|
const refreshRtkLabel = () => {
|
|
503
523
|
try {
|
|
504
524
|
const sessionId = ctx.sessionManager.getSessionId();
|
|
@@ -510,7 +530,16 @@ export function updateProgressWidget(ctx, unitType, unitId, state, accessors, ti
|
|
|
510
530
|
cachedRtkLabel = null;
|
|
511
531
|
}
|
|
512
532
|
};
|
|
533
|
+
const refreshRuntimeRecord = () => {
|
|
534
|
+
try {
|
|
535
|
+
cachedRuntimeRecord = readUnitRuntimeRecord(accessors.getBasePath(), unitType, unitId);
|
|
536
|
+
}
|
|
537
|
+
catch {
|
|
538
|
+
cachedRuntimeRecord = null;
|
|
539
|
+
}
|
|
540
|
+
};
|
|
513
541
|
refreshRtkLabel();
|
|
542
|
+
refreshRuntimeRecord();
|
|
514
543
|
const pulseTimer = setInterval(() => {
|
|
515
544
|
pulseBright = !pulseBright;
|
|
516
545
|
cachedLines = undefined;
|
|
@@ -526,6 +555,7 @@ export function updateProgressWidget(ctx, unitType, unitId, state, accessors, ti
|
|
|
526
555
|
updateSliceProgressCache(accessors.getBasePath(), mid.id, slice?.id);
|
|
527
556
|
}
|
|
528
557
|
refreshRtkLabel();
|
|
558
|
+
refreshRuntimeRecord();
|
|
529
559
|
cachedLines = undefined;
|
|
530
560
|
}
|
|
531
561
|
catch (err) { /* non-fatal */
|
|
@@ -555,13 +585,16 @@ export function updateProgressWidget(ctx, unitType, unitId, state, accessors, ti
|
|
|
555
585
|
const modeTag = accessors.isStepMode() ? "NEXT" : "AUTO";
|
|
556
586
|
// Health indicator in header
|
|
557
587
|
const score = computeProgressScore();
|
|
558
|
-
const
|
|
559
|
-
|
|
588
|
+
const runtimeSignal = formatRuntimeHealthSignal(cachedRuntimeRecord);
|
|
589
|
+
const healthLevel = runtimeSignal?.level ?? score.level;
|
|
590
|
+
const healthSummary = runtimeSignal?.summary ?? score.summary;
|
|
591
|
+
const healthColor = healthLevel === "green" ? "success"
|
|
592
|
+
: healthLevel === "yellow" ? "warning"
|
|
560
593
|
: "error";
|
|
561
|
-
const healthIcon =
|
|
562
|
-
:
|
|
594
|
+
const healthIcon = healthLevel === "green" ? GLYPH.statusActive
|
|
595
|
+
: healthLevel === "yellow" ? "!"
|
|
563
596
|
: "x";
|
|
564
|
-
const healthStr = ` ${theme.fg(healthColor, healthIcon)} ${theme.fg(healthColor,
|
|
597
|
+
const healthStr = ` ${theme.fg(healthColor, healthIcon)} ${theme.fg(healthColor, healthSummary)}`;
|
|
565
598
|
const headerLeft = `${pad}${dot} ${theme.fg("accent", theme.bold("GSD"))} ${theme.fg("success", modeTag)}${healthStr}`;
|
|
566
599
|
// ETA in header right, after elapsed
|
|
567
600
|
const eta = estimateTimeRemaining();
|
|
@@ -573,7 +606,10 @@ export function updateProgressWidget(ctx, unitType, unitId, state, accessors, ti
|
|
|
573
606
|
: "";
|
|
574
607
|
lines.push(rightAlign(headerLeft, headerRight, width));
|
|
575
608
|
// Show health signal details when degraded (yellow/red)
|
|
576
|
-
if (
|
|
609
|
+
if (runtimeSignal?.detail && widgetMode !== "min") {
|
|
610
|
+
lines.push(`${pad} ${theme.fg("dim", runtimeSignal.detail)}`);
|
|
611
|
+
}
|
|
612
|
+
else if (score.level !== "green" && score.signals.length > 0 && widgetMode !== "min") {
|
|
577
613
|
// Show up to 3 most relevant signals in compact form
|
|
578
614
|
const topSignals = score.signals
|
|
579
615
|
.filter(s => s.kind === "negative")
|
|
@@ -645,7 +681,7 @@ export function updateProgressWidget(ctx, unitType, unitId, state, accessors, ti
|
|
|
645
681
|
lines.push(rightAlign(actionLeft, theme.fg("dim", phaseLabel), width));
|
|
646
682
|
// Progress bar
|
|
647
683
|
const roadmapSlices = mid ? getRoadmapSlicesSync() : null;
|
|
648
|
-
if (roadmapSlices) {
|
|
684
|
+
if (shouldRenderRoadmapProgress(roadmapSlices)) {
|
|
649
685
|
const { done, total, activeSliceTasks } = roadmapSlices;
|
|
650
686
|
const barWidth = Math.max(6, Math.min(18, Math.floor(width * 0.25)));
|
|
651
687
|
const pct = total > 0 ? done / total : 0;
|
|
@@ -706,7 +742,7 @@ export function updateProgressWidget(ctx, unitType, unitId, state, accessors, ti
|
|
|
706
742
|
? Math.floor(width * (width >= 100 ? 0.45 : 0.50))
|
|
707
743
|
: width;
|
|
708
744
|
const leftLines = [];
|
|
709
|
-
if (roadmapSlices) {
|
|
745
|
+
if (shouldRenderRoadmapProgress(roadmapSlices)) {
|
|
710
746
|
const { done, total, activeSliceTasks } = roadmapSlices;
|
|
711
747
|
const barWidth = Math.max(6, Math.min(18, Math.floor(leftColWidth * 0.4)));
|
|
712
748
|
const pct = total > 0 ? done / total : 0;
|
|
@@ -93,6 +93,16 @@ export function hasPendingDeepStage(prefs, basePath) {
|
|
|
93
93
|
const gate = getDeepStageGate(prefs, basePath);
|
|
94
94
|
return gate.status === "pending" || gate.status === "blocked";
|
|
95
95
|
}
|
|
96
|
+
export function shouldRunDeepProjectSetup(state, prefs, basePath, options = {}) {
|
|
97
|
+
if (options.hasSurvivorBranch === true)
|
|
98
|
+
return false;
|
|
99
|
+
if (state.phase !== "pre-planning" &&
|
|
100
|
+
state.phase !== "needs-discussion" &&
|
|
101
|
+
state.phase !== "planning") {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
return hasPendingDeepStage(prefs, basePath);
|
|
105
|
+
}
|
|
96
106
|
function missingSliceStop(mid, phase) {
|
|
97
107
|
return {
|
|
98
108
|
action: "stop",
|
|
@@ -12,7 +12,7 @@ import { appendEvent } from "./workflow-events.js";
|
|
|
12
12
|
import { atomicWriteSync } from "./atomic-write.js";
|
|
13
13
|
import { clearParseCache } from "./files.js";
|
|
14
14
|
import { parseRoadmap as parseLegacyRoadmap, parsePlan as parseLegacyPlan } from "./parsers-legacy.js";
|
|
15
|
-
import { isDbAvailable, getTask, getSlice, getSliceTasks, getPendingGates, updateTaskStatus, updateSliceStatus, insertSlice, getMilestone, refreshOpenDatabaseFromDisk } from "./gsd-db.js";
|
|
15
|
+
import { isDbAvailable, getTask, getSlice, getSliceTasks, getPendingGates, updateTaskStatus, updateSliceStatus, insertSlice, getMilestone, refreshOpenDatabaseFromDisk, getCompletedMilestoneTaskFileHints, getMilestoneCommitAttributionShas, recordMilestoneCommitAttribution } from "./gsd-db.js";
|
|
16
16
|
import { isValidationTerminal } from "./state.js";
|
|
17
17
|
import { getErrorMessage } from "./error-utils.js";
|
|
18
18
|
import { logWarning, logError } from "./workflow-logger.js";
|
|
@@ -110,17 +110,32 @@ export function hasImplementationArtifacts(basePath, milestoneId) {
|
|
|
110
110
|
// milestone commits instead of treating the self-diff as proof of no work.
|
|
111
111
|
if (changedFiles.length === 0) {
|
|
112
112
|
if (milestoneId && currentBranch === integrationBranch) {
|
|
113
|
-
const
|
|
114
|
-
if (!
|
|
113
|
+
const milestoneEvidence = getChangedFilesFromMilestoneEvidence(basePath, milestoneId);
|
|
114
|
+
if (!milestoneEvidence.ok)
|
|
115
115
|
return "unknown";
|
|
116
|
-
if (
|
|
117
|
-
return classifyImplementationFiles(
|
|
116
|
+
if (milestoneEvidence.matched)
|
|
117
|
+
return classifyImplementationFiles(milestoneEvidence.files);
|
|
118
118
|
}
|
|
119
119
|
if (currentBranch && currentBranch !== "HEAD")
|
|
120
120
|
return "absent";
|
|
121
121
|
return "unknown";
|
|
122
122
|
}
|
|
123
|
-
|
|
123
|
+
const branchClassification = classifyImplementationFiles(changedFiles);
|
|
124
|
+
if (branchClassification === "present")
|
|
125
|
+
return "present";
|
|
126
|
+
// A completing milestone branch can have a non-empty diff containing only
|
|
127
|
+
// .gsd/ closeout files after implementation commits already landed on the
|
|
128
|
+
// recorded integration branch. In that topology, the branch diff alone is
|
|
129
|
+
// insufficient; use the same milestone-tagged evidence fallback as the
|
|
130
|
+
// self-diff retry path before declaring the milestone implementation-free.
|
|
131
|
+
if (milestoneId) {
|
|
132
|
+
const milestoneEvidence = getChangedFilesFromMilestoneEvidence(basePath, milestoneId);
|
|
133
|
+
if (!milestoneEvidence.ok)
|
|
134
|
+
return "unknown";
|
|
135
|
+
if (milestoneEvidence.matched)
|
|
136
|
+
return classifyImplementationFiles(milestoneEvidence.files);
|
|
137
|
+
}
|
|
138
|
+
return "absent";
|
|
124
139
|
}
|
|
125
140
|
catch (e) {
|
|
126
141
|
// Non-fatal — if git operations fail, return unknown so callers can decide
|
|
@@ -148,6 +163,9 @@ function classifyImplementationFiles(files) {
|
|
|
148
163
|
function isImplementationPath(file) {
|
|
149
164
|
return !file.startsWith(".gsd/") && !file.startsWith(".gsd\\");
|
|
150
165
|
}
|
|
166
|
+
function normalizeRepoPath(file) {
|
|
167
|
+
return file.trim().replace(/\\/g, "/").replace(/^\.\/+/, "");
|
|
168
|
+
}
|
|
151
169
|
/**
|
|
152
170
|
* Detect the main/master branch name.
|
|
153
171
|
*/
|
|
@@ -217,7 +235,7 @@ function getChangedFilesFromMilestoneTaggedCommits(basePath, milestoneId) {
|
|
|
217
235
|
]);
|
|
218
236
|
if (!scoped.ok)
|
|
219
237
|
return scoped;
|
|
220
|
-
if (scoped.matched)
|
|
238
|
+
if (scoped.matched && classifyImplementationFiles(scoped.files) === "present")
|
|
221
239
|
return scoped;
|
|
222
240
|
// Fallback (#5033): when .gsd/ is gitignored / external / untracked, the
|
|
223
241
|
// path-scoped scan matches no commits even though GSD-tagged commits
|
|
@@ -228,9 +246,137 @@ function getChangedFilesFromMilestoneTaggedCommits(basePath, milestoneId) {
|
|
|
228
246
|
// Intentionally unbounded — symmetric with the primary scan, and avoids
|
|
229
247
|
// reintroducing the rolling-depth failure class removed in #4699 where
|
|
230
248
|
// milestone evidence aged out behind unrelated activity.
|
|
231
|
-
|
|
249
|
+
const unscoped = scanGsdTaggedCommits(basePath, milestoneId, [
|
|
232
250
|
"log", "--format=%H%x1f%B%x1e", "HEAD",
|
|
233
251
|
]);
|
|
252
|
+
if (!unscoped.ok)
|
|
253
|
+
return scoped.matched ? scoped : unscoped;
|
|
254
|
+
if (!unscoped.matched)
|
|
255
|
+
return scoped;
|
|
256
|
+
return {
|
|
257
|
+
ok: true,
|
|
258
|
+
matched: true,
|
|
259
|
+
files: [...new Set([...scoped.files, ...unscoped.files])],
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
function getChangedFilesFromMilestoneEvidence(basePath, milestoneId) {
|
|
263
|
+
const tagged = getChangedFilesFromMilestoneTaggedCommits(basePath, milestoneId);
|
|
264
|
+
if (!tagged.ok)
|
|
265
|
+
return tagged;
|
|
266
|
+
if (tagged.matched && classifyImplementationFiles(tagged.files) === "present")
|
|
267
|
+
return tagged;
|
|
268
|
+
const attributed = getChangedFilesFromAttributedMilestoneCommits(basePath, milestoneId);
|
|
269
|
+
if (!attributed.ok)
|
|
270
|
+
return tagged.matched ? tagged : attributed;
|
|
271
|
+
if (attributed.matched && classifyImplementationFiles(attributed.files) === "present")
|
|
272
|
+
return attributed;
|
|
273
|
+
const backfilled = backfillChangedFilesFromUntaggedMilestoneCommits(basePath, milestoneId);
|
|
274
|
+
if (!backfilled.ok)
|
|
275
|
+
return tagged.matched ? tagged : attributed.matched ? attributed : backfilled;
|
|
276
|
+
if (!backfilled.matched) {
|
|
277
|
+
if (tagged.matched)
|
|
278
|
+
return tagged;
|
|
279
|
+
return attributed.matched ? attributed : backfilled;
|
|
280
|
+
}
|
|
281
|
+
return {
|
|
282
|
+
ok: true,
|
|
283
|
+
matched: true,
|
|
284
|
+
files: [...new Set([...tagged.files, ...attributed.files, ...backfilled.files])],
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function getChangedFilesFromAttributedMilestoneCommits(basePath, milestoneId) {
|
|
288
|
+
try {
|
|
289
|
+
const shas = getMilestoneCommitAttributionShas(milestoneId);
|
|
290
|
+
if (shas.length === 0)
|
|
291
|
+
return { ok: true, matched: false, files: [] };
|
|
292
|
+
const files = new Set();
|
|
293
|
+
let matched = false;
|
|
294
|
+
for (const sha of shas) {
|
|
295
|
+
if (!isFullCommitSha(sha))
|
|
296
|
+
continue;
|
|
297
|
+
const commitFiles = getChangedFilesForCommit(basePath, sha);
|
|
298
|
+
if (commitFiles.length === 0)
|
|
299
|
+
continue;
|
|
300
|
+
matched = true;
|
|
301
|
+
for (const file of commitFiles)
|
|
302
|
+
files.add(file);
|
|
303
|
+
}
|
|
304
|
+
return { ok: true, matched, files: [...files] };
|
|
305
|
+
}
|
|
306
|
+
catch (e) {
|
|
307
|
+
logWarning("recovery", `milestone attribution scan failed: ${e.message}`);
|
|
308
|
+
return { ok: false, matched: false, files: [] };
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
function backfillChangedFilesFromUntaggedMilestoneCommits(basePath, milestoneId) {
|
|
312
|
+
try {
|
|
313
|
+
const milestone = getMilestone(milestoneId);
|
|
314
|
+
const milestoneStartedAt = milestone?.created_at ? Math.floor(Date.parse(milestone.created_at) / 1000) * 1000 : NaN;
|
|
315
|
+
if (!Number.isFinite(milestoneStartedAt))
|
|
316
|
+
return { ok: true, matched: false, files: [] };
|
|
317
|
+
const taskFileHints = getCompletedMilestoneTaskFileHints(milestoneId);
|
|
318
|
+
if (taskFileHints.length === 0)
|
|
319
|
+
return { ok: true, matched: false, files: [] };
|
|
320
|
+
const hintSet = new Set(taskFileHints.map(normalizeRepoPath).filter(Boolean));
|
|
321
|
+
if (hintSet.size === 0)
|
|
322
|
+
return { ok: true, matched: false, files: [] };
|
|
323
|
+
const records = getCommitRecords(basePath);
|
|
324
|
+
const files = new Set();
|
|
325
|
+
let matched = false;
|
|
326
|
+
for (const record of records) {
|
|
327
|
+
if (!isFullCommitSha(record.hash))
|
|
328
|
+
continue;
|
|
329
|
+
if (Date.parse(record.committedAt) < milestoneStartedAt)
|
|
330
|
+
continue;
|
|
331
|
+
if (record.parents.trim().split(/\s+/).filter(Boolean).length > 1)
|
|
332
|
+
continue;
|
|
333
|
+
if (commitMessageHasGsdTrailer(record.message))
|
|
334
|
+
continue;
|
|
335
|
+
const commitFiles = getChangedFilesForCommit(basePath, record.hash);
|
|
336
|
+
const implementationFiles = commitFiles.map(normalizeRepoPath).filter(isImplementationPath);
|
|
337
|
+
if (implementationFiles.length === 0)
|
|
338
|
+
continue;
|
|
339
|
+
if (!implementationFiles.some((file) => hintSet.has(file)))
|
|
340
|
+
continue;
|
|
341
|
+
matched = true;
|
|
342
|
+
for (const file of implementationFiles)
|
|
343
|
+
files.add(file);
|
|
344
|
+
recordMilestoneCommitAttribution({
|
|
345
|
+
commitSha: record.hash,
|
|
346
|
+
milestoneId,
|
|
347
|
+
source: "backfill",
|
|
348
|
+
confidence: 0.8,
|
|
349
|
+
files: implementationFiles,
|
|
350
|
+
createdAt: new Date().toISOString(),
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
return { ok: true, matched, files: [...files] };
|
|
354
|
+
}
|
|
355
|
+
catch (e) {
|
|
356
|
+
logWarning("recovery", `milestone attribution backfill failed: ${e.message}`);
|
|
357
|
+
return { ok: false, matched: false, files: [] };
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function getCommitRecords(basePath) {
|
|
361
|
+
const logOutput = execFileSync("git", ["log", "--format=%H%x1f%P%x1f%cI%x1f%B%x1e", "HEAD"], {
|
|
362
|
+
cwd: basePath,
|
|
363
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
364
|
+
encoding: "utf-8",
|
|
365
|
+
});
|
|
366
|
+
return logOutput
|
|
367
|
+
.split("\x1e")
|
|
368
|
+
.map((record) => record.trim())
|
|
369
|
+
.filter(Boolean)
|
|
370
|
+
.flatMap((record) => {
|
|
371
|
+
const parts = record.split("\x1f");
|
|
372
|
+
if (parts.length < 4)
|
|
373
|
+
return [];
|
|
374
|
+
const [hash, parents, committedAt, ...messageParts] = parts;
|
|
375
|
+
return [{ hash: hash.trim(), parents: parents.trim(), committedAt: committedAt.trim(), message: messageParts.join("\x1f") }];
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
function isFullCommitSha(value) {
|
|
379
|
+
return /^[0-9a-f]{40}$/i.test(value);
|
|
234
380
|
}
|
|
235
381
|
function scanGsdTaggedCommits(basePath, milestoneId, gitArgs) {
|
|
236
382
|
try {
|
|
@@ -487,9 +487,8 @@ export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, reques
|
|
|
487
487
|
hasSurvivorBranch = false;
|
|
488
488
|
}
|
|
489
489
|
const effectivePrefs = loadEffectiveGSDPreferences(base)?.preferences;
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
: false;
|
|
490
|
+
const { shouldRunDeepProjectSetup } = await import("./auto-dispatch.js");
|
|
491
|
+
const deepProjectStagePending = shouldRunDeepProjectSetup(state, effectivePrefs, base, { hasSurvivorBranch });
|
|
493
492
|
if (deepProjectStagePending) {
|
|
494
493
|
// Deep project-level setup runs before the first milestone exists. Let
|
|
495
494
|
// the auto loop dispatch workflow-preferences / project / requirements
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// GSD-2 + src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts - Handles provider and agent-end recovery for GSD auto-mode.
|
|
1
2
|
import { logWarning } from "../workflow-logger.js";
|
|
2
3
|
import { checkDeepProjectSetupAfterTurn, checkAutoStartAfterDiscuss, maybeHandleReadyPhraseWithoutFiles, maybeHandleEmptyIntentTurn, resetEmptyTurnCounter, } from "../guided-flow.js";
|
|
3
4
|
import { clearPathCache } from "../paths.js";
|
|
4
5
|
import { getAutoDashboardData, getAutoModeStartModel, isAutoActive, pauseAuto, setCurrentDispatchedModelId } from "../auto.js";
|
|
5
6
|
import { getNextFallbackModel, resolveModelWithFallbacksForUnit } from "../preferences.js";
|
|
6
7
|
import { pauseAutoForProviderError } from "../provider-error-pause.js";
|
|
7
|
-
import { isSessionSwitchInFlight, resolveAgentEnd } from "../auto/resolve.js";
|
|
8
|
+
import { isSessionSwitchInFlight, resolveAgentEnd, resolveAgentEndCancelled } from "../auto/resolve.js";
|
|
8
9
|
import { resolveModelId } from "../auto-model-selection.js";
|
|
9
10
|
import { resolveProjectRoot } from "../worktree.js";
|
|
10
11
|
import { clearDiscussionFlowState } from "./write-gate.js";
|
|
@@ -47,6 +48,11 @@ export function _buildAbortedPauseContext(lastMsg) {
|
|
|
47
48
|
isTransient: true,
|
|
48
49
|
};
|
|
49
50
|
}
|
|
51
|
+
export function isUserInitiatedAbortMessage(message) {
|
|
52
|
+
if (!message)
|
|
53
|
+
return false;
|
|
54
|
+
return /\b(?:claude code process aborted by user|request aborted by user|process aborted by user)\b/i.test(message);
|
|
55
|
+
}
|
|
50
56
|
async function pauseTransientWithBackoff(cls, pi, ctx, errorDetail, isRateLimit) {
|
|
51
57
|
retryState.consecutiveTransientCount += 1;
|
|
52
58
|
const baseRetryAfterMs = "retryAfterMs" in cls ? cls.retryAfterMs : 15_000;
|
|
@@ -150,6 +156,14 @@ export async function handleAgentEnd(pi, event, ctx) {
|
|
|
150
156
|
// is in the assistant message text content. Fall back to content when
|
|
151
157
|
// errorMessage looks uninformative.
|
|
152
158
|
const rawErrorMsg = ("errorMessage" in lastMsg && lastMsg.errorMessage) ? String(lastMsg.errorMessage) : "";
|
|
159
|
+
if (isUserInitiatedAbortMessage(rawErrorMsg)) {
|
|
160
|
+
resolveAgentEndCancelled({
|
|
161
|
+
message: rawErrorMsg,
|
|
162
|
+
category: "aborted",
|
|
163
|
+
isTransient: false,
|
|
164
|
+
});
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
153
167
|
const isUseless = !rawErrorMsg || /^(success|ok|true|error|unknown)$/i.test(rawErrorMsg.trim());
|
|
154
168
|
// #3588: When errorMessage is uninformative, extract the real error from
|
|
155
169
|
// the assistant message text content for display purposes only.
|
|
@@ -2,7 +2,7 @@ import { join } from "node:path";
|
|
|
2
2
|
import { isToolCallEventType } from "@gsd/pi-coding-agent";
|
|
3
3
|
import { updateSnapshot } from "../ecosystem/gsd-extension-api.js";
|
|
4
4
|
import { buildMilestoneFileName, resolveMilestonePath, resolveSliceFile, resolveSlicePath } from "../paths.js";
|
|
5
|
-
import { canonicalToolName, clearDiscussionFlowState, isDepthConfirmationAnswer, isQueuePhaseActive, markApprovalGateVerified, markDepthVerified, resetWriteGateState, shouldBlockContextWrite, shouldBlockPlanningUnit, shouldBlockQueueExecution, isGateQuestionId, setPendingGate, clearPendingGate, getPendingGate, shouldBlockPendingGate, shouldBlockPendingGateBash, extractDepthVerificationMilestoneId } from "./write-gate.js";
|
|
5
|
+
import { canonicalToolName, clearDiscussionFlowState, isDepthConfirmationAnswer, isQueuePhaseActive, markApprovalGateVerified, markDepthVerified, resetWriteGateState, shouldBlockContextWrite, shouldBlockPlanningUnit, shouldBlockQueueExecution, shouldBlockWorktreeWrite, isGateQuestionId, setPendingGate, clearPendingGate, getPendingGate, shouldBlockPendingGate, shouldBlockPendingGateBash, extractDepthVerificationMilestoneId } from "./write-gate.js";
|
|
6
6
|
import { resolveManifest } from "../unit-context-manifest.js";
|
|
7
7
|
import { isBlockedStateFile, isBashWriteToStateFile, BLOCKED_WRITE_ERROR } from "../write-intercept.js";
|
|
8
8
|
import { loadFile, saveFile, formatContinue } from "../files.js";
|
|
@@ -432,6 +432,16 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
432
432
|
return planningGuard;
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
|
+
// ── Worktree-isolation write gate (#5199) ────────────────────────────
|
|
436
|
+
// Block planning-write tools from landing code at the project root when
|
|
437
|
+
// git.isolation=worktree but auto-mode hasn't created the milestone
|
|
438
|
+
// worktree yet. Without this, writes silently orphan outside git history.
|
|
439
|
+
if (isToolCallEventType("write", event) || isToolCallEventType("edit", event)) {
|
|
440
|
+
const wtBasePath = resolveWorktreeProjectRoot(dash.basePath ?? discussionBasePath);
|
|
441
|
+
const wtGuard = shouldBlockWorktreeWrite(event.toolName, event.input.path, wtBasePath, isAutoActive(), dash.currentUnit?.type);
|
|
442
|
+
if (wtGuard.block)
|
|
443
|
+
return wtGuard;
|
|
444
|
+
}
|
|
435
445
|
// ── Single-writer engine: block direct writes to STATE.md ──────────
|
|
436
446
|
// Covers write, edit, and bash tools to prevent bypass vectors.
|
|
437
447
|
if (isToolCallEventType("write", event)) {
|