Skip to content

Add safe single-file copy - #112

Merged
saworbit merged 7 commits into
mainfrom
codex/single-file-copy
Oct 28, 2026
Merged

saworbit merged 7 commits into
mainfrom
codex/single-file-copy

Conversation

@saworbit

Copy link
Copy Markdown
Owner

Introduces the first narrow write path for the reboot: orbit copy SOURCE_FILE DEST_FILE [--verify hash|size] [--json|--quiet].

What this branch delivers

  • Single-file copy command contract (one regular local file, exact destination, parent must exist, replacement/resume/remote intentionally out of scope).
  • Staged, flushed, verified copy pipeline: uniquely named staging file beside the destination, flush, hash-or-size verify, atomic publish.
  • Identical-destination = successful no-op; different-destination = refusal, no writes.
  • Hardening against file-identity races during the hash/copy window.
  • Documentation + design notes under docs/superpowers/.
  • Black-box vibe harness scripts/vibe-harness.ps1 (13 checks: plan determinism, no-op idempotence incl. mtime, concurrent publish atomicity, staging placement/cleanup, mid-copy source-change detection, large-file round-trip hash, JSON NDJSON schema, exit-code mapping).

Local verification

  • cargo fmt --all -- --check — clean
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo test --all-targets — 38 tests pass
  • pwsh -NoProfile -File scripts/vibe-harness.ps1 — 13/13 pass against the release binary

Known follow-ups

Tracked separately: #110 (trailing-slash dest normalisation), #111 (error-message path prefix inconsistency).

saworbit and others added 7 commits September 23, 2026 07:22
scripts/vibe-harness.ps1 drives a built orbit binary and asserts the
observable claims this milestone commits to: deterministic plan output,
no-op idempotence (hash + mtime preserved), concurrent publish
atomicity, staging-file placement and cleanup, mid-copy source-change
detection, large-file round-trip hashes, well-formed --json NDJSON,
operation_id sensitivity to inputs, and exit-code mapping.

Complements cargo test: the Rust integration tests exercise the code
from inside the process; this harness exercises the shipped binary
from outside with real filesystem and race conditions.

Default binary path resolves relative to the script so a clone +
cargo build --release + run just works; -OrbitPath overrides.

README.md gains a short section pointing to the harness.
@saworbit
saworbit merged commit 83d38f7 into main Oct 28, 2026
4 checks passed
@saworbit
saworbit deleted the codex/single-file-copy branch October 28, 2026 22:30
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.

1 participant