Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... 📒 Files selected for processing (2)
✏️ Tip: You can disable in-progress messages and the fortune message in your review settings. 📝 WalkthroughWalkthroughThis PR adds four new Kiro file type detection variants (KiroPower, KiroAgent, KiroHook, KiroMcp) to expand file type coverage. Detection logic recognizes patterns for power definitions, agent configs, hook files, and MCP settings. New types are registered in the validation registry with appropriate validators and tested against updated fixtures. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Summary of ChangesHello, 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 system's ability to recognize and validate various Kiro-related configuration files. By introducing dedicated file types and precise detection logic, it ensures that Kiro powers, agents, hooks, and MCP settings are correctly identified and routed through the appropriate validation pipelines. This improvement is supported by comprehensive test updates and fixture reorganizations, laying a solid foundation for future Kiro-specific tooling and checks. Highlights
Changelog
Activity
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 effectively expands Kiro file type support by adding KiroPower, KiroAgent, KiroHook, and KiroMcp to the core FileType enum and implementing their detection logic. The changes are well-supported by new and updated tests, including more realistic fixture paths and contract tests to ensure correct file type mapping. The introduction of case-insensitive path helpers is a nice touch for robustness. I have one suggestion to improve the readability of the new detection logic. Overall, this is a solid contribution.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/agnix-core/src/file_types/detection.rs (1)
1344-1468: Add explicit uppercase.KIRO/...test cases for all new Kiro detectors.The current tests validate the main paths, but Line 1344 onward would be more regression-resistant with direct uppercase directory assertions for power/agent/hook/mcp routes.
Suggested test hardening
@@ fn detect_kiro_power_from_dot_kiro_powers_path() { assert_eq!( detect_file_type(Path::new(".kiro/powers/deploy/POWER.md")), FileType::KiroPower ); + assert_eq!( + detect_file_type(Path::new(".KIRO/POWERS/deploy/POWER.md")), + FileType::KiroPower + ); @@ fn detect_kiro_agent_json() { assert_eq!( detect_file_type(Path::new("home/.kiro/agents/reviewer.JSON")), FileType::KiroAgent ); + assert_eq!( + detect_file_type(Path::new("home/.KIRO/AGENTS/reviewer.json")), + FileType::KiroAgent + ); @@ fn detect_kiro_hook_file() { assert_eq!( detect_file_type(Path::new(".kiro/hooks/on-save.kiro.hook")), FileType::KiroHook ); + assert_eq!( + detect_file_type(Path::new(".KIRO/HOOKS/on-save.kiro.hook")), + FileType::KiroHook + ); @@ fn detect_kiro_mcp_settings_file() { assert_eq!( detect_file_type(Path::new(".kiro/settings/mcp.json")), FileType::KiroMcp ); + assert_eq!( + detect_file_type(Path::new(".KIRO/SETTINGS/MCP.JSON")), + FileType::KiroMcp + ); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/agnix-core/src/file_types/detection.rs` around lines 1344 - 1468, Tests for the various Kiro detectors (functions calling detect_file_type and expecting FileType::KiroPower, KiroAgent, KiroHook, KiroMcp) are missing explicit uppercase-directory cases; add assertions mirroring the existing tests but using uppercase ".KIRO/..." paths (e.g., extend detect_kiro_power_from_dot_kiro_powers_path, detect_kiro_agent_json, detect_kiro_hook_file, detect_kiro_mcp_settings_file) to assert detect_file_type(Path::new(".KIRO/powers/..."), Path::new("HOME/.KIRO/agents/..."), Path::new(".KIRO/hooks/..."), Path::new(".KIRO/settings/mcp.json")) return the same FileType variants, and where appropriate add negative assertions ensuring non-matching names still do not return those FileType variants.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@crates/agnix-core/src/file_types/detection.rs`:
- Around line 1344-1468: Tests for the various Kiro detectors (functions calling
detect_file_type and expecting FileType::KiroPower, KiroAgent, KiroHook,
KiroMcp) are missing explicit uppercase-directory cases; add assertions
mirroring the existing tests but using uppercase ".KIRO/..." paths (e.g., extend
detect_kiro_power_from_dot_kiro_powers_path, detect_kiro_agent_json,
detect_kiro_hook_file, detect_kiro_mcp_settings_file) to assert
detect_file_type(Path::new(".KIRO/powers/..."),
Path::new("HOME/.KIRO/agents/..."), Path::new(".KIRO/hooks/..."),
Path::new(".KIRO/settings/mcp.json")) return the same FileType variants, and
where appropriate add negative assertions ensuring non-matching names still do
not return those FileType variants.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (15)
CHANGELOG.mdcrates/agnix-cli/tests/kiro_fixture_inventory.rscrates/agnix-core/src/file_types/detection.rscrates/agnix-core/src/file_types/types.rscrates/agnix-core/src/registry.rscrates/agnix-core/tests/api_contract.rstests/fixtures/README.mdtests/fixtures/kiro-mcp/.kiro/settings/mcp.jsontests/fixtures/kiro-powers/.kiro/powers/bad-mcp/POWER.mdtests/fixtures/kiro-powers/.kiro/powers/bad-mcp/mcp.jsontests/fixtures/kiro-powers/.kiro/powers/empty-body/POWER.mdtests/fixtures/kiro-powers/.kiro/powers/empty-keywords/POWER.mdtests/fixtures/kiro-powers/.kiro/powers/missing-frontmatter/POWER.mdtests/fixtures/kiro-powers/.kiro/powers/valid-power/POWER.mdtests/fixtures/kiro-powers/.kiro/powers/valid-power/mcp.json
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0ac56e879
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR adds four new Kiro file type detection surfaces (KiroPower, KiroAgent, KiroHook, KiroMcp) to the file type enum and validator registry, enabling the validation pipeline to route these Kiro configuration surfaces correctly. It closes issue #594 and is part of a broader Kiro feature series (preceding dedicated rule validation PRs).
Changes:
- Adds 4 new
FileTypeenum variants (KiroPower,KiroAgent,KiroHook,KiroMcp) with Display and test coverage - Implements path-based detection guards in
detect_file_typewith case-insensitive matching and MCP/agent filename guardrails; removes a now-redundantpath_contains_consecutive_components_cialias - Registers the new file types with placeholder validators (
ImportsValidatorfor Power/Agent/Hook,McpValidatorfor MCP), adds a fixture inventory, contract and routing tests, and moves Kiro power fixtures to realistic.kiro/powers/…paths
Reviewed changes
Copilot reviewed 8 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
crates/agnix-core/src/file_types/types.rs |
Adds 4 new FileType variants with Display impl and updated tests |
crates/agnix-core/src/file_types/detection.rs |
New helper functions (ends_with_ignore_ascii_case, starts_with_ignore_ascii_case) and early-return detection guards for all 4 Kiro file types; removes dead CI alias |
crates/agnix-core/src/registry.rs |
Registers 4 new Kiro file types with validators, updates count constants, adds routing test |
crates/agnix-core/tests/api_contract.rs |
Updates variant list count and exhaustive match arms |
crates/agnix-cli/tests/kiro_fixture_inventory.rs |
Updates fixture paths to new .kiro/powers/… structure; adds explicit file-type assertion tests |
tests/fixtures/kiro-powers/.kiro/powers/*/POWER.md |
Moves existing fixture files to realistic path structure |
tests/fixtures/kiro-powers/.kiro/powers/*/mcp.json |
Moves/adds MCP fixture files alongside POWER.md fixtures |
tests/fixtures/kiro-mcp/.kiro/settings/mcp.json |
New KiroMcp representative fixture file |
tests/fixtures/README.md |
Updates fixture paths and description to match restructured corpus |
CHANGELOG.md |
Adds entry for the new detection feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed follow-up review suggestions in commit df461f7:
Also addressed earlier review threads in commit 2dff8ba (readability refactor plus restored KiroPower generic-markdown validator coverage). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 15 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fde1e1c3c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b06d4713f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 16 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
KiroPower,KiroAgent,KiroHook, andKiroMcpfile types to the core enum and registry coveragedetect_file_typewith case-insensitive path handling and MCP/agent guardrails.kiro/powers/...paths and add.kiro/settings/mcp.jsonfixture coverageTesting
Closes #594
Summary by CodeRabbit
New Features
Tests