Skip to content

Add pathlib symlink and metadata OS calls#336

Open
chaliy wants to merge 6 commits intopydantic:mainfrom
chaliy:codex/issue-335-pathlib-os-calls
Open

Add pathlib symlink and metadata OS calls#336
chaliy wants to merge 6 commits intopydantic:mainfrom
chaliy:codex/issue-335-pathlib-os-calls

Conversation

@chaliy
Copy link
Copy Markdown

@chaliy chaliy commented Apr 15, 2026

What changed

This adds the pathlib symlink and metadata filesystem operations requested in issue #335.

  • add core OS-call support for Path.readlink()
  • add core OS-call support for Path.symlink_to(...)
  • add core OS-call support for Path.chmod(...)
  • add core OS-call support for Path.lstat() and Path.stat(follow_symlinks=False)
  • extend the Python AbstractOS / OSAccess surface accordingly
  • add Rust and Python coverage for the new calls

Why

Monty already exposed parts of pathlib filesystem access, but it could not round-trip symlink targets, create symlinks, change mode bits, or request non-following stat metadata. This closes that gap for the OS-call surface and the Python callback API.

Notes

  • direct/read-write mount handling supports the new operations
  • AbstractOS remains backward-compatible via the path_lstat() fallback to path_stat()
  • OverlayMemory still reports Path.chmod() and Path.symlink_to() as unsupported; that mode needs an explicit in-memory symlink model for full parity

Validation

  • make format-rs
  • make lint-rs
  • make lint-py
  • cargo test -p monty --test os_tests --features ref-count-panic
  • cargo test -p monty --test fs --features ref-count-panic
  • `uv run pytest crates/monty-python/tests/test_os_calls.py crates/monty-python/tests/test_os_access.py crates/monty-python/tests/test_os_access_raw.py

@chaliy chaliy changed the title [codex] Add pathlib symlink and metadata OS calls Add pathlib symlink and metadata OS calls Apr 15, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 15, 2026

Merging this PR will not alter performance

✅ 15 untouched benchmarks
⏩ 15 skipped benchmarks1


Comparing chaliy:codex/issue-335-pathlib-os-calls (babf080) with main (a8645d8)

Open in CodSpeed

Footnotes

  1. 15 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

@chaliy chaliy marked this pull request as ready for review April 16, 2026 21:03
@chaliy
Copy link
Copy Markdown
Author

chaliy commented Apr 16, 2026

PR touches the monty-dataset, which triggers a considerable number of code paths that are not covered by unit tests. Should I still attempt to satisfy codecov?

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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