Commit d805062
feat(polish): emit
Surface a polish bypass in the rendered YAML frontmatter so the
degradation shows up in PR diffs. Without this marker, raw-Jinja
output is structurally identical to a normal generation (same
headings, same frontmatter shape) and slips past review — see
attune-author#30 and attune-rag d39e39d, where a regeneration with
polish silently bypassed merged in degraded form.
The marker is only added when polish falls back to returning raw
content in lenient mode (no API key, swallowed LLM error). The
success path and the cache-hit path are unchanged.
Helper is idempotent: re-running polish on an already-marked file
does not double-write. Non-YAML output (project-doc templates with
HTML-comment footers) passes through unchanged — surfacing bypass
there would need a different mechanism and is deliberately out of
scope here.
Tests:
- ``test_lenient_bypass_marks_yaml_frontmatter`` — bypass injects
the marker; body is preserved verbatim.
- ``test_lenient_bypass_is_idempotent_when_already_marked`` —
re-running does not double-write.
- ``test_lenient_bypass_passes_through_non_frontmatter_content`` —
non-YAML content unchanged.
- Updated golden snapshots reflect the new marker (snapshots are
recorded under the lenient-by-default conftest fixture).
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>polish: skipped frontmatter on lenient fallback (#33)1 parent a2f99c2 commit d805062
3 files changed
Lines changed: 74 additions & 0 deletions
File tree
- src/attune_author
- tests
- __snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
348 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
349 | 375 | | |
350 | 376 | | |
351 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
100 | 145 | | |
101 | 146 | | |
102 | 147 | | |
| |||
0 commit comments