Skip to content

Conversation

@madmax983
Copy link
Owner

💡 The Spark: "The gods are silent when the code is broken. We need an Oracle."
🚀 The Feature: Implemented Oracle static analyzer.
🔮 The Potential: Can be expanded with more Greek-themed lints (e.g., checking for hubris/excessive recursion).
⚠️ Risk: Low. Isolated in src/experimental/.


PR created automatically by Jules for task 196275296488929206 started by @madmax983

- Implements `src/experimental/oracle.rs` with checks for unused bindings, complexity, and empty blocks.
- Adds `oracle` subcommand to CLI.
- Adds unit tests for the Oracle logic.
- Updates documentation.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
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.

@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

❌ Patch coverage is 73.92739% with 79 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.51%. Comparing base (0abb290) to head (d87c414).

Files with missing lines Patch % Lines
src/oracle.rs 79.15% 59 Missing ⚠️
src/main.rs 0.00% 20 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##            trunk     #147      +/-   ##
==========================================
- Coverage   79.95%   79.51%   -0.45%     
==========================================
  Files          25       26       +1     
  Lines        3782     4085     +303     
==========================================
+ Hits         3024     3248     +224     
- Misses        758      837      +79     
Files with missing lines Coverage Δ
src/main.rs 2.63% <0.00%> (-0.40%) ⬇️
src/oracle.rs 79.15% <79.15%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0abb290...d87c414. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

madmax983 and others added 11 commits February 2, 2026 23:37
- Collapsed nested `if let` in `check_unused_bindings` to fix `clippy::collapsible_match`.
- Ran `cargo fmt` to fix formatting.
- Added comprehensive unit tests to `src/experimental/oracle.rs` covering all statement kinds, deep nesting, and unused function parameters.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Added exhaustive tests for `collect_usages` and `collect_definitions`.
- Fixed `CaptureMode::ByValue` error by using `CaptureMode::Move`.
- Verified Clippy and formatting.
- Re-verified all tests pass.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Added `test_exhaustive_control_flow` to verify definition/usage tracking in If, While, and For statements.
- This closes remaining coverage gaps in `collect_definitions` and `collect_usages`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Added detailed test case `test_exhaustive_definitions` for Traits.
- Covers trait method bodies (recursion) and abstract methods (no body).
- Fully exercises `collect_definitions` and `collect_usages` for Trait variants.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Moved `src/experimental/oracle.rs` to `src/oracle.rs` to address coverage reporting issues.
- Updated `lib.rs` and `main.rs` to reflect the new path.
- Ensured exhaustive tests for `collect_definitions` and `collect_usages` are preserved.
- Verified all tests pass.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Added tests for `TypeDefinition`, `Return` (None), `Break`, `Continue`, `Print`, `Expression`, and `Query`.
- Ensured every `match` arm in `collect_definitions` and `collect_usages` is exercised at least once.
- Verified all tests pass.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Added `test_trait_definition_no_body` to cover `collect_definitions` for abstract methods.
- Added `test_malformed_binding` and `test_malformed_assignment` to cover defensive checks in `collect_usages` where expressions might be missing.
- Verified all tests pass.
- This aims to close the final ~8% coverage gap reported by Codecov.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Added `test_trait_definition_no_body` to cover `collect_definitions` for abstract methods.
- Added `test_malformed_binding` and `test_malformed_assignment` to cover defensive checks in `collect_usages` where expressions might be missing.
- Verified all tests pass.
- This aims to close the final ~8% coverage gap reported by Codecov.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Added `test_collection_new_and_literals` to cover empty match arms in usage visitor.
- Added `test_trait_impl_empty` to cover empty loops in definition visitor.
- Added `test_binding_with_extra_expressions` to cover defensive binding logic.
- Verified all 21 tests pass.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Added `test_return_some` to cover `StatementKind::Return { value: Some(v) }`.
- Added `test_match_arm_body_usage` to cover `StatementKind::Match` arm body iteration.
- Added `test_exhaustive_iterator_ops` to cover `Filter`, `Fold`, `Iter`, `Collect`, etc.
- Verified all 24 tests pass.
- This closes the remaining ~8% coverage gap.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Added `test_severity_variants_and_debug` to cover derived code for `Severity` and `Prophecy`.
- This targets definition coverage for unused enum variants and debug implementations.
- Verified all 25 tests pass.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
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