From a3c000de26cb9081d0305cafdbb0965d63cab1d4 Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Sat, 2 May 2026 22:35:26 +0200 Subject: [PATCH] fix(sf): close 6 stale test failures from gsd-2 compat sweep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Schema-version assertions hadn't been bumped past 21 in three places (complete-task/complete-slice/md-importer); manifest coverage tests caught the project-scoped unit types added for the deep planning gate (ADR-011) that weren't yet registered in either KNOWN_UNIT_TYPES table; workflow- templates registry test rejected docs-sync.yaml because the assertion was .md-only. - preferences-types.ts: KNOWN_UNIT_TYPES gains refine-slice, discuss-project, discuss-requirements, research-project, workflow-preferences. - unit-context-manifest.ts: same five types added to its local KNOWN_UNIT_TYPES + UNIT_MANIFESTS (TOOLS_PLANNING, scoped/full knowledge, COMMON_BUDGET_MEDIUM/LARGE). - complete-task / complete-slice / md-importer test: schema_version expectation 21 → 25. - workflow-templates test: file extension can be .md OR .yaml (docs-sync is intentionally yaml-step iteration). 6 test files / 81 tests now green that were red. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../extensions/sf/preferences-types.ts | 5 ++ .../sf/tests/complete-slice.test.ts | 4 +- .../extensions/sf/tests/complete-task.test.ts | 2 +- .../extensions/sf/tests/md-importer.test.ts | 4 +- .../sf/tests/workflow-templates.test.ts | 5 +- .../extensions/sf/unit-context-manifest.ts | 62 +++++++++++++++++++ 6 files changed, 75 insertions(+), 7 deletions(-) diff --git a/src/resources/extensions/sf/preferences-types.ts b/src/resources/extensions/sf/preferences-types.ts index 2d41b56be..eca6ce189 100644 --- a/src/resources/extensions/sf/preferences-types.ts +++ b/src/resources/extensions/sf/preferences-types.ts @@ -166,6 +166,7 @@ export const KNOWN_UNIT_TYPES = [ "plan-milestone", "research-slice", "plan-slice", + "refine-slice", "execute-task", "reactive-execute", "gate-evaluate", @@ -178,6 +179,10 @@ export const KNOWN_UNIT_TYPES = [ "rewrite-docs", "discuss-milestone", "discuss-slice", + "discuss-project", + "discuss-requirements", + "research-project", + "workflow-preferences", "worktree-merge", ] as const; export type UnitType = (typeof KNOWN_UNIT_TYPES)[number]; diff --git a/src/resources/extensions/sf/tests/complete-slice.test.ts b/src/resources/extensions/sf/tests/complete-slice.test.ts index db7a45d65..a7b7ed7e0 100644 --- a/src/resources/extensions/sf/tests/complete-slice.test.ts +++ b/src/resources/extensions/sf/tests/complete-slice.test.ts @@ -113,7 +113,7 @@ Run the test suite and verify all assertions pass. } describe("complete-slice: schema v6 migration", () => { - it("schema version should be 21", () => { + it("schema version should be 25", () => { const dbPath = tempDbPath(); openDatabase(dbPath); @@ -121,7 +121,7 @@ describe("complete-slice: schema v6 migration", () => { const versionRow = adapter .prepare("SELECT MAX(version) as v FROM schema_version") .get(); - assert.strictEqual(versionRow?.["v"], 21); + assert.strictEqual(versionRow?.["v"], 25); cleanup(dbPath); }); diff --git a/src/resources/extensions/sf/tests/complete-task.test.ts b/src/resources/extensions/sf/tests/complete-task.test.ts index 042c3d815..443662250 100644 --- a/src/resources/extensions/sf/tests/complete-task.test.ts +++ b/src/resources/extensions/sf/tests/complete-task.test.ts @@ -146,7 +146,7 @@ console.log("\n=== complete-task: schema v5 migration ==="); const versionRow = adapter .prepare("SELECT MAX(version) as v FROM schema_version") .get(); - assertEq(versionRow?.["v"], 21, "schema version should be 21"); + assertEq(versionRow?.["v"], 25, "schema version should be 25"); // Verify all 4 new tables exist const tables = adapter diff --git a/src/resources/extensions/sf/tests/md-importer.test.ts b/src/resources/extensions/sf/tests/md-importer.test.ts index d18aef75a..91ae1232d 100644 --- a/src/resources/extensions/sf/tests/md-importer.test.ts +++ b/src/resources/extensions/sf/tests/md-importer.test.ts @@ -522,8 +522,8 @@ test("md-importer: schema v1→v2 migration", () => { .get(); assert.deepStrictEqual( version?.v, - 21, - "new DB should be at schema version 21", + 25, + "new DB should be at schema version 25", ); // Artifacts table should exist diff --git a/src/resources/extensions/sf/tests/workflow-templates.test.ts b/src/resources/extensions/sf/tests/workflow-templates.test.ts index 5cee11097..2ad08f941 100644 --- a/src/resources/extensions/sf/tests/workflow-templates.test.ts +++ b/src/resources/extensions/sf/tests/workflow-templates.test.ts @@ -63,8 +63,9 @@ describe("workflow-templates", () => { `${id}: description should be non-empty`, ); assert.ok( - typeof entry.file === "string" && entry.file.endsWith(".md"), - `${id}: file should be a .md path`, + typeof entry.file === "string" && + (entry.file.endsWith(".md") || entry.file.endsWith(".yaml")), + `${id}: file should be a .md or .yaml path`, ); assert.ok( Array.isArray(entry.phases) && entry.phases.length > 0, diff --git a/src/resources/extensions/sf/unit-context-manifest.ts b/src/resources/extensions/sf/unit-context-manifest.ts index 50753eab4..5de10cacf 100644 --- a/src/resources/extensions/sf/unit-context-manifest.ts +++ b/src/resources/extensions/sf/unit-context-manifest.ts @@ -297,6 +297,11 @@ export const KNOWN_UNIT_TYPES = [ "run-uat", "gate-evaluate", "rewrite-docs", + // ADR-011 deep planning gate (project-scoped, before any milestone work) + "discuss-project", + "discuss-requirements", + "research-project", + "workflow-preferences", ] as const; export type UnitType = (typeof KNOWN_UNIT_TYPES)[number]; @@ -638,6 +643,63 @@ export const UNIT_MANIFESTS: Record = { }, maxSystemPromptChars: COMMON_BUDGET_MEDIUM, }, + // ─── Project-scoped (deep planning gate, ADR-011) ─────────────────── + "discuss-project": { + skills: { mode: "all" }, + knowledge: "full", + memory: "prompt-relevant", + codebaseMap: true, + preferences: "active-only", + tools: TOOLS_PLANNING, + artifacts: { + inline: ["project", "templates"], + excerpt: [], + onDemand: [], + }, + maxSystemPromptChars: COMMON_BUDGET_MEDIUM, + }, + "discuss-requirements": { + skills: { mode: "all" }, + knowledge: "full", + memory: "prompt-relevant", + codebaseMap: true, + preferences: "active-only", + tools: TOOLS_PLANNING, + artifacts: { + inline: ["project", "requirements", "templates"], + excerpt: [], + onDemand: [], + }, + maxSystemPromptChars: COMMON_BUDGET_MEDIUM, + }, + "research-project": { + skills: { mode: "all" }, + knowledge: "full", + memory: "prompt-relevant", + codebaseMap: true, + preferences: "active-only", + tools: TOOLS_PLANNING, + artifacts: { + inline: ["project", "requirements", "decisions", "templates"], + excerpt: [], + onDemand: [], + }, + maxSystemPromptChars: COMMON_BUDGET_LARGE, + }, + "workflow-preferences": { + skills: { mode: "all" }, + knowledge: "scoped", + memory: "prompt-relevant", + codebaseMap: false, + preferences: "active-only", + tools: TOOLS_PLANNING, + artifacts: { + inline: ["templates"], + excerpt: [], + onDemand: [], + }, + maxSystemPromptChars: COMMON_BUDGET_MEDIUM, + }, }; // ─── Lookup helper ────────────────────────────────────────────────────────