Repository navigation
fix(ci): run the unit tests when agent instruction files change - #12494
Merged
Merged
Conversation
#12493 added the guardrails section "Long-running work reports progress proactively" but changed no Python, so "Run Tests" skipped it and test_every_companion_section_is_registered failed on main. Register the section and the classifier-denial rule with their CLAUDE.md anchors, and let ci-tests.yml run the tests for changes to CLAUDE.md, AGENTS.md, the Copilot instructions, .claude/guardrails.md, .claude/skills/ and agentic/commands/, which the unit tests read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H7HSkGyea1k2v293XiAMo8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H7HSkGyea1k2v293XiAMo8
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A moderate active CI issue remains because the workflow filter can skip checks for changes to agentic/docs/project-guide.md, allowing path/link regressions to go undetected.
1 open issue
What changed in this PR
This pull request restores CI coverage for agent-instruction changes and registers the new guardrails introduced by PR #12493.
Changes:
- Registers the new guardrails and classifier-denial rule with their required
CLAUDE.mdanchors. - Expands CI test triggering for instruction, skill, command, workflow, and prompt changes.
- Adds a changelog fragment documenting the fix.
- The CI path filter still omits
agentic/docs/, althoughtests/unit/test_agent_instructions.pyvalidatesagentic/docs/project-guide.md.
| File | Description |
|---|---|
tests/unit/test_agent_instructions.py |
Registers the new guardrail obligations and required binding anchors. |
changelog.d/guardrails-section-registry.md |
Documents the CI and instruction-registry fix. |
.github/workflows/ci-tests.yml |
Expands change detection so relevant agent-instruction changes trigger tests. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
test_agent_instructions.py reads it through AGENT_FILES (Copilot review). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H7HSkGyea1k2v293XiAMo8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
.claude/guardrails.mdsection "Long-running work reports progress proactively" without registering it intests/unit/test_agent_instructions.py, sotest_every_companion_section_is_registeredfails (seen on feat(agents): serve plotly and bokeh in the agent chat (PB-2a) #12490's CI run).ci-tests.ymlnow also runs the tests forCLAUDE.md,AGENTS.md,.github/copilot-instructions.md,.claude/guardrails.md,.claude/skills/andagentic/commands/, whichtests/unit/test_agent_instructions.pyandtests/unit/skillsread.Plan
N/A (follow-up to #12493)
Test plan
uv run --extra dev --extra test pytest tests/unit/test_agent_instructions.py tests/unit/skills tests/unit/workflows -n auto: 1,319 passedCLAUDE.md,.claude/guardrails.md, a skill and a command, and notdocs/index.mdorapp/(dry run of the grep)tools.changelog check --base origin/mainpasseshttps://claude.ai/code/session_01H7HSkGyea1k2v293XiAMo8