refactor(bindings): unify mount API, read-only by default#1154
Merged
Conversation
Rename MountConfig.readOnly → writable (default false) so mounts are safe-by-default. Callers must explicitly pass writable: true to enable host writes, instead of remembering to pass readOnly: true for safety.
Align both bindings to the same conceptual mount API:
- files: dict/record for in-memory text files (writable)
- mounts: list/array of {host_path, vfs_path?, writable?} (read-only default)
- mount()/unmount() runtime methods on all bindings
Python: replace 6 mount kwargs with files dict + mounts list,
rename FileSystem.real(readwrite=) to writable=.
JS: rename mountReal() to mount().
Add binding parity requirement to spec 003-vfs and maintenance
checklist to spec 012-maintenance.
- Update _bashkit.pyi stubs to match new files/mounts API - Rename readwrite → writable in FileSystem.real stub - Add test_bash_mounts_readonly_by_default verifying safe default
- Add tests for missing host_path and non-dict mount entries - Remove unused py parameter from parse_mounts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
writable: trueto enable host writesfilesdict +mountslist + runtimemount()/unmount())specs/003-vfs.mdand maintenance checklist tospecs/012-maintenance.mdBefore → After
JS:
Python:
Test plan
filesdict,mountslist, read-only default, writable, live mount/unmountmount()/unmount()runtime methodstest_bash_mounts_readonly_by_defaultverifies safe default_bashkit.pyi) updatedcargo check,cargo fmt,ruff check,ruff formatall clean