Skip to content

[AI][eldritch] Implement file.list_recent()#1780

Merged
KCarretto merged 3 commits intomainfrom
ai-eldritch-list-recent-15882233856388592596
Feb 9, 2026
Merged

[AI][eldritch] Implement file.list_recent()#1780
KCarretto merged 3 commits intomainfrom
ai-eldritch-list-recent-15882233856388592596

Conversation

@KCarretto
Copy link
Copy Markdown
Collaborator

@KCarretto KCarretto commented Feb 9, 2026

Implemented file.list_recent() to recursively scan and return recently modified files.

image

PR created automatically by Jules for task 15882233856388592596 started by @KCarretto

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>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2564    ±0 2564    ±0 0    ±0 0    ±0 0    ±0 0    ±0 1ms    ±0

Previous Results

Build 🏗️ Result 🧪 Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
#935 2564 2564 0 0 0 0 18.3s

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2564 0 0 5.2s

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
eldritch-libsys: std::dll_inject_impl::tests::test_dll_inject_simple 1 5.2s 5.2s
imix::bin/imix: install::tests::test_install_execution 3 1.2s 3.4s
imix::bin/imix: install::tests::test_install_execution 3 1.2s 3.4s
imix::bin/imix: install::tests::test_install_execution 3 1.2s 3.4s
imix::bin/imix: tests::task_tests::test_task_streaming_error 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_streaming_error 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_streaming_error 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_streaming_output 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_streaming_output 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_streaming_output 3 3.0s 3.0s

🎉 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>;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also update our eldritch.md user guide with the new method!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@KCarretto KCarretto requested a review from hulto February 9, 2026 04:13
google-labs-jules bot and others added 2 commits February 9, 2026 04:18
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>
@KCarretto KCarretto marked this pull request as ready for review February 9, 2026 04:54
@KCarretto KCarretto enabled auto-merge February 9, 2026 04:54
@KCarretto KCarretto added this pull request to the merge queue Feb 9, 2026
Merged via the queue into main with commit 3e852b4 Feb 9, 2026
8 checks passed
@KCarretto KCarretto deleted the ai-eldritch-list-recent-15882233856388592596 branch February 9, 2026 22:52
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