Skip to content

docs(#1801): add cross-file consistency review guidance - #1804

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/1801-cross-file-consistency-guidance
Open

docs(#1801): add cross-file consistency review guidance#1804
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/1801-cross-file-consistency-guidance

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

What:

Add a "Cross-file Consistency" section to AGENTS.md that instructs reviewers to verify repeated patterns are applied consistently across all policy packages in a PR.

Why:

In PR #1781, the review agent approved a change where is_string() guard clauses were added to 4 packages but one (sbom.rego) was missing the guard. A human reviewer caught the inconsistency 25 days later. The review agent analyzed each file independently rather than cross-referencing patterns across files. Adding explicit guidance about cross-file consistency checking helps both the review agent and code agent catch this class of issue.

The new section covers:

  • Verifying guard clauses, helper function calls, and error severity are consistent across all instances of a repeated pattern
  • Checking METADATA annotations follow the same structure across files
  • Suggesting extraction of shared helpers into policy/lib/ when logic is duplicated in 3+ packages

Tickets:

#1801


Closes #1801

Post-script verification

  • Branch is not main/master (agent/1801-cross-file-consistency-guidance)
  • Secret scan passed (gitleaks — c09eff2a05a0b5ce23515a96b907b8a6f361cdfb..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

Add a "Cross-file Consistency" section to AGENTS.md between the
"Review Checklist for New Policy Rules" and "PR Conventions"
sections. The new section instructs reviewers to verify that
repeated patterns (guard clauses, helper calls, error-handling
conventions) are applied consistently across all policy packages
in a PR. It also recommends extracting shared helpers into
policy/lib/ when logic is duplicated in 3+ packages.

This addresses a gap identified in PR #1781, where a missing
is_string() guard in sbom.rego was caught by a human reviewer
25 days after the review agent approved. The agent analyzed
files independently rather than cross-referencing patterns,
missing the inconsistency.

Note: make fmt could not run in the sandbox (dependency
download timeout). This is a documentation-only change to
AGENTS.md — no Rego files were modified, so rego formatting
is not applicable.

Closes #1801
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unit-tests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cross-file consistency review guidance to AGENTS.md

0 participants