Repository navigation
fix(pr-assistant): block other agents' instruction files in automated fixes - #294
Merged
Merged
Conversation
… fixes #284 stopped automated fixes from committing AGENTS.md/CLAUDE.md after radar-ofertas#23, but the basename list missed AGENT.md, .windsurfrules, .clinerules and the folder-based rule files (.cursor/rules/, .github/instructions/, .clinerules/). These carry the same owner policy and must not be rewritten by a bot fix either. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cn6JQLtmA8NV75CtdV373W
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.
Requested by Antonio · project thread
Summary
Por quê: o #284 impediu que o auto-fix commitasse
AGENTS.md/CLAUDE.mddepois do incidente radar-ofertas#23 (fix trocou o AGENTS.md público por instruções privadas). MasisForbiddenPathsó compara o nome do arquivo com uma lista curta, então outros arquivos de instrução de agente, com a mesma natureza de política do dono, continuavam liberados:AGENT.md(Amp),.windsurfrules,.clinerules(arquivo ou pasta), e as regras baseadas em pasta.cursor/rules/*.mdce.github/instructions/*.instructions.md(Copilot), que o teste por nome de arquivo nunca pega.O que mudou:
ts/src/agents/pr_assistant/forbidden-paths.ts: adicionaagent.md,.windsurfrules,.clinerulesà lista por nome e uma regra por pasta (.cursor/rules/,.github/instructions/,.clinerules/) em qualquer nível, sem diferenciar maiúsculas.ts/tests/forbidden-paths.test.ts: casos positivos para cada um e negativos para vizinhos que continuam liberados (.cursor/mcp.json,.github/workflows/ci.yml,docs/instructions/setup.md,src/rules/a.ts).Quality Checklist
Verification
Como foi verificado
Antes da correção:
Depois:
Generated by Claude Code