[AI][eldritch] Implement file.list_recent()#1780
Conversation
This change adds a new method `file.list_recent(path: str = "/", limit: int=10) -> List<str>` to the `eldritch` file library. It recursively scans the specified directory and returns a list of files sorted by their modification time in descending order (most recent first). Key changes: - Added `list_recent` to `FileLibrary` trait in `implants/lib/eldritch/stdlib/eldritch-libfile/src/lib.rs`. - Implemented `list_recent` in `implants/lib/eldritch/stdlib/eldritch-libfile/src/std/list_recent_impl.rs` using recursive `read_dir`. - Added fake implementation in `implants/lib/eldritch/stdlib/eldritch-libfile/src/fake.rs`. - Added tests for the new method. - Fixed potential infinite recursion issue by checking `entry.file_type()?.is_dir()` instead of following symlinks. - Ensured `no_std` compatibility by correctly managing imports. Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Summary
Previous Results
Insights
Slowest Tests
🎉 No failed tests in this run. | 🍂 No flaky tests in this run. Github Test Reporter by CTRF 💚 🔄 This comment has been updated |
| /// | ||
| /// **Errors** | ||
| /// - Returns an error string if scanning fails. | ||
| fn list_recent(&self, path: String, limit: i64) -> Result<Vec<String>, String>; |
There was a problem hiding this comment.
also update our eldritch.md user guide with the new method!
There was a problem hiding this comment.
I've updated docs/_docs/user-guide/eldritch.md to include documentation for file.list_recent. I also fixed the formatting issue in fake.rs that caused the CI failure.
This commit: - Fixes formatting issues in `implants/lib/eldritch/stdlib/eldritch-libfile/src/fake.rs` found by `cargo fmt`. - Updates `docs/_docs/user-guide/eldritch.md` to document the new `file.list_recent` method. Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
Implemented
file.list_recent()to recursively scan and return recently modified files.PR created automatically by Jules for task 15882233856388592596 started by @KCarretto