feat: make feasibility agent choose validators from catalog#30
Conversation
Summary of ChangesHello @naaa760, 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 feasibility agent's intelligence by allowing it to dynamically select appropriate validators from a catalog when analyzing rule descriptions and generating YAML configurations. This change moves away from static, hardcoded rule logic, making the agent more adaptable and robust in handling diverse rule requirements. The update also improves the transparency of the agent's decision-making by explicitly tracking the chosen validators throughout the process. Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request is a solid improvement, refactoring the feasibility agent to dynamically select validators from a catalog rather than relying on hardcoded rules. This change significantly enhances the agent's extensibility and maintainability. The prompt engineering has been thoughtfully updated to guide the language model in this new, more flexible workflow. The modifications to data models and agent logic are consistent and well-executed. I have one minor suggestion to improve code conciseness and readability.
| validator_catalog = [] | ||
| for v in get_validator_descriptions(): | ||
| validator_catalog.append( | ||
| f"- name: {v.get('name')}\n" | ||
| f" event_types: {v.get('event_types')}\n" | ||
| f" parameter_patterns: {v.get('parameter_patterns')}\n" | ||
| f" description: {v.get('description')}" | ||
| ) | ||
| validators_text = "\n".join(validator_catalog) |
There was a problem hiding this comment.
The loop for building validators_text can be made more concise and idiomatic by using a generator expression directly within "\n".join(). This improves readability by reducing boilerplate and expressing the transformation more directly.
validators_text = "\n".join(
f"- name: {v.get('name')}\n"
f" event_types: {v.get('event_types')}\n"
f" parameter_patterns: {v.get('parameter_patterns')}\n"
f" description: {v.get('description')}"
for v in get_validator_descriptions()
)|
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (30.0%) is below the target coverage (80.0%). You can increase the patch coverage or adjust the target coverage. @@ Coverage Diff @@
## main #30 +/- ##
=======================================
+ Coverage 24.7% 32.0% +7.2%
=======================================
Files 79 85 +6
Lines 4497 5001 +504
=======================================
+ Hits 1115 1604 +489
- Misses 3382 3397 +15 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Feasibility prompt now lists the validator catalog and asks the LLM to pick applicable validators (no hardcoded rules).
Structured output/state adds
chosen_validators; AgentResult returns it for transparency.YAML generation uses only the chosen validators; if none fit, it returns empty instead of inventing params.
Pre-commit passes; scope limited to feasibility agent prompt/state/nodes/output.