ci: add self-validation to CI [skip changelog]#646
Conversation
Add agnix job to CI that uses ./ to validate the repo's own agent configurations against .agnix.toml on push and PR.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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 enhances the continuous integration process by introducing a self-validation step for agent configurations. It ensures that the repository's agent configurations are always valid by running the Highlights
Changelog
Ignored Files
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.
Pull request overview
Adds an agnix “self-validation” check to CI so the repository validates its own agent configuration/docs on pushes and PRs, and updates .agnix.toml suppressions to keep the new gate green.
Changes:
- Adds a new
agnixjob to.github/workflows/ci.ymlthat runs the repo’s./GitHub Action against.agnix.toml. - Expands and documents
disabled_rulesin.agnix.tomlto suppress additional rule IDs during self-validation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/ci.yml | Adds a new CI job that runs the local agnix composite action for repo self-validation. |
| .agnix.toml | Reformats and expands the disabled rule list to suppress additional rules during self-validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.agnix.toml
Outdated
| "CC-SK-017", # Intentional - version is a client-specific frontmatter field | ||
| "XML-001", # <ValidationOutcome> is a Rust type reference, not unclosed XML |
There was a problem hiding this comment.
Disabling XML-001 repo-wide reduces the usefulness of the new self-validation gate and may mask genuine unclosed-tag issues elsewhere. Since the trigger here appears to be Rust generic type syntax like LintResult<ValidationOutcome> in markdown, prefer fixing the docs (wrap the type in backticks or escape </>), or narrowing the suppression to specific paths, so XML balance checking stays active for the rest of the repo.
| # - XP-006: We intentionally have both CLAUDE.md and AGENTS.md | ||
| # - VER-001: Version pinning not needed for the linter itself | ||
| # - CC-MEM-006: Negative instructions are sometimes necessary in CLAUDE.md | ||
| # - PE-003: Weak language in docs is acceptable | ||
| disabled_rules = ["XP-001", "XP-002", "XP-003", "XP-006", "VER-001", "CC-MEM-006", "PE-003"] | ||
| disabled_rules = [ |
There was a problem hiding this comment.
The comment block above disabled_rules is now incomplete (it lists only the original suppressions, but the list also includes CDX-AG-005 / CC-MEM-009 / CC-SK-017 / XML-001). Updating the comment to match the new set will help future maintainers understand why these additional rules are suppressed.
| - name: Validate agent configurations | ||
| uses: ./ | ||
| with: | ||
| config: '.agnix.toml' | ||
| fail-on-error: 'true' |
There was a problem hiding this comment.
This CI job uses the local action (uses: ./) but does not set build-from-source: 'true', so it will validate using the latest released agnix binary rather than the code in this PR. That makes self-validation less reliable for changes to the linter/action and adds an external dependency on release availability. Consider enabling build-from-source (or pinning version explicitly) for this workflow job so it always validates with the PR's implementation.
| "PE-003", # Weak language in docs is acceptable | ||
| "CDX-AG-005", # AGENTS.md uses structured code blocks for API documentation | ||
| "CC-MEM-009", # CLAUDE.md is intentionally detailed - it's the project memory |
There was a problem hiding this comment.
Disabling CDX-AG-005 globally hides real broken backtick file references in CLAUDE.md/AGENTS.md (e.g., rules.json and VALIDATION-RULES.md are referenced without the knowledge-base/ prefix and do not exist at repo root). It would be better to fix the references so this rule can remain enabled, preserving the value of self-validation for link/file-rot in AGENTS.md.
There was a problem hiding this comment.
Code Review
This pull request updates the .agnix.toml configuration to suppress several linter rules, enabling self-validation in the CI pipeline. The reformatting of the disabled_rules list into a multi-line array with comments is a great improvement for readability and maintainability. I've added a couple of suggestions to make the justifications for the disabled rules even more precise, which should help with future maintenance.
Note: Security Review has been skipped due to the limited scope of the PR.
| "XP-001", # We document tool paths, mentioning them is expected | ||
| "XP-002", # Same as XP-001 | ||
| "XP-003", # Same as XP-001 |
There was a problem hiding this comment.
The comments for XP-001, XP-002, and XP-003 could be more precise. These are distinct rules checking for different conditions (Claude-specific features, Markdown structure, and hard-coded paths, respectively). Using 'Same as XP-001' for two of them can be confusing, and the comment for XP-001 is more applicable to XP-003. For better maintainability, it would be clearer if each rule had a specific justification.
| "XP-001", # We document tool paths, mentioning them is expected | |
| "XP-002", # Same as XP-001 | |
| "XP-003", # Same as XP-001 | |
| "XP-001", # We document Claude-specific features, which this rule flags | |
| "XP-002", # AGENTS.md structure is valid but may trigger this rule | |
| "XP-003", # We document tool paths, which this rule flags |
| "VER-001", # Version pinning not needed for the linter itself | ||
| "CC-MEM-006", # Negative instructions are sometimes necessary | ||
| "PE-003", # Weak language in docs is acceptable | ||
| "CDX-AG-005", # AGENTS.md uses structured code blocks for API documentation |
There was a problem hiding this comment.
The justification for disabling CDX-AG-005 could be more specific. The rule checks for references to missing files, while the comment mentions 'structured code blocks'. A more direct comment would clarify why it's being suppressed, for example, by explaining that the linter is misinterpreting content within code blocks as file paths.
| "CDX-AG-005", # AGENTS.md uses structured code blocks for API documentation | |
| "CDX-AG-005", # Linter incorrectly flags crate names in code blocks as missing files |
XML-001 suppression was unnecessary (code blocks aren't flagged) and broke test_cli_reports_xml_fixtures which expects XML-001 output.
The released v0.16.1 binary flags <ValidationOutcome> as XML-001 in code blocks, but the current source handles this correctly. Building from source ensures self-validation uses the latest detection logic.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable | ||
| with: | ||
| toolchain: stable | ||
|
|
||
| - name: Validate agent configurations | ||
| uses: ./ | ||
| with: | ||
| config: '.agnix.toml' | ||
| fail-on-error: 'true' | ||
| build-from-source: 'true' |
There was a problem hiding this comment.
The new agnix job runs the composite action with build-from-source: 'true', which triggers a full cargo build --release -p agnix-cli (see scripts/download.sh). Without a Rust cache step, this will recompile from scratch on every CI run and likely add several minutes. Consider adding Swatinem/rust-cache (similar to the ci job) or switching to build-from-source: 'false' if validating against the latest release is acceptable.
| "VER-001", # Version pinning not needed for the linter itself | ||
| "CC-MEM-006", # Negative instructions are sometimes necessary | ||
| "PE-003", # Weak language in docs is acceptable | ||
| "CDX-AG-005", # AGENTS.md uses structured code blocks for API documentation |
There was a problem hiding this comment.
CDX-AG-005 is meant to catch broken backtick-quoted file references in AGENTS.md. It looks like it’s being disabled to accommodate references like parsers/, schemas/, etc., which don’t exist at repo root and will always trigger this rule. If possible, prefer updating those references to the real paths (e.g., crates/agnix-core/src/parsers/) or avoiding backticks for conceptual module names so the rule can remain enabled for catching genuine broken links.
| "CDX-AG-005", # AGENTS.md uses structured code blocks for API documentation |
LintResult<ValidationOutcome> in prose triggers the unclosed XML tag rule. Wrapping in inline code backticks fixes this properly instead of suppressing the rule.
Summary
.agnix.tomlconfig with additional rule suppressions./action referenceTest plan