Skip to content

refactor(fspy): carry paths inside access variants - #848

Merged
wan9chi merged 3 commits into
claude/fspy-invalid-access-modes-6856f9from
claude/fspy-access-paths
Oct 13, 2026
Merged

wan9chi merged 3 commits into
claude/fspy-invalid-access-modes-6856f9from
claude/fspy-access-paths

Conversation

@wan9chi

@wan9chi wan9chi commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Motivation

fspy may later track accesses that touch more than one path, such as a rename from one path to another. A record of one path plus one mode can't express that, and neither can consumers that keep a map from path to mode.

Changes

  • PathAccess is now an enum whose variants hold their own paths: Read(path), Write(path), ReadWrite(path), ReadDir(path). An access with two paths becomes one more variant. The wire bytes don't change: a one-byte tag, then the path.
  • PathAccess::paths() yields every path an access touched, for checks like "did anything touch this path".
  • Consumers work on accesses instead of path-to-mode maps:
    • TrackedPathAccesses matches on each variant.
    • The test helper takes the expected variant: assert_contains(&accesses, path, PathAccess::Read).
    • fspy_e2e writes one line per distinct access.
  • AccessMode is no longer sent and stays only at the clients' open entry points, where an interception chooses the kind before the path is resolved. AccessMode::with_path builds the record. Exec resolution reports plain paths, and fspy re-exports IpcPath instead of AccessMode.

🤖 Generated with Claude Code

A record was one path plus a mode, which leaves no room for accesses
that touch more than one path, such as a rename from one path to
another. PathAccess is now an enum whose variants hold their own
paths. The wire bytes are unchanged: a one-byte tag, then the path.

Consumers work on accesses instead of path-to-mode maps. AccessMode
remains only for interceptions, which decide the mode before the path
is resolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wan9chi
wan9chi added this pull request to stack #849 October 13, 2026 04:43
…py-access-paths

# Conflicts:
#	crates/fspy_shared/src/ipc/mod.rs
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.20%  [ -5.39% ..  +5.61%]  overhead   +52.24%
dynamic/access             change  +0.00%  [ -7.30% ..  +6.64%]  overhead   +23.96%
dynamic/access-relative    change  +0.00%  [ -7.46% ..  +9.08%]  overhead   +72.64%
dynamic/access-contended   change  -0.11%  [-11.06% ..  +9.68%]  overhead   +25.15%
static/launch              change  +0.86%  [ -5.76% ..  +7.67%]  overhead  +180.96%
static/access              change  +1.07%  [ -3.32% .. +17.02%]  overhead +1452.12%
static/access-relative     change  +0.07%  [ -2.13% ..  +2.27%]  overhead +1911.12%
static/access-contended    change  +0.71%  [ -0.75% ..  +1.59%]  overhead +1556.15%

macos

dynamic/launch             change  -0.12%  [ -3.02% ..  +2.78%]  overhead  +225.56%
dynamic/access             change  +1.07%  [ -3.74% ..  +4.85%]  overhead    +3.47%
dynamic/access-relative    change  -0.11%  [ -2.21% ..  +1.91%]  overhead  +259.57%
dynamic/access-contended   change  -0.56%  [ -7.84% ..  +3.74%]  overhead    +2.85%

windows

dynamic/launch             change  +0.02%  [-10.71% ..  +9.39%]  overhead   +26.21%
dynamic/access             change  -0.53%  [-19.78% .. +23.23%]  overhead    +4.11%
dynamic/access-relative    change  -0.25%  [ -5.90% ..  +6.62%]  overhead    +2.14%
dynamic/access-contended   change  -0.92%  [-13.90% ..  +4.34%]  overhead    +3.29%

Exec resolution only ever reports reads, so its callbacks now take a
plain path and their callers build PathAccess::Read. AccessMode is left
at the clients' open entry points, where an interception chooses the
kind before the path is resolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wan9chi
wan9chi merged commit fdb7403 into main Oct 13, 2026
21 checks passed
@wan9chi
wan9chi deleted the claude/fspy-access-paths branch October 13, 2026 05:46
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