Skip to content

Conversation

@pyramation
Copy link
Contributor

Summary

This PR creates a ZenFsAdapter class that implements just-bash's IFileSystem interface, enabling just-bash to operate directly on a zen-fs filesystem. This allows writes made via just-bash commands to be visible from the zen-fs perspective (and vice versa), rather than requiring manual file copying between separate filesystems.

The tests have been refactored to remove redundant tests that only exercised one library in isolation, focusing instead on demonstrating the integration between just-bash and zen-fs.

Key changes:

  • New ZenFsAdapter class (186 lines) wrapping zen-fs sync APIs as async methods
  • Adapter auto-creates parent directories on write operations (via ensureParentDirs)
  • 9 integration tests demonstrating bidirectional file operations

Review & Testing Checklist for Human

  • Verify ZenFsAdapter interface compatibility: The adapter implements methods based on just-bash's IFileSystem interface, but there's no explicit type import/check. Confirm the method signatures match what just-bash expects.
  • Review ensureParentDirs behavior: The adapter auto-creates parent directories on write/append/symlink/link operations. This differs from standard fs behavior - verify this is acceptable.
  • Check untested adapter methods: symlink, link, chmod, readlink, lstat are implemented but not covered by tests. Consider if these need test coverage.

Test plan:

cd packages/zen-bash
pnpm test

All 9 tests should pass, demonstrating:

  • Writing via just-bash, reading via zen-fs
  • Writing via zen-fs, processing via just-bash
  • Directory creation, file copy/move/remove operations

Notes

The adapter wraps zen-fs sync methods in async functions since just-bash's IFileSystem interface is async. The getAllPaths() method implements a recursive directory walk for glob support.

Link to Devin run: https://app.devin.ai/sessions/e5a59ab234c5481e817dad43a74cfc6e
Requested by: Dan Lynch (@pyramation)

- Created ZenFsAdapter that implements IFileSystem interface
- Removed redundant tests that only tested one library
- Added tests demonstrating just-bash writing to zen-fs filesystem
- Tests verify writes via just-bash are visible from zen-fs perspective
@devin-ai-integration
Copy link

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit 57cb93f into main Dec 28, 2025
1 check passed
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.

2 participants