fix(#628): read snake_case requirements_completed in summary-extract (#640)

* fix(#628): read snake_case requirements_completed in summary-extract

cmdSummaryExtract read only the kebab frontmatter key
`requirements-completed`, but the tool's own JSON output key and the
milestone-audit `--pick` both use the snake form `requirements_completed`.
A SUMMARY written in the snake form the tool itself emits was silently
read back as [] — a false negative in milestone requirement traceability
with no diagnostic.

Make the reader tolerant of both key forms (kebab takes precedence), so a
round-tripped field is no longer dropped. extractFrontmatter does no
hyphen<->underscore normalization, so distinct keys had to be read
explicitly.

Adds regression tests: snake-only fixture now returns the IDs, and a
both-forms-present fixture asserts kebab precedence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* chore(#628): add changeset for summary-extract snake-key fix

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-06-03 08:06:31 -04:00
committed by GitHub
parent 3cf112b3de
commit 56a815c722
3 changed files with 65 additions and 1 deletions

View File

@@ -750,7 +750,11 @@ function cmdSummaryExtract(cwd: string, summaryPath: string | undefined, fields:
tech_added: (techStack && techStack['added']) || [],
patterns: fm['patterns-established'] || [],
decisions: parseDecisions(fm['key-decisions']),
requirements_completed: fm['requirements-completed'] || [],
// Tolerate both key forms: the template/reader use kebab `requirements-completed`,
// but the tool's own JSON output and the milestone audit `--pick` use snake
// `requirements_completed`. Reading both prevents a snake-keyed SUMMARY (the form the
// tool emits) from being silently dropped to []. See #628.
requirements_completed: fm['requirements-completed'] ?? fm['requirements_completed'] ?? [],
};
// If fields specified, filter to only those fields