Skip to content

Filesystem Phase 1: file operations + content - #2

Open
col wants to merge 8 commits into
mainfrom
feat/filesystem
Open

Filesystem Phase 1: file operations + content#2
col wants to merge 8 commits into
mainfrom
feat/filesystem

Conversation

@col

@col col commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

Adds E2bEx.Filesystem (Phase 1) — read/write file content and the core metadata operations against the sandbox's envd daemon (same transport family as E2bEx.Commands).

  • E2bEx.Filesystemread/4, write/5, list/4, get_info/4, exists/4, make_dir/4, rename/5, remove/4.
  • E2bEx.EntryInfo — typed struct for a file/dir entry (type: :file | :dir, RFC3339 modified_time, symlink_target, metadata, …).
  • E2bEx.Envd.Rpc — two new HTTP helpers, get_file/3 / put_file/4 (GET/POST /files), for raw file content. The 6 metadata ops ride the existing Rpc.unary/4 against filesystem.Filesystem/* Connect paths unchanged.

Behaviour notes

  • read returns {:ok, binary} (an Elixir binary already serves as text+bytes); "" for an empty file.
  • write uploads application/octet-stream and returns the written {:ok, %EntryInfo{}}.
  • exists / make_dir translate a specific envd error code to a boolean (the Rpc.kill/2 idiom).
  • list returns {:ok, []} for an empty dir (proto3 omits the entries field).
  • get_info / rename return {:error, …} rather than a malformed {:ok, %{}} if envd ever returns a 2xx with no entry.

Scope

Phase 1 only. Deferred: watch (live filesystem events — Phase 2, its own spec), plus gzip, xattr/metadata write headers, batch write_files (multipart), signed-URL generation, and streaming reads.

Spec: docs/superpowers/specs/2026-06-13-e2b-filesystem-design.md · Plan: docs/superpowers/plans/2026-06-13-e2b-filesystem.md

Test Plan

  • mix test — 152 tests, 0 failures
  • mix compile --warnings-as-errors clean
  • Coverage: EntryInfo.from_api/1 decode; Rpc.get_file/put_file (raw bytes, octet-stream, :user query param, non-2xx errors, Connect-header stripping); all 8 Filesystem ops incl. empty-dir, boolean translations, :user end-to-end, and the no-entry error path
  • Manual: exercise against a live sandbox (read/write/list a real file)

🤖 Generated with Claude Code

col and others added 8 commits June 13, 2026 11:38
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rename/remove)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ser tests

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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