Skip to content

Finalize filesystem error semantics - #52

Merged
novelKR merged 3 commits into
mainfrom
cursor/p0-filesystem-semantics
Sep 18, 2026
Merged

novelKR merged 3 commits into
mainfrom
cursor/p0-filesystem-semantics

Conversation

@novelKR

@novelKR novelKR commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Map codespace-fs FsError 1:1 onto product codes: FILE_NOT_FOUND, PATH_NOT_DIRECTORY, FILE_OPERATION_FAILED, plus existing SYMLINK_REJECTED / SPECIAL_FILE_REJECTED. Runner owns a single fs_error_body translator (including find root canonicalize); rollback no longer sends filesystem I/O as INVALID_PATCH.
  • PATH_ESCAPE is a workspace/path containment violation: a ../ or absolute request, or a find walk result outside workspace.root. FILE_OPERATION_FAILED means containment held and the operation itself failed.
  • Bump WIRE_PROTOCOL 2 → 3 because ErrorBody product codes travel on that JSON. Handshake mismatch remains before-dispatch.
  • Contract tests cover missing / ENOTDIR / escape / symlink / fifo / generic Io on runner, MCP read/find, and UDS. MCP fifo asserts SPECIAL_FILE_REJECTED only. Deleted-root find asserts FILE_OPERATION_FAILED on runner, UDS, and MCP. No new I/O, sandbox, or MCP tool names.

Reference note

Test plan

  • cargo fmt
  • cargo clippy --offline --all-targets -- -D warnings
  • cargo test --offline -p codespace-runner (including find_on_deleted_root and UDS uds_find_on_deleted_root_is_file_operation_failed)
  • cargo test --offline -p codespace-server --test read_find --test security (FIFO exact SPECIAL_FILE_REJECTED; MCP find on deleted root is FILE_OPERATION_FAILED)
  • ./scripts/check-no-model-deps.sh
  • python3 -B scripts/check_docs.py
  • CI rust job on this draft (do not merge)

novelKR and others added 3 commits September 18, 2026 19:34
PATH_ESCAPE is workspace-scope escape only; the new error vocabulary bumps WIRE_PROTOCOL to 3.

Co-authored-by: Cursor <cursoragent@cursor.com>
Route find canonicalize through fs_error_body, assert FILE_OPERATION_FAILED on UDS and MCP, and treat PATH_ESCAPE as a containment violation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@novelKR
novelKR marked this pull request as ready for review September 18, 2026 11:59
@novelKR
novelKR merged commit f810e2d into main Sep 18, 2026
4 checks passed
@novelKR
novelKR deleted the cursor/p0-filesystem-semantics branch September 18, 2026 11:59
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