Skip to content

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Feb 12, 2026


This PR is on branch hermes.

⬇️ Download this PR

Branch

git fetch origin refs/heads/G4uato76xa2ezceilkolqtzoxhlxmxbg2 && git checkout -b pr-G4uato76xa2ezceilkolqtzoxhlxmxbg2 FETCH_HEAD

Checkout

git fetch origin refs/heads/G4uato76xa2ezceilkolqtzoxhlxmxbg2 && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/G4uato76xa2ezceilkolqtzoxhlxmxbg2 && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/G4uato76xa2ezceilkolqtzoxhlxmxbg2

Stacked PRs enabled by GHerrit.

gherrit-pr-id: G4uato76xa2ezceilkolqtzoxhlxmxbg2
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @joshlf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Hermes tool's capabilities by integrating the Aeneas formal verification tool. This integration establishes a complete pipeline where Rust code is first processed by Charon to produce Low-Level Bytecode (LLBC), which is then automatically translated into Lean code by Aeneas. This streamlines the process of formally verifying Rust programs within the Hermes ecosystem, providing a more robust and organized output structure for generated artifacts.

Highlights

  • Aeneas Integration: A new Rust module aeneas.rs was added to the Hermes tool, enabling the invocation of the Aeneas formal verification tool.
  • Workflow Enhancement: The Hermes main execution flow was updated to first run Charon to generate LLBC, and then automatically invoke Aeneas to translate this LLBC into Lean code.
  • Output Directory Refactoring: The directory structure for generated artifacts was refined, introducing distinct llbc_root and lean_generated_root paths for better organization.
  • Artifact Naming Standardization: A new artifact_slug method was introduced in HermesArtifact to provide a consistent, unique naming convention for generated files and directories across different tools.
  • Expanded Test Coverage: The integration test suite was significantly updated to accommodate the Aeneas integration, including a new Aeneas shim and new test fixtures covering various scenarios like cfg blind spots, external path dependencies, and macro expansions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • tools/hermes/src/aeneas.rs
    • Added a new module responsible for invoking the Aeneas tool with appropriate arguments, handling output directories, and error reporting.
  • tools/hermes/src/charon.rs
    • Updated the output directory for Charon to use the new llbc_root instead of charon_root.
  • tools/hermes/src/main.rs
    • Modified the main execution logic to import and sequentially call run_charon and run_aeneas.
    • Adjusted the behavior for cases with no Hermes annotations from an error to a warning.
  • tools/hermes/src/resolve.rs
    • Introduced new llbc_root and lean_generated_root methods to Roots for managing distinct output paths.
  • tools/hermes/src/scanner.rs
    • Refactored artifact naming by introducing artifact_slug for a base unique name and updating llbc_file_name to use it.
  • tools/hermes/tests/fixtures/cfg_blind_spot/expected_status.txt
    • Added expected test status for a new fixture.
  • tools/hermes/tests/fixtures/cfg_blind_spot/expected_stderr.txt
    • Added expected stderr output for a new fixture.
  • tools/hermes/tests/fixtures/cfg_blind_spot/source/Cargo.toml
    • Added Cargo manifest for a new test fixture.
  • tools/hermes/tests/fixtures/cfg_blind_spot/source/src/lib.rs
    • Added Rust source file for a new test fixture.
  • tools/hermes/tests/fixtures/external_path_dep/extra.rs
    • Added an external Rust source file for a new test fixture.
  • tools/hermes/tests/fixtures/external_path_dep/hermes.toml
    • Added Hermes configuration for a new test fixture.
  • tools/hermes/tests/fixtures/external_path_dep/source/Cargo.toml
    • Added Cargo manifest for a new test fixture.
  • tools/hermes/tests/fixtures/external_path_dep/source/src/lib.rs
    • Added Rust source file referencing an external path for a new test fixture.
  • tools/hermes/tests/fixtures/hidden_syntax_error/expected_status.txt
    • Added expected test status for a new fixture.
  • tools/hermes/tests/fixtures/hidden_syntax_error/expected_stderr.txt
    • Added expected stderr output for a new fixture.
  • tools/hermes/tests/fixtures/hidden_syntax_error/source/Cargo.toml
    • Added Cargo manifest for a new test fixture.
  • tools/hermes/tests/fixtures/hidden_syntax_error/source/src/lib.rs
    • Added Rust source file with a hidden syntax error for a new test fixture.
  • tools/hermes/tests/fixtures/macro_blind_spot/expected_status.txt
    • Updated the expected test status from failure to success.
  • tools/hermes/tests/fixtures/macro_blind_spot/source/Cargo.toml
    • Added library path configuration to the Cargo manifest.
  • tools/hermes/tests/fixtures/macro_blind_spot/source/src/hidden.rs
    • Added a new Rust source file for a test fixture.
  • tools/hermes/tests/fixtures/macro_blind_spot/source/src/lib.rs
    • Refactored macro usage to generate a module.
  • tools/hermes/tests/fixtures/map_canonical_mismatch/expected_status.txt
    • Updated the expected test status from failure to success.
  • tools/hermes/tests/fixtures/map_canonical_mismatch/expected_stderr.txt
    • Updated the expected stderr message.
  • tools/hermes/tests/fixtures/map_external_dep/expected_stderr.txt
    • Updated the expected stderr message.
  • tools/hermes/tests/fixtures/map_macro_expansion/expected_status.txt
    • Updated the expected test status from failure to success.
  • tools/hermes/tests/fixtures/map_macro_expansion/expected_stderr.txt
    • Updated the expected stderr message.
  • tools/hermes/tests/fixtures/map_mixed_diagnostics/expected_status.txt
    • Updated the expected test status from failure to success.
  • tools/hermes/tests/fixtures/map_mixed_diagnostics/expected_stderr.txt
    • Updated the expected stderr message.
  • tools/hermes/tests/fixtures/map_relative_path/expected_status.txt
    • Updated the expected test status from failure to success.
  • tools/hermes/tests/fixtures/map_relative_path/expected_stderr.txt
    • Updated the expected stderr message.
  • tools/hermes/tests/fixtures/map_std_lib/expected_status.txt
    • Updated the expected test status from failure to success.
  • tools/hermes/tests/fixtures/map_std_lib/expected_stderr.txt
    • Updated the expected stderr message.
  • tools/hermes/tests/fixtures/map_std_library/expected_stderr.txt
    • Updated the expected stderr message.
  • tools/hermes/tests/fixtures/map_symlinked_file/expected_stderr.txt
    • Updated the expected stderr message.
  • tools/hermes/tests/fixtures/map_workspace_path_dep/expected_status.txt
    • Updated the expected test status from failure to success.
  • tools/hermes/tests/fixtures/map_workspace_path_dep/expected_stderr.txt
    • Updated the expected stderr message.
  • tools/hermes/tests/fixtures/no_specs/expected_status.txt
    • Updated the expected test status from failure to success.
  • tools/hermes/tests/fixtures/orphaned_entry/hermes.toml
    • Added Hermes configuration for a new test fixture.
  • tools/hermes/tests/fixtures/orphaned_entry/source/Cargo.toml
    • Added Cargo manifest for a new test fixture.
  • tools/hermes/tests/fixtures/orphaned_entry/source/src/lib.rs
    • Added Rust source file with an orphaned entry for a new test fixture.
  • tools/hermes/tests/fixtures/split_personality_mod/hermes.toml
    • Added Hermes configuration for a new test fixture.
  • tools/hermes/tests/fixtures/split_personality_mod/source/Cargo.toml
    • Added Cargo manifest for a new test fixture.
  • tools/hermes/tests/fixtures/split_personality_mod/source/src/a.rs
    • Added a Rust source file for a new test fixture.
  • tools/hermes/tests/fixtures/split_personality_mod/source/src/lib.rs
    • Added Rust source file defining modules for a new test fixture.
  • tools/hermes/tests/fixtures/warnings_vs_errors/expected_status.txt
    • Updated the expected test status from failure to success.
  • tools/hermes/tests/fixtures/warnings_vs_errors/expected_stderr.txt
    • Updated the expected stderr message.
  • tools/hermes/tests/integration.rs
    • Modified ArtifactExpectation struct to include an optional kind field.
    • Added logic to copy extra.rs for specific tests.
    • Introduced an Aeneas shim for testing purposes.
    • Set a default RUST_LOG level to warn.
    • Updated artifact assertion logic to handle different artifact kinds and root directories.
