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
|
@@ -34,7 +34,7 @@ import { clearSkillSnapshot } from "./skill-discovery.js";
|
|
|
34
34
|
import { captureAvailableSkills, resetSkillTelemetry, } from "./skill-telemetry.js";
|
|
35
35
|
import { getRtkSessionSavings } from "../shared/rtk-session-stats.js";
|
|
36
36
|
import { initMetrics, resetMetrics, getLedger, getProjectTotals, formatCost, formatTokenCount, } from "./metrics.js";
|
|
37
|
-
import { setLogBasePath
|
|
37
|
+
import { setLogBasePath } from "./workflow-logger.js";
|
|
38
38
|
import { join } from "node:path";
|
|
39
39
|
import { readFileSync, existsSync, mkdirSync, writeFileSync, unlinkSync } from "node:fs";
|
|
40
40
|
import { atomicWriteSync } from "./atomic-write.js";
|
|
@@ -137,9 +137,8 @@ export function getAutoDashboardData() {
|
|
|
137
137
|
pendingCaptureCount = countPendingCaptures(s.basePath);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
catch
|
|
140
|
+
catch {
|
|
141
141
|
// Non-fatal — captures module may not be loaded
|
|
142
|
-
logWarning("engine", `capture count failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
143
142
|
}
|
|
144
143
|
return {
|
|
145
144
|
active: s.active,
|
|
@@ -341,9 +340,8 @@ function cleanupAfterLoopExit(ctx) {
|
|
|
341
340
|
if (lockBase())
|
|
342
341
|
releaseSessionLock(lockBase());
|
|
343
342
|
}
|
|
344
|
-
catch
|
|
343
|
+
catch {
|
|
345
344
|
/* best-effort — mirror stopAuto cleanup */
|
|
346
|
-
logWarning("session", `lock cleanup failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
347
345
|
}
|
|
348
346
|
ctx.ui.setStatus("gsd-auto", undefined);
|
|
349
347
|
ctx.ui.setWidget("gsd-progress", undefined);
|
|
@@ -354,9 +352,8 @@ function cleanupAfterLoopExit(ctx) {
|
|
|
354
352
|
try {
|
|
355
353
|
process.chdir(s.basePath);
|
|
356
354
|
}
|
|
357
|
-
catch
|
|
355
|
+
catch {
|
|
358
356
|
/* best-effort */
|
|
359
|
-
logWarning("engine", `chdir failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
360
357
|
}
|
|
361
358
|
}
|
|
362
359
|
}
|
|
@@ -418,9 +415,8 @@ export async function stopAuto(ctx, pi, reason) {
|
|
|
418
415
|
milestoneComplete = true;
|
|
419
416
|
}
|
|
420
417
|
}
|
|
421
|
-
catch
|
|
418
|
+
catch {
|
|
422
419
|
// Non-fatal — fall through to preserveBranch path
|
|
423
|
-
logWarning("engine", `milestone summary check failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
424
420
|
}
|
|
425
421
|
if (milestoneComplete) {
|
|
426
422
|
// Milestone is complete — merge worktree branch back to main
|
|
@@ -456,9 +452,8 @@ export async function stopAuto(ctx, pi, reason) {
|
|
|
456
452
|
try {
|
|
457
453
|
process.chdir(s.basePath);
|
|
458
454
|
}
|
|
459
|
-
catch
|
|
455
|
+
catch {
|
|
460
456
|
/* best-effort */
|
|
461
|
-
logWarning("engine", `chdir failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
462
457
|
}
|
|
463
458
|
}
|
|
464
459
|
}
|
|
@@ -527,9 +522,7 @@ export async function stopAuto(ctx, pi, reason) {
|
|
|
527
522
|
if (existsSync(pausedPath))
|
|
528
523
|
unlinkSync(pausedPath);
|
|
529
524
|
}
|
|
530
|
-
catch
|
|
531
|
-
logWarning("engine", `file unlink failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
532
|
-
}
|
|
525
|
+
catch { /* non-fatal */ }
|
|
533
526
|
// ── Step 13: Restore original model (before reset clears IDs) ──
|
|
534
527
|
try {
|
|
535
528
|
if (pi && ctx && s.originalModelId && s.originalModelProvider) {
|
|
@@ -563,9 +556,7 @@ export async function stopAuto(ctx, pi, reason) {
|
|
|
563
556
|
await closeBrowser();
|
|
564
557
|
}
|
|
565
558
|
}
|
|
566
|
-
catch
|
|
567
|
-
logWarning("engine", `browser teardown failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
568
|
-
}
|
|
559
|
+
catch { /* non-fatal: browser-tools may not be loaded */ }
|
|
569
560
|
// External cleanup (not covered by session reset)
|
|
570
561
|
clearInFlightTools();
|
|
571
562
|
clearSliceProgressCache();
|
|
@@ -611,18 +602,16 @@ export async function pauseAuto(ctx, _pi, _errorContext) {
|
|
|
611
602
|
mkdirSync(runtimeDir, { recursive: true });
|
|
612
603
|
writeFileSync(join(runtimeDir, "paused-session.json"), JSON.stringify(pausedMeta, null, 2), "utf-8");
|
|
613
604
|
}
|
|
614
|
-
catch
|
|
605
|
+
catch {
|
|
615
606
|
// Non-fatal — resume will still work via full bootstrap, just without worktree context
|
|
616
|
-
logWarning("engine", `paused-session file write failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
617
607
|
}
|
|
618
608
|
// Close out the current unit so its runtime record doesn't stay at "dispatched"
|
|
619
609
|
if (s.currentUnit && ctx) {
|
|
620
610
|
try {
|
|
621
611
|
await closeoutUnit(ctx, s.basePath, s.currentUnit.type, s.currentUnit.id, s.currentUnit.startedAt);
|
|
622
612
|
}
|
|
623
|
-
catch
|
|
613
|
+
catch {
|
|
624
614
|
// Non-fatal — best-effort closeout on pause
|
|
625
|
-
logWarning("engine", `unit closeout on pause failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
626
615
|
}
|
|
627
616
|
s.currentUnit = null;
|
|
628
617
|
}
|
|
@@ -809,9 +798,7 @@ export async function startAuto(ctx, pi, base, verboseMode, options) {
|
|
|
809
798
|
try {
|
|
810
799
|
unlinkSync(pausedPath);
|
|
811
800
|
}
|
|
812
|
-
catch
|
|
813
|
-
logWarning("session", `pause file cleanup failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
814
|
-
}
|
|
801
|
+
catch { /* non-fatal */ }
|
|
815
802
|
ctx.ui.notify(`Resuming paused custom workflow${meta.activeRunDir ? ` (${meta.activeRunDir})` : ""}.`, "info");
|
|
816
803
|
}
|
|
817
804
|
else if (meta.milestoneId) {
|
|
@@ -823,9 +810,7 @@ export async function startAuto(ctx, pi, base, verboseMode, options) {
|
|
|
823
810
|
try {
|
|
824
811
|
unlinkSync(pausedPath);
|
|
825
812
|
}
|
|
826
|
-
catch
|
|
827
|
-
logWarning("session", `pause file cleanup failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
828
|
-
}
|
|
813
|
+
catch { /* non-fatal */ }
|
|
829
814
|
ctx.ui.notify(`Paused milestone ${meta.milestoneId} is ${!mDir ? "missing" : "already complete"}. Starting fresh.`, "info");
|
|
830
815
|
}
|
|
831
816
|
else {
|
|
@@ -837,17 +822,14 @@ export async function startAuto(ctx, pi, base, verboseMode, options) {
|
|
|
837
822
|
try {
|
|
838
823
|
unlinkSync(pausedPath);
|
|
839
824
|
}
|
|
840
|
-
catch
|
|
841
|
-
logWarning("session", `pause file cleanup failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
842
|
-
}
|
|
825
|
+
catch { /* non-fatal */ }
|
|
843
826
|
ctx.ui.notify(`Resuming paused session for ${meta.milestoneId}${meta.worktreePath ? ` (worktree)` : ""}.`, "info");
|
|
844
827
|
}
|
|
845
828
|
}
|
|
846
829
|
}
|
|
847
830
|
}
|
|
848
|
-
catch
|
|
831
|
+
catch {
|
|
849
832
|
// Malformed or missing — proceed with fresh bootstrap
|
|
850
|
-
logWarning("session", `paused-session restore failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
851
833
|
}
|
|
852
834
|
}
|
|
853
835
|
if (s.paused) {
|
|
@@ -935,9 +917,8 @@ export async function startAuto(ctx, pi, base, verboseMode, options) {
|
|
|
935
917
|
try {
|
|
936
918
|
syncCmuxSidebar(loadEffectiveGSDPreferences()?.preferences, await deriveState(s.basePath));
|
|
937
919
|
}
|
|
938
|
-
catch
|
|
920
|
+
catch {
|
|
939
921
|
// Best-effort only — sidebar sync must never block auto-mode startup
|
|
940
|
-
logWarning("engine", `cmux sync failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
941
922
|
}
|
|
942
923
|
logCmuxEvent(loadEffectiveGSDPreferences()?.preferences, requestedStepMode ? "Step-mode started." : "Auto-mode started.", "progress");
|
|
943
924
|
// Dispatch the first unit
|
|
@@ -1062,9 +1043,8 @@ export async function dispatchHookUnit(ctx, pi, hookName, triggerUnitType, trigg
|
|
|
1062
1043
|
try {
|
|
1063
1044
|
await pi.setModel(match);
|
|
1064
1045
|
}
|
|
1065
|
-
catch
|
|
1046
|
+
catch {
|
|
1066
1047
|
/* non-fatal */
|
|
1067
|
-
logWarning("dispatch", `hook model set failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
1068
1048
|
}
|
|
1069
1049
|
}
|
|
1070
1050
|
else {
|
|
@@ -1092,9 +1072,7 @@ export async function dispatchHookUnit(ctx, pi, hookName, triggerUnitType, trigg
|
|
|
1092
1072
|
if (process.cwd() !== s.basePath)
|
|
1093
1073
|
process.chdir(s.basePath);
|
|
1094
1074
|
}
|
|
1095
|
-
catch
|
|
1096
|
-
logWarning("engine", `chdir failed before hook dispatch: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
1097
|
-
}
|
|
1075
|
+
catch { }
|
|
1098
1076
|
debugLog("dispatchHookUnit", {
|
|
1099
1077
|
phase: "send-message",
|
|
1100
1078
|
promptLength: hookPrompt.length,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { logWarning } from "../workflow-logger.js";
|
|
2
1
|
import { checkAutoStartAfterDiscuss } from "../guided-flow.js";
|
|
3
2
|
import { getAutoDashboardData, getAutoModeStartModel, isAutoActive, pauseAuto } from "../auto.js";
|
|
4
3
|
import { getNextFallbackModel, resolveModelWithFallbacksForUnit } from "../preferences.js";
|
|
@@ -69,9 +68,7 @@ export async function handleAgentEnd(pi, event, ctx) {
|
|
|
69
68
|
try {
|
|
70
69
|
await pauseAuto(ctx, pi);
|
|
71
70
|
}
|
|
72
|
-
catch
|
|
73
|
-
logWarning("bootstrap", `pauseAuto failed after empty-content abort: ${e.message}`);
|
|
74
|
-
}
|
|
71
|
+
catch { /* best-effort */ }
|
|
75
72
|
}
|
|
76
73
|
return;
|
|
77
74
|
}
|
|
@@ -187,8 +184,8 @@ export async function handleAgentEnd(pi, event, ctx) {
|
|
|
187
184
|
try {
|
|
188
185
|
await pauseAuto(ctx, pi);
|
|
189
186
|
}
|
|
190
|
-
catch
|
|
191
|
-
|
|
187
|
+
catch {
|
|
188
|
+
// best-effort
|
|
192
189
|
}
|
|
193
190
|
}
|
|
194
191
|
}
|
|
@@ -403,8 +403,8 @@ export function registerDbTools(pi) {
|
|
|
403
403
|
const { insertMilestone } = await import("../gsd-db.js");
|
|
404
404
|
insertMilestone({ id: milestoneId, status: "queued" });
|
|
405
405
|
}
|
|
406
|
-
catch
|
|
407
|
-
|
|
406
|
+
catch {
|
|
407
|
+
// Non-fatal — the safety-net in deriveStateFromDb will catch this
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
const milestoneGenerateIdTool = {
|
|
@@ -2,7 +2,7 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { join, sep } from "node:path";
|
|
3
3
|
import { createBashTool, createEditTool, createReadTool, createWriteTool } from "@gsd/pi-coding-agent";
|
|
4
4
|
import { DEFAULT_BASH_TIMEOUT_SECS } from "../constants.js";
|
|
5
|
-
import { setLogBasePath
|
|
5
|
+
import { setLogBasePath } from "../workflow-logger.js";
|
|
6
6
|
/**
|
|
7
7
|
* Resolve the correct DB path for the current working directory.
|
|
8
8
|
* If `basePath` is inside a `.gsd/worktrees/<MID>/` directory, returns
|
|
@@ -82,7 +82,7 @@ export async function ensureDbOpen() {
|
|
|
82
82
|
migrateFromMarkdown(basePath);
|
|
83
83
|
}
|
|
84
84
|
catch (err) {
|
|
85
|
-
|
|
85
|
+
process.stderr.write(`gsd-db: ensureDbOpen auto-migration failed: ${err.message}\n`);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
return opened;
|
|
@@ -93,11 +93,17 @@ export async function ensureDbOpen() {
|
|
|
93
93
|
setLogBasePath(projectRoot);
|
|
94
94
|
return opened;
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
process.stderr.write(`gsd-db: ensureDbOpen failed — no .gsd directory found (resolvedPath=${resolveProjectRootDbPath(basePath)}, cwd=${basePath})\n`);
|
|
97
97
|
return false;
|
|
98
98
|
}
|
|
99
99
|
catch (err) {
|
|
100
|
-
|
|
100
|
+
const basePath = process.cwd();
|
|
101
|
+
const diagnostic = {
|
|
102
|
+
resolvedPath: resolveProjectRootDbPath(basePath),
|
|
103
|
+
cwd: basePath,
|
|
104
|
+
error: err.message ?? String(err),
|
|
105
|
+
};
|
|
106
|
+
process.stderr.write(`gsd-db: ensureDbOpen failed — ${JSON.stringify(diagnostic)}\n`);
|
|
101
107
|
return false;
|
|
102
108
|
}
|
|
103
109
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
2
|
import { queryJournal } from "../journal.js";
|
|
3
|
-
import { logWarning } from "../workflow-logger.js";
|
|
4
3
|
export function registerJournalTools(pi) {
|
|
5
4
|
pi.registerTool({
|
|
6
5
|
name: "gsd_journal_query",
|
|
@@ -52,7 +51,7 @@ export function registerJournalTools(pi) {
|
|
|
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", text: `Error querying journal: ${msg}` }],
|
|
58
57
|
details: { operation: "journal_query", error: msg },
|
|
@@ -303,11 +303,4 @@ export function registerHooks(pi) {
|
|
|
303
303
|
payload.service_tier = tier;
|
|
304
304
|
return payload;
|
|
305
305
|
});
|
|
306
|
-
// Capability-aware model routing hook (ADR-004)
|
|
307
|
-
// Extensions can override model selection by returning { modelId: "..." }
|
|
308
|
-
// Return undefined to let the built-in capability scoring proceed.
|
|
309
|
-
pi.on("before_model_select", async (_event) => {
|
|
310
|
-
// Default: no override — let capability scoring handle selection
|
|
311
|
-
return undefined;
|
|
312
|
-
});
|
|
313
306
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync, unlinkSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { logWarning } from "../workflow-logger.js";
|
|
5
4
|
import { debugTime } from "../debug-logger.js";
|
|
6
5
|
import { loadPrompt } from "../prompt-loader.js";
|
|
7
6
|
import { readForensicsMarker } from "../forensics.js";
|
|
@@ -62,8 +61,8 @@ export async function buildBeforeAgentStartResult(event, ctx) {
|
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
|
-
catch
|
|
66
|
-
|
|
64
|
+
catch {
|
|
65
|
+
// non-fatal
|
|
67
66
|
}
|
|
68
67
|
let newSkillsBlock = "";
|
|
69
68
|
if (hasSkillSnapshot()) {
|
|
@@ -89,8 +88,8 @@ export async function buildBeforeAgentStartResult(event, ctx) {
|
|
|
89
88
|
codebaseBlock = `\n\n[PROJECT CODEBASE — File structure and descriptions (generated ${generatedAt}, may be stale — run /gsd codebase update to refresh)]\n\n${content}`;
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
|
-
catch
|
|
93
|
-
|
|
91
|
+
catch {
|
|
92
|
+
// skip
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
warnDeprecatedAgentInstructions();
|
|
@@ -129,8 +128,8 @@ export function loadKnowledgeBlock(gsdHomeDir, cwd) {
|
|
|
129
128
|
globalKnowledge = content;
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
|
-
catch
|
|
133
|
-
|
|
131
|
+
catch {
|
|
132
|
+
// skip
|
|
134
133
|
}
|
|
135
134
|
}
|
|
136
135
|
// 2. Project knowledge (.gsd/KNOWLEDGE.md) — project-specific
|
|
@@ -142,8 +141,8 @@ export function loadKnowledgeBlock(gsdHomeDir, cwd) {
|
|
|
142
141
|
if (content)
|
|
143
142
|
projectKnowledge = content;
|
|
144
143
|
}
|
|
145
|
-
catch
|
|
146
|
-
|
|
144
|
+
catch {
|
|
145
|
+
// skip
|
|
147
146
|
}
|
|
148
147
|
}
|
|
149
148
|
if (!globalKnowledge && !projectKnowledge) {
|
|
@@ -382,8 +381,8 @@ export function clearForensicsMarker(basePath) {
|
|
|
382
381
|
try {
|
|
383
382
|
unlinkSync(markerPath);
|
|
384
383
|
}
|
|
385
|
-
catch
|
|
386
|
-
|
|
384
|
+
catch {
|
|
385
|
+
// non-fatal
|
|
387
386
|
}
|
|
388
387
|
}
|
|
389
388
|
}
|
|
@@ -216,10 +216,8 @@ const NESTED_COMPLETIONS = {
|
|
|
216
216
|
codebase: [
|
|
217
217
|
{ cmd: "generate", desc: "Generate or regenerate CODEBASE.md" },
|
|
218
218
|
{ cmd: "generate --max-files", desc: "Generate with custom file limit (default: 500)" },
|
|
219
|
-
{ cmd: "generate --collapse-threshold", desc: "Generate with custom collapse threshold (default: 20)" },
|
|
220
219
|
{ cmd: "update", desc: "Incremental update (preserves descriptions)" },
|
|
221
220
|
{ cmd: "update --max-files", desc: "Update with custom file limit" },
|
|
222
|
-
{ cmd: "update --collapse-threshold", desc: "Update with custom collapse threshold" },
|
|
223
221
|
{ cmd: "stats", desc: "Show file count, description coverage, and generation time" },
|
|
224
222
|
{ cmd: "help", desc: "Show usage and available subcommands" },
|
|
225
223
|
],
|
|
@@ -5,32 +5,26 @@
|
|
|
5
5
|
* Subcommands: generate, update, stats, help
|
|
6
6
|
*/
|
|
7
7
|
import { generateCodebaseMap, updateCodebaseMap, writeCodebaseMap, getCodebaseMapStats, readCodebaseMap, } from "./codebase-generator.js";
|
|
8
|
-
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
9
8
|
const USAGE = "Usage: /gsd codebase [generate|update|stats]\n\n" +
|
|
10
|
-
" generate [--max-files N]
|
|
11
|
-
" update
|
|
12
|
-
" stats
|
|
13
|
-
" help
|
|
14
|
-
"With no subcommand, shows stats if a map exists or help if not
|
|
15
|
-
"Configure defaults via preferences.md:\n" +
|
|
16
|
-
" codebase:\n" +
|
|
17
|
-
" exclude_patterns: [\"docs/\", \"fixtures/\"]\n" +
|
|
18
|
-
" max_files: 1000\n" +
|
|
19
|
-
" collapse_threshold: 15";
|
|
9
|
+
" generate [--max-files N] — Generate or regenerate CODEBASE.md\n" +
|
|
10
|
+
" update — Incremental update (preserves descriptions)\n" +
|
|
11
|
+
" stats — Show file count, coverage, and generation time\n" +
|
|
12
|
+
" help — Show this help\n\n" +
|
|
13
|
+
"With no subcommand, shows stats if a map exists or help if not.";
|
|
20
14
|
export async function handleCodebase(args, ctx, _pi) {
|
|
21
15
|
const basePath = process.cwd();
|
|
22
16
|
const parts = args.trim().split(/\s+/);
|
|
23
17
|
const sub = parts[0] ?? "";
|
|
24
18
|
switch (sub) {
|
|
25
19
|
case "generate": {
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
20
|
+
const maxFiles = parseMaxFiles(args, ctx);
|
|
21
|
+
if (maxFiles === false)
|
|
28
22
|
return; // validation failed, message already shown
|
|
29
23
|
const existing = readCodebaseMap(basePath);
|
|
30
24
|
const existingDescriptions = existing
|
|
31
25
|
? (await import("./codebase-generator.js")).parseCodebaseMap(existing)
|
|
32
26
|
: undefined;
|
|
33
|
-
const result = generateCodebaseMap(basePath,
|
|
27
|
+
const result = generateCodebaseMap(basePath, { maxFiles: maxFiles ?? undefined }, existingDescriptions);
|
|
34
28
|
if (result.fileCount === 0) {
|
|
35
29
|
ctx.ui.notify("Codebase map generated with 0 files.\n" +
|
|
36
30
|
"Is this a git repository? Run 'git ls-files' to verify.", "warning");
|
|
@@ -48,10 +42,10 @@ export async function handleCodebase(args, ctx, _pi) {
|
|
|
48
42
|
ctx.ui.notify("No codebase map found. Run /gsd codebase generate to create one.", "warning");
|
|
49
43
|
return;
|
|
50
44
|
}
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
45
|
+
const maxFiles = parseMaxFiles(args, ctx);
|
|
46
|
+
if (maxFiles === false)
|
|
53
47
|
return;
|
|
54
|
-
const result = updateCodebaseMap(basePath,
|
|
48
|
+
const result = updateCodebaseMap(basePath, { maxFiles: maxFiles ?? undefined });
|
|
55
49
|
writeCodebaseMap(basePath, result.content);
|
|
56
50
|
ctx.ui.notify(`Codebase map updated: ${result.fileCount} files\n` +
|
|
57
51
|
` Added: ${result.added} | Removed: ${result.removed} | Unchanged: ${result.unchanged}` +
|
|
@@ -99,40 +93,19 @@ function showStats(basePath, ctx) {
|
|
|
99
93
|
: `Coverage is complete.`), "info");
|
|
100
94
|
}
|
|
101
95
|
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* Returns false if validation failed (error already shown to user).
|
|
96
|
+
* Parse and validate --max-files flag.
|
|
97
|
+
* Returns the parsed number, undefined if flag not present, or false if invalid.
|
|
105
98
|
*/
|
|
106
|
-
function
|
|
107
|
-
// Load preferences defaults
|
|
108
|
-
const prefs = loadEffectiveGSDPreferences()?.preferences?.codebase;
|
|
109
|
-
// Parse CLI flags
|
|
99
|
+
function parseMaxFiles(args, ctx) {
|
|
110
100
|
const maxFilesStr = extractFlag(args, "--max-files");
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
ctx.ui.notify("--max-files must be a positive integer (e.g. --max-files 200).", "warning");
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
// Validate --collapse-threshold
|
|
122
|
-
let collapseThreshold;
|
|
123
|
-
if (collapseStr) {
|
|
124
|
-
collapseThreshold = parseInt(collapseStr, 10);
|
|
125
|
-
if (isNaN(collapseThreshold) || collapseThreshold < 1) {
|
|
126
|
-
ctx.ui.notify("--collapse-threshold must be a positive integer (e.g. --collapse-threshold 15).", "warning");
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
101
|
+
if (!maxFilesStr)
|
|
102
|
+
return undefined;
|
|
103
|
+
const maxFiles = parseInt(maxFilesStr, 10);
|
|
104
|
+
if (isNaN(maxFiles) || maxFiles < 1) {
|
|
105
|
+
ctx.ui.notify("--max-files must be a positive integer (e.g. --max-files 200).", "warning");
|
|
106
|
+
return false;
|
|
129
107
|
}
|
|
130
|
-
return
|
|
131
|
-
// CLI flags override preferences
|
|
132
|
-
maxFiles: maxFiles ?? prefs?.max_files,
|
|
133
|
-
collapseThreshold: collapseThreshold ?? prefs?.collapse_threshold,
|
|
134
|
-
excludePatterns: prefs?.exclude_patterns,
|
|
135
|
-
};
|
|
108
|
+
return maxFiles;
|
|
136
109
|
}
|
|
137
110
|
function extractFlag(args, flag) {
|
|
138
111
|
const escaped = flag.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { existsSync } from "node:fs";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
import { gsdRoot } from "./paths.js";
|
|
9
|
-
import { logWarning } from "./workflow-logger.js";
|
|
10
9
|
import { getErrorMessage } from "./error-utils.js";
|
|
11
10
|
export function formatInspectOutput(data) {
|
|
12
11
|
const lines = [];
|
|
@@ -72,7 +71,7 @@ export async function handleInspect(ctx) {
|
|
|
72
71
|
ctx.ui.notify(formatInspectOutput(data), "info");
|
|
73
72
|
}
|
|
74
73
|
catch (err) {
|
|
75
|
-
|
|
74
|
+
process.stderr.write(`gsd-db: /gsd inspect failed: ${getErrorMessage(err)}\n`);
|
|
76
75
|
ctx.ui.notify("Failed to inspect GSD database. Check stderr for details.", "error");
|
|
77
76
|
}
|
|
78
77
|
}
|
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { deriveState } from "./state.js";
|
|
7
7
|
import { nativeBranchList, nativeDetectMainBranch, nativeBranchListMerged, nativeBranchDelete, nativeForEachRef, nativeUpdateRef } from "./native-git-bridge.js";
|
|
8
|
-
import { logWarning } from "./workflow-logger.js";
|
|
9
8
|
export async function handleCleanupBranches(ctx, basePath) {
|
|
10
9
|
let branches;
|
|
11
10
|
try {
|
|
12
11
|
branches = nativeBranchList(basePath, "gsd/*");
|
|
13
12
|
}
|
|
14
|
-
catch
|
|
15
|
-
logWarning("command", `branch list failed: ${e.message}`);
|
|
13
|
+
catch {
|
|
16
14
|
ctx.ui.notify("No GSD branches to clean up.", "info");
|
|
17
15
|
return;
|
|
18
16
|
}
|
|
@@ -22,8 +20,7 @@ export async function handleCleanupBranches(ctx, basePath) {
|
|
|
22
20
|
try {
|
|
23
21
|
merged = nativeBranchListMerged(basePath, mainBranch, "gsd/*");
|
|
24
22
|
}
|
|
25
|
-
catch
|
|
26
|
-
logWarning("command", `merged branch list failed: ${e.message}`);
|
|
23
|
+
catch {
|
|
27
24
|
merged = [];
|
|
28
25
|
}
|
|
29
26
|
const mergedNonQuick = merged.filter((b) => !b.startsWith("gsd/quick/"));
|
|
@@ -33,8 +30,8 @@ export async function handleCleanupBranches(ctx, basePath) {
|
|
|
33
30
|
nativeBranchDelete(basePath, branch, false);
|
|
34
31
|
deletedMerged++;
|
|
35
32
|
}
|
|
36
|
-
catch
|
|
37
|
-
|
|
33
|
+
catch {
|
|
34
|
+
/* skip branches that cannot be deleted */
|
|
38
35
|
}
|
|
39
36
|
}
|
|
40
37
|
// Also delete stale milestone branches for completed milestones when detached
|
|
@@ -64,9 +61,7 @@ export async function handleCleanupBranches(ctx, basePath) {
|
|
|
64
61
|
nativeBranchDelete(basePath, branch, true);
|
|
65
62
|
deletedStaleMilestones++;
|
|
66
63
|
}
|
|
67
|
-
catch
|
|
68
|
-
logWarning("command", `stale milestone branch delete failed for ${branch}: ${e.message}`);
|
|
69
|
-
}
|
|
64
|
+
catch { /* non-fatal */ }
|
|
70
65
|
continue;
|
|
71
66
|
}
|
|
72
67
|
}
|
|
@@ -78,8 +73,7 @@ export async function handleCleanupBranches(ctx, basePath) {
|
|
|
78
73
|
try {
|
|
79
74
|
roadmapContent = await loadFile(roadmapPath);
|
|
80
75
|
}
|
|
81
|
-
catch
|
|
82
|
-
logWarning("command", `loadFile failed for ${roadmapPath}: ${e.message}`);
|
|
76
|
+
catch {
|
|
83
77
|
roadmapContent = null;
|
|
84
78
|
}
|
|
85
79
|
if (!roadmapContent)
|
|
@@ -90,13 +84,13 @@ export async function handleCleanupBranches(ctx, basePath) {
|
|
|
90
84
|
nativeBranchDelete(basePath, branch, true);
|
|
91
85
|
deletedStaleMilestones++;
|
|
92
86
|
}
|
|
93
|
-
catch
|
|
94
|
-
|
|
87
|
+
catch {
|
|
88
|
+
/* non-fatal */
|
|
95
89
|
}
|
|
96
90
|
}
|
|
97
91
|
}
|
|
98
|
-
catch
|
|
99
|
-
|
|
92
|
+
catch {
|
|
93
|
+
/* non-fatal */
|
|
100
94
|
}
|
|
101
95
|
const summary = [];
|
|
102
96
|
if (deletedMerged > 0) {
|
|
@@ -122,8 +116,7 @@ export async function handleCleanupSnapshots(ctx, basePath) {
|
|
|
122
116
|
try {
|
|
123
117
|
refs = nativeForEachRef(basePath, "refs/gsd/snapshots/");
|
|
124
118
|
}
|
|
125
|
-
catch
|
|
126
|
-
logWarning("command", `snapshot ref list failed: ${e.message}`);
|
|
119
|
+
catch {
|
|
127
120
|
ctx.ui.notify("No snapshot refs to clean up.", "info");
|
|
128
121
|
return;
|
|
129
122
|
}
|
|
@@ -147,8 +140,8 @@ export async function handleCleanupSnapshots(ctx, basePath) {
|
|
|
147
140
|
nativeUpdateRef(basePath, old);
|
|
148
141
|
pruned++;
|
|
149
142
|
}
|
|
150
|
-
catch
|
|
151
|
-
|
|
143
|
+
catch {
|
|
144
|
+
/* skip individual failures */
|
|
152
145
|
}
|
|
153
146
|
}
|
|
154
147
|
}
|
|
@@ -162,8 +155,7 @@ export async function handleCleanupWorktrees(ctx, basePath) {
|
|
|
162
155
|
try {
|
|
163
156
|
statuses = getAllWorktreeHealth(basePath);
|
|
164
157
|
}
|
|
165
|
-
catch
|
|
166
|
-
logWarning("command", `worktree health inspection failed: ${e.message}`);
|
|
158
|
+
catch {
|
|
167
159
|
ctx.ui.notify("Failed to inspect worktrees.", "error");
|
|
168
160
|
return;
|
|
169
161
|
}
|
|
@@ -193,8 +185,7 @@ export async function handleCleanupWorktrees(ctx, basePath) {
|
|
|
193
185
|
lines.push(` ✓ ${wt.name} removed (branch ${wt.branch} deleted)`);
|
|
194
186
|
removed++;
|
|
195
187
|
}
|
|
196
|
-
catch
|
|
197
|
-
logWarning("command", `worktree removal failed for ${wt.name}: ${e.message}`);
|
|
188
|
+
catch {
|
|
198
189
|
lines.push(` ✗ ${wt.name} failed to remove`);
|
|
199
190
|
}
|
|
200
191
|
}
|
|
@@ -237,9 +228,7 @@ export async function handleSkip(unitArg, ctx, basePath) {
|
|
|
237
228
|
keys = JSON.parse(readFile(completedKeysFile, "utf-8"));
|
|
238
229
|
}
|
|
239
230
|
}
|
|
240
|
-
catch
|
|
241
|
-
logWarning("command", `completed-units.json parse failed: ${e.message}`);
|
|
242
|
-
}
|
|
231
|
+
catch { /* start fresh */ }
|
|
243
232
|
// Normalize: accept "execute-task/M001/S01/T03", "M001/S01/T03", or just "T03"
|
|
244
233
|
let skipKey = unitArg;
|
|
245
234
|
if (!skipKey.includes("execute-task") && !skipKey.includes("plan-") && !skipKey.includes("research-") && !skipKey.includes("complete-")) {
|
|
@@ -350,8 +339,7 @@ export async function handleCleanupProjects(args, ctx) {
|
|
|
350
339
|
.filter(e => e.isDirectory())
|
|
351
340
|
.map(e => e.name);
|
|
352
341
|
}
|
|
353
|
-
catch
|
|
354
|
-
logWarning("command", `readdir failed for project-state directory: ${e.message}`);
|
|
342
|
+
catch {
|
|
355
343
|
ctx.ui.notify(`Failed to read project-state directory at ${projectsDir}.`, "error");
|
|
356
344
|
return;
|
|
357
345
|
}
|
|
@@ -425,8 +413,7 @@ export async function handleCleanupProjects(args, ctx) {
|
|
|
425
413
|
fsRmSync(pathJoin(projectsDir, e.hash), { recursive: true, force: true });
|
|
426
414
|
removed++;
|
|
427
415
|
}
|
|
428
|
-
catch
|
|
429
|
-
logWarning("command", `project cleanup rm failed for ${e.hash}: ${err.message}`);
|
|
416
|
+
catch {
|
|
430
417
|
failed.push(e.hash);
|
|
431
418
|
}
|
|
432
419
|
}
|
|
@@ -492,7 +479,7 @@ export async function handleRecover(ctx, basePath) {
|
|
|
492
479
|
}
|
|
493
480
|
catch (err) {
|
|
494
481
|
const msg = err instanceof Error ? err.message : String(err);
|
|
495
|
-
|
|
482
|
+
process.stderr.write(`gsd-recover: failed: ${msg}\n`);
|
|
496
483
|
ctx.ui.notify(`gsd recover failed: ${msg}`, "error");
|
|
497
484
|
}
|
|
498
485
|
}
|