gsd-pi 2.60.0-dev.2580e65 → 2.60.0-dev.d9052f5
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/ask-user-questions.js +4 -7
- package/dist/resources/extensions/gsd/auto/phases.js +7 -15
- package/dist/resources/extensions/gsd/auto-dashboard.js +8 -21
- package/dist/resources/extensions/gsd/auto-dispatch.js +3 -6
- package/dist/resources/extensions/gsd/auto-model-selection.js +9 -58
- package/dist/resources/extensions/gsd/auto-post-unit.js +2 -3
- package/dist/resources/extensions/gsd/auto-prompts.js +20 -36
- package/dist/resources/extensions/gsd/auto-recovery.js +18 -37
- package/dist/resources/extensions/gsd/auto-start.js +5 -9
- package/dist/resources/extensions/gsd/auto-timers.js +5 -11
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +3 -5
- package/dist/resources/extensions/gsd/auto-verification.js +2 -3
- package/dist/resources/extensions/gsd/auto-worktree.js +55 -120
- package/dist/resources/extensions/gsd/auto.js +17 -39
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +3 -6
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +2 -2
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +10 -4
- package/dist/resources/extensions/gsd/bootstrap/journal-tools.js +1 -2
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +0 -7
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +10 -11
- package/dist/resources/extensions/gsd/commands/catalog.js +0 -2
- package/dist/resources/extensions/gsd/commands-codebase.js +21 -48
- package/dist/resources/extensions/gsd/commands-inspect.js +1 -2
- package/dist/resources/extensions/gsd/commands-maintenance.js +19 -32
- package/dist/resources/extensions/gsd/complexity-classifier.js +4 -8
- package/dist/resources/extensions/gsd/custom-verification.js +2 -3
- package/dist/resources/extensions/gsd/gsd-db.js +13 -33
- package/dist/resources/extensions/gsd/guided-flow.js +9 -19
- package/dist/resources/extensions/gsd/init-wizard.js +0 -12
- package/dist/resources/extensions/gsd/markdown-renderer.js +9 -11
- package/dist/resources/extensions/gsd/md-importer.js +4 -5
- package/dist/resources/extensions/gsd/milestone-actions.js +2 -3
- package/dist/resources/extensions/gsd/milestone-ids.js +1 -2
- package/dist/resources/extensions/gsd/model-router.js +121 -156
- package/dist/resources/extensions/gsd/parallel-merge.js +3 -5
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +14 -26
- package/dist/resources/extensions/gsd/preferences-types.js +0 -1
- package/dist/resources/extensions/gsd/preferences-validation.js +0 -45
- package/dist/resources/extensions/gsd/preferences.js +3 -15
- package/dist/resources/extensions/gsd/prompt-loader.js +2 -3
- package/dist/resources/extensions/gsd/prompts/rethink.md +1 -1
- package/dist/resources/extensions/gsd/rule-registry.js +6 -7
- package/dist/resources/extensions/gsd/safe-fs.js +8 -6
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +2 -3
- package/dist/resources/extensions/gsd/tools/complete-slice.js +2 -3
- package/dist/resources/extensions/gsd/tools/complete-task.js +2 -3
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +2 -3
- package/dist/resources/extensions/gsd/tools/plan-slice.js +2 -3
- package/dist/resources/extensions/gsd/tools/plan-task.js +1 -2
- package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +4 -4
- package/dist/resources/extensions/gsd/tools/reopen-slice.js +1 -2
- package/dist/resources/extensions/gsd/tools/reopen-task.js +1 -2
- package/dist/resources/extensions/gsd/tools/replan-slice.js +1 -2
- package/dist/resources/extensions/gsd/tools/validate-milestone.js +1 -2
- package/dist/resources/extensions/gsd/triage-resolution.js +4 -11
- package/dist/resources/extensions/gsd/workflow-events.js +1 -2
- package/dist/resources/extensions/gsd/workflow-logger.js +4 -37
- package/dist/resources/extensions/gsd/workflow-migration.js +12 -14
- package/dist/resources/extensions/gsd/workflow-projections.js +2 -2
- package/dist/resources/extensions/gsd/workflow-reconcile.js +2 -2
- package/dist/resources/extensions/gsd/worktree-manager.js +14 -26
- package/dist/resources/extensions/shared/interview-ui.js +1 -3
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +19 -19
- 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 +19 -19
- 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/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +0 -5
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +1 -2
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +0 -16
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +0 -26
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.js +1 -6
- package/packages/pi-coding-agent/dist/core/lsp/config.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/defaults.json +2 -2
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +0 -6
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +0 -19
- package/packages/pi-coding-agent/src/core/extensions/types.ts +0 -26
- package/packages/pi-coding-agent/src/core/lsp/config.ts +1 -7
- package/packages/pi-coding-agent/src/core/lsp/defaults.json +2 -2
- package/src/resources/extensions/ask-user-questions.ts +3 -7
- package/src/resources/extensions/gsd/auto/phases.ts +7 -17
- package/src/resources/extensions/gsd/auto-dashboard.ts +8 -22
- package/src/resources/extensions/gsd/auto-dispatch.ts +3 -7
- package/src/resources/extensions/gsd/auto-model-selection.ts +15 -77
- package/src/resources/extensions/gsd/auto-post-unit.ts +4 -4
- package/src/resources/extensions/gsd/auto-prompts.ts +20 -37
- package/src/resources/extensions/gsd/auto-recovery.ts +18 -38
- package/src/resources/extensions/gsd/auto-start.ts +9 -10
- package/src/resources/extensions/gsd/auto-timers.ts +5 -12
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +2 -6
- package/src/resources/extensions/gsd/auto-verification.ts +6 -3
- package/src/resources/extensions/gsd/auto-worktree.ts +55 -121
- package/src/resources/extensions/gsd/auto.ts +17 -40
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +3 -4
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +2 -2
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +16 -4
- package/src/resources/extensions/gsd/bootstrap/journal-tools.ts +1 -2
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +0 -8
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +10 -11
- package/src/resources/extensions/gsd/commands/catalog.ts +0 -2
- package/src/resources/extensions/gsd/commands-codebase.ts +20 -52
- package/src/resources/extensions/gsd/commands-inspect.ts +1 -2
- package/src/resources/extensions/gsd/commands-maintenance.ts +19 -28
- package/src/resources/extensions/gsd/complexity-classifier.ts +4 -9
- package/src/resources/extensions/gsd/custom-verification.ts +2 -3
- package/src/resources/extensions/gsd/gsd-db.ts +14 -12
- package/src/resources/extensions/gsd/guided-flow.ts +8 -9
- package/src/resources/extensions/gsd/init-wizard.ts +0 -12
- package/src/resources/extensions/gsd/markdown-renderer.ts +17 -11
- package/src/resources/extensions/gsd/md-importer.ts +4 -5
- package/src/resources/extensions/gsd/milestone-actions.ts +2 -3
- package/src/resources/extensions/gsd/milestone-ids.ts +1 -2
- package/src/resources/extensions/gsd/model-router.ts +173 -199
- package/src/resources/extensions/gsd/parallel-merge.ts +3 -5
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +14 -18
- package/src/resources/extensions/gsd/preferences-types.ts +0 -13
- package/src/resources/extensions/gsd/preferences-validation.ts +0 -45
- package/src/resources/extensions/gsd/preferences.ts +3 -16
- package/src/resources/extensions/gsd/prompt-loader.ts +2 -3
- package/src/resources/extensions/gsd/prompts/rethink.md +1 -1
- package/src/resources/extensions/gsd/rule-registry.ts +6 -7
- package/src/resources/extensions/gsd/safe-fs.ts +5 -6
- package/src/resources/extensions/gsd/tests/codebase-generator.test.ts +0 -63
- package/src/resources/extensions/gsd/tests/complexity-classifier.test.ts +2 -27
- package/src/resources/extensions/gsd/tests/db-path-worktree-symlink.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/model-router.test.ts +3 -403
- package/src/resources/extensions/gsd/tests/preferences.test.ts +0 -62
- package/src/resources/extensions/gsd/tests/remote-questions.test.ts +0 -21
- package/src/resources/extensions/gsd/tests/workflow-logger.test.ts +6 -6
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +6 -3
- package/src/resources/extensions/gsd/tools/complete-slice.ts +6 -3
- package/src/resources/extensions/gsd/tools/complete-task.ts +6 -3
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +6 -3
- package/src/resources/extensions/gsd/tools/plan-slice.ts +6 -3
- package/src/resources/extensions/gsd/tools/plan-task.ts +3 -2
- package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +6 -4
- package/src/resources/extensions/gsd/tools/reopen-slice.ts +3 -2
- package/src/resources/extensions/gsd/tools/reopen-task.ts +3 -2
- package/src/resources/extensions/gsd/tools/replan-slice.ts +3 -2
- package/src/resources/extensions/gsd/tools/validate-milestone.ts +3 -2
- package/src/resources/extensions/gsd/triage-resolution.ts +4 -11
- package/src/resources/extensions/gsd/types.ts +0 -1
- package/src/resources/extensions/gsd/workflow-events.ts +1 -2
- package/src/resources/extensions/gsd/workflow-logger.ts +5 -52
- package/src/resources/extensions/gsd/workflow-migration.ts +12 -14
- package/src/resources/extensions/gsd/workflow-projections.ts +2 -2
- package/src/resources/extensions/gsd/workflow-reconcile.ts +2 -2
- package/src/resources/extensions/gsd/worktree-manager.ts +14 -16
- package/src/resources/extensions/shared/interview-ui.ts +1 -3
- package/packages/pi-coding-agent/dist/core/lsp/lsp-legacy-alias.test.d.ts +0 -2
- package/packages/pi-coding-agent/dist/core/lsp/lsp-legacy-alias.test.d.ts.map +0 -1
- package/packages/pi-coding-agent/dist/core/lsp/lsp-legacy-alias.test.js +0 -47
- package/packages/pi-coding-agent/dist/core/lsp/lsp-legacy-alias.test.js.map +0 -1
- package/packages/pi-coding-agent/src/core/lsp/lsp-legacy-alias.test.ts +0 -70
- package/src/resources/extensions/gsd/tests/capability-router.test.ts +0 -347
- package/src/resources/extensions/gsd/tests/integration/state-machine-edge-cases.test.ts +0 -1188
- package/src/resources/extensions/gsd/tests/integration/state-machine-runtime-failures.test.ts +0 -841
- package/src/resources/extensions/gsd/tests/silent-catch-diagnostics.test.ts +0 -284
- package/src/resources/extensions/gsd/tests/workflow-logger-audit.test.ts +0 -120
- package/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +0 -144
- /package/dist/web/standalone/.next/static/{ogyMN7M-3bGGuRY08L5HR → JVkoVYumy0cDhOQISEYdG}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{ogyMN7M-3bGGuRY08L5HR → JVkoVYumy0cDhOQISEYdG}/_ssgManifest.js +0 -0
|
@@ -115,7 +115,7 @@ import {
|
|
|
115
115
|
formatCost,
|
|
116
116
|
formatTokenCount,
|
|
117
117
|
} from "./metrics.js";
|
|
118
|
-
import { setLogBasePath
|
|
118
|
+
import { setLogBasePath } from "./workflow-logger.js";
|
|
119
119
|
import { join } from "node:path";
|
|
120
120
|
import { readFileSync, existsSync, mkdirSync, writeFileSync, unlinkSync } from "node:fs";
|
|
121
121
|
import { atomicWriteSync } from "./atomic-write.js";
|
|
@@ -316,9 +316,8 @@ export function getAutoDashboardData(): AutoDashboardData {
|
|
|
316
316
|
if (s.basePath) {
|
|
317
317
|
pendingCaptureCount = countPendingCaptures(s.basePath);
|
|
318
318
|
}
|
|
319
|
-
} catch
|
|
319
|
+
} catch {
|
|
320
320
|
// Non-fatal — captures module may not be loaded
|
|
321
|
-
logWarning("engine", `capture count failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
322
321
|
}
|
|
323
322
|
return {
|
|
324
323
|
active: s.active,
|
|
@@ -566,9 +565,8 @@ function cleanupAfterLoopExit(ctx: ExtensionContext): void {
|
|
|
566
565
|
try {
|
|
567
566
|
if (lockBase()) clearLock(lockBase());
|
|
568
567
|
if (lockBase()) releaseSessionLock(lockBase());
|
|
569
|
-
} catch
|
|
568
|
+
} catch {
|
|
570
569
|
/* best-effort — mirror stopAuto cleanup */
|
|
571
|
-
logWarning("session", `lock cleanup failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
572
570
|
}
|
|
573
571
|
|
|
574
572
|
ctx.ui.setStatus("gsd-auto", undefined);
|
|
@@ -580,9 +578,8 @@ function cleanupAfterLoopExit(ctx: ExtensionContext): void {
|
|
|
580
578
|
s.basePath = s.originalBasePath;
|
|
581
579
|
try {
|
|
582
580
|
process.chdir(s.basePath);
|
|
583
|
-
} catch
|
|
581
|
+
} catch {
|
|
584
582
|
/* best-effort */
|
|
585
|
-
logWarning("engine", `chdir failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
586
583
|
}
|
|
587
584
|
}
|
|
588
585
|
}
|
|
@@ -654,9 +651,8 @@ export async function stopAuto(
|
|
|
654
651
|
} else {
|
|
655
652
|
milestoneComplete = true;
|
|
656
653
|
}
|
|
657
|
-
} catch
|
|
654
|
+
} catch {
|
|
658
655
|
// Non-fatal — fall through to preserveBranch path
|
|
659
|
-
logWarning("engine", `milestone summary check failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
660
656
|
}
|
|
661
657
|
|
|
662
658
|
if (milestoneComplete) {
|
|
@@ -691,9 +687,8 @@ export async function stopAuto(
|
|
|
691
687
|
s.basePath = s.originalBasePath;
|
|
692
688
|
try {
|
|
693
689
|
process.chdir(s.basePath);
|
|
694
|
-
} catch
|
|
690
|
+
} catch {
|
|
695
691
|
/* best-effort */
|
|
696
|
-
logWarning("engine", `chdir failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
697
692
|
}
|
|
698
693
|
}
|
|
699
694
|
} catch (e) {
|
|
@@ -765,9 +760,7 @@ export async function stopAuto(
|
|
|
765
760
|
try {
|
|
766
761
|
const pausedPath = join(gsdRoot(s.originalBasePath || s.basePath), "runtime", "paused-session.json");
|
|
767
762
|
if (existsSync(pausedPath)) unlinkSync(pausedPath);
|
|
768
|
-
} catch
|
|
769
|
-
logWarning("engine", `file unlink failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
770
|
-
}
|
|
763
|
+
} catch { /* non-fatal */ }
|
|
771
764
|
|
|
772
765
|
// ── Step 13: Restore original model (before reset clears IDs) ──
|
|
773
766
|
try {
|
|
@@ -801,9 +794,7 @@ export async function stopAuto(
|
|
|
801
794
|
const { closeBrowser } = await import("../browser-tools/lifecycle.js");
|
|
802
795
|
await closeBrowser();
|
|
803
796
|
}
|
|
804
|
-
} catch
|
|
805
|
-
logWarning("engine", `browser teardown failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
806
|
-
}
|
|
797
|
+
} catch { /* non-fatal: browser-tools may not be loaded */ }
|
|
807
798
|
|
|
808
799
|
// External cleanup (not covered by session reset)
|
|
809
800
|
clearInFlightTools();
|
|
@@ -861,18 +852,16 @@ export async function pauseAuto(
|
|
|
861
852
|
JSON.stringify(pausedMeta, null, 2),
|
|
862
853
|
"utf-8",
|
|
863
854
|
);
|
|
864
|
-
} catch
|
|
855
|
+
} catch {
|
|
865
856
|
// Non-fatal — resume will still work via full bootstrap, just without worktree context
|
|
866
|
-
logWarning("engine", `paused-session file write failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
867
857
|
}
|
|
868
858
|
|
|
869
859
|
// Close out the current unit so its runtime record doesn't stay at "dispatched"
|
|
870
860
|
if (s.currentUnit && ctx) {
|
|
871
861
|
try {
|
|
872
862
|
await closeoutUnit(ctx, s.basePath, s.currentUnit.type, s.currentUnit.id, s.currentUnit.startedAt);
|
|
873
|
-
} catch
|
|
863
|
+
} catch {
|
|
874
864
|
// Non-fatal — best-effort closeout on pause
|
|
875
|
-
logWarning("engine", `unit closeout on pause failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
876
865
|
}
|
|
877
866
|
s.currentUnit = null;
|
|
878
867
|
}
|
|
@@ -1096,9 +1085,7 @@ export async function startAuto(
|
|
|
1096
1085
|
s.originalBasePath = meta.originalBasePath || base;
|
|
1097
1086
|
s.stepMode = meta.stepMode ?? requestedStepMode;
|
|
1098
1087
|
s.paused = true;
|
|
1099
|
-
try { unlinkSync(pausedPath); } catch
|
|
1100
|
-
logWarning("session", `pause file cleanup failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
1101
|
-
}
|
|
1088
|
+
try { unlinkSync(pausedPath); } catch { /* non-fatal */ }
|
|
1102
1089
|
ctx.ui.notify(
|
|
1103
1090
|
`Resuming paused custom workflow${meta.activeRunDir ? ` (${meta.activeRunDir})` : ""}.`,
|
|
1104
1091
|
"info",
|
|
@@ -1109,9 +1096,7 @@ export async function startAuto(
|
|
|
1109
1096
|
const summaryFile = resolveMilestoneFile(base, meta.milestoneId, "SUMMARY");
|
|
1110
1097
|
if (!mDir || summaryFile) {
|
|
1111
1098
|
// Stale milestone — clean up and fall through to fresh bootstrap
|
|
1112
|
-
try { unlinkSync(pausedPath); } catch
|
|
1113
|
-
logWarning("session", `pause file cleanup failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
1114
|
-
}
|
|
1099
|
+
try { unlinkSync(pausedPath); } catch { /* non-fatal */ }
|
|
1115
1100
|
ctx.ui.notify(
|
|
1116
1101
|
`Paused milestone ${meta.milestoneId} is ${!mDir ? "missing" : "already complete"}. Starting fresh.`,
|
|
1117
1102
|
"info",
|
|
@@ -1122,9 +1107,7 @@ export async function startAuto(
|
|
|
1122
1107
|
s.stepMode = meta.stepMode ?? requestedStepMode;
|
|
1123
1108
|
s.paused = true;
|
|
1124
1109
|
// Clean up the persisted file — we're consuming it
|
|
1125
|
-
try { unlinkSync(pausedPath); } catch
|
|
1126
|
-
logWarning("session", `pause file cleanup failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
1127
|
-
}
|
|
1110
|
+
try { unlinkSync(pausedPath); } catch { /* non-fatal */ }
|
|
1128
1111
|
ctx.ui.notify(
|
|
1129
1112
|
`Resuming paused session for ${meta.milestoneId}${meta.worktreePath ? ` (worktree)` : ""}.`,
|
|
1130
1113
|
"info",
|
|
@@ -1132,9 +1115,8 @@ export async function startAuto(
|
|
|
1132
1115
|
}
|
|
1133
1116
|
}
|
|
1134
1117
|
}
|
|
1135
|
-
} catch
|
|
1118
|
+
} catch {
|
|
1136
1119
|
// Malformed or missing — proceed with fresh bootstrap
|
|
1137
|
-
logWarning("session", `paused-session restore failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
1138
1120
|
}
|
|
1139
1121
|
}
|
|
1140
1122
|
|
|
@@ -1260,9 +1242,8 @@ export async function startAuto(
|
|
|
1260
1242
|
|
|
1261
1243
|
try {
|
|
1262
1244
|
syncCmuxSidebar(loadEffectiveGSDPreferences()?.preferences, await deriveState(s.basePath));
|
|
1263
|
-
} catch
|
|
1245
|
+
} catch {
|
|
1264
1246
|
// Best-effort only — sidebar sync must never block auto-mode startup
|
|
1265
|
-
logWarning("engine", `cmux sync failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
1266
1247
|
}
|
|
1267
1248
|
logCmuxEvent(loadEffectiveGSDPreferences()?.preferences, requestedStepMode ? "Step-mode started." : "Auto-mode started.", "progress");
|
|
1268
1249
|
|
|
@@ -1434,9 +1415,8 @@ export async function dispatchHookUnit(
|
|
|
1434
1415
|
if (match) {
|
|
1435
1416
|
try {
|
|
1436
1417
|
await pi.setModel(match);
|
|
1437
|
-
} catch
|
|
1418
|
+
} catch {
|
|
1438
1419
|
/* non-fatal */
|
|
1439
|
-
logWarning("dispatch", `hook model set failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
1440
1420
|
}
|
|
1441
1421
|
} else {
|
|
1442
1422
|
ctx.ui.notify(
|
|
@@ -1473,9 +1453,7 @@ export async function dispatchHookUnit(
|
|
|
1473
1453
|
ctx.ui.notify(`Running post-unit hook: ${hookName}`, "info");
|
|
1474
1454
|
|
|
1475
1455
|
// Ensure cwd matches basePath before hook dispatch (#1389)
|
|
1476
|
-
try { if (process.cwd() !== s.basePath) process.chdir(s.basePath); } catch
|
|
1477
|
-
logWarning("engine", `chdir failed before hook dispatch: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
1478
|
-
}
|
|
1456
|
+
try { if (process.cwd() !== s.basePath) process.chdir(s.basePath); } catch {}
|
|
1479
1457
|
|
|
1480
1458
|
debugLog("dispatchHookUnit", {
|
|
1481
1459
|
phase: "send-message",
|
|
@@ -1497,4 +1475,3 @@ export {
|
|
|
1497
1475
|
buildLoopRemediationSteps,
|
|
1498
1476
|
} from "./auto-recovery.js";
|
|
1499
1477
|
export { resolveExpectedArtifactPath } from "./auto-artifact-paths.js";
|
|
1500
|
-
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtensionAPI, ExtensionContext } from "@gsd/pi-coding-agent";
|
|
2
2
|
|
|
3
|
-
import { logWarning } from "../workflow-logger.js";
|
|
4
3
|
import { checkAutoStartAfterDiscuss } from "../guided-flow.js";
|
|
5
4
|
import { getAutoDashboardData, getAutoModeStartModel, isAutoActive, pauseAuto } from "../auto.js";
|
|
6
5
|
import { getNextFallbackModel, resolveModelWithFallbacksForUnit } from "../preferences.js";
|
|
@@ -86,7 +85,7 @@ export async function handleAgentEnd(
|
|
|
86
85
|
} catch (err) {
|
|
87
86
|
const message = err instanceof Error ? err.message : String(err);
|
|
88
87
|
ctx.ui.notify(`Auto-mode error after empty-content abort: ${message}. Stopping auto-mode.`, "error");
|
|
89
|
-
try { await pauseAuto(ctx, pi); } catch
|
|
88
|
+
try { await pauseAuto(ctx, pi); } catch { /* best-effort */ }
|
|
90
89
|
}
|
|
91
90
|
return;
|
|
92
91
|
}
|
|
@@ -213,8 +212,8 @@ export async function handleAgentEnd(
|
|
|
213
212
|
ctx.ui.notify(`Auto-mode error in agent_end handler: ${message}. Stopping auto-mode.`, "error");
|
|
214
213
|
try {
|
|
215
214
|
await pauseAuto(ctx, pi);
|
|
216
|
-
} catch
|
|
217
|
-
|
|
215
|
+
} catch {
|
|
216
|
+
// best-effort
|
|
218
217
|
}
|
|
219
218
|
}
|
|
220
219
|
}
|
|
@@ -413,8 +413,8 @@ export function registerDbTools(pi: ExtensionAPI): void {
|
|
|
413
413
|
try {
|
|
414
414
|
const { insertMilestone } = await import("../gsd-db.js");
|
|
415
415
|
insertMilestone({ id: milestoneId, status: "queued" });
|
|
416
|
-
} catch
|
|
417
|
-
|
|
416
|
+
} catch {
|
|
417
|
+
// Non-fatal — the safety-net in deriveStateFromDb will catch this
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
|
|
@@ -5,7 +5,7 @@ import type { ExtensionAPI } from "@gsd/pi-coding-agent";
|
|
|
5
5
|
import { createBashTool, createEditTool, createReadTool, createWriteTool } from "@gsd/pi-coding-agent";
|
|
6
6
|
|
|
7
7
|
import { DEFAULT_BASH_TIMEOUT_SECS } from "../constants.js";
|
|
8
|
-
import { setLogBasePath
|
|
8
|
+
import { setLogBasePath } from "../workflow-logger.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Resolve the correct DB path for the current working directory.
|
|
@@ -92,7 +92,9 @@ export async function ensureDbOpen(): Promise<boolean> {
|
|
|
92
92
|
const { migrateFromMarkdown } = await import("../md-importer.js");
|
|
93
93
|
migrateFromMarkdown(basePath);
|
|
94
94
|
} catch (err) {
|
|
95
|
-
|
|
95
|
+
process.stderr.write(
|
|
96
|
+
`gsd-db: ensureDbOpen auto-migration failed: ${(err as Error).message}\n`,
|
|
97
|
+
);
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
100
|
return opened;
|
|
@@ -104,10 +106,20 @@ export async function ensureDbOpen(): Promise<boolean> {
|
|
|
104
106
|
return opened;
|
|
105
107
|
}
|
|
106
108
|
|
|
107
|
-
|
|
109
|
+
process.stderr.write(
|
|
110
|
+
`gsd-db: ensureDbOpen failed — no .gsd directory found (resolvedPath=${resolveProjectRootDbPath(basePath)}, cwd=${basePath})\n`,
|
|
111
|
+
);
|
|
108
112
|
return false;
|
|
109
113
|
} catch (err) {
|
|
110
|
-
|
|
114
|
+
const basePath = process.cwd();
|
|
115
|
+
const diagnostic = {
|
|
116
|
+
resolvedPath: resolveProjectRootDbPath(basePath),
|
|
117
|
+
cwd: basePath,
|
|
118
|
+
error: (err as Error).message ?? String(err),
|
|
119
|
+
};
|
|
120
|
+
process.stderr.write(
|
|
121
|
+
`gsd-db: ensureDbOpen failed — ${JSON.stringify(diagnostic)}\n`,
|
|
122
|
+
);
|
|
111
123
|
return false;
|
|
112
124
|
}
|
|
113
125
|
}
|
|
@@ -2,7 +2,6 @@ import { Type } from "@sinclair/typebox";
|
|
|
2
2
|
import type { ExtensionAPI } from "@gsd/pi-coding-agent";
|
|
3
3
|
|
|
4
4
|
import { queryJournal } from "../journal.js";
|
|
5
|
-
import { logWarning } from "../workflow-logger.js";
|
|
6
5
|
|
|
7
6
|
export function registerJournalTools(pi: ExtensionAPI): void {
|
|
8
7
|
pi.registerTool({
|
|
@@ -52,7 +51,7 @@ export function registerJournalTools(pi: ExtensionAPI): void {
|
|
|
52
51
|
};
|
|
53
52
|
} catch (err) {
|
|
54
53
|
const msg = err instanceof Error ? err.message : String(err);
|
|
55
|
-
|
|
54
|
+
process.stderr.write(`gsd-journal: gsd_journal_query tool failed: ${msg}\n`);
|
|
56
55
|
return {
|
|
57
56
|
content: [{ type: "text" as const, text: `Error querying journal: ${msg}` }],
|
|
58
57
|
details: { operation: "journal_query", error: msg } as any,
|
|
@@ -322,12 +322,4 @@ export function registerHooks(pi: ExtensionAPI): void {
|
|
|
322
322
|
payload.service_tier = tier;
|
|
323
323
|
return payload;
|
|
324
324
|
});
|
|
325
|
-
|
|
326
|
-
// Capability-aware model routing hook (ADR-004)
|
|
327
|
-
// Extensions can override model selection by returning { modelId: "..." }
|
|
328
|
-
// Return undefined to let the built-in capability scoring proceed.
|
|
329
|
-
pi.on("before_model_select", async (_event) => {
|
|
330
|
-
// Default: no override — let capability scoring handle selection
|
|
331
|
-
return undefined;
|
|
332
|
-
});
|
|
333
325
|
}
|
|
@@ -4,7 +4,6 @@ import { join } from "node:path";
|
|
|
4
4
|
|
|
5
5
|
import type { ExtensionContext } from "@gsd/pi-coding-agent";
|
|
6
6
|
|
|
7
|
-
import { logWarning } from "../workflow-logger.js";
|
|
8
7
|
import { debugTime } from "../debug-logger.js";
|
|
9
8
|
import { loadPrompt } from "../prompt-loader.js";
|
|
10
9
|
import { readForensicsMarker } from "../forensics.js";
|
|
@@ -84,8 +83,8 @@ export async function buildBeforeAgentStartResult(
|
|
|
84
83
|
memoryBlock = `\n\n${formatted}`;
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
|
-
} catch
|
|
88
|
-
|
|
86
|
+
} catch {
|
|
87
|
+
// non-fatal
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
let newSkillsBlock = "";
|
|
@@ -112,8 +111,8 @@ export async function buildBeforeAgentStartResult(
|
|
|
112
111
|
: rawContent;
|
|
113
112
|
codebaseBlock = `\n\n[PROJECT CODEBASE — File structure and descriptions (generated ${generatedAt}, may be stale — run /gsd codebase update to refresh)]\n\n${content}`;
|
|
114
113
|
}
|
|
115
|
-
} catch
|
|
116
|
-
|
|
114
|
+
} catch {
|
|
115
|
+
// skip
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
|
|
@@ -159,8 +158,8 @@ export function loadKnowledgeBlock(gsdHomeDir: string, cwd: string): { block: st
|
|
|
159
158
|
globalSizeKb = Buffer.byteLength(content, "utf-8") / 1024;
|
|
160
159
|
globalKnowledge = content;
|
|
161
160
|
}
|
|
162
|
-
} catch
|
|
163
|
-
|
|
161
|
+
} catch {
|
|
162
|
+
// skip
|
|
164
163
|
}
|
|
165
164
|
}
|
|
166
165
|
|
|
@@ -171,8 +170,8 @@ export function loadKnowledgeBlock(gsdHomeDir: string, cwd: string): { block: st
|
|
|
171
170
|
try {
|
|
172
171
|
const content = readFileSync(knowledgePath, "utf-8").trim();
|
|
173
172
|
if (content) projectKnowledge = content;
|
|
174
|
-
} catch
|
|
175
|
-
|
|
173
|
+
} catch {
|
|
174
|
+
// skip
|
|
176
175
|
}
|
|
177
176
|
}
|
|
178
177
|
|
|
@@ -430,8 +429,8 @@ export function clearForensicsMarker(basePath: string): void {
|
|
|
430
429
|
if (existsSync(markerPath)) {
|
|
431
430
|
try {
|
|
432
431
|
unlinkSync(markerPath);
|
|
433
|
-
} catch
|
|
434
|
-
|
|
432
|
+
} catch {
|
|
433
|
+
// non-fatal
|
|
435
434
|
}
|
|
436
435
|
}
|
|
437
436
|
}
|
|
@@ -229,10 +229,8 @@ const NESTED_COMPLETIONS: CompletionMap = {
|
|
|
229
229
|
codebase: [
|
|
230
230
|
{ cmd: "generate", desc: "Generate or regenerate CODEBASE.md" },
|
|
231
231
|
{ cmd: "generate --max-files", desc: "Generate with custom file limit (default: 500)" },
|
|
232
|
-
{ cmd: "generate --collapse-threshold", desc: "Generate with custom collapse threshold (default: 20)" },
|
|
233
232
|
{ cmd: "update", desc: "Incremental update (preserves descriptions)" },
|
|
234
233
|
{ cmd: "update --max-files", desc: "Update with custom file limit" },
|
|
235
|
-
{ cmd: "update --collapse-threshold", desc: "Update with custom collapse threshold" },
|
|
236
234
|
{ cmd: "stats", desc: "Show file count, description coverage, and generation time" },
|
|
237
235
|
{ cmd: "help", desc: "Show usage and available subcommands" },
|
|
238
236
|
],
|
|
@@ -14,21 +14,14 @@ import {
|
|
|
14
14
|
getCodebaseMapStats,
|
|
15
15
|
readCodebaseMap,
|
|
16
16
|
} from "./codebase-generator.js";
|
|
17
|
-
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
18
|
-
import type { CodebaseMapOptions } from "./codebase-generator.js";
|
|
19
17
|
|
|
20
18
|
const USAGE =
|
|
21
19
|
"Usage: /gsd codebase [generate|update|stats]\n\n" +
|
|
22
|
-
" generate [--max-files N]
|
|
23
|
-
" update
|
|
24
|
-
" stats
|
|
25
|
-
" help
|
|
26
|
-
"With no subcommand, shows stats if a map exists or help if not
|
|
27
|
-
"Configure defaults via preferences.md:\n" +
|
|
28
|
-
" codebase:\n" +
|
|
29
|
-
" exclude_patterns: [\"docs/\", \"fixtures/\"]\n" +
|
|
30
|
-
" max_files: 1000\n" +
|
|
31
|
-
" collapse_threshold: 15";
|
|
20
|
+
" generate [--max-files N] — Generate or regenerate CODEBASE.md\n" +
|
|
21
|
+
" update — Incremental update (preserves descriptions)\n" +
|
|
22
|
+
" stats — Show file count, coverage, and generation time\n" +
|
|
23
|
+
" help — Show this help\n\n" +
|
|
24
|
+
"With no subcommand, shows stats if a map exists or help if not.";
|
|
32
25
|
|
|
33
26
|
export async function handleCodebase(
|
|
34
27
|
args: string,
|
|
@@ -41,15 +34,15 @@ export async function handleCodebase(
|
|
|
41
34
|
|
|
42
35
|
switch (sub) {
|
|
43
36
|
case "generate": {
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
37
|
+
const maxFiles = parseMaxFiles(args, ctx);
|
|
38
|
+
if (maxFiles === false) return; // validation failed, message already shown
|
|
46
39
|
|
|
47
40
|
const existing = readCodebaseMap(basePath);
|
|
48
41
|
const existingDescriptions = existing
|
|
49
42
|
? (await import("./codebase-generator.js")).parseCodebaseMap(existing)
|
|
50
43
|
: undefined;
|
|
51
44
|
|
|
52
|
-
const result = generateCodebaseMap(basePath,
|
|
45
|
+
const result = generateCodebaseMap(basePath, { maxFiles: maxFiles ?? undefined }, existingDescriptions);
|
|
53
46
|
|
|
54
47
|
if (result.fileCount === 0) {
|
|
55
48
|
ctx.ui.notify(
|
|
@@ -80,10 +73,10 @@ export async function handleCodebase(
|
|
|
80
73
|
return;
|
|
81
74
|
}
|
|
82
75
|
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
76
|
+
const maxFiles = parseMaxFiles(args, ctx);
|
|
77
|
+
if (maxFiles === false) return;
|
|
85
78
|
|
|
86
|
-
const result = updateCodebaseMap(basePath,
|
|
79
|
+
const result = updateCodebaseMap(basePath, { maxFiles: maxFiles ?? undefined });
|
|
87
80
|
writeCodebaseMap(basePath, result.content);
|
|
88
81
|
|
|
89
82
|
ctx.ui.notify(
|
|
@@ -148,44 +141,19 @@ function showStats(basePath: string, ctx: ExtensionCommandContext): void {
|
|
|
148
141
|
}
|
|
149
142
|
|
|
150
143
|
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* Returns false if validation failed (error already shown to user).
|
|
144
|
+
* Parse and validate --max-files flag.
|
|
145
|
+
* Returns the parsed number, undefined if flag not present, or false if invalid.
|
|
154
146
|
*/
|
|
155
|
-
function
|
|
156
|
-
// Load preferences defaults
|
|
157
|
-
const prefs = loadEffectiveGSDPreferences()?.preferences?.codebase;
|
|
158
|
-
|
|
159
|
-
// Parse CLI flags
|
|
147
|
+
function parseMaxFiles(args: string, ctx: ExtensionCommandContext): number | undefined | false {
|
|
160
148
|
const maxFilesStr = extractFlag(args, "--max-files");
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
// Validate --max-files
|
|
164
|
-
let maxFiles: number | undefined;
|
|
165
|
-
if (maxFilesStr) {
|
|
166
|
-
maxFiles = parseInt(maxFilesStr, 10);
|
|
167
|
-
if (isNaN(maxFiles) || maxFiles < 1) {
|
|
168
|
-
ctx.ui.notify("--max-files must be a positive integer (e.g. --max-files 200).", "warning");
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
149
|
+
if (!maxFilesStr) return undefined;
|
|
172
150
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (isNaN(collapseThreshold) || collapseThreshold < 1) {
|
|
178
|
-
ctx.ui.notify("--collapse-threshold must be a positive integer (e.g. --collapse-threshold 15).", "warning");
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
151
|
+
const maxFiles = parseInt(maxFilesStr, 10);
|
|
152
|
+
if (isNaN(maxFiles) || maxFiles < 1) {
|
|
153
|
+
ctx.ui.notify("--max-files must be a positive integer (e.g. --max-files 200).", "warning");
|
|
154
|
+
return false;
|
|
181
155
|
}
|
|
182
|
-
|
|
183
|
-
return {
|
|
184
|
-
// CLI flags override preferences
|
|
185
|
-
maxFiles: maxFiles ?? prefs?.max_files,
|
|
186
|
-
collapseThreshold: collapseThreshold ?? prefs?.collapse_threshold,
|
|
187
|
-
excludePatterns: prefs?.exclude_patterns,
|
|
188
|
-
};
|
|
156
|
+
return maxFiles;
|
|
189
157
|
}
|
|
190
158
|
|
|
191
159
|
function extractFlag(args: string, flag: string): string | undefined {
|
|
@@ -8,7 +8,6 @@ import type { ExtensionCommandContext } from "@gsd/pi-coding-agent";
|
|
|
8
8
|
import { existsSync } from "node:fs";
|
|
9
9
|
import { join } from "node:path";
|
|
10
10
|
import { gsdRoot } from "./paths.js";
|
|
11
|
-
import { logWarning } from "./workflow-logger.js";
|
|
12
11
|
import { getErrorMessage } from "./error-utils.js";
|
|
13
12
|
|
|
14
13
|
export interface InspectData {
|
|
@@ -93,7 +92,7 @@ export async function handleInspect(ctx: ExtensionCommandContext): Promise<void>
|
|
|
93
92
|
|
|
94
93
|
ctx.ui.notify(formatInspectOutput(data), "info");
|
|
95
94
|
} catch (err) {
|
|
96
|
-
|
|
95
|
+
process.stderr.write(`gsd-db: /gsd inspect failed: ${getErrorMessage(err)}\n`);
|
|
97
96
|
ctx.ui.notify("Failed to inspect GSD database. Check stderr for details.", "error");
|
|
98
97
|
}
|
|
99
98
|
}
|
|
@@ -7,14 +7,12 @@
|
|
|
7
7
|
import type { ExtensionCommandContext } from "@gsd/pi-coding-agent";
|
|
8
8
|
import { deriveState } from "./state.js";
|
|
9
9
|
import { nativeBranchList, nativeDetectMainBranch, nativeBranchListMerged, nativeBranchDelete, nativeForEachRef, nativeUpdateRef } from "./native-git-bridge.js";
|
|
10
|
-
import { logWarning } from "./workflow-logger.js";
|
|
11
10
|
|
|
12
11
|
export async function handleCleanupBranches(ctx: ExtensionCommandContext, basePath: string): Promise<void> {
|
|
13
12
|
let branches: string[];
|
|
14
13
|
try {
|
|
15
14
|
branches = nativeBranchList(basePath, "gsd/*");
|
|
16
|
-
} catch
|
|
17
|
-
logWarning("command", `branch list failed: ${(e as Error).message}`);
|
|
15
|
+
} catch {
|
|
18
16
|
ctx.ui.notify("No GSD branches to clean up.", "info");
|
|
19
17
|
return;
|
|
20
18
|
}
|
|
@@ -25,8 +23,7 @@ export async function handleCleanupBranches(ctx: ExtensionCommandContext, basePa
|
|
|
25
23
|
let merged: string[];
|
|
26
24
|
try {
|
|
27
25
|
merged = nativeBranchListMerged(basePath, mainBranch, "gsd/*");
|
|
28
|
-
} catch
|
|
29
|
-
logWarning("command", `merged branch list failed: ${(e as Error).message}`);
|
|
26
|
+
} catch {
|
|
30
27
|
merged = [];
|
|
31
28
|
}
|
|
32
29
|
|
|
@@ -36,8 +33,8 @@ export async function handleCleanupBranches(ctx: ExtensionCommandContext, basePa
|
|
|
36
33
|
try {
|
|
37
34
|
nativeBranchDelete(basePath, branch, false);
|
|
38
35
|
deletedMerged++;
|
|
39
|
-
} catch
|
|
40
|
-
|
|
36
|
+
} catch {
|
|
37
|
+
/* skip branches that cannot be deleted */
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
40
|
|
|
@@ -69,7 +66,7 @@ export async function handleCleanupBranches(ctx: ExtensionCommandContext, basePa
|
|
|
69
66
|
try {
|
|
70
67
|
nativeBranchDelete(basePath, branch, true);
|
|
71
68
|
deletedStaleMilestones++;
|
|
72
|
-
} catch
|
|
69
|
+
} catch { /* non-fatal */ }
|
|
73
70
|
continue;
|
|
74
71
|
}
|
|
75
72
|
}
|
|
@@ -80,8 +77,7 @@ export async function handleCleanupBranches(ctx: ExtensionCommandContext, basePa
|
|
|
80
77
|
let roadmapContent: string | null = null;
|
|
81
78
|
try {
|
|
82
79
|
roadmapContent = await loadFile(roadmapPath);
|
|
83
|
-
} catch
|
|
84
|
-
logWarning("command", `loadFile failed for ${roadmapPath}: ${(e as Error).message}`);
|
|
80
|
+
} catch {
|
|
85
81
|
roadmapContent = null;
|
|
86
82
|
}
|
|
87
83
|
if (!roadmapContent) continue;
|
|
@@ -89,12 +85,12 @@ export async function handleCleanupBranches(ctx: ExtensionCommandContext, basePa
|
|
|
89
85
|
try {
|
|
90
86
|
nativeBranchDelete(basePath, branch, true);
|
|
91
87
|
deletedStaleMilestones++;
|
|
92
|
-
} catch
|
|
93
|
-
|
|
88
|
+
} catch {
|
|
89
|
+
/* non-fatal */
|
|
94
90
|
}
|
|
95
91
|
}
|
|
96
|
-
} catch
|
|
97
|
-
|
|
92
|
+
} catch {
|
|
93
|
+
/* non-fatal */
|
|
98
94
|
}
|
|
99
95
|
|
|
100
96
|
const summary: string[] = [];
|
|
@@ -126,8 +122,7 @@ export async function handleCleanupSnapshots(ctx: ExtensionCommandContext, baseP
|
|
|
126
122
|
let refs: string[];
|
|
127
123
|
try {
|
|
128
124
|
refs = nativeForEachRef(basePath, "refs/gsd/snapshots/");
|
|
129
|
-
} catch
|
|
130
|
-
logWarning("command", `snapshot ref list failed: ${(e as Error).message}`);
|
|
125
|
+
} catch {
|
|
131
126
|
ctx.ui.notify("No snapshot refs to clean up.", "info");
|
|
132
127
|
return;
|
|
133
128
|
}
|
|
@@ -152,8 +147,8 @@ export async function handleCleanupSnapshots(ctx: ExtensionCommandContext, baseP
|
|
|
152
147
|
try {
|
|
153
148
|
nativeUpdateRef(basePath, old);
|
|
154
149
|
pruned++;
|
|
155
|
-
} catch
|
|
156
|
-
|
|
150
|
+
} catch {
|
|
151
|
+
/* skip individual failures */
|
|
157
152
|
}
|
|
158
153
|
}
|
|
159
154
|
}
|
|
@@ -169,8 +164,7 @@ export async function handleCleanupWorktrees(ctx: ExtensionCommandContext, baseP
|
|
|
169
164
|
let statuses;
|
|
170
165
|
try {
|
|
171
166
|
statuses = getAllWorktreeHealth(basePath);
|
|
172
|
-
} catch
|
|
173
|
-
logWarning("command", `worktree health inspection failed: ${(e as Error).message}`);
|
|
167
|
+
} catch {
|
|
174
168
|
ctx.ui.notify("Failed to inspect worktrees.", "error");
|
|
175
169
|
return;
|
|
176
170
|
}
|
|
@@ -203,8 +197,7 @@ export async function handleCleanupWorktrees(ctx: ExtensionCommandContext, baseP
|
|
|
203
197
|
removeWorktree(basePath, wt.name, { deleteBranch: true });
|
|
204
198
|
lines.push(` ✓ ${wt.name} removed (branch ${wt.branch} deleted)`);
|
|
205
199
|
removed++;
|
|
206
|
-
} catch
|
|
207
|
-
logWarning("command", `worktree removal failed for ${wt.name}: ${(e as Error).message}`);
|
|
200
|
+
} catch {
|
|
208
201
|
lines.push(` ✗ ${wt.name} failed to remove`);
|
|
209
202
|
}
|
|
210
203
|
}
|
|
@@ -253,7 +246,7 @@ export async function handleSkip(unitArg: string, ctx: ExtensionCommandContext,
|
|
|
253
246
|
if (fileExists(completedKeysFile)) {
|
|
254
247
|
keys = JSON.parse(readFile(completedKeysFile, "utf-8"));
|
|
255
248
|
}
|
|
256
|
-
} catch
|
|
249
|
+
} catch { /* start fresh */ }
|
|
257
250
|
|
|
258
251
|
// Normalize: accept "execute-task/M001/S01/T03", "M001/S01/T03", or just "T03"
|
|
259
252
|
let skipKey = unitArg;
|
|
@@ -378,8 +371,7 @@ export async function handleCleanupProjects(args: string, ctx: ExtensionCommandC
|
|
|
378
371
|
hashList = readdirSync(projectsDir, { withFileTypes: true })
|
|
379
372
|
.filter(e => e.isDirectory())
|
|
380
373
|
.map(e => e.name);
|
|
381
|
-
} catch
|
|
382
|
-
logWarning("command", `readdir failed for project-state directory: ${(e as Error).message}`);
|
|
374
|
+
} catch {
|
|
383
375
|
ctx.ui.notify(`Failed to read project-state directory at ${projectsDir}.`, "error");
|
|
384
376
|
return;
|
|
385
377
|
}
|
|
@@ -462,8 +454,7 @@ export async function handleCleanupProjects(args: string, ctx: ExtensionCommandC
|
|
|
462
454
|
try {
|
|
463
455
|
fsRmSync(pathJoin(projectsDir, e.hash), { recursive: true, force: true });
|
|
464
456
|
removed++;
|
|
465
|
-
} catch
|
|
466
|
-
logWarning("command", `project cleanup rm failed for ${e.hash}: ${(err as Error).message}`);
|
|
457
|
+
} catch {
|
|
467
458
|
failed.push(e.hash);
|
|
468
459
|
}
|
|
469
460
|
}
|
|
@@ -538,7 +529,7 @@ export async function handleRecover(ctx: ExtensionCommandContext, basePath: stri
|
|
|
538
529
|
ctx.ui.notify(lines.join("\n"), "success");
|
|
539
530
|
} catch (err) {
|
|
540
531
|
const msg = err instanceof Error ? err.message : String(err);
|
|
541
|
-
|
|
532
|
+
process.stderr.write(`gsd-recover: failed: ${msg}\n`);
|
|
542
533
|
ctx.ui.notify(`gsd recover failed: ${msg}`, "error");
|
|
543
534
|
}
|
|
544
535
|
}
|