What we found
Building a custom filesystem backend against the declared IFileSystem Protocol (just_bash/types.py), five methods that real commands invoke are absent from the Protocol: lstat (called by the test builtin and readlink), cp, mv, link (the cp/mv/ln commands call the backend directly rather than composing read+write), and readdir_with_file_types. A backend that implements exactly the Protocol passes type-checking and then dies at runtime with AttributeError on test -L, cp, mv, ln, and some ls paths.
All four built-in backends (InMemoryFs, ReadWriteFs, OverlayFs, MountableFs) implement these five — which is itself the evidence they're de-facto required. #6 was one instance of this class (utimes missing from ReadWriteFs); this is the general case for third-party backends: the Protocol is the advertised contract, and it under-promises.
Ask
Add the five methods to IFileSystem (or a documented IExtendedFileSystem), so mypy/pyright catch an incomplete backend at build time instead of an agent hitting AttributeError mid-session.
Context
We hit this wiring a remote-workspace backend (network filesystem semantics) under just-bash 0.2.1.
PR inbound for this.
What we found
Building a custom filesystem backend against the declared IFileSystem Protocol (just_bash/types.py), five methods that real commands invoke are absent from the Protocol: lstat (called by the test builtin and readlink), cp, mv, link (the cp/mv/ln commands call the backend directly rather than composing read+write), and readdir_with_file_types. A backend that implements exactly the Protocol passes type-checking and then dies at runtime with AttributeError on test -L, cp, mv, ln, and some ls paths.
All four built-in backends (InMemoryFs, ReadWriteFs, OverlayFs, MountableFs) implement these five — which is itself the evidence they're de-facto required. #6 was one instance of this class (utimes missing from ReadWriteFs); this is the general case for third-party backends: the Protocol is the advertised contract, and it under-promises.
Ask
Add the five methods to IFileSystem (or a documented IExtendedFileSystem), so mypy/pyright catch an incomplete backend at build time instead of an agent hitting AttributeError mid-session.
Context
We hit this wiring a remote-workspace backend (network filesystem semantics) under just-bash 0.2.1.
PR inbound for this.