Skip to content

test(generator): cover frontmatter-reinjection edge cases#71

Merged
silversurfer562 merged 1 commit into
mainfrom
test/frontmatter-reinjection-edge-cases
Jun 17, 2026
Merged

test(generator): cover frontmatter-reinjection edge cases#71
silversurfer562 merged 1 commit into
mainfrom
test/frontmatter-reinjection-edge-cases

Conversation

@silversurfer562

Copy link
Copy Markdown
Member

Adds 4 unit tests for _replace_polished_frontmatter covering behavior branches of the current implementation that had no direct coverage:

  1. comment/blank lines inside polished frontmatter preserved (empty-key path)
  2. deterministic field present in polished but absent from canonical → dropped ("better silence than a perturbed value")
  3. deterministic field missing from polished → re-appended from canonical (the final-loop invariant, distinct from the whole-frontmatter-missing path)
  4. multi-line / structural YAML values pass through verbatim

These scenarios were surfaced by the now-retired fix/source-hash-llm-laundering branch, but written fresh against main's actual behavior rather than ported (that branch was 3 weeks divergent and tested a different impl). Test-only; all 13 in the file pass locally (py3.10).

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

Adds 4 unit tests for _replace_polished_frontmatter exercising
previously-uncovered behavior branches of the current implementation:
- comment/blank lines inside polished frontmatter preserved (empty-key path)
- deterministic field present in polished but absent from canonical is dropped
- deterministic field missing from polished is re-appended from canonical
- multi-line/structural YAML values pass through verbatim

Scenarios surfaced by the retired fix/source-hash-llm-laundering branch;
written fresh against main's actual behavior (not the branch's stale impl).

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

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@silversurfer562 silversurfer562 merged commit f1f4d8d into main Jun 17, 2026
13 checks passed
@silversurfer562 silversurfer562 deleted the test/frontmatter-reinjection-edge-cases branch June 17, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant