From 947ff2ba0a714600ddf0371fcf28cd30d75d2e9f Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Mon, 6 Apr 2026 19:36:01 -0700 Subject: [PATCH] fix(gsd): default insertMilestone status to queued instead of active Hallucinated tool calls could auto-create phantom milestones as "active", hijacking the state machine. Observed: complete-slice issued a stray gsd_task_complete for M000, which was auto-created as active and promoted over the real M028. Changing the default from "active" to "queued" means phantom milestones from stray tool calls won't be promoted as active. Combined with the ghost detection fix (#3645), they'll be cleaned up automatically. Legitimate callers (plan-milestone, state reconciliation, md-importer) already pass status explicitly. Closes #3380 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/resources/extensions/gsd/gsd-db.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/resources/extensions/gsd/gsd-db.ts b/src/resources/extensions/gsd/gsd-db.ts index fdb53492a..933b3d32e 100644 --- a/src/resources/extensions/gsd/gsd-db.ts +++ b/src/resources/extensions/gsd/gsd-db.ts @@ -1119,7 +1119,9 @@ export function insertMilestone(m: { ).run({ ":id": m.id, ":title": m.title ?? "", - ":status": m.status ?? "active", + // Default to "queued" — never auto-create milestones as "active" (#3380). + // Callers that need "active" must pass it explicitly. + ":status": m.status ?? "queued", ":depends_on": JSON.stringify(m.depends_on ?? []), ":created_at": new Date().toISOString(), ":vision": m.planning?.vision ?? "",