Activity
  • No explicit human activity (comments, reviews) was provided in the context. The PR description only contained a gherrit-pr-id.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the invocation of Aeneas after Charon runs, which is a key step in the verification toolchain. The changes include a new aeneas.rs module, updates to directory structures for build artifacts, and significant enhancements to the integration testing framework to support aeneas. The code is well-structured and the refactoring to create an artifact_slug is a nice improvement.

However, I've identified a couple of issues in the test runner (integration.rs) that will prevent the new tests for aeneas from working as intended. One issue is with how test expectations are loaded, and another is with parsing the arguments logged by the new aeneas shim. I've left a specific comment on the latter. Addressing these will be important to ensure the new functionality is properly tested.

r#"#!/bin/sh
echo "AENEAS INVOKED" >> "{0}"
for arg in "$@"; do
echo "AENEAS_ARG:$arg" >> "{0}"
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The aeneas shim logs arguments with the prefix AENEAS_ARG:. However, the existing parse_command_log function in this file only parses arguments with the ARG: prefix. This means that any command expectations for aeneas will not be checked correctly.

To fix this, you should either update parse_command_log to handle AENEAS_ARG: (and potentially other prefixes for future shims), or change the prefix here to ARG:. If you change it to ARG:, be aware that charon and aeneas invocations will be logged to the same file and might be hard to distinguish if the order of execution is not guaranteed.

Suggested change
echo "AENEAS_ARG:$arg" >> "{0}"
echo "ARG:$arg" >> "{0}"

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.87%. Comparing base (fe0159f) to head (92a5536).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           Gmkf32xtwlqyoky63oeo4l5id2hqup3os    #3048   +/-   ##
==================================================================
  Coverage                              91.87%   91.87%           
==================================================================
  Files                                     20       20           
  Lines                                   6057     6057           
==================================================================
  Hits                                    5565     5565           
  Misses                                   492      492           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

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