From b94f8754fae81a7d21c2eca2840cc68f36462fa0 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Sun, 12 Jul 2026 13:57:09 -0400 Subject: [PATCH] fix(#2140): scope hasRow to traceability-row shape (review L2) hasRow keyed on a bare '| ID |' which could match the ID as the first cell of a non-traceability table elsewhere in REQUIREMENTS.md, suppressing a real table_unmatched signal. Require a second cell ('| ID | |') so only a traceability-row shape counts as a row. --- src/milestone.cts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/milestone.cts b/src/milestone.cts index 70c67ec74..b7c318ca5 100644 --- a/src/milestone.cts +++ b/src/milestone.cts @@ -96,7 +96,9 @@ function cmdRequirementsMarkComplete(cwd: string, reqIdsRaw: string[], raw: bool if (tableHit) reqContent = afterTable; // Coverage of the traceability surface for this ID (computed after any flip). - const hasRow = new RegExp(`\\|\\s*${reqEscaped}\\s*\\|`, 'i').test(reqContent); + // hasRow keys on the ID + a second cell (`| ID | |`) so a bare mention + // of the ID in a non-traceability table does not masquerade as a real row. + const hasRow = new RegExp(`\\|\\s*${reqEscaped}\\s*\\|[^|]+\\|`, 'i').test(reqContent); const doneCheckbox = new RegExp(`-\\s*\\[x\\]\\s*\\*\\*${reqEscaped}\\*\\*`, 'i').test(reqContent); const doneTable = new RegExp(`\\|\\s*${reqEscaped}\\s*\\|[^|]+\\|\\s*Complete\\s*\\|`, 'i').test(reqContent);