ekp/.phrase/phases/phase-kp-overhaul-20260726/change_save_transaction_20260728.md
Kinneyzhang fd1210e557 fix: close repository audit findings
Complete task002 through task016 across cache correctness, editor lifecycle, C boundaries, build and release governance, dictionary provenance, performance, interactive workflows, tests, documentation, and final cleanup.
2026-07-28 22:43:10 +08:00

1.5 KiB

Change Log: Non-mutating Save Serialization 2026-07-28

task004

  • Modifyekp-region.el

    • Removed the before/after-save unjustify/rejustify transaction.
    • Added one logical write-buffer owner using the documented write-region-annotate-functions buffer-switch contract.
    • Added bounded cleanup on success, retry, integration removal, and source buffer teardown.
  • Modifytests/ekp-region-tests.el

    • Added real filesystem failure, forced encoding failure with successful retry, and quit regressions through save-buffer.
    • Preserved the existing successful logical-write assertion.
  • Modify — public, developer, audit, and phase documentation

    • Documented failure-safe visible behavior and closed issue002.
    • Added postmortem/20260728-nonmutating-save-serialization.md.

Validation

  • Focused red: 0/2; failure and interruption both removed the layout.
  • Focused green: 2/2.
  • Save matrix: 4/4 for success, filesystem failure, encoding retry, and interruption.
  • Full ERT: 102/102.
  • C/Elisp fuzz: 300/300.
  • Byte compilation with warnings as errors: clean.
  • checkdoc: clean.

Behavior and Risk

  • The display buffer is never unformatted during saving.
  • Later write annotations and coding conversion operate on logical text.
  • A failed write may retain one hidden logical copy until retry or teardown; it never grows beyond one per source buffer.
  • No global advice, saved-file format, public API, or dependency changed.