fix(2134): fix code-review SUMMARY.md parser section-reset for top-level keys (#2142)
* test(2134): add failing test for code-review SUMMARY.md YAML parser section reset Demonstrates bug #2134: the section-reset regex in the inline node parser in get-shit-done/workflows/code-review.md uses \s+ (requires leading whitespace), so top-level YAML keys at column 0 (decisions:, metrics:, tags:) never reset inSection, causing their list items to be mis-classified as key_files.modified entries. RED test asserts that the buggy parser contaminates the file list with decision strings. GREEN test and additional tests verify correct behaviour with the fix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(2134): fix YAML parser section reset to handle top-level keys (\s* not \s+) The inline node parser in compute_file_scope (Tier 2) used \s+ in the section-reset regex, requiring leading whitespace. Top-level YAML keys at column 0 (decisions:, metrics:, tags:) never matched, so inSection was never cleared and their list items were mis-classified as key_files.modified entries. Fix: change \s+ to \s* in both the reset check and its dash-guard companion so any key at any indentation level (including column 0) resets inSection. Before: /^\s+\w+:/.test(line) && !/^\s+-/.test(line) After: /^\s*\w+:/.test(line) && !/^\s*-/.test(line) Closes #2134 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -172,7 +172,7 @@ if [ -z "$FILES_OVERRIDE" ]; then
|
||||
for (const line of yaml.split('\n')) {
|
||||
if (/^\s+created:/.test(line)) { inSection = 'created'; continue; }
|
||||
if (/^\s+modified:/.test(line)) { inSection = 'modified'; continue; }
|
||||
if (/^\s+\w+:/.test(line) && !/^\s+-/.test(line)) { inSection = null; continue; }
|
||||
if (/^\s*\w+:/.test(line) && !/^\s*-/.test(line)) { inSection = null; continue; }
|
||||
if (inSection && /^\s+-\s+(.+)/.test(line)) {
|
||||
files.push(line.match(/^\s+-\s+(.+)/)[1].trim());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user