feat(rivetkit-agent-os): phase 3 filesystem — mkdir/readdir/exists/move/deleteFile/readFiles/writeFiles/readdirRecursive arms + batch DTOs#5195
Conversation
…ve/deleteFile/readFiles/writeFiles/readdirRecursive arms + batch DTOs
Code Review: Phase 3 Filesystem ActionsOverviewThis PR adds eight new filesystem action handlers (mkdir, readdir, exists, move, deleteFile, writeFiles, readFiles, readdirRecursive) to rivetkit-agent-os, and refactors the WriteFileContent/JsonCompatUint8Array DTOs from mod.rs into filesystem.rs where they now live alongside the new batch DTOs. The overall shape follows the existing readFile/writeFile pattern cleanly. Issues1. Em dashes in doc comments (project convention violation) Multiple new doc comments use em dashes. CLAUDE.md explicitly prohibits em dashes and says to use periods instead. Affects mkdir, readdir, exists, move_path, delete_file, write_files, read_files, and readdir_recursive doc comments. 2. Misleading readdir doc comment The comment states "Returns the (unsorted) child names, including 3. Unnecessary The 4. Overly wide visibility on moved types When WriteFileContent and JsonCompatUint8Array lived in mod.rs they were module-private. After the move they are pub in filesystem.rs, and JsonCompatUint8Array::bytes went from a private field to a pub field. Since nothing outside this crate needs to construct these, pub(crate) (or pub(super) for the field) would be the right scope. 5. Forward-looking comment in delete_file The comment says: "Non-recursive by default; matches JS deleteFile semantics (use delete for the recursive variant when added)." "When added" references planned future work. CLAUDE.md cautions against documenting things that are not there yet. The non-recursive behaviour is self-explanatory; the note about a future recursive variant belongs in a todo file, not in the source. 6. String content forced to bytes in write_files All content variants including WriteFileContent::String are converted to FileContent::Bytes. The single-file writeFile arm likely passes FileContent::Text when the variant is a string. This inconsistency means string content sent through writeFiles will be stored differently than through writeFile. Worth confirming this is intentional, or mirroring the single-file logic. Minor Observations
SummaryThe core logic is sound and follows the established dispatcher pattern. Main actionable items: fix the em dashes, confirm or correct the readdir dot-entry claim, narrow pub visibility on the moved types, drop the forward-looking comment in delete_file, and verify the string-to-bytes coercion in write_files. |
No description provided.