feat(sdk): strip blockquote-prefixed lines before UAT item scan (#3184)

Cycle 8 of ~15: adds blockquote-line stripping pass. Quoted
documentation snippets no longer pollute the item roster.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-05-18 22:47:15 -04:00
parent 47a7412164
commit 7c1ffb4131
2 changed files with 34 additions and 0 deletions

View File

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

View File

@@ -47,6 +47,8 @@ function stripMarkdownInjection(content: string): string {
s = s.replace(/```[\s\S]*?```/g, '');
// Pass 3: strip HTML comment regions (<!-- ... -->)
s = s.replace(/<!--[\s\S]*?-->/g, '');
// Pass 4: strip blockquote-prefixed lines (any line starting with optional whitespace + >)
s = s.replace(/^\s*>.*$/gm, '');
return s;
}