Skip to content

Pseudo filesystem support#85

Merged
samuelcolvin merged 39 commits intomainfrom
files
Feb 3, 2026
Merged

Pseudo filesystem support#85
samuelcolvin merged 39 commits intomainfrom
files

Conversation

@samuelcolvin
Copy link
Member

Implement sandboxed filesystem access through Python's pathlib module. The design uses:

  • OsAccess trait: Trait with methods like stat(), exists(), read_bytes() - passed as impl OsAccess generic
  • External function mechanism: Path filesystem methods yield via existing external function pattern
  • Run loop interception: The run loop intercepts path-related external calls and routes them through the OsAccess implementation
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 29, 2026

Merging this PR will not alter performance

✅ 11 untouched benchmarks


Comparing files (3e24968) with main (9b8aa64)

Open in CodSpeed
samuelcolvin and others added 14 commits January 30, 2026 09:46
- Add MontyObject::NamedTuple variant for named tuple representation
- Add StatMode and StatPerms structs for ergonomic file mode creation
- Add file_stat, dir_stat, symlink_stat builders in os.rs
- Add stat_result field names to StaticStrings
- Update os_tests.rs with round-trip tests using new API
- Add NamedTuple handling to JS and Python converters

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Instead of converting NamedTuple to a plain tuple, now creates a proper
Python namedtuple type using collections.namedtuple(type_name, field_names)
and instantiates it with the values. This preserves named field access.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use raw i64 mode values instead of wrapper types. The file_stat,
dir_stat, and symlink_stat functions now document common permission
values like 0o644 and 0o755.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Allows handling OS calls (Path.exists, Path.stat, etc.) synchronously
in run() via a callback, instead of requiring start/resume flow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@samuelcolvin
Copy link
Member Author

!reviewfast

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

@codecov
Copy link

codecov bot commented Feb 2, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@samuelcolvin samuelcolvin merged commit f774f1f into main Feb 3, 2026
23 checks passed
@samuelcolvin samuelcolvin deleted the files branch February 3, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant