gsd-pi 2.48.0-dev.ced2eca → 2.49.0-dev.c319e08
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/extensions/gsd/auto/session.js +4 -0
- package/dist/resources/extensions/gsd/guided-flow-queue.js +10 -11
- package/dist/resources/extensions/gsd/worktree-resolver.js +24 -0
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +16 -16
- 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 +2 -2
- 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/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 +16 -16
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +2 -2
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/package.json +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/gsd/auto/session.ts +5 -0
- package/src/resources/extensions/gsd/guided-flow-queue.ts +11 -12
- package/src/resources/extensions/gsd/tests/queue-completed-milestone-perf.test.ts +155 -0
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +67 -0
- package/src/resources/extensions/gsd/worktree-resolver.ts +31 -0
- /package/dist/web/standalone/.next/static/{PTL5V00OW8q4-092tUQKx → QBhWLjeTSHlwrt9jbPmIz}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{PTL5V00OW8q4-092tUQKx → QBhWLjeTSHlwrt9jbPmIz}/_ssgManifest.js +0 -0
|
@@ -846,3 +846,70 @@ test("GitService is rebuilt with originalBasePath after exitMilestone", () => {
|
|
|
846
846
|
|
|
847
847
|
assert.equal(gitServiceBasePath, "/project"); // project root, not worktree
|
|
848
848
|
});
|
|
849
|
+
|
|
850
|
+
// ─── Isolation Degradation Tests (#2483) ──────────────────────────────────
|
|
851
|
+
|
|
852
|
+
test("enterMilestone sets isolationDegraded when worktree creation throws (#2483)", () => {
|
|
853
|
+
const s = makeSession();
|
|
854
|
+
const deps = makeDeps({
|
|
855
|
+
getAutoWorktreePath: () => null,
|
|
856
|
+
createAutoWorktree: () => {
|
|
857
|
+
throw new Error("empty repo");
|
|
858
|
+
},
|
|
859
|
+
});
|
|
860
|
+
const ctx = makeNotifyCtx();
|
|
861
|
+
const resolver = new WorktreeResolver(s, deps);
|
|
862
|
+
|
|
863
|
+
resolver.enterMilestone("M001", ctx);
|
|
864
|
+
|
|
865
|
+
assert.equal(s.isolationDegraded, true);
|
|
866
|
+
assert.equal(s.basePath, "/project"); // unchanged — error recovery
|
|
867
|
+
});
|
|
868
|
+
|
|
869
|
+
test("enterMilestone is no-op when isolationDegraded is true (#2483)", () => {
|
|
870
|
+
const s = makeSession();
|
|
871
|
+
s.isolationDegraded = true;
|
|
872
|
+
const deps = makeDeps();
|
|
873
|
+
const ctx = makeNotifyCtx();
|
|
874
|
+
const resolver = new WorktreeResolver(s, deps);
|
|
875
|
+
|
|
876
|
+
resolver.enterMilestone("M001", ctx);
|
|
877
|
+
|
|
878
|
+
assert.equal(s.basePath, "/project"); // unchanged
|
|
879
|
+
assert.equal(findCalls(deps.calls, "createAutoWorktree").length, 0);
|
|
880
|
+
assert.equal(findCalls(deps.calls, "enterAutoWorktree").length, 0);
|
|
881
|
+
assert.equal(findCalls(deps.calls, "shouldUseWorktreeIsolation").length, 0);
|
|
882
|
+
});
|
|
883
|
+
|
|
884
|
+
test("mergeAndExit is no-op when isolationDegraded is true (#2483)", () => {
|
|
885
|
+
const s = makeSession({
|
|
886
|
+
basePath: "/project",
|
|
887
|
+
originalBasePath: "/project",
|
|
888
|
+
});
|
|
889
|
+
s.isolationDegraded = true;
|
|
890
|
+
const deps = makeDeps({
|
|
891
|
+
getIsolationMode: () => "worktree",
|
|
892
|
+
});
|
|
893
|
+
const ctx = makeNotifyCtx();
|
|
894
|
+
const resolver = new WorktreeResolver(s, deps);
|
|
895
|
+
|
|
896
|
+
resolver.mergeAndExit("M001", ctx);
|
|
897
|
+
|
|
898
|
+
assert.equal(findCalls(deps.calls, "mergeMilestoneToMain").length, 0);
|
|
899
|
+
assert.equal(findCalls(deps.calls, "teardownAutoWorktree").length, 0);
|
|
900
|
+
assert.equal(findCalls(deps.calls, "getIsolationMode").length, 0);
|
|
901
|
+
assert.ok(
|
|
902
|
+
ctx.messages.some(
|
|
903
|
+
(m) => m.level === "info" && m.msg.includes("isolation was degraded"),
|
|
904
|
+
),
|
|
905
|
+
);
|
|
906
|
+
});
|
|
907
|
+
|
|
908
|
+
test("isolationDegraded is reset by session.reset() (#2483)", () => {
|
|
909
|
+
const s = new AutoSession();
|
|
910
|
+
s.isolationDegraded = true;
|
|
911
|
+
|
|
912
|
+
s.reset();
|
|
913
|
+
|
|
914
|
+
assert.equal(s.isolationDegraded, false);
|
|
915
|
+
});
|
|
@@ -150,6 +150,18 @@ export class WorktreeResolver {
|
|
|
150
150
|
*/
|
|
151
151
|
enterMilestone(milestoneId: string, ctx: NotifyCtx): void {
|
|
152
152
|
this.validateMilestoneId(milestoneId);
|
|
153
|
+
|
|
154
|
+
// If worktree creation failed earlier this session, skip all future attempts
|
|
155
|
+
if (this.s.isolationDegraded) {
|
|
156
|
+
debugLog("WorktreeResolver", {
|
|
157
|
+
action: "enterMilestone",
|
|
158
|
+
milestoneId,
|
|
159
|
+
skipped: true,
|
|
160
|
+
reason: "isolation-degraded",
|
|
161
|
+
});
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
|
|
153
165
|
if (!this.deps.shouldUseWorktreeIsolation()) {
|
|
154
166
|
debugLog("WorktreeResolver", {
|
|
155
167
|
action: "enterMilestone",
|
|
@@ -220,6 +232,9 @@ export class WorktreeResolver {
|
|
|
220
232
|
`Auto-worktree creation for ${milestoneId} failed: ${msg}. Continuing in project root.`,
|
|
221
233
|
"warning",
|
|
222
234
|
);
|
|
235
|
+
// Degrade isolation for the rest of this session so mergeAndExit
|
|
236
|
+
// doesn't try to merge a nonexistent worktree branch (#2483)
|
|
237
|
+
this.s.isolationDegraded = true;
|
|
223
238
|
// Do NOT update s.basePath — stay in project root
|
|
224
239
|
}
|
|
225
240
|
}
|
|
@@ -304,6 +319,22 @@ export class WorktreeResolver {
|
|
|
304
319
|
*/
|
|
305
320
|
mergeAndExit(milestoneId: string, ctx: NotifyCtx): void {
|
|
306
321
|
this.validateMilestoneId(milestoneId);
|
|
322
|
+
|
|
323
|
+
// If worktree creation failed earlier, skip merge — work is on current branch (#2483)
|
|
324
|
+
if (this.s.isolationDegraded) {
|
|
325
|
+
debugLog("WorktreeResolver", {
|
|
326
|
+
action: "mergeAndExit",
|
|
327
|
+
milestoneId,
|
|
328
|
+
skipped: true,
|
|
329
|
+
reason: "isolation-degraded",
|
|
330
|
+
});
|
|
331
|
+
ctx.notify(
|
|
332
|
+
`Skipping worktree merge for ${milestoneId} — isolation was degraded (worktree creation failed earlier). Work is on the current branch.`,
|
|
333
|
+
"info",
|
|
334
|
+
);
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
|
|
307
338
|
const mode = this.deps.getIsolationMode();
|
|
308
339
|
debugLog("WorktreeResolver", {
|
|
309
340
|
action: "mergeAndExit",
|
|
File without changes
|
|
File without changes
|