gsd-pi 2.82.0-dev.3709f22a5 → 2.82.0-dev.3a3c6509d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +1 -1
- package/dist/resources/extensions/gsd/auto/phases.js +53 -29
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +1 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +12 -18
- package/dist/resources/extensions/gsd/auto-post-unit.js +1 -1
- package/dist/resources/extensions/gsd/auto-recovery.js +40 -13
- package/dist/resources/extensions/gsd/auto-start.js +3 -3
- package/dist/resources/extensions/gsd/auto-verification.js +17 -4
- package/dist/resources/extensions/gsd/auto-worktree.js +65 -9
- package/dist/resources/extensions/gsd/auto.js +0 -1
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +6 -1
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +1 -1
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +1 -1
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +7 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +16 -4
- package/dist/resources/extensions/gsd/db/milestone-leases.js +24 -0
- package/dist/resources/extensions/gsd/forensics.js +3 -3
- package/dist/resources/extensions/gsd/git-service.js +6 -2
- package/dist/resources/extensions/gsd/gsd-db.js +20 -6
- package/dist/resources/extensions/gsd/guided-flow-queue.js +4 -3
- package/dist/resources/extensions/gsd/guided-flow.js +8 -5
- package/dist/resources/extensions/gsd/queue-reorder-ui.js +30 -13
- package/dist/resources/extensions/gsd/state.js +1 -1
- package/dist/resources/extensions/gsd/status-guards.js +7 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +17 -1
- package/dist/resources/extensions/gsd/worktree-manager.js +1 -1
- 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 +9 -9
- 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/browse-directories/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 +9 -9
- package/dist/web/standalone/.next/server/middleware-build-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/package.json +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.js +5 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.js +41 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.js.map +1 -0
- package/packages/pi-ai/src/providers/google-gemini-cli.test.ts +49 -0
- package/packages/pi-ai/src/providers/google-gemini-cli.ts +7 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +44 -3
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.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 +71 -97
- 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.js +12 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +19 -8
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +53 -3
- package/packages/pi-coding-agent/src/core/sdk.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +75 -102
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-ordering.test.ts +14 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +23 -8
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/terminal.test.d.ts +2 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.js +103 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.js.map +1 -0
- package/packages/pi-tui/dist/terminal.d.ts +2 -0
- package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
- package/packages/pi-tui/dist/terminal.js +12 -0
- package/packages/pi-tui/dist/terminal.js.map +1 -1
- package/packages/pi-tui/src/__tests__/terminal.test.ts +121 -0
- package/packages/pi-tui/src/terminal.ts +11 -0
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +1 -1
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +9 -0
- package/src/resources/extensions/gsd/auto/phases.ts +60 -36
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +1 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +12 -18
- package/src/resources/extensions/gsd/auto-post-unit.ts +1 -1
- package/src/resources/extensions/gsd/auto-recovery.ts +45 -11
- package/src/resources/extensions/gsd/auto-start.ts +2 -3
- package/src/resources/extensions/gsd/auto-verification.ts +22 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +74 -9
- package/src/resources/extensions/gsd/auto.ts +0 -1
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +9 -1
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +1 -1
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +1 -1
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +8 -3
- package/src/resources/extensions/gsd/crash-recovery.ts +16 -2
- package/src/resources/extensions/gsd/db/milestone-leases.ts +26 -0
- package/src/resources/extensions/gsd/forensics.ts +3 -3
- package/src/resources/extensions/gsd/git-service.ts +6 -3
- package/src/resources/extensions/gsd/gsd-db.ts +18 -6
- package/src/resources/extensions/gsd/guided-flow-queue.ts +4 -3
- package/src/resources/extensions/gsd/guided-flow.ts +8 -5
- package/src/resources/extensions/gsd/queue-reorder-ui.ts +31 -13
- package/src/resources/extensions/gsd/state.ts +1 -1
- package/src/resources/extensions/gsd/status-guards.ts +8 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +29 -1
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +76 -5
- package/src/resources/extensions/gsd/tests/checkout-branch-stash-guard.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +43 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/merge-db-cycle.test.ts +179 -0
- package/src/resources/extensions/gsd/tests/pipeline-variant-dispatch.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +18 -1
- package/src/resources/extensions/gsd/tests/queue-reorder-ui.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/remediation-completion-guard.test.ts +43 -0
- package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +2 -3
- package/src/resources/extensions/gsd/tests/status-guards.test.ts +13 -1
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +17 -0
- package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +29 -2
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +18 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +18 -1
- package/src/resources/extensions/gsd/worktree-manager.ts +1 -1
- /package/dist/web/standalone/.next/static/{kkGf3_VaPFkiDNV_D7Dtl → O6femb9LLl3nlgsDaYwS-}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{kkGf3_VaPFkiDNV_D7Dtl → O6femb9LLl3nlgsDaYwS-}/_ssgManifest.js +0 -0
|
@@ -141,3 +141,62 @@ test("category summaries expose the wizard menu surface for configured prefs", (
|
|
|
141
141
|
assert.match(summaries.integrations, /remote: C123/);
|
|
142
142
|
assert.match(summaries.verification, /1 cmd/);
|
|
143
143
|
});
|
|
144
|
+
|
|
145
|
+
test("models wizard offers discovered models for enabled providers", async () => {
|
|
146
|
+
const dir = mkdtempSync(join(tmpdir(), "gsd-prefs-wizard-"));
|
|
147
|
+
const prefsPath = join(dir, "PREFERENCES.md");
|
|
148
|
+
const choices = [
|
|
149
|
+
"Models",
|
|
150
|
+
"local (2 models)",
|
|
151
|
+
"discovered-model",
|
|
152
|
+
"(keep current)",
|
|
153
|
+
"(keep current)",
|
|
154
|
+
"(keep current)",
|
|
155
|
+
"(keep current)",
|
|
156
|
+
"(keep current)",
|
|
157
|
+
"(keep current)",
|
|
158
|
+
"(keep current)",
|
|
159
|
+
];
|
|
160
|
+
const ctx = {
|
|
161
|
+
modelRegistry: {
|
|
162
|
+
getAvailable: () => [{ provider: "local", id: "baseline-model" }],
|
|
163
|
+
getAllWithDiscovered: () => [
|
|
164
|
+
{ provider: "local", id: "baseline-model" },
|
|
165
|
+
{ provider: "local", id: "discovered-model" },
|
|
166
|
+
{ provider: "disabled", id: "hidden-model" },
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
ui: {
|
|
170
|
+
notify() {},
|
|
171
|
+
select: async (label: string, options: string[]) => {
|
|
172
|
+
const choice = choices.shift();
|
|
173
|
+
if (!choice && label === "GSD Preferences") return "── Save & Exit ──";
|
|
174
|
+
if (!choice && options.includes("(keep current)")) return "(keep current)";
|
|
175
|
+
if (!choice && options.includes("Done")) return "Done";
|
|
176
|
+
assert.ok(choice, `Unexpected prompt: ${label}`);
|
|
177
|
+
if (choice === "Models") {
|
|
178
|
+
const modelsOption = options.find((option) => option.startsWith("Models"));
|
|
179
|
+
assert.ok(modelsOption, "Expected Models category option");
|
|
180
|
+
return modelsOption;
|
|
181
|
+
}
|
|
182
|
+
assert.ok(options.includes(choice), `"${choice}" must be offered by "${label}"`);
|
|
183
|
+
assert.ok(!options.includes("hidden-model"), "models from disabled providers must not be offered");
|
|
184
|
+
return choice;
|
|
185
|
+
},
|
|
186
|
+
input: async () => null,
|
|
187
|
+
},
|
|
188
|
+
waitForIdle: async () => {},
|
|
189
|
+
reload: async () => {},
|
|
190
|
+
} as any;
|
|
191
|
+
|
|
192
|
+
try {
|
|
193
|
+
await handlePrefsWizard(ctx, "project", {}, { pathOverride: prefsPath });
|
|
194
|
+
|
|
195
|
+
assert.equal(choices.length, 0, "Expected all queued wizard choices to be consumed");
|
|
196
|
+
const saved = readFileSync(prefsPath, "utf-8");
|
|
197
|
+
assert.match(saved, /research:\s+local\/discovered-model/);
|
|
198
|
+
assert.doesNotMatch(saved, /hidden-model/);
|
|
199
|
+
} finally {
|
|
200
|
+
rmSync(dir, { recursive: true, force: true });
|
|
201
|
+
}
|
|
202
|
+
});
|
|
@@ -10,7 +10,12 @@ import assert from "node:assert/strict";
|
|
|
10
10
|
import { classifyError, isTransient, isTransientNetworkError } from "../error-classifier.ts";
|
|
11
11
|
import { pauseAutoForProviderError } from "../provider-error-pause.ts";
|
|
12
12
|
import { resumeAutoAfterProviderDelay } from "../bootstrap/provider-error-resume.ts";
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
MAX_TRANSIENT_AUTO_RESUMES,
|
|
15
|
+
isTerminalDeletedWorktreeProviderError,
|
|
16
|
+
resetTransientRetryState,
|
|
17
|
+
shouldDeferTransientErrorToCoreRetry,
|
|
18
|
+
} from "../bootstrap/agent-end-recovery.ts";
|
|
14
19
|
import { _buildCancelledUnitStopReason } from "../auto/phases.ts";
|
|
15
20
|
import { getNextFallbackModel } from "../preferences.ts";
|
|
16
21
|
// Zero-import module — imported by path rather than through the package
|
|
@@ -678,3 +683,15 @@ test("agent-session retryable error regex matches server_error (underscore)", ()
|
|
|
678
683
|
// "temporarily backed off" must NOT be matched (intentional exclusion #3429)
|
|
679
684
|
assert.ok(!RETRYABLE_ERROR_RE.test("temporarily backed off"));
|
|
680
685
|
});
|
|
686
|
+
|
|
687
|
+
test("exhausted retry errors are not deferred back to core retry handling", () => {
|
|
688
|
+
const cls = classifyError("Retry failed after 3 attempts: 500 empty_stream: upstream stream closed before first payload");
|
|
689
|
+
assert.equal(cls.kind, "server");
|
|
690
|
+
assert.equal(
|
|
691
|
+
shouldDeferTransientErrorToCoreRetry(
|
|
692
|
+
cls,
|
|
693
|
+
"Retry failed after 3 attempts: 500 empty_stream: upstream stream closed before first payload",
|
|
694
|
+
),
|
|
695
|
+
false,
|
|
696
|
+
);
|
|
697
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { describe, test } from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
|
|
4
|
+
import { showQueueReorder } from "../queue-reorder-ui.ts";
|
|
5
|
+
|
|
6
|
+
const fakeTheme = {
|
|
7
|
+
fg: (_color: string, text: string) => text,
|
|
8
|
+
bold: (text: string) => text,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
describe("queue-reorder-ui", () => {
|
|
12
|
+
test("keeps cursor visible while scrolling long queue with arrow keys (#4656)", async () => {
|
|
13
|
+
const originalRowsDescriptor = Object.getOwnPropertyDescriptor(process.stdout, "rows");
|
|
14
|
+
Object.defineProperty(process.stdout, "rows", { value: 20, configurable: true });
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const pending = Array.from({ length: 20 }, (_, idx) => ({
|
|
18
|
+
id: `M${String(idx + 1).padStart(3, "0")}`,
|
|
19
|
+
title: `Milestone ${idx + 1}`,
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
let resolved: { order: string[]; depsToRemove: Array<{ milestone: string; dep: string }> } | null = null;
|
|
23
|
+
let lastRender: string[] = [];
|
|
24
|
+
|
|
25
|
+
const ctx = {
|
|
26
|
+
hasUI: true,
|
|
27
|
+
ui: {
|
|
28
|
+
custom: async (factory: any) => {
|
|
29
|
+
const component = factory({ requestRender() {} }, fakeTheme, null, (value: any) => {
|
|
30
|
+
resolved = value;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
for (let i = 0; i < 15; i++) component.handleInput("\u001b[B");
|
|
34
|
+
lastRender = component.render(100);
|
|
35
|
+
component.handleInput("\r");
|
|
36
|
+
return resolved;
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
} as any;
|
|
40
|
+
|
|
41
|
+
await showQueueReorder(ctx, [], pending);
|
|
42
|
+
|
|
43
|
+
const joined = lastRender.join("\n");
|
|
44
|
+
assert.ok(joined.includes("M016"), "selected item should stay visible after scrolling");
|
|
45
|
+
assert.ok(lastRender.length <= 16, `overlay should fit terminal max-height, got ${lastRender.length}`);
|
|
46
|
+
} finally {
|
|
47
|
+
if (originalRowsDescriptor) {
|
|
48
|
+
Object.defineProperty(process.stdout, "rows", originalRowsDescriptor);
|
|
49
|
+
} else {
|
|
50
|
+
delete (process.stdout as { rows?: number }).rows;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -110,6 +110,49 @@ test("completing-milestone blocks when VALIDATION verdict is needs-attention (#5
|
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
+
test("completing-milestone blocks when VALIDATION verdict is fail (#5920)", async () => {
|
|
114
|
+
const base = mkdtempSync(join(tmpdir(), "gsd-fail-verdict-"));
|
|
115
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001"), { recursive: true });
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
writeFileSync(
|
|
119
|
+
join(base, ".gsd", "milestones", "M001", "M001-VALIDATION.md"),
|
|
120
|
+
[
|
|
121
|
+
"---",
|
|
122
|
+
"verdict: fail",
|
|
123
|
+
"---",
|
|
124
|
+
"",
|
|
125
|
+
"# Validation Report",
|
|
126
|
+
"",
|
|
127
|
+
"Blocking failures remain unresolved.",
|
|
128
|
+
].join("\n"),
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
const ctx = {
|
|
132
|
+
mid: "M001",
|
|
133
|
+
midTitle: "Test Milestone",
|
|
134
|
+
basePath: base,
|
|
135
|
+
state: { phase: "completing-milestone" } as any,
|
|
136
|
+
prefs: {} as any,
|
|
137
|
+
session: undefined,
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const result = await completingRule!.match(ctx);
|
|
141
|
+
|
|
142
|
+
assert.ok(result !== null, "rule should match");
|
|
143
|
+
assert.equal(result!.action, "stop", "should return stop action");
|
|
144
|
+
if (result!.action === "stop") {
|
|
145
|
+
assert.equal(result!.level, "warning", "should be warning level (pausable)");
|
|
146
|
+
assert.ok(
|
|
147
|
+
result!.reason.includes('verdict is "fail"'),
|
|
148
|
+
"reason should mention fail verdict",
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
} finally {
|
|
152
|
+
rmSync(base, { recursive: true, force: true });
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
113
156
|
test("completing-milestone proceeds normally when VALIDATION verdict is pass (#2675 guard)", async () => {
|
|
114
157
|
const base = mkdtempSync(join(tmpdir(), "gsd-remediation-"));
|
|
115
158
|
mkdirSync(join(base, ".gsd", "milestones", "M001"), { recursive: true });
|
|
@@ -36,7 +36,7 @@ function makeUatProject(): string {
|
|
|
36
36
|
return base;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
test("run-uat dispatch
|
|
39
|
+
test("run-uat dispatch skips after three attempts without a verdict", async () => {
|
|
40
40
|
const basePath = makeUatProject();
|
|
41
41
|
const rule = DISPATCH_RULES.find((r) => r.name === "run-uat (post-completion)");
|
|
42
42
|
assert.ok(rule, "run-uat dispatch rule is registered");
|
|
@@ -58,8 +58,7 @@ test("run-uat dispatch stops after three attempts without a verdict", async () =
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
const capped = await rule.match(ctx as any);
|
|
61
|
-
assert.equal(capped?.action, "
|
|
62
|
-
assert.match(capped?.reason ?? "", /dispatched 3 times/);
|
|
61
|
+
assert.equal(capped?.action, "skip");
|
|
63
62
|
assert.equal(getUatCount(basePath, "M001", "S01"), 4);
|
|
64
63
|
} finally {
|
|
65
64
|
rmSync(basePath, { recursive: true, force: true });
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import test from 'node:test';
|
|
4
4
|
import assert from 'node:assert/strict';
|
|
5
5
|
|
|
6
|
-
import { isClosedStatus } from '../status-guards.ts';
|
|
6
|
+
import { isClosedStatus, isFutureMilestoneStatus } from '../status-guards.ts';
|
|
7
7
|
|
|
8
8
|
test('isClosedStatus: "complete" returns true', () => {
|
|
9
9
|
assert.equal(isClosedStatus('complete'), true);
|
|
@@ -32,3 +32,15 @@ test('isClosedStatus: "active" returns false', () => {
|
|
|
32
32
|
test('isClosedStatus: "" (empty string) returns false', () => {
|
|
33
33
|
assert.equal(isClosedStatus(''), false);
|
|
34
34
|
});
|
|
35
|
+
|
|
36
|
+
test('isFutureMilestoneStatus includes future milestone aliases', () => {
|
|
37
|
+
assert.equal(isFutureMilestoneStatus('pending'), true);
|
|
38
|
+
assert.equal(isFutureMilestoneStatus('queued'), true);
|
|
39
|
+
assert.equal(isFutureMilestoneStatus('planned'), true);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('isFutureMilestoneStatus excludes active and closed milestones', () => {
|
|
43
|
+
assert.equal(isFutureMilestoneStatus('active'), false);
|
|
44
|
+
assert.equal(isFutureMilestoneStatus('complete'), false);
|
|
45
|
+
assert.equal(isFutureMilestoneStatus('parked'), false);
|
|
46
|
+
});
|
|
@@ -301,6 +301,23 @@ test("#5843: run-uat uses verification tools policy so build/test commands can r
|
|
|
301
301
|
assert.match(sourceWriteResult.reason!, /tools-policy "verification"/);
|
|
302
302
|
});
|
|
303
303
|
|
|
304
|
+
test("planning-dispatch hard block message omits internal tracker references", () => {
|
|
305
|
+
const manifest = UNIT_MANIFESTS["validate-milestone"];
|
|
306
|
+
assert.strictEqual(manifest.tools.mode, "planning-dispatch");
|
|
307
|
+
|
|
308
|
+
const result = shouldBlockPlanningUnit(
|
|
309
|
+
"task",
|
|
310
|
+
"scout",
|
|
311
|
+
process.cwd(),
|
|
312
|
+
"validate-milestone",
|
|
313
|
+
manifest.tools,
|
|
314
|
+
);
|
|
315
|
+
|
|
316
|
+
assert.strictEqual(result.block, true);
|
|
317
|
+
assert.ok(result.reason, "blocked dispatch should include a user-facing reason");
|
|
318
|
+
assert.doesNotMatch(result.reason!, /#[0-9]{3,}/);
|
|
319
|
+
});
|
|
320
|
+
|
|
304
321
|
test('planning-dispatch mode is reserved for slice-level decomposition and completion units', () => {
|
|
305
322
|
const allowedDispatchUnits = new Set([
|
|
306
323
|
"plan-slice",
|
|
@@ -162,7 +162,7 @@ describe("validate-milestone stuck-loop guard (#4094)", () => {
|
|
|
162
162
|
assert.equal(pauseAutoMock.mock.callCount(), 0);
|
|
163
163
|
});
|
|
164
164
|
|
|
165
|
-
test("
|
|
165
|
+
test("retries when no VALIDATION file exists yet", async () => {
|
|
166
166
|
insertMilestone({ id: "M001" });
|
|
167
167
|
insertSlice({ id: "S01", milestoneId: "M001", title: "Slice 1", status: "complete" });
|
|
168
168
|
|
|
@@ -173,7 +173,34 @@ describe("validate-milestone stuck-loop guard (#4094)", () => {
|
|
|
173
173
|
|
|
174
174
|
const result = await runPostUnitVerification({ s, ctx, pi } as VerificationContext, pauseAutoMock);
|
|
175
175
|
|
|
176
|
-
assert.equal(result, "
|
|
176
|
+
assert.equal(result, "retry");
|
|
177
|
+
assert.equal(pauseAutoMock.mock.callCount(), 0);
|
|
178
|
+
assert.ok(s.pendingVerificationRetry);
|
|
179
|
+
assert.equal(s.pendingVerificationRetry!.unitId, "M001");
|
|
180
|
+
assert.match(s.pendingVerificationRetry!.failureContext, /gsd_validate_milestone/);
|
|
181
|
+
assert.equal(s.pendingVerificationRetry!.attempt, 1);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
test("retries when VALIDATION file exists but is empty", async () => {
|
|
185
|
+
insertMilestone({ id: "M001" });
|
|
186
|
+
insertSlice({ id: "S01", milestoneId: "M001", title: "Slice 1", status: "complete" });
|
|
187
|
+
|
|
188
|
+
const path = join(tempDir, ".gsd", "milestones", "M001", "M001-VALIDATION.md");
|
|
189
|
+
writeFileSync(path, "", "utf-8");
|
|
190
|
+
invalidateAllCaches();
|
|
191
|
+
|
|
192
|
+
const ctx = makeMockCtx();
|
|
193
|
+
const pi = makeMockPi();
|
|
194
|
+
const pauseAutoMock = mock.fn(async () => {});
|
|
195
|
+
const s = makeMockSession(tempDir, "validate-milestone", "M001");
|
|
196
|
+
|
|
197
|
+
const result = await runPostUnitVerification({ s, ctx, pi } as VerificationContext, pauseAutoMock);
|
|
198
|
+
|
|
199
|
+
assert.equal(result, "retry");
|
|
177
200
|
assert.equal(pauseAutoMock.mock.callCount(), 0);
|
|
201
|
+
assert.ok(s.pendingVerificationRetry);
|
|
202
|
+
assert.equal(s.pendingVerificationRetry!.unitId, "M001");
|
|
203
|
+
assert.match(s.pendingVerificationRetry!.failureContext, /exists but is empty/);
|
|
204
|
+
assert.equal(s.pendingVerificationRetry!.attempt, 1);
|
|
178
205
|
});
|
|
179
206
|
});
|
|
@@ -746,3 +746,21 @@ test("transport compatibility still blocks units whose MCP tools are not exposed
|
|
|
746
746
|
assert.match(error ?? "", /requires secure_env_collect/);
|
|
747
747
|
assert.match(error ?? "", /currently exposes only/);
|
|
748
748
|
});
|
|
749
|
+
|
|
750
|
+
test("transport compatibility accepts MCP-namespaced runtime tools", () => {
|
|
751
|
+
const error = getWorkflowTransportSupportError(
|
|
752
|
+
"claude-code",
|
|
753
|
+
["gsd_summary_save"],
|
|
754
|
+
{
|
|
755
|
+
projectRoot: "/tmp/project",
|
|
756
|
+
env: { GSD_WORKFLOW_MCP_COMMAND: "node" },
|
|
757
|
+
surface: "auto-mode",
|
|
758
|
+
unitType: "research-slice",
|
|
759
|
+
authMode: "externalCli",
|
|
760
|
+
baseUrl: "local://claude-code",
|
|
761
|
+
activeTools: ["mcp__gsd-workflow__gsd_summary_save"],
|
|
762
|
+
},
|
|
763
|
+
);
|
|
764
|
+
|
|
765
|
+
assert.equal(error, null);
|
|
766
|
+
});
|
|
@@ -18,6 +18,7 @@ export interface WorkflowCapabilityOptions {
|
|
|
18
18
|
unitType?: string;
|
|
19
19
|
authMode?: "apiKey" | "oauth" | "externalCli" | "none";
|
|
20
20
|
baseUrl?: string;
|
|
21
|
+
activeTools?: string[];
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
const MCP_WORKFLOW_TOOL_SURFACE = new Set([
|
|
@@ -383,6 +384,15 @@ function hasAskUserQuestionsTool(activeTools: string[]): boolean {
|
|
|
383
384
|
});
|
|
384
385
|
}
|
|
385
386
|
|
|
387
|
+
function hasRequiredTool(requiredTool: string, activeTools: string[]): boolean {
|
|
388
|
+
return activeTools.some((toolName) => {
|
|
389
|
+
if (toolName === requiredTool) return true;
|
|
390
|
+
if (!toolName.startsWith("mcp__")) return false;
|
|
391
|
+
const toolSeparator = toolName.indexOf("__", "mcp__".length);
|
|
392
|
+
return toolSeparator >= 0 && toolName.slice(toolSeparator + 2) === requiredTool;
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
|
|
386
396
|
function workflowMcpStructuredQuestionsOptIn(env: NodeJS.ProcessEnv = process.env): boolean {
|
|
387
397
|
const value = env.GSD_WORKFLOW_MCP_STRUCTURED_QUESTIONS;
|
|
388
398
|
return value === "1" || value === "true";
|
|
@@ -423,8 +433,15 @@ export function getWorkflowTransportSupportError(
|
|
|
423
433
|
return `Provider ${providerLabel} cannot run ${surface}${unitLabel}: the GSD workflow MCP server is not configured or discoverable. Detected Claude Code model but no workflow MCP. Please run /gsd mcp init . from your project root. You can also configure GSD_WORKFLOW_MCP_COMMAND, build packages/mcp-server/dist/cli.js, or install gsd-mcp-server on PATH.`;
|
|
424
434
|
}
|
|
425
435
|
|
|
426
|
-
const
|
|
436
|
+
const uniqueRequired = [...new Set(requiredTools)];
|
|
437
|
+
const missing = (options.activeTools && options.activeTools.length > 0)
|
|
438
|
+
? uniqueRequired.filter((tool) => !hasRequiredTool(tool, options.activeTools!))
|
|
439
|
+
: uniqueRequired.filter((tool) => !MCP_WORKFLOW_TOOL_SURFACE.has(tool));
|
|
427
440
|
if (missing.length === 0) return null;
|
|
428
441
|
|
|
442
|
+
if (options.activeTools && options.activeTools.length > 0) {
|
|
443
|
+
return `Provider ${providerLabel} cannot run ${surface}${unitLabel}: this unit requires ${missing.join(", ")}, but the active runtime toolset currently exposes only ${options.activeTools.slice().sort().join(", ")}.`;
|
|
444
|
+
}
|
|
445
|
+
|
|
429
446
|
return `Provider ${providerLabel} cannot run ${surface}${unitLabel}: this unit requires ${missing.join(", ")}, but the workflow MCP transport currently exposes only ${Array.from(MCP_WORKFLOW_TOOL_SURFACE).sort().join(", ")}.`;
|
|
430
447
|
}
|
|
@@ -618,7 +618,7 @@ export function removeWorktree(
|
|
|
618
618
|
try {
|
|
619
619
|
rmSync(nestedGitPath, { recursive: true, force: true });
|
|
620
620
|
logWarning("reconcile",
|
|
621
|
-
`Removed nested .git directory from scaffolded project to prevent data loss
|
|
621
|
+
`Removed nested .git directory from scaffolded project to prevent data loss`,
|
|
622
622
|
{ worktree: name, nestedRepo: nestedDir },
|
|
623
623
|
);
|
|
624
624
|
} catch {
|
|
File without changes
|
|
File without changes
|