Skip to content

test: lock atomic evidence replacement - #57

Merged
tayfuryldz merged 1 commit into
tayfuryldz:mainfrom
Ymax27:ymax27/test-atomic-evidence-write
Oct 2, 2026
Merged

tayfuryldz merged 1 commit into
tayfuryldz:mainfrom
Ymax27:ymax27/test-atomic-evidence-write

Conversation

@Ymax27

@Ymax27 Ymax27 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds tests for atomic_write_text().
  • Parent directories are created, an existing file is replaced completely, the temporary sibling is removed, and an fsync OSError still leaves the new content in place.
  • No production behavior changes.

Scope

Fixes #27.

Validation

Commands run on this branch:

PYTHONPATH=src python3 -m pytest -q tests/test_file_safety.py

Observed result: 2 passed.

ruff and mypy are not installed in this environment, so those gates were not run.

Checklist

  • CLI changes are safe by default and documented.
  • New detection behavior includes tests.
  • False-positive filtering remains conservative by default.
  • Observations/probes are preserved even when findings are filtered.
  • Evidence schema and proof-gate mutation tests pass.
  • No destructive payloads or denial-of-service behavior were added.
  • I reviewed the final diff and can explain the changes I am submitting.
  • Validation results in this PR are from commands actually run on this branch; no results or evidence were fabricated.
  • Any assumptions I could not verify are stated explicitly instead of being presented as facts.

Made with Cursor

@Ymax27
Ymax27 requested a review from tayfuryldz as a code owner October 2, 2026 10:51

@tayfuryldz tayfuryldz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this against current main and ran the full maintainer gates locally: pytest, Ruff, and mypy are clean. The diff stays within the issue scope and I did not find a blocking regression.

@tayfuryldz
tayfuryldz enabled auto-merge (squash) October 2, 2026 16:56
@tayfuryldz
tayfuryldz force-pushed the ymax27/test-atomic-evidence-write branch 3 times, most recently from 84a7bda to 5983bcc Compare October 2, 2026 17:05
Show that evidence writes create parents, replace the destination completely, and still publish when fsync fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tayfuryldz
tayfuryldz force-pushed the ymax27/test-atomic-evidence-write branch from 5983bcc to 6e844d2 Compare October 2, 2026 17:08
@tayfuryldz
tayfuryldz merged commit d69ebda into tayfuryldz:main Oct 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add atomic evidence write regression tests

2 participants