gsd-pi 2.82.0-dev.dfbc5f58f → 2.82.0-dev.e7a7f1ed5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +1 -1
- package/dist/resources/extensions/gsd/auto/phases.js +73 -30
- package/dist/resources/extensions/gsd/auto-dashboard.js +66 -1
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +1 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +10 -16
- package/dist/resources/extensions/gsd/auto-recovery.js +40 -13
- package/dist/resources/extensions/gsd/auto-start.js +3 -3
- package/dist/resources/extensions/gsd/auto-verification.js +17 -4
- package/dist/resources/extensions/gsd/auto-worktree.js +65 -9
- package/dist/resources/extensions/gsd/auto.js +7 -2
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +27 -6
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +4 -2
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +7 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +16 -4
- package/dist/resources/extensions/gsd/db/milestone-leases.js +24 -0
- package/dist/resources/extensions/gsd/doctor-git-checks.js +46 -1
- package/dist/resources/extensions/gsd/git-service.js +6 -2
- package/dist/resources/extensions/gsd/gsd-db.js +20 -6
- package/dist/resources/extensions/gsd/guided-flow-queue.js +4 -3
- package/dist/resources/extensions/gsd/guided-flow.js +95 -116
- package/dist/resources/extensions/gsd/guided-unit-context.js +23 -0
- package/dist/resources/extensions/gsd/migration-auto-check.js +12 -17
- package/dist/resources/extensions/gsd/pending-auto-start.js +52 -0
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +8 -8
- package/dist/resources/extensions/gsd/prompts/discuss.md +9 -9
- package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
- package/dist/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/queue.md +4 -4
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/dist/resources/extensions/gsd/queue-reorder-ui.js +30 -13
- package/dist/resources/extensions/gsd/smart-entry-routing.js +36 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +9 -14
- package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +19 -24
- package/dist/resources/extensions/gsd/status-guards.js +7 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +17 -1
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +9 -9
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +9 -9
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/package.json +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.js +5 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.js +41 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.test.js.map +1 -0
- package/packages/pi-ai/src/providers/google-gemini-cli.test.ts +49 -0
- package/packages/pi-ai/src/providers/google-gemini-cli.ts +7 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +24 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +23 -7
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/terminal.test.d.ts +2 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.js +103 -0
- package/packages/pi-tui/dist/__tests__/terminal.test.js.map +1 -0
- package/packages/pi-tui/dist/terminal.d.ts +2 -0
- package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
- package/packages/pi-tui/dist/terminal.js +12 -0
- package/packages/pi-tui/dist/terminal.js.map +1 -1
- package/packages/pi-tui/src/__tests__/terminal.test.ts +121 -0
- package/packages/pi-tui/src/terminal.ts +11 -0
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +1 -1
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +9 -0
- package/src/resources/extensions/gsd/auto/phases.ts +83 -37
- package/src/resources/extensions/gsd/auto-dashboard.ts +72 -1
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +1 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +10 -16
- package/src/resources/extensions/gsd/auto-recovery.ts +45 -11
- package/src/resources/extensions/gsd/auto-start.ts +2 -3
- package/src/resources/extensions/gsd/auto-verification.ts +22 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +74 -9
- package/src/resources/extensions/gsd/auto.ts +8 -2
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +36 -6
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +4 -2
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +8 -3
- package/src/resources/extensions/gsd/crash-recovery.ts +16 -2
- package/src/resources/extensions/gsd/db/milestone-leases.ts +26 -0
- package/src/resources/extensions/gsd/doctor-git-checks.ts +45 -1
- package/src/resources/extensions/gsd/doctor-types.ts +1 -0
- package/src/resources/extensions/gsd/git-service.ts +6 -3
- package/src/resources/extensions/gsd/gsd-db.ts +18 -6
- package/src/resources/extensions/gsd/guided-flow-queue.ts +4 -3
- package/src/resources/extensions/gsd/guided-flow.ts +128 -133
- package/src/resources/extensions/gsd/guided-unit-context.ts +30 -0
- package/src/resources/extensions/gsd/migration-auto-check.ts +15 -23
- package/src/resources/extensions/gsd/pending-auto-start.ts +79 -0
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +8 -8
- package/src/resources/extensions/gsd/prompts/discuss.md +9 -9
- package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
- package/src/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/queue.md +4 -4
- package/src/resources/extensions/gsd/prompts/refine-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/src/resources/extensions/gsd/queue-reorder-ui.ts +31 -13
- package/src/resources/extensions/gsd/smart-entry-routing.ts +77 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +12 -15
- package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +17 -25
- package/src/resources/extensions/gsd/status-guards.ts +8 -0
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +71 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +29 -1
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +53 -2
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +76 -5
- package/src/resources/extensions/gsd/tests/auto-stop-notification.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/checkout-branch-stash-guard.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +11 -2
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +5 -9
- package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +43 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/db-authority-regression.test.ts +208 -0
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/doctor-empty-worktree.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +11 -0
- package/src/resources/extensions/gsd/tests/guided-discuss-project-prompt-rendering.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +106 -0
- package/src/resources/extensions/gsd/tests/guided-flow-session-isolation.test.ts +59 -11
- package/src/resources/extensions/gsd/tests/guided-tool-contract.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +7 -7
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/merge-db-cycle.test.ts +179 -0
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +26 -18
- package/src/resources/extensions/gsd/tests/pending-autostart-scope.test.ts +29 -5
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +37 -1
- package/src/resources/extensions/gsd/tests/queue-reorder-ui.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/remediation-completion-guard.test.ts +43 -0
- package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +2 -3
- package/src/resources/extensions/gsd/tests/smart-entry-routing.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +22 -1
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +119 -23
- package/src/resources/extensions/gsd/tests/status-guards.test.ts +13 -1
- package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +29 -2
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +18 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +18 -1
- /package/dist/web/standalone/.next/static/{q0WYuDVbHeFFYbdd-fei2 → 4dSwdrs__8NwCZggxP9KF}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{q0WYuDVbHeFFYbdd-fei2 → 4dSwdrs__8NwCZggxP9KF}/_ssgManifest.js +0 -0
|
@@ -2,21 +2,17 @@ import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
|
2
2
|
|
|
3
3
|
import { ensureDbOpen } from "./bootstrap/dynamic-tools.js";
|
|
4
4
|
import {
|
|
5
|
-
clearEngineHierarchy,
|
|
6
5
|
getAllMilestones,
|
|
7
6
|
getMilestoneSlices,
|
|
8
7
|
getSliceTasks,
|
|
9
8
|
isDbAvailable,
|
|
10
|
-
transaction,
|
|
11
9
|
} from "./gsd-db.js";
|
|
12
|
-
import { migrateHierarchyToDb } from "./md-importer.js";
|
|
13
10
|
import { parsePlan, parseRoadmap } from "./parsers-legacy.js";
|
|
14
11
|
import {
|
|
15
12
|
milestonesDir,
|
|
16
13
|
resolveMilestoneFile,
|
|
17
14
|
resolveSliceFile,
|
|
18
15
|
} from "./paths.js";
|
|
19
|
-
import { invalidateStateCache } from "./state.js";
|
|
20
16
|
|
|
21
17
|
export interface HierarchyCounts {
|
|
22
18
|
milestones: number;
|
|
@@ -25,11 +21,13 @@ export interface HierarchyCounts {
|
|
|
25
21
|
}
|
|
26
22
|
|
|
27
23
|
export interface MigrationAutoCheckResult {
|
|
28
|
-
action: "none" | "
|
|
24
|
+
action: "none" | "recovery-required";
|
|
29
25
|
reason: "no-markdown" | "in-sync" | "db-empty" | "count-mismatch";
|
|
30
26
|
markdown: HierarchyCounts;
|
|
31
27
|
beforeDb: HierarchyCounts;
|
|
32
28
|
afterDb: HierarchyCounts;
|
|
29
|
+
recoveryCommand?: string;
|
|
30
|
+
message?: string;
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
function zeroCounts(): HierarchyCounts {
|
|
@@ -83,7 +81,7 @@ export function countDbHierarchy(): HierarchyCounts {
|
|
|
83
81
|
return counts;
|
|
84
82
|
}
|
|
85
83
|
|
|
86
|
-
export async function
|
|
84
|
+
export async function checkMarkdownHierarchyAgainstDb(
|
|
87
85
|
basePath: string,
|
|
88
86
|
): Promise<MigrationAutoCheckResult> {
|
|
89
87
|
const markdown = countMarkdownHierarchy(basePath);
|
|
@@ -108,22 +106,16 @@ export async function autoImportMarkdownHierarchyIfDbMismatch(
|
|
|
108
106
|
}
|
|
109
107
|
|
|
110
108
|
const reason = sameCounts(beforeDb, zeroCounts()) ? "db-empty" : "count-mismatch";
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
109
|
+
return {
|
|
110
|
+
action: "recovery-required",
|
|
111
|
+
reason,
|
|
112
|
+
markdown,
|
|
113
|
+
beforeDb,
|
|
114
|
+
afterDb: beforeDb,
|
|
115
|
+
recoveryCommand: "gsd recover",
|
|
116
|
+
message:
|
|
117
|
+
`Markdown planning artifacts (${markdown.milestones}M/${markdown.slices}S/${markdown.tasks}T) ` +
|
|
118
|
+
`do not match the authoritative DB (${beforeDb.milestones}M/${beforeDb.slices}S/${beforeDb.tasks}T). ` +
|
|
119
|
+
"Runtime startup will not import markdown automatically; run explicit GSD recovery if markdown should repopulate the database.",
|
|
121
120
|
};
|
|
122
|
-
if (!sameCounts(markdown, afterDb)) {
|
|
123
|
-
throw new Error(
|
|
124
|
-
`migration auto-import verification failed: markdown ${markdown.milestones}M/${markdown.slices}S/${markdown.tasks}T, db ${afterDb.milestones}M/${afterDb.slices}S/${afterDb.tasks}T`,
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return { action: "imported", reason, markdown, beforeDb, afterDb };
|
|
129
121
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// GSD-2 — Pending auto-start handoff state.
|
|
2
|
+
// Stores discuss-to-auto handoff entries keyed by project root.
|
|
3
|
+
|
|
4
|
+
import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent";
|
|
5
|
+
import { createWorkspace, scopeMilestone, type MilestoneScope } from "./workspace.js";
|
|
6
|
+
|
|
7
|
+
export interface PendingAutoStartEntry {
|
|
8
|
+
ctx: ExtensionCommandContext;
|
|
9
|
+
pi: ExtensionAPI;
|
|
10
|
+
basePath: string;
|
|
11
|
+
milestoneId: string;
|
|
12
|
+
step?: boolean;
|
|
13
|
+
createdAt: number;
|
|
14
|
+
readyRejectCount?: number;
|
|
15
|
+
scope: MilestoneScope;
|
|
16
|
+
planBlockedRecoveryCount: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface PendingAutoStartInput {
|
|
20
|
+
basePath: string;
|
|
21
|
+
milestoneId: string;
|
|
22
|
+
ctx: ExtensionCommandContext;
|
|
23
|
+
pi: ExtensionAPI;
|
|
24
|
+
step?: boolean;
|
|
25
|
+
createdAt?: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const pendingAutoStartMap = new Map<string, PendingAutoStartEntry>();
|
|
29
|
+
|
|
30
|
+
export function getPendingAutoStart(basePath?: string): PendingAutoStartEntry | null {
|
|
31
|
+
if (basePath) return pendingAutoStartMap.get(basePath) ?? null;
|
|
32
|
+
if (pendingAutoStartMap.size === 1) return pendingAutoStartMap.values().next().value!;
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const _getPendingAutoStart = getPendingAutoStart;
|
|
37
|
+
|
|
38
|
+
export function hasPendingAutoStart(basePath?: string): boolean {
|
|
39
|
+
if (basePath) return pendingAutoStartMap.has(basePath);
|
|
40
|
+
return pendingAutoStartMap.size > 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function setPendingAutoStart(basePath: string, entry: PendingAutoStartInput): void {
|
|
44
|
+
if (!entry.ctx || !entry.pi) {
|
|
45
|
+
throw new Error("setPendingAutoStart requires ctx and pi");
|
|
46
|
+
}
|
|
47
|
+
const ws = createWorkspace(entry.basePath);
|
|
48
|
+
const scope = scopeMilestone(ws, entry.milestoneId);
|
|
49
|
+
pendingAutoStartMap.set(basePath, {
|
|
50
|
+
createdAt: Date.now(),
|
|
51
|
+
planBlockedRecoveryCount: 0,
|
|
52
|
+
...entry,
|
|
53
|
+
scope,
|
|
54
|
+
ctx: entry.ctx,
|
|
55
|
+
pi: entry.pi,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function deletePendingAutoStart(basePath: string): void {
|
|
60
|
+
pendingAutoStartMap.delete(basePath);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function clearPendingAutoStart(basePath?: string): void {
|
|
64
|
+
if (basePath) {
|
|
65
|
+
pendingAutoStartMap.delete(basePath);
|
|
66
|
+
} else {
|
|
67
|
+
pendingAutoStartMap.clear();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function getDiscussionMilestoneId(basePath?: string): string | null {
|
|
72
|
+
if (basePath) {
|
|
73
|
+
return pendingAutoStartMap.get(basePath)?.milestoneId ?? null;
|
|
74
|
+
}
|
|
75
|
+
if (pendingAutoStartMap.size === 1) {
|
|
76
|
+
return pendingAutoStartMap.values().next().value!.milestoneId;
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
@@ -57,7 +57,7 @@ Subagents report only; they do not write user source. Fold any findings into Dec
|
|
|
57
57
|
**Success path** (all verifications passed):
|
|
58
58
|
|
|
59
59
|
10. For each requirement whose status changed in step 9, call `gsd_requirement_update` with the requirement ID and updated `status` and `validation` fields — the tool regenerates `.gsd/REQUIREMENTS.md` automatically. Do this BEFORE completing the milestone so requirement updates are persisted.
|
|
60
|
-
11.
|
|
60
|
+
11. Refresh the project state through `gsd_summary_save` with `artifact_type: "PROJECT"` and the full updated project markdown as `content`; omit `milestone_id`. The tool persists the DB-backed PROJECT artifact and renders `.gsd/PROJECT.md`. Do not write or edit `.gsd/PROJECT.md` directly.
|
|
61
61
|
12. Extract structured learnings from this milestone and persist them to the GSD memory store. Follow the procedure block immediately below — it writes `{{milestoneId}}-LEARNINGS.md` as the audit trail and persists Patterns, Lessons, and Decisions via `capture_thought` (categories: pattern, gotcha/convention, architecture). The memory store is the single source of truth for cross-session durable knowledge (ADR-013).
|
|
62
62
|
|
|
63
63
|
{{extractLearningsSteps}}
|
|
@@ -34,7 +34,7 @@ Use `subagent` only for fresh-context review when useful: reviewer for cross-cut
|
|
|
34
34
|
12. Review the inlined task-summary excerpts for DECISIONS.md and KNOWLEDGE.md-worthy decisions, patterns, and gotchas. Read full `*-SUMMARY.md` files only when an excerpt is absent, truncated, or lacks the specific evidence needed for the slice narrative. Capture significant items with `capture_thought`; do not append knowledge files directly.
|
|
35
35
|
13. When verification passes, call `gsd_slice_complete`. The DB-backed tool is the canonical write path. Do **not** manually write `{{sliceSummaryPath}}`. Do **not** manually write `{{sliceUatPath}}`. Do not edit roadmap checkboxes; the tool renders files and updates projections.
|
|
36
36
|
14. Do not run git commands.
|
|
37
|
-
15.
|
|
37
|
+
15. If the current project state needs refresh, call `gsd_summary_save` with `artifact_type: "PROJECT"` and the full updated project markdown as `content`; omit `milestone_id`. Do not write or edit `.gsd/PROJECT.md` directly.
|
|
38
38
|
|
|
39
39
|
**Autonomous execution:** no human is available. Do not call `ask_user_questions` or `secure_env_collect`; make reasonable assumptions and document them.
|
|
40
40
|
|
|
@@ -106,8 +106,8 @@ Directories use bare IDs. Files use ID-SUFFIX format. Titles live inside content
|
|
|
106
106
|
|
|
107
107
|
In a single pass:
|
|
108
108
|
1. `mkdir -p .gsd/milestones/{{milestoneId}}/slices`
|
|
109
|
-
2.
|
|
110
|
-
3.
|
|
109
|
+
2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full Project template content. The tool persists the DB-backed PROJECT artifact and renders `.gsd/PROJECT.md`. Describe what the project is, its current state, and list the milestone sequence.
|
|
110
|
+
3. Persist requirements with `gsd_requirement_save` or `gsd_requirement_update`, then call `gsd_summary_save` with `artifact_type: "REQUIREMENTS"` so the tool renders `.gsd/REQUIREMENTS.md` from DB rows. Confirm states, ownership, and traceability before roadmap creation.
|
|
111
111
|
|
|
112
112
|
**Depth-Preservation Guidance for context.md:** Preserve the specification's exact terminology, emphasis, and framing. Do not flatten domain-specific language into generics. CONTEXT.md is downstream agents' only window into this spec.
|
|
113
113
|
|
|
@@ -120,8 +120,8 @@ In a single pass:
|
|
|
120
120
|
|
|
121
121
|
Before emitting the ready phrase, verify in the CURRENT turn that you have:
|
|
122
122
|
|
|
123
|
-
- [ ]
|
|
124
|
-
- [ ]
|
|
123
|
+
- [ ] Called `gsd_summary_save` for the PROJECT artifact (step 2)
|
|
124
|
+
- [ ] Persisted requirements and called `gsd_summary_save` for the REQUIREMENTS artifact (step 3)
|
|
125
125
|
- [ ] Written `{{contextPath}}` (step 4)
|
|
126
126
|
- [ ] Called `gsd_plan_milestone` (step 5)
|
|
127
127
|
|
|
@@ -145,8 +145,8 @@ Next steps:
|
|
|
145
145
|
#### Phase 1: Shared artifacts
|
|
146
146
|
|
|
147
147
|
1. For each milestone, call `gsd_milestone_generate_id`; never invent IDs. Then `mkdir -p .gsd/milestones/<ID>/slices`.
|
|
148
|
-
2.
|
|
149
|
-
3.
|
|
148
|
+
2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full Project template content so the tool persists the DB-backed PROJECT artifact and renders `.gsd/PROJECT.md`.
|
|
149
|
+
3. Persist requirements with `gsd_requirement_save` or `gsd_requirement_update`, then call `gsd_summary_save` with `artifact_type: "REQUIREMENTS"` so the tool renders `.gsd/REQUIREMENTS.md` from DB rows. Capture Active, Deferred, Out of Scope, and any already Validated requirements. Later milestones may have provisional ownership where slice plans do not exist yet.
|
|
150
150
|
4. For any architectural or pattern decisions, call `gsd_decision_save` — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically.
|
|
151
151
|
|
|
152
152
|
#### Phase 2: Primary milestone
|
|
@@ -214,8 +214,8 @@ For single-milestone projects, do NOT write this file.
|
|
|
214
214
|
|
|
215
215
|
Before emitting the ready phrase, verify in the CURRENT turn that you have:
|
|
216
216
|
|
|
217
|
-
- [ ]
|
|
218
|
-
- [ ]
|
|
217
|
+
- [ ] Called `gsd_summary_save` for the PROJECT artifact
|
|
218
|
+
- [ ] Persisted requirements and called `gsd_summary_save` for the REQUIREMENTS artifact
|
|
219
219
|
- [ ] Written the primary milestone `CONTEXT.md`
|
|
220
220
|
- [ ] Called `gsd_plan_milestone` for the primary milestone
|
|
221
221
|
- [ ] Written `.gsd/DISCUSSION-MANIFEST.json` with `gates_completed === total`
|
|
@@ -186,7 +186,7 @@ Research is advisory, not auto-binding. Use discussion output to identify table
|
|
|
186
186
|
|
|
187
187
|
## Capability Contract
|
|
188
188
|
|
|
189
|
-
Before writing a roadmap,
|
|
189
|
+
Before writing a roadmap, persist requirements with `gsd_requirement_save` or `gsd_requirement_update`, then render `.gsd/REQUIREMENTS.md` through `gsd_summary_save` with `artifact_type: "REQUIREMENTS"`.
|
|
190
190
|
|
|
191
191
|
Use it as the project's explicit capability contract.
|
|
192
192
|
|
|
@@ -226,8 +226,8 @@ Directories use bare IDs. Files use ID-SUFFIX format. Titles live inside file co
|
|
|
226
226
|
|
|
227
227
|
Once the user is satisfied, in a single pass:
|
|
228
228
|
1. `mkdir -p .gsd/milestones/{{milestoneId}}/slices`
|
|
229
|
-
2.
|
|
230
|
-
3.
|
|
229
|
+
2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full Project template content. The tool persists the DB-backed PROJECT artifact and renders `.gsd/PROJECT.md`. Describe what the project is, its current state, and list the milestone sequence.
|
|
230
|
+
3. Persist requirements with `gsd_requirement_save` or `gsd_requirement_update`, then call `gsd_summary_save` with `artifact_type: "REQUIREMENTS"` so the tool renders `.gsd/REQUIREMENTS.md` from DB rows. Confirm requirement states, ownership, and traceability before roadmap creation.
|
|
231
231
|
**Depth-Preservation Guidance for context.md:**
|
|
232
232
|
When writing context.md, preserve the user's exact terminology, emphasis, and framing. Do not flatten nuance into generic summaries. If the user said "craft feel," write "craft feel," not "high-quality user experience." CONTEXT.md is downstream agents' only window into this conversation.
|
|
233
233
|
|
|
@@ -243,8 +243,8 @@ When writing CONTEXT.md, include discussion-layer sections: **Scope**, **Archite
|
|
|
243
243
|
|
|
244
244
|
Before emitting the ready phrase, verify in the CURRENT turn that you have:
|
|
245
245
|
|
|
246
|
-
- [ ]
|
|
247
|
-
- [ ]
|
|
246
|
+
- [ ] Called `gsd_summary_save` for the PROJECT artifact (step 2)
|
|
247
|
+
- [ ] Persisted requirements and called `gsd_summary_save` for the REQUIREMENTS artifact (step 3)
|
|
248
248
|
- [ ] Written `{{contextPath}}` (step 4)
|
|
249
249
|
- [ ] Called `gsd_plan_milestone` (step 5)
|
|
250
250
|
|
|
@@ -270,8 +270,8 @@ Once the user confirms the milestone split:
|
|
|
270
270
|
#### Phase 1: Shared artifacts
|
|
271
271
|
|
|
272
272
|
1. For each milestone, call `gsd_milestone_generate_id`; never invent IDs. Then `mkdir -p .gsd/milestones/<ID>/slices`.
|
|
273
|
-
2.
|
|
274
|
-
3.
|
|
273
|
+
2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full Project template content so the tool persists the DB-backed PROJECT artifact and renders `.gsd/PROJECT.md`.
|
|
274
|
+
3. Persist requirements with `gsd_requirement_save` or `gsd_requirement_update`, then call `gsd_summary_save` with `artifact_type: "REQUIREMENTS"` so the tool renders `.gsd/REQUIREMENTS.md` from DB rows. Capture Active, Deferred, Out of Scope, and any already Validated requirements. Later milestones may have provisional ownership where slice plans do not exist yet.
|
|
275
275
|
4. For any architectural or pattern decisions made during discussion, call `gsd_decision_save` — the tool auto-assigns IDs and regenerates `.gsd/DECISIONS.md` automatically.
|
|
276
276
|
|
|
277
277
|
#### Phase 2: Primary milestone
|
|
@@ -344,8 +344,8 @@ For single-milestone projects, do NOT write this file.
|
|
|
344
344
|
|
|
345
345
|
Before emitting the ready phrase, verify in the CURRENT turn that you have:
|
|
346
346
|
|
|
347
|
-
- [ ]
|
|
348
|
-
- [ ]
|
|
347
|
+
- [ ] Called `gsd_summary_save` for the PROJECT artifact (Phase 1)
|
|
348
|
+
- [ ] Persisted requirements and called `gsd_summary_save` for the REQUIREMENTS artifact (Phase 1)
|
|
349
349
|
- [ ] Written primary-milestone `CONTEXT.md` (Phase 2)
|
|
350
350
|
- [ ] Called `gsd_plan_milestone` for the primary milestone (Phase 2)
|
|
351
351
|
- [ ] Written `.gsd/DISCUSSION-MANIFEST.json` with `gates_completed === total` (Phase 3)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
**Working directory:** `{{workingDirectory}}`. All file reads, writes, and shell commands MUST operate relative to this directory. Do NOT `cd` elsewhere. For `.gsd` files, use absolute paths rooted at `{{workingDirectory}}`, not `Glob`.
|
|
2
2
|
|
|
3
|
-
Discuss the **project** as a whole: vision, users, anti-goals, constraints, and rough milestone sequence. Ask only real gray areas, then
|
|
3
|
+
Discuss the **project** as a whole: vision, users, anti-goals, constraints, and rough milestone sequence. Ask only real gray areas, then persist the final Project template through `gsd_summary_save` with `artifact_type: "PROJECT"`. The tool renders `.gsd/PROJECT.md`; do not write the projection directly. If a `GSD Skill Preferences` block exists, use it; artifact rules still apply.
|
|
4
4
|
|
|
5
5
|
This runs once before milestone discussion. Later milestones, requirements, and roadmaps depend on it.
|
|
6
6
|
|
|
@@ -34,7 +34,7 @@ After the opening answer, classify project shape as **`simple`** or **`complex`*
|
|
|
34
34
|
|
|
35
35
|
**Default to `complex` when uncertain.** The user can override the verdict in plain text; if they do, accept it and proceed.
|
|
36
36
|
|
|
37
|
-
Persist the verdict
|
|
37
|
+
Persist the verdict through `gsd_summary_save` with `artifact_type: "PROJECT"` into `## Project Shape`; downstream `discuss-requirements`, `discuss-milestone`, and `discuss-slice` read the rendered projection.
|
|
38
38
|
|
|
39
39
|
### Before deeper rounds
|
|
40
40
|
|
|
@@ -95,7 +95,7 @@ If they clarify, absorb the correction and re-verify.
|
|
|
95
95
|
|
|
96
96
|
The depth verification is the only required confirmation gate. Do not add a second "ready to proceed?" gate after it.
|
|
97
97
|
|
|
98
|
-
**CRITICAL — Confirmation gate:** Do not
|
|
98
|
+
**CRITICAL — Confirmation gate:** Do not persist final PROJECT content until the user selects the "(Recommended)" option (structured path) or explicitly confirms (plain-text path). If the user declines, cancels, does not respond, or the tool fails, re-ask.
|
|
99
99
|
|
|
100
100
|
---
|
|
101
101
|
|
|
@@ -104,7 +104,7 @@ The depth verification is the only required confirmation gate. Do not add a seco
|
|
|
104
104
|
Once the user confirms depth:
|
|
105
105
|
|
|
106
106
|
1. Use the **Project** output template (inlined above).
|
|
107
|
-
2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full project markdown as `content`; omit `milestone_id`. The tool
|
|
107
|
+
2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full project markdown as `content`; omit `milestone_id`. The tool persists the DB-backed PROJECT artifact and renders `.gsd/PROJECT.md`. Preserve the user's terms and framing.
|
|
108
108
|
3. The `## Project Shape` section MUST contain `**Complexity:** simple` or `**Complexity:** complex` (matching the verdict you announced) plus a one-line `**Why:**` rationale. Downstream stages read this line.
|
|
109
109
|
4. The `## Capability Contract` section MUST reference `.gsd/REQUIREMENTS.md` — that file does not yet exist; the next stage (`discuss-requirements`) will produce it.
|
|
110
110
|
5. The `## Milestone Sequence` MUST list at least M001 with title and one-liner. Subsequent milestones may be listed as known intents; they will be elaborated in their own discuss-milestone stages.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
**Working directory:** `{{workingDirectory}}`. All file reads, writes, and shell commands MUST operate relative to this directory. Do NOT `cd` elsewhere. For `.gsd` files, use absolute paths rooted at `{{workingDirectory}}`, not `Glob`.
|
|
2
2
|
|
|
3
|
-
Discuss **project-level requirements**. Read `.gsd/PROJECT.md` first; it is
|
|
3
|
+
Discuss **project-level requirements**. Read `.gsd/PROJECT.md` first; it is the rendered project artifact for vision, core value, anti-goals, and milestone sequence. Requirements must trace to it. Ask capability gray areas, then persist requirements with `gsd_requirement_save` and render `.gsd/REQUIREMENTS.md` through `gsd_summary_save` using v2 `R###` format and the **Requirements** template.
|
|
4
4
|
|
|
5
5
|
This runs once after `discuss-project` and before milestone work, creating the capability contract for milestones, slices, and verification.
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ Before your first action, print this banner verbatim in chat:
|
|
|
25
25
|
3. If `.gsd/REQUIREMENTS.md` exists, read it as the working set.
|
|
26
26
|
|
|
27
27
|
**Shape-dependent cadence:**
|
|
28
|
-
- **`simple`**: one fast pass. Extract from PROJECT.md, ask 1-2 plain-text clarifiers only when class/status is ambiguous, then
|
|
28
|
+
- **`simple`**: one fast pass. Extract from PROJECT.md, ask 1-2 plain-text clarifiers only when class/status is ambiguous, then persist requirements through the DB-backed tools.
|
|
29
29
|
- **`complex`**: multi-round questioning with structured 3-4-option questions where alternatives matter.
|
|
30
30
|
|
|
31
31
|
---
|
|
@@ -81,7 +81,7 @@ Before the wrap-up gate, verify: every milestone has an Active requirement; Core
|
|
|
81
81
|
|
|
82
82
|
If they adjust, absorb and re-verify.
|
|
83
83
|
|
|
84
|
-
**CRITICAL — Confirmation gate:** Do not
|
|
84
|
+
**CRITICAL — Confirmation gate:** Do not persist final REQUIREMENTS content until explicit confirmation. Never rationalize past it.
|
|
85
85
|
|
|
86
86
|
---
|
|
87
87
|
|
|
@@ -42,7 +42,7 @@ If slice research is inlined, trust its architectural findings, but verify every
|
|
|
42
42
|
8. Each task needs the exact `gsd_plan_slice.tasks[]` shape: `taskId`, `title`, `description`, `estimate`, `files`, `verify`, `inputs`, `expectedOutput`, and optional `observabilityImpact`. `description` should contain the Why / Do / Done-when narrative. `files`, `inputs`, and `expectedOutput` must be JSON arrays of strings, even when there is only one path (for example, `"inputs": ["src/index.ts"]`, never `"inputs": "src/index.ts"`). Use paths relative to `{{workingDirectory}}`; do not put absolute paths to the original checkout or any directory outside `{{workingDirectory}}` in `files`, `inputs`, `expectedOutput`, or verification commands. **`expectedOutput` must only list files the task actually creates or overwrites on disk.** Do NOT include files the task merely reads, verifies, or tests — those belong only in `inputs`. If a task is a pure verification or test task that produces no new files, `expectedOutput` may be `[]` or limited to test-result artifacts (e.g. a log or assertion output). A file that does not yet exist on disk and is needed as an `input` must be produced by an earlier task's `expectedOutput` — if no prior task creates it, add a task before this one that does.
|
|
43
43
|
9. Persist with `gsd_plan_slice` using `milestoneId`, `sliceId`, `goal`, optional `successCriteria`/`proofLevel`/`integrationClosure`/`observabilityImpact`, and `tasks`. `gsd_plan_slice` handles task persistence transactionally and renders `{{outputPath}}` plus task plans; do not call `gsd_plan_task`. The DB-backed tool is the canonical write path. Do **not** rely on direct `PLAN.md` writes as the source of truth.
|
|
44
44
|
10. Self-audit before finishing: goal/demo closure, requirement coverage, locked decisions, concrete paths, dependency order, wiring, scope size, proof truthfulness, feature completeness, and quality gates. Quality gates: non-trivial slices/tasks include specific Q3-Q7 coverage where applicable.
|
|
45
|
-
11. If planning creates structural decisions,
|
|
45
|
+
11. If planning creates structural decisions, call `gsd_decision_save` for each; the tool persists the decision and regenerates `.gsd/DECISIONS.md`.
|
|
46
46
|
12. {{commitInstruction}}
|
|
47
47
|
|
|
48
48
|
The slice directory already exists. Do not mkdir.
|
|
@@ -114,10 +114,10 @@ Once the user is satisfied, in one pass for **each** new milestone:
|
|
|
114
114
|
|
|
115
115
|
After all milestone directories and context files are written:
|
|
116
116
|
|
|
117
|
-
3.
|
|
118
|
-
4. If
|
|
119
|
-
5. If discussion produced decisions relevant to existing work,
|
|
120
|
-
6.
|
|
117
|
+
3. Refresh project state through `gsd_summary_save` with `artifact_type: "PROJECT"` and full PROJECT content that includes the new milestones in the Milestone Sequence; omit `milestone_id`.
|
|
118
|
+
4. If the queued work introduces new in-scope capabilities or promotes Deferred items, persist those changes with `gsd_requirement_save` or `gsd_requirement_update`, then call `gsd_summary_save` with `artifact_type: "REQUIREMENTS"` so `.gsd/REQUIREMENTS.md` renders from DB rows.
|
|
119
|
+
5. If discussion produced decisions relevant to existing work, call `gsd_decision_save` for each decision; the tool regenerates `.gsd/DECISIONS.md`.
|
|
120
|
+
6. If `.gsd/QUEUE.md` is maintained, update it only as an audit projection of queued intent. Runtime queue state must come from the DB-backed milestone/context tool calls above.
|
|
121
121
|
7. {{commitInstruction}}
|
|
122
122
|
|
|
123
123
|
**Do NOT write roadmaps for queued milestones.**
|
|
@@ -67,7 +67,7 @@ Then:
|
|
|
67
67
|
5. Decompose the slice into tasks that fit one context window each. Every task passed to `gsd_plan_slice` must use the exact keys `taskId`, `title`, `description`, `estimate`, `files`, `verify`, `inputs`, `expectedOutput`, and optional `observabilityImpact`. Put Why / Do / Done-when detail in `description`. `files`, `inputs`, and `expectedOutput` must be JSON arrays of strings, even for one path (for example, `"expectedOutput": ["src/index.ts"]`, never `"expectedOutput": "src/index.ts"`).
|
|
68
68
|
6. **Persist planning state through `gsd_plan_slice`.** Call it with the full payload. The tool writes to the DB and renders `{{outputPath}}` and `{{slicePath}}/tasks/T##-PLAN.md` automatically. Do NOT rely on direct `PLAN.md` writes.
|
|
69
69
|
7. **Self-audit the plan.** If every task were completed exactly as written, the slice goal/demo should be true. Every must-have maps to a task. Inputs and Expected Output are backtick-wrapped file paths.
|
|
70
|
-
8. If refinement produced structural decisions that diverge from the sketch,
|
|
70
|
+
8. If refinement produced structural decisions that diverge from the sketch, call `gsd_decision_save` for each; the tool persists the decision and regenerates `.gsd/DECISIONS.md`.
|
|
71
71
|
9. {{commitInstruction}}
|
|
72
72
|
|
|
73
73
|
The slice directory and tasks/ subdirectory already exist. Do NOT mkdir.
|
|
@@ -23,7 +23,7 @@ An override was issued by the user that changes a fundamental decision or approa
|
|
|
23
23
|
- For DECISIONS.md: append a new decision entry documenting the override and why. Do NOT delete prior decisions — mark them as superseded with a note.
|
|
24
24
|
- For slice plans (S##-PLAN.md): update Goal, Demo, and Verification sections if affected. Update Files Likely Touched if the override changes scope. Do NOT modify completed task entries.
|
|
25
25
|
- For REQUIREMENTS.md: update requirement descriptions if the override changes what "done" means, but do not remove requirements.
|
|
26
|
-
- For PROJECT.md:
|
|
26
|
+
- For PROJECT.md: do not edit the projection directly. If the override changes project-level facts, persist the revised Project content through `gsd_summary_save` with `artifact_type: "PROJECT"` so the DB remains authoritative.
|
|
27
27
|
- Milestone context files are reference only — do not modify them.
|
|
28
28
|
4. Mark all active overrides as resolved: change `**Scope:** active` to `**Scope:** resolved` in `{{overridesPath}}`
|
|
29
29
|
5. Do not commit manually — the system auto-commits your changes after this unit completes.
|
|
@@ -43,6 +43,7 @@ export async function showQueueReorder(
|
|
|
43
43
|
const items = [...pending];
|
|
44
44
|
let cursor = 0;
|
|
45
45
|
let grabbed = false;
|
|
46
|
+
let scrollOffset = 0;
|
|
46
47
|
let cachedLines: string[] | undefined;
|
|
47
48
|
let validation: DependencyValidation;
|
|
48
49
|
|
|
@@ -154,8 +155,10 @@ export async function showQueueReorder(
|
|
|
154
155
|
|
|
155
156
|
const ui = makeUI(theme, width);
|
|
156
157
|
const lines: string[] = [];
|
|
158
|
+
const queueRows: string[] = [];
|
|
157
159
|
const push = (...rows: string[][]) => { for (const r of rows) lines.push(...r); };
|
|
158
160
|
const add = (s: string) => truncateToWidth(s, width);
|
|
161
|
+
let cursorQueueRow = 0;
|
|
159
162
|
|
|
160
163
|
const headerText = grabbed ? " Queue Reorder — Moving Item" : " Queue Reorder";
|
|
161
164
|
push(ui.bar(), ui.blank(), ui.header(headerText), ui.blank());
|
|
@@ -188,11 +191,13 @@ export async function showQueueReorder(
|
|
|
188
191
|
const label = item.title && item.title !== item.id ? `${item.id} ${item.title}` : item.id;
|
|
189
192
|
|
|
190
193
|
if (isCursor && grabbed) {
|
|
191
|
-
|
|
194
|
+
cursorQueueRow = queueRows.length;
|
|
195
|
+
queueRows.push(add(` ${theme.fg("warning", `▸▸ ${num}. ${label}`)}`));
|
|
192
196
|
} else if (isCursor) {
|
|
193
|
-
|
|
197
|
+
cursorQueueRow = queueRows.length;
|
|
198
|
+
queueRows.push(add(` ${theme.fg("accent", `${GLYPH.cursor} ${num}. ${label}`)}`));
|
|
194
199
|
} else {
|
|
195
|
-
|
|
200
|
+
queueRows.push(add(` ${theme.fg("text", `${num}. ${label}`)}`));
|
|
196
201
|
}
|
|
197
202
|
|
|
198
203
|
// depends_on annotations
|
|
@@ -201,36 +206,37 @@ export async function showQueueReorder(
|
|
|
201
206
|
if (completedIds.has(dep)) continue;
|
|
202
207
|
const pairKey = `${item.id}:${dep}`;
|
|
203
208
|
if (violatedPairs.has(pairKey)) {
|
|
204
|
-
|
|
209
|
+
queueRows.push(add(` ${theme.fg("warning", `${GLYPH.statusWarning} depends_on: ${dep} — auto-removed on confirm`)}`));
|
|
205
210
|
} else if (redundantPairs.has(pairKey)) {
|
|
206
|
-
|
|
211
|
+
queueRows.push(add(` ${theme.fg("dim", `↳ depends_on: ${dep} (redundant)`)}`));
|
|
207
212
|
} else {
|
|
208
|
-
|
|
213
|
+
queueRows.push(add(` ${theme.fg("dim", `↳ depends_on: ${dep}`)}`));
|
|
209
214
|
}
|
|
210
215
|
}
|
|
211
216
|
|
|
212
217
|
// Missing deps
|
|
213
218
|
for (const v of validation.violations.filter(v => v.milestone === item.id && v.type === 'missing_dep')) {
|
|
214
|
-
|
|
219
|
+
queueRows.push(add(` ${theme.fg("error", `${GLYPH.statusWarning} depends_on: ${v.dependsOn} (does not exist)`)}`));
|
|
215
220
|
}
|
|
216
221
|
}
|
|
217
222
|
|
|
218
223
|
// Removed deps feedback
|
|
224
|
+
const trailingLines: string[] = [];
|
|
219
225
|
if (removedDeps.length > 0) {
|
|
220
|
-
push(ui.blank());
|
|
226
|
+
trailingLines.push(...ui.blank());
|
|
221
227
|
for (const r of removedDeps) {
|
|
222
|
-
|
|
228
|
+
trailingLines.push(add(` ${theme.fg("success", `${GLYPH.statusDone} Removed: ${r.milestone} depends_on ${r.dep}`)}`));
|
|
223
229
|
}
|
|
224
230
|
}
|
|
225
231
|
|
|
226
232
|
// Circular warning
|
|
227
233
|
const circ = validation.violations.find(v => v.type === 'circular');
|
|
228
234
|
if (circ) {
|
|
229
|
-
push(ui.blank());
|
|
230
|
-
|
|
235
|
+
trailingLines.push(...ui.blank());
|
|
236
|
+
trailingLines.push(add(` ${theme.fg("error", `${GLYPH.statusWarning} ${circ.message}`)}`));
|
|
231
237
|
}
|
|
232
238
|
|
|
233
|
-
push(ui.blank());
|
|
239
|
+
trailingLines.push(...ui.blank());
|
|
234
240
|
|
|
235
241
|
// Hints — context-sensitive based on grab state
|
|
236
242
|
const hints: string[] = [];
|
|
@@ -250,7 +256,19 @@ export async function showQueueReorder(
|
|
|
250
256
|
}
|
|
251
257
|
hints.push("esc");
|
|
252
258
|
|
|
253
|
-
push(ui.hints(hints), ui.bar());
|
|
259
|
+
trailingLines.push(...ui.hints(hints), ...ui.bar());
|
|
260
|
+
|
|
261
|
+
const maxOverlayRows = Math.max(10, process.stdout.rows ? Math.floor(process.stdout.rows * 0.8) : 24);
|
|
262
|
+
const availableQueueRows = Math.max(1, maxOverlayRows - lines.length - trailingLines.length);
|
|
263
|
+
const maxScroll = Math.max(0, queueRows.length - availableQueueRows);
|
|
264
|
+
if (cursorQueueRow < scrollOffset) {
|
|
265
|
+
scrollOffset = cursorQueueRow;
|
|
266
|
+
} else if (cursorQueueRow >= scrollOffset + availableQueueRows) {
|
|
267
|
+
scrollOffset = cursorQueueRow - availableQueueRows + 1;
|
|
268
|
+
}
|
|
269
|
+
scrollOffset = Math.min(Math.max(scrollOffset, 0), maxScroll);
|
|
270
|
+
|
|
271
|
+
lines.push(...queueRows.slice(scrollOffset, scrollOffset + availableQueueRows), ...trailingLines);
|
|
254
272
|
|
|
255
273
|
cachedLines = lines;
|
|
256
274
|
return lines;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// GSD-2 — Smart entry routing decisions.
|
|
2
|
+
// Pure route selection for /gsd guided wizard choices.
|
|
3
|
+
|
|
4
|
+
export type SmartEntryIsolationMode = "worktree" | "branch" | "none";
|
|
5
|
+
|
|
6
|
+
export type ActiveTaskChoice =
|
|
7
|
+
| "execute"
|
|
8
|
+
| "auto"
|
|
9
|
+
| "status"
|
|
10
|
+
| "milestone_actions";
|
|
11
|
+
|
|
12
|
+
export type ActiveTaskRoute =
|
|
13
|
+
| {
|
|
14
|
+
kind: "auto-bootstrap";
|
|
15
|
+
verboseMode: false;
|
|
16
|
+
options?: {
|
|
17
|
+
step?: true;
|
|
18
|
+
milestoneLock?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
| {
|
|
22
|
+
kind: "guided-dispatch";
|
|
23
|
+
unitType: "execute-task";
|
|
24
|
+
}
|
|
25
|
+
| {
|
|
26
|
+
kind: "status";
|
|
27
|
+
}
|
|
28
|
+
| {
|
|
29
|
+
kind: "milestone-actions";
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export function resolveGuidedExecuteLaunchMode(
|
|
33
|
+
isolationMode: SmartEntryIsolationMode,
|
|
34
|
+
): "auto-step" | "guided-dispatch" {
|
|
35
|
+
return isolationMode === "worktree" ? "auto-step" : "guided-dispatch";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function resolveActiveTaskChoiceRoute(input: {
|
|
39
|
+
choice: ActiveTaskChoice;
|
|
40
|
+
isolationMode: SmartEntryIsolationMode;
|
|
41
|
+
milestoneId: string;
|
|
42
|
+
}): ActiveTaskRoute {
|
|
43
|
+
if (input.choice === "auto") {
|
|
44
|
+
return {
|
|
45
|
+
kind: "auto-bootstrap",
|
|
46
|
+
verboseMode: false,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (input.choice === "execute") {
|
|
51
|
+
if (resolveGuidedExecuteLaunchMode(input.isolationMode) === "auto-step") {
|
|
52
|
+
return {
|
|
53
|
+
kind: "auto-bootstrap",
|
|
54
|
+
verboseMode: false,
|
|
55
|
+
options: {
|
|
56
|
+
step: true,
|
|
57
|
+
milestoneLock: input.milestoneId,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
kind: "guided-dispatch",
|
|
64
|
+
unitType: "execute-task",
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (input.choice === "status") {
|
|
69
|
+
return { kind: "status" };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (input.choice === "milestone_actions") {
|
|
73
|
+
return { kind: "milestone-actions" };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
throw new Error(`Invalid ActiveTaskChoice: ${input.choice}`);
|
|
77
|
+
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// Project/App: GSD-2
|
|
2
2
|
// File Purpose: ADR-017 unregistered-milestone drift handler. Detects
|
|
3
3
|
// milestones whose on-disk directory has meaningful content (ROADMAP/
|
|
4
|
-
// CONTEXT/SUMMARY) but no DB row, then
|
|
5
|
-
//
|
|
6
|
-
//
|
|
4
|
+
// CONTEXT/SUMMARY) but no DB row, then fails closed with an explicit recovery
|
|
5
|
+
// instruction. Markdown hierarchy import is reserved for operator-controlled
|
|
6
|
+
// migration/recovery commands, not automatic runtime reconciliation.
|
|
7
7
|
|
|
8
8
|
import { existsSync } from "node:fs";
|
|
9
9
|
|
|
10
10
|
import { getMilestone, isDbAvailable } from "../../gsd-db.js";
|
|
11
|
-
import { migrateHierarchyToDb } from "../../md-importer.js";
|
|
12
11
|
import { findMilestoneIds } from "../../milestone-ids.js";
|
|
13
12
|
import { resolveMilestoneFile } from "../../paths.js";
|
|
14
13
|
import type { GSDState } from "../../types.js";
|
|
@@ -46,20 +45,18 @@ export function detectUnregisteredMilestoneDrift(
|
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
/**
|
|
49
|
-
* Repair
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* Note: even though we receive one record at a time, the importer is a
|
|
54
|
-
* project-wide operation. Repeated invocation across multiple drift records
|
|
55
|
-
* in the same pass is wasteful but safe; a future optimization could
|
|
56
|
-
* coalesce by checking whether the importer has already run this pass.
|
|
48
|
+
* Repair intentionally fails closed. The project-root DB is authoritative at
|
|
49
|
+
* runtime; markdown-only milestones must be imported through an explicit
|
|
50
|
+
* migration/recovery command so operators opt into changing canonical state.
|
|
57
51
|
*/
|
|
58
52
|
export function repairUnregisteredMilestone(
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
record: UnregisteredMilestoneDrift,
|
|
54
|
+
_ctx: DriftContext,
|
|
61
55
|
): void {
|
|
62
|
-
|
|
56
|
+
throw new Error(
|
|
57
|
+
`Milestone ${record.milestoneId} exists only as markdown projection. ` +
|
|
58
|
+
"Runtime reconciliation will not import markdown into the authoritative DB; run explicit GSD recovery/migration if this markdown should repopulate the database.",
|
|
59
|
+
);
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
export const unregisteredMilestoneHandler: DriftHandler<UnregisteredMilestoneDrift> = {
|