Skip to content

Split fsops copy, atomic write, and validation helpers#18

Merged
danieljhkim merged 1 commit into
mainfrom
orbit/T20260510-16-6a00e95a
May 10, 2026
Merged

Split fsops copy, atomic write, and validation helpers#18
danieljhkim merged 1 commit into
mainfrom
orbit/T20260510-16-6a00e95a

Conversation

@danieljhkim
Copy link
Copy Markdown
Owner

Task

T20260510-16 — Split fsops copy, atomic write, and validation helpers

Description

Problem

internal/fsops/fs.go now contains the FS interface, the RealFS implementation, recursive copy and copy-source validation, atomic write logic, path existence, and identifier/path validation. The file is doing too many jobs, especially after the symlink-safe copy changes.

Why It Matters

Filesystem behavior is security-sensitive and touched by many modules. Separating copy policy, atomic writes, and validation into focused files makes review sharper and lets future filesystem work run in parallel with persist or engine changes.

Constraints / Notes

  • Treat this as a behavior-preserving refactor.
  • Preserve the FS interface and public constructor/API names.
  • Keep symlink rejection, non-regular file rejection, and atomic-write semantics exactly as covered by current tests.
  • This task owns only the fsops package surface; callers in persist/engine/sync should not need source changes.

Acceptance Criteria

  • internal/fsops/fs.go is reduced to the interface, constructor, and simple RealFS method grouping, while copy policy, atomic write, and validation helpers live in focused fsops files.
  • Existing symlink-rejection and non-regular-file copy tests still assert that link targets are not read or copied.
  • go test -v ./internal/fsops passes.
  • go test -v ./internal/... passes.

Execution Summary

Click to expand

Outcome: success

Changes:

  • Split monodev-managed copy behavior, recursive copy helpers, and ValidateCopySource into internal/fsops/copy.go.
  • Moved AtomicWrite into internal/fsops/atomic_write.go.
  • Moved Exists, ValidateRelPath, and ValidateIdentifier into internal/fsops/validation.go, leaving internal/fsops/fs.go focused on the FS interface, RealFS constructor, and direct OS wrapper methods.

Assessment: Behavior-preserving fsops refactor validated with go test -v ./internal/fsops and go test -v ./internal/....

Validation

  • Not reported

Branch Freshness

  • Base ref: origin/main
  • Head ref: orbit/T20260510-16-6a00e95a
  • Behind base: 0
  • Ahead of base: 1

authored by: gpt-5

Tasks:
- T20260510-16: Split fsops copy, atomic write, and validation helpers
@danieljhkim danieljhkim merged commit 2af0f3d into main May 10, 2026
3 of 4 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.

1 participant