Skip to content

fix(output): prevent accidental overwrites in capture and replay - #708

Merged
Karib0u merged 2 commits into
mainfrom
claude/rustinel-issue-700-ee39ec
Oct 7, 2026
Merged

Karib0u merged 2 commits into
mainfrom
claude/rustinel-issue-700-ee39ec

Conversation

@Karib0u

@Karib0u Karib0u commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Closes #700.

Changes

  • capture: refuses an existing payload or manifest (both checked before either is created), creates them with exclusive creation, and removes only the payload it created if the manifest cannot be created.
  • replay --output: refuses an existing file, and an output that aliases the recording or manifest (canonical path, symlink, or hard link). A partial report created by a failed run is removed.
  • New create_new_output_file helper; open_output_file semantics are unchanged for config, logging and the final manifest rewrite.
  • CLI help and docs (cli.md, output.md, replay.md) state the behavior. No overwrite option added (refusal-only, per the issue).

Tests

Unit tests for payload-only and manifest-only collisions (bytes unchanged, no half pair), exclusive creation, and aliasing; integration tests for replay refusal, aliasing via symlink, and the happy path. cargo test --lib, replay/capture/generated_docs tests and clippy pass on macOS.

Capture checks both the payload and manifest before creating either, then
creates them exclusively and removes only what it created on failure.
Replay refuses an existing --output and any output aliasing the recording
or its manifest, and removes a partial report it created if the run fails.

Closes #700
@Karib0u
Karib0u merged commit 356b4ca into main Oct 7, 2026
17 checks passed
@Karib0u
Karib0u deleted the claude/rustinel-issue-700-ee39ec branch October 7, 2026 11:36
@Karib0u Karib0u added the bug Something isn't working label Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(output): prevent accidental overwrites in capture and replay

1 participant