diff --git a/sdk/src/query/phase-uat-passed.test.ts b/sdk/src/query/phase-uat-passed.test.ts index 5677a764c..7896b748e 100644 --- a/sdk/src/query/phase-uat-passed.test.ts +++ b/sdk/src/query/phase-uat-passed.test.ts @@ -197,6 +197,38 @@ expected: blah result: pass --> +### 1. Real item +expected: real +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('Real item'); + expect(result.passed).toBe(true); + } finally { + await rm(localTmp, { recursive: true, force: true }); + } + }); + + it('ignores ### item content on blockquote-prefixed lines', async () => { + const localTmp = await mkdtemp(join(tmpdir(), 'gsd-uat-c8-')); + try { + const phaseDir = join(localTmp, '.planning', 'phases', '05-blockquote-injection'); + 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. Quoted item +expected: blah +result: pass + ### 1. Real item expected: real result: pass diff --git a/sdk/src/query/phase-uat-passed.ts b/sdk/src/query/phase-uat-passed.ts index 3c5cb3bea..9048a07a9 100644 --- a/sdk/src/query/phase-uat-passed.ts +++ b/sdk/src/query/phase-uat-passed.ts @@ -47,6 +47,8 @@ function stripMarkdownInjection(content: string): string { s = s.replace(/```[\s\S]*?```/g, ''); // Pass 3: strip HTML comment regions () s = s.replace(//g, ''); + // Pass 4: strip blockquote-prefixed lines (any line starting with optional whitespace + >) + s = s.replace(/^\s*>.*$/gm, ''); return s; }