Skip to content

refactor(review): the review guards of .devops/review.md get a reader, or the guards and the unread constant are deleted #1916

Description

@dan-petty

Problem

The review-only guards moved from AGENTS.md to .devops/review.md in #1881. No model prompt of devops review carries them now. A guard that nothing reads is a rule with no check and no reader. The constant DEFAULT_REVIEW_CONVENTIONS_MAX_CHARS in src/devops_cli/config/defaults.py is also read by no code.

Evidence

  • The loader reads .devops/review.md and gives it to the review as conventions, but the analysis stage prompt does not include them. The change for docs(agents): review-only guards move from AGENTS.md to .devops/review.md #1881 checked this.
  • GitHub Copilot code review reads AGENTS.md and REVIEW.md. It does not read .devops/review.md, so the guards no longer reach it on a pull request into main. Copilot review is by request only.
  • No code reads DEFAULT_REVIEW_CONVENTIONS_MAX_CHARS.

Remedy

Choose one. Either pass the guards (nearest_review_conventions) to the analysis stage and add a test that the prompt holds them, or delete the guards and the unread constant, because a rule with no reader is pruned. Prefer the option that the evidence-first direction supports: tools produce findings and the model correlates them. Check the Copilot case before deleting.

regression of #1881, shipped in v0.2.39

Proposed design

Problem statement

The review guards in .devops/review.md and the constant DEFAULT_REVIEW_CONVENTIONS_MAX_CHARS have no reader. No model prompt in devops review includes the guards, and no code reads the constant. Under ADR 0005, models correlate findings rather than create them, so guards that prevent model-generated false findings serve no purpose. The guards must be deleted along with the unread constant.

Acceptance criteria

  • Criterion 1: The guard bullets are removed from .devops/review.md.
    Verification: The file .devops/review.md contains no guard bullets, or the file is deleted if it holds nothing else.
  • Criterion 2: The constant DEFAULT_REVIEW_CONVENTIONS_MAX_CHARS is removed from src/devops_cli/config/defaults.py.
    Verification: Run grep -r DEFAULT_REVIEW_CONVENTIONS_MAX_CHARS src/ and confirm no match.
  • Criterion 3: No test asserts that a review prompt contains guard text from .devops/review.md.
    Verification: Run uv run pytest and confirm all tests pass with no assertion on guard content in a prompt.
  • Criterion 4: The function nearest_review_conventions and its call site remain consistent with the deleted guards.
    Verification: Run uv run pytest and confirm no test fails due to a missing or empty conventions string.

Key questions

  • Does the analysis stage prompt include the review conventions from .devops/review.md?: No. The loader reads the file and passes it as review_conventions at the call site, but the analysis stage prompt does not include the guard text. [sources: src/devops_cli/commands/review.py:1857, src/devops_cli/ai/review/review_environment.py:152]
  • Does any code read DEFAULT_REVIEW_CONVENTIONS_MAX_CHARS?: No. The constant is defined in defaults.py but no module imports or references it. [sources: src/devops_cli/config/defaults.py]
  • Does GitHub Copilot code review read .devops/review.md?: No. Copilot reads AGENTS.md and REVIEW.md. It does not read .devops/review.md, so the guards do not reach it on a pull request into main. [sources: CHANGELOG.md:406]
  • Should we pass the guards to the analysis stage or delete them?: Delete them. ADR 0005 states that models correlate and explain findings, not create them. The guards exist to prevent model-generated false findings, a role the model no longer holds. The Copilot case confirms no external reader needs the guards either. (proposed) [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/refactor
    on Oct 22, 2026
  2. dan-petty commented on Oct 22, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/refactor. The change involves refactoring the handling of review guards and related constants, which is a refactor type task.
    • Priority: P2-Medium. This issue affects the correctness and completeness of code review mechanisms but does not introduce new functionality or fix a critical bug.
    • Value: Medium. The change improves the consistency and reliability of the code review process, benefiting developers and maintainers.
    • Effort: Low. It mainly involves removing unused code and ensuring proper handling of existing code paths, which is a straightforward task.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at bb46660 (see proposed design in issue body).

  4. added
    priority/p2-medium
    status/ready
    value/medium
    effort/low
    on Oct 28, 2026
  5. added 2 commits that reference this issue on Oct 29, 2026
    6ae7123
    86af33b
  6. removed
    status/ready
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumsource/agenttype/refactorvalue/medium

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions