diff --git a/sdk/src/query/phase-uat-passed.test.ts b/sdk/src/query/phase-uat-passed.test.ts index 7896b748e..ff33163fc 100644 --- a/sdk/src/query/phase-uat-passed.test.ts +++ b/sdk/src/query/phase-uat-passed.test.ts @@ -243,4 +243,33 @@ result: pass await rm(localTmp, { recursive: true, force: true }); } }); + + it('parses bold-prefixed **result:** key as equivalent to bare result:', async () => { + const localTmp = await mkdtemp(join(tmpdir(), 'gsd-uat-c9-')); + try { + const phaseDir = join(localTmp, '.planning', 'phases', '05-bold-key'); + await mkdir(phaseDir, { recursive: true }); + const content = `--- +status: complete +phase: 5 +source: roadmap +started: 2026-05-18T00:00:00Z +updated: 2026-05-18T00:00:00Z +--- + +### 1. Bold-key item +expected: thing +**result:** pass +`; + await writeFile(join(phaseDir, '05-HUMAN-UAT.md'), content); + + const result = await isPhaseUatPassed(localTmp, '5'); + expect(result.items.length).toBe(1); + expect(result.items[0].name).toBe('Bold-key item'); + expect(result.items[0].result).toBe('pass'); + expect(result.passed).toBe(true); + } finally { + await rm(localTmp, { recursive: true, force: true }); + } + }); }); diff --git a/sdk/src/query/phase-uat-passed.ts b/sdk/src/query/phase-uat-passed.ts index 9048a07a9..1dea2e76f 100644 --- a/sdk/src/query/phase-uat-passed.ts +++ b/sdk/src/query/phase-uat-passed.ts @@ -24,9 +24,10 @@ export type UatReason = { capturedValue?: string; }; -/** Regex to parse all UAT items regardless of result value. */ +/** Regex to parse all UAT items regardless of result value. + * Accepts optional bold markers (**key:**) around expected/result keys. */ const UAT_ITEM_PATTERN = - /###\s*(\d+)\.\s*([^\n]+)\nexpected:\s*([^\n]+)\nresult:\s*(\w+)/g; + /###\s*(\d+)\.\s*([^\n]+)\n(?:\*\*)?expected:(?:\*\*)?\s*([^\n]+)\n(?:\*\*)?result:(?:\*\*)?\s*(\w+)/g; interface UatItem { test: number;