File: internal/tool/edit_file.go L176-182.
CaptureDiagnosticBaseline runs before the write; on atomicWriteFile failure the error return never calls ClearDiagnosticBaseline (whose comment says it is 'Used when an edit is skipped or fails'). File on disk is unchanged but a baseline is registered; a later edit diffs against the stale snapshot and can misattribute or miss diagnostics.
Impact: Low - contract violation with bounded effect.
Fix: ClearDiagnosticBaseline on the write-error return.
Verified by independent re-review.
File: internal/tool/edit_file.go L176-182.
CaptureDiagnosticBaseline runs before the write; on atomicWriteFile failure the error return never calls ClearDiagnosticBaseline (whose comment says it is 'Used when an edit is skipped or fails'). File on disk is unchanged but a baseline is registered; a later edit diffs against the stale snapshot and can misattribute or miss diagnostics.
Impact: Low - contract violation with bounded effect.
Fix: ClearDiagnosticBaseline on the write-error return.
Verified by independent re-review.