Skip to content

[business-logic] edit_file.go write-failure path leaks captured diagnostic baseline #824

Description

@topcheer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions