gsd-pi 2.44.0-dev.d25d507 → 2.45.0-dev.6b9da3e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/resources/extensions/gsd/activity-log.js +7 -0
- package/dist/resources/extensions/gsd/auto/infra-errors.js +3 -0
- package/dist/resources/extensions/gsd/auto/phases.js +37 -36
- package/dist/resources/extensions/gsd/auto-prompts.js +24 -1
- package/dist/resources/extensions/gsd/auto-start.js +21 -2
- package/dist/resources/extensions/gsd/auto-timers.js +57 -3
- package/dist/resources/extensions/gsd/auto-worktree-sync.js +4 -0
- package/dist/resources/extensions/gsd/auto-worktree.js +9 -6
- package/dist/resources/extensions/gsd/auto.js +30 -3
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +156 -0
- package/dist/resources/extensions/gsd/commands/catalog.js +7 -1
- package/dist/resources/extensions/gsd/commands/handlers/core.js +2 -0
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +10 -0
- package/dist/resources/extensions/gsd/commands-mcp-status.js +187 -0
- package/dist/resources/extensions/gsd/db-writer.js +34 -16
- package/dist/resources/extensions/gsd/doctor.js +8 -0
- package/dist/resources/extensions/gsd/git-service.js +8 -3
- package/dist/resources/extensions/gsd/gsd-db.js +12 -1
- package/dist/resources/extensions/gsd/markdown-renderer.js +1 -1
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +2 -4
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/reassess-roadmap.md +6 -6
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +3 -14
- package/dist/resources/extensions/gsd/prompts/rethink.md +78 -0
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +7 -37
- package/dist/resources/extensions/gsd/provider-error-pause.js +7 -0
- package/dist/resources/extensions/gsd/repo-identity.js +45 -7
- package/dist/resources/extensions/gsd/rethink.js +115 -0
- package/dist/resources/extensions/gsd/state.js +41 -3
- package/dist/resources/extensions/gsd/tools/plan-slice.js +1 -0
- package/dist/resources/extensions/gsd/tools/plan-task.js +1 -0
- package/dist/resources/extensions/gsd/tools/replan-slice.js +2 -0
- package/dist/resources/extensions/gsd/tools/validate-milestone.js +88 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +32 -2
- package/dist/resources/extensions/gsd/worktree-resolver.js +6 -0
- package/dist/resources/extensions/mcp-client/index.js +14 -0
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +18 -18
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +2 -2
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- 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/page.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- 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 +2 -2
- 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 +2 -2
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- 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 +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/page.js +1 -1
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +18 -18
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- 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/dist/web/standalone/.next/static/chunks/4024.11ca5c01938e5948.js +9 -0
- package/dist/web/standalone/.next/static/chunks/{3721.bf31263de6d5fa46.js → 485.243af25f0cdf50d6.js} +2 -2
- package/dist/web/standalone/.next/static/chunks/app/{page-b9367c5ae13b99c6.js → page-6654a8cca61a3d1c.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/webpack-0a4cd455ec4197d2.js +1 -0
- package/dist/web/standalone/.next/static/css/dd4ae3f58ac9b600.css +1 -0
- package/package.json +1 -1
- package/packages/native/dist/stream-process/index.js +2 -2
- package/packages/native/src/__tests__/stream-process.test.mjs +34 -0
- package/packages/native/src/stream-process/index.ts +2 -2
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +3 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +15 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/local-model-check.d.ts +15 -0
- package/packages/pi-coding-agent/dist/core/local-model-check.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/local-model-check.js +41 -0
- package/packages/pi-coding-agent/dist/core/local-model-check.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +20 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +3 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +6 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/main.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/main.js +17 -0
- package/packages/pi-coding-agent/dist/main.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/timestamp.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/timestamp.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/timestamp.test.js +32 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/timestamp.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +3 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +8 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +12 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/timestamp.d.ts +15 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/timestamp.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/timestamp.js +40 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/timestamp.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +4 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts +5 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +13 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +17 -8
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +7 -3
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/auth-storage.ts +15 -1
- package/packages/pi-coding-agent/src/core/local-model-check.ts +45 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +21 -1
- package/packages/pi-coding-agent/src/core/settings-manager.ts +9 -0
- package/packages/pi-coding-agent/src/main.ts +19 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/timestamp.test.ts +38 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +10 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +15 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/timestamp.ts +48 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +3 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +18 -3
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +16 -7
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +8 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/gsd/activity-log.ts +1 -0
- package/src/resources/extensions/gsd/auto/infra-errors.ts +3 -0
- package/src/resources/extensions/gsd/auto/phases.ts +46 -48
- package/src/resources/extensions/gsd/auto-prompts.ts +24 -1
- package/src/resources/extensions/gsd/auto-start.ts +25 -2
- package/src/resources/extensions/gsd/auto-timers.ts +64 -3
- package/src/resources/extensions/gsd/auto-worktree-sync.ts +5 -0
- package/src/resources/extensions/gsd/auto-worktree.ts +9 -6
- package/src/resources/extensions/gsd/auto.ts +37 -3
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +148 -0
- package/src/resources/extensions/gsd/commands/catalog.ts +7 -1
- package/src/resources/extensions/gsd/commands/handlers/core.ts +2 -0
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +10 -0
- package/src/resources/extensions/gsd/commands-mcp-status.ts +247 -0
- package/src/resources/extensions/gsd/db-writer.ts +39 -17
- package/src/resources/extensions/gsd/doctor.ts +7 -1
- package/src/resources/extensions/gsd/git-service.ts +6 -2
- package/src/resources/extensions/gsd/gsd-db.ts +16 -1
- package/src/resources/extensions/gsd/markdown-renderer.ts +1 -1
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +2 -4
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/reassess-roadmap.md +6 -6
- package/src/resources/extensions/gsd/prompts/replan-slice.md +3 -14
- package/src/resources/extensions/gsd/prompts/rethink.md +78 -0
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +7 -37
- package/src/resources/extensions/gsd/provider-error-pause.ts +9 -0
- package/src/resources/extensions/gsd/repo-identity.ts +46 -7
- package/src/resources/extensions/gsd/rethink.ts +154 -0
- package/src/resources/extensions/gsd/state.ts +41 -1
- package/src/resources/extensions/gsd/tests/auto-pr-bugs.test.ts +88 -0
- package/src/resources/extensions/gsd/tests/completed-units-metrics-sync.test.ts +114 -0
- package/src/resources/extensions/gsd/tests/db-writer.test.ts +79 -0
- package/src/resources/extensions/gsd/tests/derive-state-db-disk-reconcile.test.ts +121 -0
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +60 -0
- package/src/resources/extensions/gsd/tests/est-annotation-timeout.test.ts +120 -0
- package/src/resources/extensions/gsd/tests/infra-error.test.ts +20 -2
- package/src/resources/extensions/gsd/tests/inherited-repo-home-dir.test.ts +121 -0
- package/src/resources/extensions/gsd/tests/mcp-status.test.ts +103 -0
- package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +11 -7
- package/src/resources/extensions/gsd/tests/recovery-attempts-reset.test.ts +176 -0
- package/src/resources/extensions/gsd/tests/stop-auto-merge-back.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/survivor-branch-complete.test.ts +108 -0
- package/src/resources/extensions/gsd/tests/terminated-transient.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/tool-naming.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/worktree-submodule-safety.test.ts +65 -0
- package/src/resources/extensions/gsd/tools/plan-slice.ts +2 -0
- package/src/resources/extensions/gsd/tools/plan-task.ts +2 -0
- package/src/resources/extensions/gsd/tools/replan-slice.ts +3 -0
- package/src/resources/extensions/gsd/tools/validate-milestone.ts +127 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +43 -2
- package/src/resources/extensions/gsd/worktree-resolver.ts +7 -0
- package/src/resources/extensions/mcp-client/index.ts +20 -0
- package/dist/web/standalone/.next/static/chunks/4024.0de81b543b28b9fe.js +0 -9
- package/dist/web/standalone/.next/static/chunks/webpack-9014b5adb127a98a.js +0 -1
- package/dist/web/standalone/.next/static/css/8a727f372cf53002.css +0 -1
- /package/dist/web/standalone/.next/static/{tokoGmfkYfWf1_Yl_Gz7i → rzO54ZboyINyEt7cVM_uS}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{tokoGmfkYfWf1_Yl_Gz7i → rzO54ZboyINyEt7cVM_uS}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Status — `/gsd mcp` command handler.
|
|
3
|
+
*
|
|
4
|
+
* Shows configured MCP servers, their connection status, and available tools.
|
|
5
|
+
*
|
|
6
|
+
* Subcommands:
|
|
7
|
+
* /gsd mcp — Overview of all servers (alias: /gsd mcp status)
|
|
8
|
+
* /gsd mcp status — Same as bare /gsd mcp
|
|
9
|
+
* /gsd mcp check <srv> — Detailed status for a specific server
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type { ExtensionCommandContext } from "@gsd/pi-coding-agent";
|
|
13
|
+
|
|
14
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
15
|
+
import { join } from "node:path";
|
|
16
|
+
|
|
17
|
+
// ─── Types ──────────────────────────────────────────────────────────────────
|
|
18
|
+
|
|
19
|
+
export interface McpServerStatus {
|
|
20
|
+
name: string;
|
|
21
|
+
transport: "stdio" | "http" | "unknown";
|
|
22
|
+
connected: boolean;
|
|
23
|
+
toolCount: number;
|
|
24
|
+
error: string | undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface McpServerDetail extends McpServerStatus {
|
|
28
|
+
tools: string[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// ─── Config reader (standalone — does not import mcp-client internals) ──────
|
|
32
|
+
|
|
33
|
+
interface McpServerRawConfig {
|
|
34
|
+
name: string;
|
|
35
|
+
transport: "stdio" | "http" | "unknown";
|
|
36
|
+
command?: string;
|
|
37
|
+
args?: string[];
|
|
38
|
+
url?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function readMcpConfigs(): McpServerRawConfig[] {
|
|
42
|
+
const servers: McpServerRawConfig[] = [];
|
|
43
|
+
const seen = new Set<string>();
|
|
44
|
+
const configPaths = [
|
|
45
|
+
join(process.cwd(), ".mcp.json"),
|
|
46
|
+
join(process.cwd(), ".gsd", "mcp.json"),
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
for (const configPath of configPaths) {
|
|
50
|
+
try {
|
|
51
|
+
if (!existsSync(configPath)) continue;
|
|
52
|
+
const raw = readFileSync(configPath, "utf-8");
|
|
53
|
+
const data = JSON.parse(raw) as Record<string, unknown>;
|
|
54
|
+
const mcpServers = (data.mcpServers ?? data.servers) as
|
|
55
|
+
| Record<string, Record<string, unknown>>
|
|
56
|
+
| undefined;
|
|
57
|
+
if (!mcpServers || typeof mcpServers !== "object") continue;
|
|
58
|
+
|
|
59
|
+
for (const [name, config] of Object.entries(mcpServers)) {
|
|
60
|
+
if (seen.has(name)) continue;
|
|
61
|
+
seen.add(name);
|
|
62
|
+
|
|
63
|
+
const hasCommand = typeof config.command === "string";
|
|
64
|
+
const hasUrl = typeof config.url === "string";
|
|
65
|
+
const transport: McpServerRawConfig["transport"] = hasCommand
|
|
66
|
+
? "stdio"
|
|
67
|
+
: hasUrl
|
|
68
|
+
? "http"
|
|
69
|
+
: "unknown";
|
|
70
|
+
|
|
71
|
+
servers.push({
|
|
72
|
+
name,
|
|
73
|
+
transport,
|
|
74
|
+
...(hasCommand && {
|
|
75
|
+
command: config.command as string,
|
|
76
|
+
args: Array.isArray(config.args) ? (config.args as string[]) : undefined,
|
|
77
|
+
}),
|
|
78
|
+
...(hasUrl && { url: config.url as string }),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
} catch {
|
|
82
|
+
// Non-fatal — config file may not exist or be malformed
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return servers;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ─── Formatters (exported for testing) ──────────────────────────────────────
|
|
90
|
+
|
|
91
|
+
export function formatMcpStatusReport(servers: McpServerStatus[]): string {
|
|
92
|
+
if (servers.length === 0) {
|
|
93
|
+
return [
|
|
94
|
+
"No MCP servers configured.",
|
|
95
|
+
"",
|
|
96
|
+
"Add servers to .mcp.json or .gsd/mcp.json to enable MCP integrations.",
|
|
97
|
+
"See: https://modelcontextprotocol.io/quickstart",
|
|
98
|
+
].join("\n");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const lines: string[] = [`MCP Server Status — ${servers.length} server(s)\n`];
|
|
102
|
+
|
|
103
|
+
for (const s of servers) {
|
|
104
|
+
const icon = s.error ? "✗" : s.connected ? "✓" : "○";
|
|
105
|
+
const status = s.error
|
|
106
|
+
? `error: ${s.error}`
|
|
107
|
+
: s.connected
|
|
108
|
+
? `connected — ${s.toolCount} tools`
|
|
109
|
+
: "disconnected";
|
|
110
|
+
lines.push(` ${icon} ${s.name} (${s.transport}) — ${status}`);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
lines.push("");
|
|
114
|
+
lines.push("Use /gsd mcp check <server> for details on a specific server.");
|
|
115
|
+
lines.push("Use mcp_discover to connect and list tools for a server.");
|
|
116
|
+
|
|
117
|
+
return lines.join("\n");
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function formatMcpServerDetail(server: McpServerDetail): string {
|
|
121
|
+
const lines: string[] = [`MCP Server: ${server.name}\n`];
|
|
122
|
+
|
|
123
|
+
lines.push(` Transport: ${server.transport}`);
|
|
124
|
+
|
|
125
|
+
if (server.error) {
|
|
126
|
+
lines.push(` Status: error`);
|
|
127
|
+
lines.push(` Error: ${server.error}`);
|
|
128
|
+
} else if (server.connected) {
|
|
129
|
+
lines.push(` Status: connected`);
|
|
130
|
+
lines.push(` Tools: ${server.toolCount}`);
|
|
131
|
+
if (server.tools.length > 0) {
|
|
132
|
+
lines.push("");
|
|
133
|
+
lines.push(" Available tools:");
|
|
134
|
+
for (const tool of server.tools) {
|
|
135
|
+
lines.push(` - ${tool}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
lines.push(` Status: disconnected`);
|
|
140
|
+
lines.push("");
|
|
141
|
+
lines.push(` Run mcp_discover("${server.name}") to connect and list tools.`);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return lines.join("\n");
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// ─── Command handler ────────────────────────────────────────────────────────
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Handle `/gsd mcp [status|check <server>]`.
|
|
151
|
+
*/
|
|
152
|
+
export async function handleMcpStatus(
|
|
153
|
+
args: string,
|
|
154
|
+
ctx: ExtensionCommandContext,
|
|
155
|
+
): Promise<void> {
|
|
156
|
+
const trimmed = args.trim().toLowerCase();
|
|
157
|
+
const configs = readMcpConfigs();
|
|
158
|
+
|
|
159
|
+
// /gsd mcp check <server>
|
|
160
|
+
if (trimmed.startsWith("check ")) {
|
|
161
|
+
const serverName = args.trim().slice("check ".length).trim();
|
|
162
|
+
const config = configs.find((c) => c.name === serverName);
|
|
163
|
+
if (!config) {
|
|
164
|
+
const available = configs.map((c) => c.name).join(", ") || "(none)";
|
|
165
|
+
ctx.ui.notify(
|
|
166
|
+
`Unknown MCP server: "${serverName}"\n\nAvailable: ${available}`,
|
|
167
|
+
"warning",
|
|
168
|
+
);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Try to get connection/tool info from the mcp-client module if available
|
|
173
|
+
let connected = false;
|
|
174
|
+
let toolNames: string[] = [];
|
|
175
|
+
let error: string | undefined;
|
|
176
|
+
try {
|
|
177
|
+
const mcpClient = await import("../mcp-client/index.js");
|
|
178
|
+
// Access the module's connection state if exported; fall back gracefully
|
|
179
|
+
const mod = mcpClient as Record<string, unknown>;
|
|
180
|
+
if (typeof mod.getConnectionStatus === "function") {
|
|
181
|
+
const status = (mod.getConnectionStatus as (name: string) => { connected: boolean; tools: string[]; error?: string })(serverName);
|
|
182
|
+
connected = status.connected;
|
|
183
|
+
toolNames = status.tools;
|
|
184
|
+
error = status.error;
|
|
185
|
+
}
|
|
186
|
+
} catch {
|
|
187
|
+
// mcp-client may not expose status helpers — that's fine
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
ctx.ui.notify(
|
|
191
|
+
formatMcpServerDetail({
|
|
192
|
+
name: config.name,
|
|
193
|
+
transport: config.transport,
|
|
194
|
+
connected,
|
|
195
|
+
toolCount: toolNames.length,
|
|
196
|
+
tools: toolNames,
|
|
197
|
+
error,
|
|
198
|
+
}),
|
|
199
|
+
"info",
|
|
200
|
+
);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// /gsd mcp or /gsd mcp status
|
|
205
|
+
if (!trimmed || trimmed === "status") {
|
|
206
|
+
// Build status for each server
|
|
207
|
+
const statuses: McpServerStatus[] = [];
|
|
208
|
+
|
|
209
|
+
for (const config of configs) {
|
|
210
|
+
let connected = false;
|
|
211
|
+
let toolCount = 0;
|
|
212
|
+
let error: string | undefined;
|
|
213
|
+
|
|
214
|
+
try {
|
|
215
|
+
const mcpClient = await import("../mcp-client/index.js");
|
|
216
|
+
const mod = mcpClient as Record<string, unknown>;
|
|
217
|
+
if (typeof mod.getConnectionStatus === "function") {
|
|
218
|
+
const status = (mod.getConnectionStatus as (name: string) => { connected: boolean; tools: string[]; error?: string })(config.name);
|
|
219
|
+
connected = status.connected;
|
|
220
|
+
toolCount = status.tools.length;
|
|
221
|
+
error = status.error;
|
|
222
|
+
}
|
|
223
|
+
} catch {
|
|
224
|
+
// Fall back to unknown state
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
statuses.push({
|
|
228
|
+
name: config.name,
|
|
229
|
+
transport: config.transport,
|
|
230
|
+
connected,
|
|
231
|
+
toolCount,
|
|
232
|
+
error,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
ctx.ui.notify(formatMcpStatusReport(statuses), "info");
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Unknown subcommand
|
|
241
|
+
ctx.ui.notify(
|
|
242
|
+
"Usage: /gsd mcp [status|check <server>]\n\n" +
|
|
243
|
+
" status Show all MCP server statuses (default)\n" +
|
|
244
|
+
" check <server> Detailed status for a specific server",
|
|
245
|
+
"warning",
|
|
246
|
+
);
|
|
247
|
+
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// parseDecisionsTable() and parseRequirementsSections() with field fidelity.
|
|
10
10
|
|
|
11
11
|
import { join, resolve } from 'node:path';
|
|
12
|
-
import { readFileSync, existsSync } from 'node:fs';
|
|
12
|
+
import { readFileSync, existsSync, statSync } from 'node:fs';
|
|
13
13
|
import type { Decision, Requirement } from './types.js';
|
|
14
14
|
import { resolveGsdRootFile } from './paths.js';
|
|
15
15
|
import { saveFile } from './files.js';
|
|
@@ -428,30 +428,52 @@ export async function saveArtifactToDb(
|
|
|
428
428
|
try {
|
|
429
429
|
const db = await import('./gsd-db.js');
|
|
430
430
|
|
|
431
|
+
// Guard against path traversal before any reads/writes
|
|
432
|
+
const gsdDir = resolve(basePath, '.gsd');
|
|
433
|
+
const fullPath = resolve(basePath, '.gsd', opts.path);
|
|
434
|
+
if (!fullPath.startsWith(gsdDir)) {
|
|
435
|
+
throw new GSDError(GSD_IO_ERROR, `saveArtifactToDb: path escapes .gsd/ directory: ${opts.path}`);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// Shrinkage guard: if the file already exists and the new content is
|
|
439
|
+
// significantly smaller (<50%), preserve the richer file on disk and
|
|
440
|
+
// store its content in the DB instead of the abbreviated version.
|
|
441
|
+
let dbContent = opts.content;
|
|
442
|
+
let skipDiskWrite = false;
|
|
443
|
+
if (existsSync(fullPath)) {
|
|
444
|
+
const existingSize = statSync(fullPath).size;
|
|
445
|
+
const newSize = Buffer.byteLength(opts.content, 'utf-8');
|
|
446
|
+
if (existingSize > 0 && newSize < existingSize * 0.5) {
|
|
447
|
+
process.stderr.write(
|
|
448
|
+
`gsd-db: saveArtifactToDb — new content (${newSize}B) is <50% of existing file ` +
|
|
449
|
+
`(${existingSize}B) at ${opts.path}. Preserving disk file to prevent data loss.\n`,
|
|
450
|
+
);
|
|
451
|
+
dbContent = readFileSync(fullPath, 'utf-8');
|
|
452
|
+
skipDiskWrite = true;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
431
456
|
db.insertArtifact({
|
|
432
457
|
path: opts.path,
|
|
433
458
|
artifact_type: opts.artifact_type,
|
|
434
459
|
milestone_id: opts.milestone_id ?? null,
|
|
435
460
|
slice_id: opts.slice_id ?? null,
|
|
436
461
|
task_id: opts.task_id ?? null,
|
|
437
|
-
full_content:
|
|
462
|
+
full_content: dbContent,
|
|
438
463
|
});
|
|
439
464
|
|
|
440
|
-
// Write the file to disk (
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
const rollbackAdapter = db._getAdapter();
|
|
453
|
-
rollbackAdapter?.prepare('DELETE FROM artifacts WHERE path = :path').run({ ':path': opts.path });
|
|
454
|
-
throw diskErr;
|
|
465
|
+
// Write the file to disk (only if we're not preserving a richer existing file)
|
|
466
|
+
if (!skipDiskWrite) {
|
|
467
|
+
try {
|
|
468
|
+
await saveFile(fullPath, opts.content);
|
|
469
|
+
} catch (diskErr) {
|
|
470
|
+
process.stderr.write(
|
|
471
|
+
`gsd-db: saveArtifactToDb — disk write failed, rolling back DB row: ${(diskErr as Error).message}\n`,
|
|
472
|
+
);
|
|
473
|
+
const rollbackAdapter = db._getAdapter();
|
|
474
|
+
rollbackAdapter?.prepare('DELETE FROM artifacts WHERE path = :path').run({ ':path': opts.path });
|
|
475
|
+
throw diskErr;
|
|
476
|
+
}
|
|
455
477
|
}
|
|
456
478
|
// Invalidate file-read caches so deriveState() sees the updated markdown.
|
|
457
479
|
// Do NOT clear the artifacts table — we just wrote to it intentionally.
|
|
@@ -470,7 +470,7 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
|
|
|
470
470
|
if (!roadmapContent) continue;
|
|
471
471
|
|
|
472
472
|
// Normalize slices: prefer DB, fall back to parser
|
|
473
|
-
type NormSlice = RoadmapSliceEntry;
|
|
473
|
+
type NormSlice = RoadmapSliceEntry & { pending?: boolean };
|
|
474
474
|
let slices: NormSlice[];
|
|
475
475
|
if (isDbAvailable()) {
|
|
476
476
|
const dbSlices = getMilestoneSlices(milestoneId);
|
|
@@ -478,6 +478,7 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
|
|
|
478
478
|
id: s.id,
|
|
479
479
|
title: s.title,
|
|
480
480
|
done: s.status === "complete",
|
|
481
|
+
pending: s.status === "pending",
|
|
481
482
|
risk: (s.risk || "medium") as RoadmapSliceEntry["risk"],
|
|
482
483
|
depends: s.depends,
|
|
483
484
|
demo: s.demo,
|
|
@@ -564,6 +565,9 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
|
|
|
564
565
|
|
|
565
566
|
const slicePath = resolveSlicePath(basePath, milestoneId, slice.id);
|
|
566
567
|
if (!slicePath) {
|
|
568
|
+
// Pending slices haven't been planned yet — directories are created
|
|
569
|
+
// lazily by ensurePreconditions() at dispatch time. Skip them.
|
|
570
|
+
if (slice.pending) continue;
|
|
567
571
|
const expectedPath = relSlicePath(basePath, milestoneId, slice.id);
|
|
568
572
|
issues.push({
|
|
569
573
|
severity: slice.done ? "warning" : "error",
|
|
@@ -586,6 +590,8 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
|
|
|
586
590
|
|
|
587
591
|
const tasksDir = resolveTasksDir(basePath, milestoneId, slice.id);
|
|
588
592
|
if (!tasksDir) {
|
|
593
|
+
// Pending slices haven't been planned yet — tasks/ is created on demand.
|
|
594
|
+
if (slice.pending) continue;
|
|
589
595
|
issues.push({
|
|
590
596
|
severity: slice.done ? "warning" : "error",
|
|
591
597
|
code: "missing_tasks_dir",
|
|
@@ -684,13 +684,17 @@ export function createDraftPR(
|
|
|
684
684
|
milestoneId: string,
|
|
685
685
|
title: string,
|
|
686
686
|
body: string,
|
|
687
|
+
opts?: { head?: string; base?: string },
|
|
687
688
|
): string | null {
|
|
688
689
|
try {
|
|
689
|
-
const
|
|
690
|
+
const args = [
|
|
690
691
|
"pr", "create", "--draft",
|
|
691
692
|
"--title", title,
|
|
692
693
|
"--body", body,
|
|
693
|
-
]
|
|
694
|
+
];
|
|
695
|
+
if (opts?.head) args.push("--head", opts.head);
|
|
696
|
+
if (opts?.base) args.push("--base", opts.base);
|
|
697
|
+
const result = execFileSync("gh", args, { cwd: basePath, encoding: "utf8", timeout: 30000, env: GIT_NO_PROMPT_ENV });
|
|
694
698
|
return result.trim();
|
|
695
699
|
} catch {
|
|
696
700
|
return null;
|
|
@@ -301,6 +301,7 @@ function initSchema(db: DbAdapter, fileBacked: boolean): void {
|
|
|
301
301
|
inputs TEXT NOT NULL DEFAULT '[]',
|
|
302
302
|
expected_output TEXT NOT NULL DEFAULT '[]',
|
|
303
303
|
observability_impact TEXT NOT NULL DEFAULT '',
|
|
304
|
+
full_plan_md TEXT NOT NULL DEFAULT '',
|
|
304
305
|
sequence INTEGER DEFAULT 0, -- DEAD CODE: no tool exposes sequence — always 0
|
|
305
306
|
PRIMARY KEY (milestone_id, slice_id, id),
|
|
306
307
|
FOREIGN KEY (milestone_id, slice_id) REFERENCES slices(milestone_id, id)
|
|
@@ -616,6 +617,15 @@ function migrateSchema(db: DbAdapter): void {
|
|
|
616
617
|
});
|
|
617
618
|
}
|
|
618
619
|
|
|
620
|
+
if (currentVersion < 11) {
|
|
621
|
+
ensureColumn(db, "tasks", "full_plan_md", `ALTER TABLE tasks ADD COLUMN full_plan_md TEXT NOT NULL DEFAULT ''`);
|
|
622
|
+
|
|
623
|
+
db.prepare("INSERT INTO schema_version (version, applied_at) VALUES (:version, :applied_at)").run({
|
|
624
|
+
":version": 11,
|
|
625
|
+
":applied_at": new Date().toISOString(),
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
|
|
619
629
|
db.exec("COMMIT");
|
|
620
630
|
} catch (err) {
|
|
621
631
|
db.exec("ROLLBACK");
|
|
@@ -923,6 +933,7 @@ export interface TaskPlanningRecord {
|
|
|
923
933
|
inputs: string[];
|
|
924
934
|
expectedOutput: string[];
|
|
925
935
|
observabilityImpact: string;
|
|
936
|
+
fullPlanMd?: string;
|
|
926
937
|
}
|
|
927
938
|
|
|
928
939
|
export function insertMilestone(m: {
|
|
@@ -1163,7 +1174,8 @@ export function upsertTaskPlanning(milestoneId: string, sliceId: string, taskId:
|
|
|
1163
1174
|
verify = COALESCE(:verify, verify),
|
|
1164
1175
|
inputs = COALESCE(:inputs, inputs),
|
|
1165
1176
|
expected_output = COALESCE(:expected_output, expected_output),
|
|
1166
|
-
observability_impact = COALESCE(:observability_impact, observability_impact)
|
|
1177
|
+
observability_impact = COALESCE(:observability_impact, observability_impact),
|
|
1178
|
+
full_plan_md = COALESCE(:full_plan_md, full_plan_md)
|
|
1167
1179
|
WHERE milestone_id = :milestone_id AND slice_id = :slice_id AND id = :id`,
|
|
1168
1180
|
).run({
|
|
1169
1181
|
":milestone_id": milestoneId,
|
|
@@ -1177,6 +1189,7 @@ export function upsertTaskPlanning(milestoneId: string, sliceId: string, taskId:
|
|
|
1177
1189
|
":inputs": planning.inputs ? JSON.stringify(planning.inputs) : null,
|
|
1178
1190
|
":expected_output": planning.expectedOutput ? JSON.stringify(planning.expectedOutput) : null,
|
|
1179
1191
|
":observability_impact": planning.observabilityImpact ?? null,
|
|
1192
|
+
":full_plan_md": planning.fullPlanMd ?? null,
|
|
1180
1193
|
});
|
|
1181
1194
|
}
|
|
1182
1195
|
|
|
@@ -1268,6 +1281,7 @@ export interface TaskRow {
|
|
|
1268
1281
|
inputs: string[];
|
|
1269
1282
|
expected_output: string[];
|
|
1270
1283
|
observability_impact: string;
|
|
1284
|
+
full_plan_md: string;
|
|
1271
1285
|
sequence: number;
|
|
1272
1286
|
}
|
|
1273
1287
|
|
|
@@ -1296,6 +1310,7 @@ function rowToTask(row: Record<string, unknown>): TaskRow {
|
|
|
1296
1310
|
inputs: JSON.parse((row["inputs"] as string) || "[]"),
|
|
1297
1311
|
expected_output: JSON.parse((row["expected_output"] as string) || "[]"),
|
|
1298
1312
|
observability_impact: (row["observability_impact"] as string) ?? "",
|
|
1313
|
+
full_plan_md: (row["full_plan_md"] as string) ?? "",
|
|
1299
1314
|
sequence: (row["sequence"] as number) ?? 0,
|
|
1300
1315
|
};
|
|
1301
1316
|
}
|
|
@@ -387,7 +387,7 @@ export async function renderTaskPlanFromDb(
|
|
|
387
387
|
mkdirSync(tasksDir, { recursive: true });
|
|
388
388
|
const absPath = join(tasksDir, buildTaskFileName(taskId, "PLAN"));
|
|
389
389
|
const artifactPath = toArtifactPath(absPath, basePath);
|
|
390
|
-
const content = renderTaskPlanMarkdown(task);
|
|
390
|
+
const content = task.full_plan_md.trim() ? task.full_plan_md : renderTaskPlanMarkdown(task);
|
|
391
391
|
|
|
392
392
|
await writeAndStore(absPath, artifactPath, content, {
|
|
393
393
|
artifact_type: "PLAN",
|
|
@@ -21,8 +21,8 @@ Then:
|
|
|
21
21
|
4. Verify each **success criterion** from the milestone definition in `{{roadmapPath}}`. For each criterion, confirm it was met with specific evidence from slice summaries, test results, or observable behavior. List any criterion that was NOT met.
|
|
22
22
|
5. Verify the milestone's **definition of done** — all slices are `[x]`, all slice summaries exist, and any cross-slice integration points work correctly.
|
|
23
23
|
6. Validate **requirement status transitions**. For each requirement that changed status during this milestone, confirm the transition is supported by evidence. Requirements can move between Active, Validated, Deferred, Blocked, or Out of Scope — but only with proof.
|
|
24
|
-
7.
|
|
25
|
-
8. Update `.gsd/REQUIREMENTS.md` if any requirement status transitions were validated in step
|
|
24
|
+
7. **Persist completion through `gsd_complete_milestone`.** Call it with: `milestoneId`, `title`, `oneLiner`, `narrative`, `successCriteriaResults`, `definitionOfDoneResults`, `requirementOutcomes`, `keyDecisions`, `keyFiles`, `lessonsLearned`, `followUps`, `deviations`. The tool updates the milestone status in the DB, renders `{{milestoneSummaryPath}}`, and validates all slices are complete before proceeding.
|
|
25
|
+
8. Update `.gsd/REQUIREMENTS.md` if any requirement status transitions were validated in step 6.
|
|
26
26
|
9. Update `.gsd/PROJECT.md` to reflect milestone completion and current project state.
|
|
27
27
|
10. Review all slice summaries for cross-cutting lessons, patterns, or gotchas that emerged during this milestone. Append any non-obvious, reusable insights to `.gsd/KNOWLEDGE.md`.
|
|
28
28
|
11. Do not commit manually — the system auto-commits your changes after this unit completes.
|
|
@@ -31,6 +31,4 @@ Then:
|
|
|
31
31
|
|
|
32
32
|
**File system safety:** When scanning milestone directories for evidence, use `ls` or `find` to list directory contents first — never pass a directory path (e.g. `tasks/`, `slices/`) directly to the `read` tool. The `read` tool only accepts file paths, not directories.
|
|
33
33
|
|
|
34
|
-
**You MUST write `{{milestoneSummaryPath}}` AND update PROJECT.md before finishing.**
|
|
35
|
-
|
|
36
34
|
When done, say: "Milestone {{milestoneId}} complete."
|
|
@@ -63,7 +63,7 @@ Then:
|
|
|
63
63
|
- a matching task plan file with description, steps, must-haves, verification, inputs, and expected output
|
|
64
64
|
- **Inputs and Expected Output must list concrete backtick-wrapped file paths** (e.g. `` `src/types.ts` ``). These are machine-parsed to derive task dependencies — vague prose without paths breaks parallel execution. Every task must have at least one output file path.
|
|
65
65
|
- Observability Impact section **only if the task touches runtime boundaries, async flows, or error paths** — omit it otherwise
|
|
66
|
-
6. **Persist planning state through
|
|
66
|
+
6. **Persist planning state through `gsd_plan_slice`.** Call it with the full slice planning payload (goal, demo, must-haves, verification, tasks, and metadata). The tool inserts all tasks in the same transaction, writes to the DB, and renders `{{outputPath}}` and `{{slicePath}}/tasks/T##-PLAN.md` files automatically. Do **not** call `gsd_plan_task` separately — `gsd_plan_slice` handles task persistence. Do **not** rely on direct `PLAN.md` writes as the source of truth; the DB-backed tool is the canonical write path for slice and task planning state.
|
|
67
67
|
7. **Self-audit the plan.** Walk through each check — if any fail, fix the plan files before moving on:
|
|
68
68
|
- **Completion semantics:** If every task were completed exactly as written, the slice goal/demo should actually be true.
|
|
69
69
|
- **Requirement coverage:** Every must-have in the slice maps to at least one task. No must-have is orphaned. If `REQUIREMENTS.md` exists, every Active requirement this slice owns maps to at least one task.
|
|
@@ -50,14 +50,14 @@ If all criteria have at least one remaining owning slice, the coverage check pas
|
|
|
50
50
|
|
|
51
51
|
**If the roadmap is still good:**
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Use `gsd_reassess_roadmap` with `verdict: "roadmap-confirmed"`, an empty `sliceChanges` object, and the assessment text — the tool writes the assessment to the DB and renders `{{assessmentPath}}`. If requirements exist, explicitly note whether requirement coverage remains sound.
|
|
54
54
|
|
|
55
55
|
**If changes are needed:**
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
**Persist changes through `gsd_reassess_roadmap`.** Pass: `milestoneId`, `completedSliceId`, `verdict` (e.g. "roadmap-adjusted"), `assessment` (text explaining the decision), and `sliceChanges` with `modified` (array of sliceId, title, risk, depends, demo), `added` (same shape), `removed` (array of slice ID strings). The tool structurally enforces preservation of completed slices, writes the assessment to the DB, re-renders `{{roadmapPath}}`, and renders `{{assessmentPath}}`.
|
|
58
|
+
|
|
59
|
+
If `.gsd/REQUIREMENTS.md` exists and requirement ownership or status changed, update it.
|
|
60
|
+
|
|
61
|
+
{{commitInstruction}}
|
|
62
62
|
|
|
63
63
|
When done, say: "Roadmap reassessed."
|
|
@@ -32,19 +32,8 @@ Consider these captures when rewriting the remaining tasks — they represent th
|
|
|
32
32
|
|
|
33
33
|
1. Read the blocker task summary carefully. Understand exactly what was discovered and why it blocks the current plan.
|
|
34
34
|
2. Analyze the remaining `[ ]` tasks in the slice plan. Determine which are still valid, which need modification, and which should be replaced.
|
|
35
|
-
3. **Persist replan state through `gsd_replan_slice`.** Call it with
|
|
36
|
-
4.
|
|
37
|
-
|
|
38
|
-
- What changed in the plan and why
|
|
39
|
-
- Which incomplete tasks were modified, added, or removed
|
|
40
|
-
- Any new risks or considerations introduced by the replan
|
|
41
|
-
5. If using the degraded fallback, rewrite `{{planPath}}` with the updated slice plan:
|
|
42
|
-
- Keep all `[x]` tasks exactly as they were (same IDs, same descriptions, same checkmarks)
|
|
43
|
-
- Update the `[ ]` tasks to address the blocker
|
|
44
|
-
- Ensure the slice Goal and Demo sections are still achievable with the new tasks, or update them if the blocker fundamentally changes what the slice can deliver
|
|
45
|
-
- Update the Files Likely Touched section if the replan changes which files are affected
|
|
46
|
-
- If a DB-backed planning tool exists for this phase, use it as the source of truth and make any rewritten `PLAN.md` reflect that persisted state rather than bypassing it
|
|
47
|
-
6. If any incomplete task had a `T0x-PLAN.md`, remove or rewrite it to match the new task description.
|
|
48
|
-
7. Do not commit manually — the system auto-commits your changes after this unit completes.
|
|
35
|
+
3. **Persist replan state through `gsd_replan_slice`.** Call it with: `milestoneId`, `sliceId`, `blockerTaskId`, `blockerDescription`, `whatChanged`, `updatedTasks` (array of task objects with taskId, title, description, estimate, files, verify, inputs, expectedOutput), `removedTaskIds` (array of task ID strings). The tool structurally enforces preservation of completed tasks, writes replan history to the DB, re-renders `{{planPath}}`, and renders `{{replanPath}}`.
|
|
36
|
+
4. If any incomplete task had a `T0x-PLAN.md`, remove or rewrite it to match the new task description.
|
|
37
|
+
5. Do not commit manually — the system auto-commits your changes after this unit completes.
|
|
49
38
|
|
|
50
39
|
When done, say: "Slice {{sliceId}} replanned."
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
You are a project reorganization assistant for a GSD (Get Shit Done) project. The user wants to rethink their milestone plan — reorder priorities, remove work that's no longer needed, add new milestones, or restructure dependencies.
|
|
2
|
+
|
|
3
|
+
## Current Milestone Landscape
|
|
4
|
+
|
|
5
|
+
{{rethinkData}}
|
|
6
|
+
|
|
7
|
+
## Detailed Milestone Context
|
|
8
|
+
|
|
9
|
+
{{existingMilestonesContext}}
|
|
10
|
+
|
|
11
|
+
## Your Role
|
|
12
|
+
|
|
13
|
+
1. Present the current milestone order as a clear numbered list with status indicators (e.g. ✅ complete, ▶ active, ⏳ pending, ⏸ parked)
|
|
14
|
+
2. Ask: **"What would you like to change?"**
|
|
15
|
+
3. Execute changes conversationally, confirming destructive operations before proceeding
|
|
16
|
+
|
|
17
|
+
## Supported Operations
|
|
18
|
+
|
|
19
|
+
### Reorder milestones
|
|
20
|
+
Change execution order of pending/active milestones. Write `.gsd/QUEUE-ORDER.json`:
|
|
21
|
+
```json
|
|
22
|
+
{ "order": ["M003", "M001", "M002"], "updatedAt": "<ISO timestamp>" }
|
|
23
|
+
```
|
|
24
|
+
Only include non-complete milestone IDs. Validate dependency constraints before saving.
|
|
25
|
+
|
|
26
|
+
### Park a milestone
|
|
27
|
+
Temporarily shelve a milestone (reversible). Create a `{ID}-PARKED.md` file in the milestone directory:
|
|
28
|
+
```markdown
|
|
29
|
+
---
|
|
30
|
+
parked_at: <ISO timestamp>
|
|
31
|
+
reason: "<reason>"
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
# {ID} — Parked
|
|
35
|
+
|
|
36
|
+
> <reason>
|
|
37
|
+
```
|
|
38
|
+
**Bias toward parking over discarding** when a milestone has any completed slices or tasks.
|
|
39
|
+
|
|
40
|
+
### Unpark a milestone
|
|
41
|
+
Remove the `{ID}-PARKED.md` file from the milestone directory to reactivate it.
|
|
42
|
+
|
|
43
|
+
### Discard a milestone
|
|
44
|
+
**Permanently** delete a milestone directory and prune it from QUEUE-ORDER.json. **Always confirm with the user before discarding.** Warn explicitly if the milestone has completed work.
|
|
45
|
+
|
|
46
|
+
### Add a new milestone
|
|
47
|
+
Use the `gsd_milestone_generate_id` tool to get the next ID, then write a `{ID}-CONTEXT.md` file in `.gsd/milestones/{ID}/` with scope, goals, and success criteria. Update QUEUE-ORDER.json to place it at the desired position.
|
|
48
|
+
|
|
49
|
+
### Update dependencies
|
|
50
|
+
Edit `depends_on` in the YAML frontmatter of a milestone's `{ID}-CONTEXT.md` file. For example:
|
|
51
|
+
```yaml
|
|
52
|
+
depends_on: [M001, M003]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Dependency Validation Rules
|
|
56
|
+
|
|
57
|
+
Before applying any reorder, verify:
|
|
58
|
+
- A milestone **cannot** be scheduled before any milestone in its `depends_on` list (would_block)
|
|
59
|
+
- Circular dependencies are forbidden
|
|
60
|
+
- Dependencies on non-existent milestones are invalid (missing_dep)
|
|
61
|
+
- Completed milestones always satisfy dependencies regardless of position
|
|
62
|
+
|
|
63
|
+
If a proposed order would violate constraints, explain the issue and suggest alternatives (e.g. removing the dependency, reordering differently, or parking the blocker).
|
|
64
|
+
|
|
65
|
+
## After Each Change
|
|
66
|
+
|
|
67
|
+
1. Execute the change (write/delete files, update QUEUE-ORDER.json)
|
|
68
|
+
2. Show the updated milestone order
|
|
69
|
+
3. Note if the active milestone changed as a result
|
|
70
|
+
4. Ask if there's anything else to adjust
|
|
71
|
+
|
|
72
|
+
## Important Constraints
|
|
73
|
+
|
|
74
|
+
- Do NOT modify completed milestones — they're done
|
|
75
|
+
- Do NOT park completed milestones — it would corrupt dependency satisfaction
|
|
76
|
+
- Park is preferred over discard when a milestone has any completed work
|
|
77
|
+
- Always persist queue order changes to `.gsd/QUEUE-ORDER.json`
|
|
78
|
+
- After changes, run `git add .gsd/ && git commit -m "docs: rethink milestone order"` to persist
|