feat(FN-5112): complete Step 1 — dangling task-doc reference detector

Fusion-Task-Id: FN-5112
Fusion-Task-Lineage: 692fba2a-5856-4256-8144-d87bda56e1aa
This commit is contained in:
Fusion (runfusion.ai)
2026-05-19 00:03:09 -07:00
committed by gsxdsm
parent febd1f872c
commit b5e257d6e3
4 changed files with 226 additions and 1 deletions

View File

@@ -507,7 +507,7 @@ function countSteps(prompt: string): number {
* Extract a named section from the prompt (e.g. "File Scope", "Do NOT").
* Returns the section from the heading to the next ## or ### heading, or end.
*/
function extractSection(prompt: string, sectionName: string): string {
export function extractSection(prompt: string, sectionName: string): string {
// Match ## Section Name or **Section Name** as a heading
const regex = new RegExp(`^## ${escapeRegex(sectionName)}\\s*$`, "m");
const match = regex.exec(prompt);