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
|
@@ -38,18 +38,15 @@ const UNIT_TYPE_TIERS = {
|
|
|
38
38
|
export function classifyUnitComplexity(unitType, unitId, basePath, budgetPct, metadata) {
|
|
39
39
|
// Hook units default to light
|
|
40
40
|
if (unitType.startsWith("hook/")) {
|
|
41
|
-
const result = { tier: "light", reason: "hook unit", downgraded: false
|
|
41
|
+
const result = { tier: "light", reason: "hook unit", downgraded: false };
|
|
42
42
|
return applyBudgetPressure(result, budgetPct);
|
|
43
43
|
}
|
|
44
44
|
// Start with the default tier for this unit type
|
|
45
45
|
let tier = UNIT_TYPE_TIERS[unitType] ?? "standard";
|
|
46
46
|
let reason = `unit type: ${unitType}`;
|
|
47
|
-
let taskMeta;
|
|
48
47
|
// For execute-task, analyze task metadata for complexity signals
|
|
49
48
|
if (unitType === "execute-task") {
|
|
50
|
-
|
|
51
|
-
taskMeta = metadata ?? extractTaskMetadata(unitId, basePath);
|
|
52
|
-
const taskAnalysis = analyzeTaskComplexity(unitId, basePath, taskMeta);
|
|
49
|
+
const taskAnalysis = analyzeTaskComplexity(unitId, basePath, metadata);
|
|
53
50
|
tier = taskAnalysis.tier;
|
|
54
51
|
reason = taskAnalysis.reason;
|
|
55
52
|
}
|
|
@@ -62,14 +59,13 @@ export function classifyUnitComplexity(unitType, unitId, basePath, budgetPct, me
|
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
61
|
// Adaptive learning: check if history suggests bumping the tier
|
|
65
|
-
|
|
66
|
-
const tags = taskMeta?.tags ?? metadata?.tags;
|
|
62
|
+
const tags = metadata?.tags ?? extractTaskMetadata(unitId, basePath).tags;
|
|
67
63
|
const adaptiveAdjustment = getAdaptiveTierAdjustment(unitType, tier, tags);
|
|
68
64
|
if (adaptiveAdjustment && tierOrdinal(adaptiveAdjustment) > tierOrdinal(tier)) {
|
|
69
65
|
reason = `${reason} (adaptive: high failure rate at ${tier})`;
|
|
70
66
|
tier = adaptiveAdjustment;
|
|
71
67
|
}
|
|
72
|
-
const result = { tier, reason, downgraded: false
|
|
68
|
+
const result = { tier, reason, downgraded: false };
|
|
73
69
|
return applyBudgetPressure(result, budgetPct);
|
|
74
70
|
}
|
|
75
71
|
/**
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
* - content-heuristic logs the specific failure (missing file, below minSize, pattern mismatch).
|
|
17
17
|
* - The frozen DEFINITION.yaml on disk is the single source of truth for step policies.
|
|
18
18
|
*/
|
|
19
|
-
import { logWarning } from "./workflow-logger.js";
|
|
20
19
|
import { readFileSync, existsSync, statSync } from "node:fs";
|
|
21
20
|
import { resolve, sep } from "node:path";
|
|
22
21
|
import { spawnSync } from "node:child_process";
|
|
@@ -106,8 +105,8 @@ function handleContentHeuristic(runDir, step, verify) {
|
|
|
106
105
|
return "pause";
|
|
107
106
|
}
|
|
108
107
|
}
|
|
109
|
-
catch
|
|
110
|
-
|
|
108
|
+
catch {
|
|
109
|
+
// Invalid regex at runtime — treat as verification failure
|
|
111
110
|
return "pause";
|
|
112
111
|
}
|
|
113
112
|
}
|
|
@@ -8,7 +8,7 @@ import { createRequire } from "node:module";
|
|
|
8
8
|
import { existsSync, copyFileSync, mkdirSync, realpathSync } from "node:fs";
|
|
9
9
|
import { dirname } from "node:path";
|
|
10
10
|
import { GSDError, GSD_STALE_STATE } from "./errors.js";
|
|
11
|
-
import { logError
|
|
11
|
+
import { logError } from "./workflow-logger.js";
|
|
12
12
|
const _require = createRequire(import.meta.url);
|
|
13
13
|
let providerName = null;
|
|
14
14
|
let providerModule = null;
|
|
@@ -710,9 +710,7 @@ export function openDatabase(path) {
|
|
|
710
710
|
try {
|
|
711
711
|
adapter.close();
|
|
712
712
|
}
|
|
713
|
-
catch
|
|
714
|
-
logWarning("db", `close after VACUUM failed: ${e.message}`);
|
|
715
|
-
}
|
|
713
|
+
catch { /* swallow */ }
|
|
716
714
|
throw retryErr;
|
|
717
715
|
}
|
|
718
716
|
}
|
|
@@ -720,9 +718,7 @@ export function openDatabase(path) {
|
|
|
720
718
|
try {
|
|
721
719
|
adapter.close();
|
|
722
720
|
}
|
|
723
|
-
catch
|
|
724
|
-
logWarning("db", `close after VACUUM failed: ${e.message}`);
|
|
725
|
-
}
|
|
721
|
+
catch { /* swallow */ }
|
|
726
722
|
throw err;
|
|
727
723
|
}
|
|
728
724
|
}
|
|
@@ -734,9 +730,7 @@ export function openDatabase(path) {
|
|
|
734
730
|
process.on("exit", () => { try {
|
|
735
731
|
closeDatabase();
|
|
736
732
|
}
|
|
737
|
-
catch
|
|
738
|
-
logWarning("db", `exit handler close failed: ${e.message}`);
|
|
739
|
-
} });
|
|
733
|
+
catch { } });
|
|
740
734
|
}
|
|
741
735
|
return true;
|
|
742
736
|
}
|
|
@@ -745,21 +739,17 @@ export function closeDatabase() {
|
|
|
745
739
|
try {
|
|
746
740
|
currentDb.exec('PRAGMA wal_checkpoint(TRUNCATE)');
|
|
747
741
|
}
|
|
748
|
-
catch
|
|
749
|
-
logWarning("db", `WAL checkpoint failed: ${e.message}`);
|
|
750
|
-
}
|
|
742
|
+
catch { /* non-fatal — best effort before close */ }
|
|
751
743
|
try {
|
|
752
744
|
// Incremental vacuum to reclaim space without blocking
|
|
753
745
|
currentDb.exec('PRAGMA incremental_vacuum(64)');
|
|
754
746
|
}
|
|
755
|
-
catch
|
|
756
|
-
logWarning("db", `incremental vacuum failed: ${e.message}`);
|
|
757
|
-
}
|
|
747
|
+
catch { /* non-fatal */ }
|
|
758
748
|
try {
|
|
759
749
|
currentDb.close();
|
|
760
750
|
}
|
|
761
|
-
catch
|
|
762
|
-
|
|
751
|
+
catch {
|
|
752
|
+
// swallow close errors
|
|
763
753
|
}
|
|
764
754
|
currentDb = null;
|
|
765
755
|
currentPath = null;
|
|
@@ -773,9 +763,7 @@ export function vacuumDatabase() {
|
|
|
773
763
|
try {
|
|
774
764
|
currentDb.exec('VACUUM');
|
|
775
765
|
}
|
|
776
|
-
catch
|
|
777
|
-
logWarning("db", `VACUUM failed: ${e.message}`);
|
|
778
|
-
}
|
|
766
|
+
catch { /* non-fatal */ }
|
|
779
767
|
}
|
|
780
768
|
let _txDepth = 0;
|
|
781
769
|
export function transaction(fn) {
|
|
@@ -973,9 +961,7 @@ export function clearArtifacts() {
|
|
|
973
961
|
try {
|
|
974
962
|
currentDb.exec("DELETE FROM artifacts");
|
|
975
963
|
}
|
|
976
|
-
catch
|
|
977
|
-
logWarning("db", `clearArtifacts failed: ${e.message}`);
|
|
978
|
-
}
|
|
964
|
+
catch { /* cache clear is best effort */ }
|
|
979
965
|
}
|
|
980
966
|
export function insertArtifact(a) {
|
|
981
967
|
if (!currentDb)
|
|
@@ -1502,9 +1488,7 @@ export function reconcileWorktreeDb(mainDbPath, worktreeDbPath) {
|
|
|
1502
1488
|
if (realpathSync(mainDbPath) === realpathSync(worktreeDbPath))
|
|
1503
1489
|
return zero;
|
|
1504
1490
|
}
|
|
1505
|
-
catch
|
|
1506
|
-
logWarning("db", `realpathSync failed: ${e.message}`);
|
|
1507
|
-
}
|
|
1491
|
+
catch { /* path resolution failed — fall through to existing checks */ }
|
|
1508
1492
|
// Sanitize path: reject any characters that could break ATTACH syntax.
|
|
1509
1493
|
// ATTACH DATABASE doesn't support parameterized paths in all providers,
|
|
1510
1494
|
// so we use strict allowlist validation instead.
|
|
@@ -1626,9 +1610,7 @@ export function reconcileWorktreeDb(mainDbPath, worktreeDbPath) {
|
|
|
1626
1610
|
try {
|
|
1627
1611
|
adapter.exec("ROLLBACK");
|
|
1628
1612
|
}
|
|
1629
|
-
catch
|
|
1630
|
-
logWarning("db", `rollback failed: ${e.message}`);
|
|
1631
|
-
}
|
|
1613
|
+
catch { /* best effort */ }
|
|
1632
1614
|
throw txErr;
|
|
1633
1615
|
}
|
|
1634
1616
|
return { ...merged, conflicts };
|
|
@@ -1637,9 +1619,7 @@ export function reconcileWorktreeDb(mainDbPath, worktreeDbPath) {
|
|
|
1637
1619
|
try {
|
|
1638
1620
|
adapter.exec("DETACH DATABASE wt");
|
|
1639
1621
|
}
|
|
1640
|
-
catch
|
|
1641
|
-
logWarning("db", `detach worktree DB failed: ${e.message}`);
|
|
1642
|
-
}
|
|
1622
|
+
catch { /* best effort */ }
|
|
1643
1623
|
}
|
|
1644
1624
|
}
|
|
1645
1625
|
catch (err) {
|
|
@@ -37,7 +37,6 @@ import { selectAndApplyModel } from "./auto-model-selection.js";
|
|
|
37
37
|
export { MILESTONE_ID_RE, generateMilestoneSuffix, nextMilestoneId, extractMilestoneSeq, parseMilestoneId, milestoneIdSort, maxMilestoneNum, findMilestoneIds, reserveMilestoneId, claimReservedId, getReservedMilestoneIds, clearReservedMilestoneIds, } from "./milestone-ids.js";
|
|
38
38
|
export { showQueue, handleQueueReorder, showQueueAdd, buildExistingMilestonesContext, } from "./guided-flow-queue.js";
|
|
39
39
|
import { getErrorMessage } from "./error-utils.js";
|
|
40
|
-
import { logWarning } from "./workflow-logger.js";
|
|
41
40
|
// ─── ID Generation with Reservation ─────────────────────────────────────────
|
|
42
41
|
/**
|
|
43
42
|
* Generate the next milestone ID, accounting for reserved IDs, and reserve it.
|
|
@@ -145,9 +144,7 @@ export function checkAutoStartAfterDiscuss() {
|
|
|
145
144
|
}
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
|
-
catch
|
|
149
|
-
logWarning("guided", `PROJECT.md parsing failed: ${e.message}`);
|
|
150
|
-
}
|
|
147
|
+
catch { /* non-fatal — PROJECT.md parsing failure shouldn't block auto-start */ }
|
|
151
148
|
}
|
|
152
149
|
// Gate 4: Discussion manifest process verification (multi-milestone only)
|
|
153
150
|
// The LLM writes DISCUSSION-MANIFEST.json after each Phase 3 gate decision.
|
|
@@ -174,9 +171,7 @@ export function checkAutoStartAfterDiscuss() {
|
|
|
174
171
|
}
|
|
175
172
|
}
|
|
176
173
|
}
|
|
177
|
-
catch
|
|
178
|
-
logWarning("guided", `discussion manifest verification failed: ${e.message}`);
|
|
179
|
-
}
|
|
174
|
+
catch { /* malformed manifest — warn but don't block */ }
|
|
180
175
|
}
|
|
181
176
|
// Draft promotion cleanup: if a CONTEXT-DRAFT.md exists alongside the new
|
|
182
177
|
// CONTEXT.md, delete the draft — it's been consumed by the discussion.
|
|
@@ -185,21 +180,18 @@ export function checkAutoStartAfterDiscuss() {
|
|
|
185
180
|
if (draftFile)
|
|
186
181
|
unlinkSync(draftFile);
|
|
187
182
|
}
|
|
188
|
-
catch
|
|
189
|
-
logWarning("guided", `CONTEXT-DRAFT.md unlink failed: ${e.message}`);
|
|
190
|
-
}
|
|
183
|
+
catch { /* non-fatal — stale draft doesn't break anything, CONTEXT.md wins */ }
|
|
191
184
|
// Cleanup: remove discussion manifest after auto-start (only needed during discussion)
|
|
192
185
|
try {
|
|
193
186
|
unlinkSync(manifestPath);
|
|
194
187
|
}
|
|
195
|
-
catch
|
|
196
|
-
logWarning("guided", `manifest unlink failed: ${e.message}`);
|
|
197
|
-
}
|
|
188
|
+
catch { /* may not exist for single-milestone */ }
|
|
198
189
|
pendingAutoStartMap.delete(basePath);
|
|
199
190
|
ctx.ui.notify(`Milestone ${milestoneId} ready.`, "info");
|
|
200
191
|
startAuto(ctx, pi, basePath, false, { step }).catch((err) => {
|
|
201
192
|
ctx.ui.notify(`Auto-start failed: ${getErrorMessage(err)}`, "error");
|
|
202
|
-
|
|
193
|
+
if (process.env.GSD_DEBUG)
|
|
194
|
+
console.error('[gsd] auto start error:', err);
|
|
203
195
|
debugLog("auto-start-failed", { error: getErrorMessage(err) });
|
|
204
196
|
});
|
|
205
197
|
return true;
|
|
@@ -752,8 +744,8 @@ function selfHealRuntimeRecords(basePath, ctx) {
|
|
|
752
744
|
}
|
|
753
745
|
return { cleared };
|
|
754
746
|
}
|
|
755
|
-
catch
|
|
756
|
-
|
|
747
|
+
catch {
|
|
748
|
+
// Non-fatal — self-heal should never block the wizard
|
|
757
749
|
return { cleared: 0 };
|
|
758
750
|
}
|
|
759
751
|
}
|
|
@@ -960,9 +952,7 @@ export async function showSmartEntry(ctx, pi, basePath, options) {
|
|
|
960
952
|
return;
|
|
961
953
|
}
|
|
962
954
|
}
|
|
963
|
-
catch
|
|
964
|
-
logWarning("guided", `directory read failed: ${e.message}`);
|
|
965
|
-
}
|
|
955
|
+
catch { /* directory exists but unreadable — fall through to normal flow */ }
|
|
966
956
|
}
|
|
967
957
|
}
|
|
968
958
|
const uniqueMilestoneIds = !!loadEffectiveGSDPreferences()?.preferences?.unique_milestone_ids;
|
|
@@ -13,7 +13,6 @@ import { ensureGitignore, untrackRuntimeFiles } from "./gitignore.js";
|
|
|
13
13
|
import { gsdRoot } from "./paths.js";
|
|
14
14
|
import { assertSafeDirectory } from "./validate-directory.js";
|
|
15
15
|
import { runSkillInstallStep } from "./skill-catalog.js";
|
|
16
|
-
import { generateCodebaseMap, writeCodebaseMap } from "./codebase-generator.js";
|
|
17
16
|
// ─── Defaults ───────────────────────────────────────────────────────────────────
|
|
18
17
|
const DEFAULT_PREFS = {
|
|
19
18
|
mode: "solo",
|
|
@@ -190,17 +189,6 @@ export async function showProjectInit(ctx, pi, basePath, detection) {
|
|
|
190
189
|
// Ensure .gitignore
|
|
191
190
|
ensureGitignore(basePath);
|
|
192
191
|
untrackRuntimeFiles(basePath);
|
|
193
|
-
// Auto-generate codebase map for instant agent orientation
|
|
194
|
-
try {
|
|
195
|
-
const result = generateCodebaseMap(basePath);
|
|
196
|
-
if (result.fileCount > 0) {
|
|
197
|
-
writeCodebaseMap(basePath, result.content);
|
|
198
|
-
ctx.ui.notify(`Codebase map generated: ${result.fileCount} files`, "info");
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
catch {
|
|
202
|
-
// Non-fatal — codebase map generation failure should never block project init
|
|
203
|
-
}
|
|
204
192
|
ctx.ui.notify("GSD initialized. Starting your first milestone...", "info");
|
|
205
193
|
return { completed: true, bootstrapped: true };
|
|
206
194
|
}
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
// Critical invariant: rendered markdown must round-trip through
|
|
9
9
|
// parseRoadmap(), parsePlan(), parseSummary() in files.ts.
|
|
10
10
|
import { readFileSync, existsSync, mkdirSync } from "node:fs";
|
|
11
|
-
import { logWarning } from "./workflow-logger.js";
|
|
12
11
|
import { isClosedStatus } from "./status-guards.js";
|
|
13
12
|
import { join, relative } from "node:path";
|
|
14
13
|
import { createRequire } from "node:module";
|
|
@@ -57,7 +56,7 @@ function loadArtifactContent(artifactPath, absPath, opts) {
|
|
|
57
56
|
content = readFileSync(absPath, "utf-8");
|
|
58
57
|
}
|
|
59
58
|
catch {
|
|
60
|
-
|
|
59
|
+
process.stderr.write(`markdown-renderer: cannot read file from disk: ${absPath}\n`);
|
|
61
60
|
return null;
|
|
62
61
|
}
|
|
63
62
|
// Store in DB for future use (graceful degradation path)
|
|
@@ -73,7 +72,7 @@ function loadArtifactContent(artifactPath, absPath, opts) {
|
|
|
73
72
|
}
|
|
74
73
|
catch {
|
|
75
74
|
// Non-fatal: we have the content, DB storage is best-effort
|
|
76
|
-
|
|
75
|
+
process.stderr.write(`markdown-renderer: warning — failed to store disk fallback in DB: ${artifactPath}\n`);
|
|
77
76
|
}
|
|
78
77
|
return content;
|
|
79
78
|
}
|
|
@@ -94,7 +93,7 @@ async function writeAndStore(absPath, artifactPath, content, opts) {
|
|
|
94
93
|
}
|
|
95
94
|
catch {
|
|
96
95
|
// Non-fatal: file is on disk, DB is best-effort
|
|
97
|
-
|
|
96
|
+
process.stderr.write(`markdown-renderer: warning — failed to update artifact in DB: ${artifactPath}\n`);
|
|
98
97
|
}
|
|
99
98
|
invalidateCaches();
|
|
100
99
|
}
|
|
@@ -614,8 +613,7 @@ export function detectStaleRenders(basePath) {
|
|
|
614
613
|
parseRoadmap = m.parseRoadmap;
|
|
615
614
|
parsePlan = m.parsePlan;
|
|
616
615
|
}
|
|
617
|
-
catch
|
|
618
|
-
logWarning("renderer", `parsers-legacy.ts require failed, falling back to .js: ${e.message}`);
|
|
616
|
+
catch {
|
|
619
617
|
const m = _require("./parsers-legacy.js");
|
|
620
618
|
parseRoadmap = m.parseRoadmap;
|
|
621
619
|
parsePlan = m.parsePlan;
|
|
@@ -649,8 +647,8 @@ export function detectStaleRenders(basePath) {
|
|
|
649
647
|
}
|
|
650
648
|
}
|
|
651
649
|
}
|
|
652
|
-
catch
|
|
653
|
-
|
|
650
|
+
catch {
|
|
651
|
+
// Can't parse roadmap — skip silently
|
|
654
652
|
}
|
|
655
653
|
}
|
|
656
654
|
// ── Check plan checkbox state and summaries for each slice ────────
|
|
@@ -681,8 +679,8 @@ export function detectStaleRenders(basePath) {
|
|
|
681
679
|
}
|
|
682
680
|
}
|
|
683
681
|
}
|
|
684
|
-
catch
|
|
685
|
-
|
|
682
|
+
catch {
|
|
683
|
+
// Can't parse plan — skip silently
|
|
686
684
|
}
|
|
687
685
|
}
|
|
688
686
|
// Check missing task summary files
|
|
@@ -826,7 +824,7 @@ export async function repairStaleRenders(basePath) {
|
|
|
826
824
|
}
|
|
827
825
|
}
|
|
828
826
|
catch (err) {
|
|
829
|
-
|
|
827
|
+
process.stderr.write(`markdown-renderer: repair failed for ${entry.path}: ${err.message}\n`);
|
|
830
828
|
}
|
|
831
829
|
}
|
|
832
830
|
if (repairCount > 0) {
|
|
@@ -10,7 +10,6 @@ import { resolveGsdRootFile, resolveMilestoneFile, resolveSliceFile, resolveTask
|
|
|
10
10
|
import { findMilestoneIds } from './guided-flow.js';
|
|
11
11
|
import { parseRoadmap, parsePlan } from './parsers-legacy.js';
|
|
12
12
|
import { parseContextDependsOn } from './files.js';
|
|
13
|
-
import { logWarning } from './workflow-logger.js';
|
|
14
13
|
// ─── DECISIONS.md Parser ───────────────────────────────────────────────────
|
|
15
14
|
const VALID_MADE_BY = new Set(['human', 'agent', 'collaborative']);
|
|
16
15
|
/**
|
|
@@ -598,25 +597,25 @@ export function migrateFromMarkdown(gsdDir) {
|
|
|
598
597
|
decisions = importDecisions(gsdDir);
|
|
599
598
|
}
|
|
600
599
|
catch (err) {
|
|
601
|
-
|
|
600
|
+
process.stderr.write(`gsd-migrate: skipping decisions import: ${err.message}\n`);
|
|
602
601
|
}
|
|
603
602
|
try {
|
|
604
603
|
requirements = importRequirements(gsdDir);
|
|
605
604
|
}
|
|
606
605
|
catch (err) {
|
|
607
|
-
|
|
606
|
+
process.stderr.write(`gsd-migrate: skipping requirements import: ${err.message}\n`);
|
|
608
607
|
}
|
|
609
608
|
try {
|
|
610
609
|
artifacts = importHierarchyArtifacts(gsdDir);
|
|
611
610
|
}
|
|
612
611
|
catch (err) {
|
|
613
|
-
|
|
612
|
+
process.stderr.write(`gsd-migrate: skipping artifacts import: ${err.message}\n`);
|
|
614
613
|
}
|
|
615
614
|
try {
|
|
616
615
|
hierarchy = migrateHierarchyToDb(gsdDir);
|
|
617
616
|
}
|
|
618
617
|
catch (err) {
|
|
619
|
-
|
|
618
|
+
process.stderr.write(`gsd-migrate: skipping hierarchy migration: ${err.message}\n`);
|
|
620
619
|
}
|
|
621
620
|
});
|
|
622
621
|
process.stderr.write(`gsd-migrate: imported ${decisions} decisions, ${requirements} requirements, ${artifacts} artifacts, ${hierarchy.milestones}M/${hierarchy.slices}S/${hierarchy.tasks}T hierarchy\n`);
|
|
@@ -16,7 +16,6 @@ import { resolveMilestonePath, resolveMilestoneFile, buildMilestoneFileName, } f
|
|
|
16
16
|
import { invalidateAllCaches } from "./cache.js";
|
|
17
17
|
import { loadQueueOrder, saveQueueOrder } from "./queue-order.js";
|
|
18
18
|
import { isDbAvailable, updateMilestoneStatus } from "./gsd-db.js";
|
|
19
|
-
import { logWarning } from "./workflow-logger.js";
|
|
20
19
|
// ─── Park ──────────────────────────────────────────────────────────────────
|
|
21
20
|
/**
|
|
22
21
|
* Park a milestone — creates a PARKED.md marker file with reason and timestamp.
|
|
@@ -52,7 +51,7 @@ export function parkMilestone(basePath, milestoneId, reason) {
|
|
|
52
51
|
updateMilestoneStatus(milestoneId, "parked");
|
|
53
52
|
}
|
|
54
53
|
catch (err) {
|
|
55
|
-
|
|
54
|
+
process.stderr.write(`gsd: parkMilestone DB sync failed for ${milestoneId}: ${err.message}\n`);
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
invalidateAllCaches();
|
|
@@ -77,7 +76,7 @@ export function unparkMilestone(basePath, milestoneId) {
|
|
|
77
76
|
updateMilestoneStatus(milestoneId, "active");
|
|
78
77
|
}
|
|
79
78
|
catch (err) {
|
|
80
|
-
|
|
79
|
+
process.stderr.write(`gsd: unparkMilestone DB sync failed for ${milestoneId}: ${err.message}\n`);
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
invalidateAllCaches();
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Consumed by 15+ modules across the GSD extension. Zero side-effects.
|
|
6
6
|
*/
|
|
7
7
|
import { randomInt } from "node:crypto";
|
|
8
|
-
import { logWarning } from "./workflow-logger.js";
|
|
9
8
|
import { readdirSync, existsSync } from "node:fs";
|
|
10
9
|
import { milestonesDir } from "./paths.js";
|
|
11
10
|
import { loadQueueOrder, sortByQueueOrder } from "./queue-order.js";
|
|
@@ -110,7 +109,7 @@ export function findMilestoneIds(basePath) {
|
|
|
110
109
|
catch (err) {
|
|
111
110
|
// Log why milestone scanning failed — silent [] here causes infinite loops (#456)
|
|
112
111
|
if (existsSync(dir)) {
|
|
113
|
-
|
|
112
|
+
console.error(`[gsd] findMilestoneIds: .gsd/milestones/ exists but readdirSync failed — ${getErrorMessage(err)}`);
|
|
114
113
|
}
|
|
115
114
|
return [];
|
|
116
115
|
}
|