fix(cv): preserve attachment flags across generic letter writers

This commit is contained in:
cesnimda
2026-10-26 08:47:47 +01:00
parent 7bf06ede52
commit fc93dfb950
5 changed files with 109 additions and 2 deletions
+10
View File
@@ -174,3 +174,13 @@ The shared renderer now omits blank optional headings, supplies an escaped local
Two new EN/NB regression cases failed before the renderer fix. Fresh full Release backend validation passed 1,229/1,229 with zero skips (`.artifacts/cv-ux-01/letter-empty-backend-successor.trx`); all 11 original application-form browser cases passed (`letter-legacy-forms-01.json`). Guarded actual MariaDB 12.2.2 passed 59/59 with zero skips, matching before/after source hashes, runner exit 0 and positive owned-service cleanup (`provider-final-04`). Independent review found no material issue. These totals overlap earlier focused/full runs and must not be added together.
The frozen aggregate and current-source Linux image/PDF checks must be rerun after this checkpoint. Earlier aggregate failures and pre-fix images do not establish final acceptance. Full frontend `frontend-final-03` remains current at 981 passing assertions across 107 suites because this checkpoint changes no frontend product or unit-test source. Final acceptance remains pending.
## 26 October: generic writer flag preservation
Frozen `final-07` passed the full backend (1,229 cases) and ordinary shard 2 (87/87), then failed shard 3 (86/88). Both source and runtime hashes were stable. Native JSON identifies two failures: the Documents editor-save request counter included its read-only letter preview POST, and the JSON job-import round trip found an unexpected `HasCoverLetter` flag promotion. This aggregate remains failed; its passing subset does not replace a complete successor.
The flag failure was a product regression introduced by moving dedicated letter-save history into the shared writer. The accepted baseline promotes the flag only for a changed nonempty dedicated letter Save, while create, generic update and application-draft writers preserve existing attachment flags. Restore that side effect to the dedicated Save after its no-op branch; retain atomic text/design/history persistence, clear semantics and the original import expectation. No backfill is performed. SQLite and MariaDB writer tests cover both existing flag values, clear, dedicated no-op, promotion and restore.
Regression evidence: three failing flag cases before the fix, then 67/67 focused cases and 1,234/1,234 full Release backend cases passed with zero skips (`letter-flag-red-01`, `letter-flag-green-01`, `letter-flag-backend-full-01`). Actual guarded MariaDB 12.2.2 passed 64/64 with source hashes unchanged, no audit override, process exit 0 and positive owned-service cleanup (`provider-final-05`). Independent diff review found no material issue.
The Documents fixture correction excludes only the current job's exact preview POST from the final editor-write count. Listing checks continue to forbid implicit rendering, preview and writes; exact Save body, expected revision, history and durable metadata readbacks remain asserted. Its entire original browser suite passed 10/10 (`documents-preview-fixture-01`). The unchanged JSON job-import suite passed all four cases (`import-flag-browser-01`), including the actual PascalCase export/native chooser round trip, graph/owner boundaries and uncertain-write recovery. Final aggregate, current-source Linux and native PDF acceptance remain pending.