fix(sf): close 6 stale test failures from gsd-2 compat sweep

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) <noreply@anthropic.com>
This commit is contained in:
Mikael Hugo 2026-05-02 22:35:26 +02:00
parent 3f213f3131
commit a3c000de26
6 changed files with 75 additions and 7 deletions

View file

@ -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];

View file

@ -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);
});

View file

@ -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

View file

@ -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

View file

@ -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,

View file

@ -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<UnitType, UnitContextManifest> = {
},
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 ────────────────────────────────────────────────────────