Skip to content

refactor(review): Pass AGENTS.md to the review prompt and set digest #2594

Open

Description

@dan-petty

Problem or Motivation

Found while building #1916 (origin/main 46958d4, 2026-10-29). devops review reads the target project's general conventions (AGENTS.md and its peers) but never gives them to a model, and it records a digest of them that no code sets.

Proposed Solution & Architectural Design

Decide with ADR 0005 (tools originate findings; the model explains them) and record the evidence:

  • either the group analysis prompt receives the target's conventions, bounded in size, and the profile records their digest; a test holds both;
  • or the conventions plumbing goes: nearest_conventions and its walk, the corpus and pull request copies, set_conventions, conventions_digest, the line in ai/tasks/review.md, and the protocol text.

Target Subsystem

devops review: ai/review/profile.py, ai/review/review_environment.py, ai/review/runner.py, ai/review/defects.py, ai/tasks/review.md, docs/SELF_IMPROVEMENT.md.

Existing Tool Considered

Nothing new is built either way. The analysis prompt and the profile already exist.

Related

#1916 retires .devops/review.md for the same reason.

Alternatives check of 2026-11-04: not-applicable.
Class: refactor, no search.
Tool: none found.

Proposed design

Problem statement

devops review reads the target's general conventions (AGENTS.md and its peers) but no prompt builder receives them. ReviewProfiler.set_conventions has no caller in src, so conventions_digest is empty in every real session. The code, the task file and the documents claim a feature that does not exist. ADR 0005 and docs/SELF_IMPROVEMENT.md say that no review stage gives project rules to the model. The change removes the dead conventions plumbing, so that the code and the documents agree.

Acceptance criteria

Requirement: Profile holds no conventions digest

The review profile SHALL NOT define conventions_digest, and ReviewProfiler SHALL NOT define set_conventions.

Scenario: Profile fields and an old profile file

  • WHEN A test builds a profile and loads a saved profile.json that still holds the key conventions_digest.
  • THEN The profile has no conventions_digest field, ReviewProfiler has no set_conventions, and the old file loads with no error.

Requirement: Review environment has no conventions reader

The module review_environment SHALL NOT define nearest_conventions, its directory walk or the list of conventions file names.

Scenario: Module names

  • WHEN A test lists the names of devops_cli.ai.review.review_environment.
  • THEN The names nearest_conventions and _TARGET_CONVENTIONS_CANDIDATES are absent, and reviewed_tree and validate_criteria_command still work.

Requirement: Pull request checkout copies only changed files

_materialize_pr_head SHALL write only the head version of each changed file and SHALL NOT copy conventions files from the base.

Scenario: Base has AGENTS.md and the pull request changes one source file

  • WHEN A test runs _materialize_pr_head with a fake GitHub client whose base holds AGENTS.md and whose pull request changes src/a.py.
  • THEN The destination directory holds src/a.py and holds no AGENTS.md.

Requirement: Defect corpus copies no conventions

devops review corpus generate SHALL NOT copy AGENTS.md or a peer conventions file into the corpus.

Scenario: Source with AGENTS.md

  • WHEN A test generates a corpus from a source directory that holds an AGENTS.md file.
  • THEN The corpus directory holds no AGENTS.md file.

Requirement: Task prompt makes no claim about conventions

The task file ai/tasks/review.md SHALL NOT tell the model to judge against conventions that the review does not give to it.

Scenario: Prompt text

  • WHEN A test reads ai/tasks/review.md.
  • THEN The text names no AGENTS.md, CLAUDE.md or conventions file that the target declares.

Requirement: Documents match the code

docs/SELF_IMPROVEMENT.md SHALL NOT name conventions_digest or describe a conventions swap per arm.

Scenario: Document text

  • WHEN A test reads docs/SELF_IMPROVEMENT.md.
  • THEN The text holds neither conventions_digest nor a step that swaps conventions between arms.

Existing Tool Considered

No open tool applies. The alternatives check gave not-applicable, class refactor. The change builds no code. It deletes about 100 lines of dead code, doc

Key questions

None.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/refactor
    status/new
    value/medium
    effort/medium
    on Oct 29, 2026
  2. dan-petty commented on Oct 29, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/refactor. The title is prefixed refactor and the body proposes either wiring existing plumbing or deleting it.
    • Priority: P3-Low. Dead plumbing and an always-empty digest cause no active break; the fix is a design decision, not a user-facing defect.
    • Value: Medium. The conventions digest is always empty, so devops ai runs compare compares nothing, and the model never receives target conventions.
    • Effort: Medium. Either wire conventions into one prompt and set the digest, or remove five or more references across four files and two docs.
    • Related: refactor(review): the review guards of .devops/review.md get a reader, or the guards and the unread constant are deleted #1916, which asks for a different change. Both address conventions discovered by devops review but never delivered to a model prompt. The candidate targets AGENTS.md and the digest; #1916 targets .devops/review.md.
  3. added
    priority/p3-low
    scope/review
    on Oct 29, 2026
  4. added
    status/ready
    and removed
    status/new
    on Oct 30, 2026
  5. devops-cli-service commented on Oct 30, 2026

    @devops-cli-service
    Contributor

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

  6. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.

    Evidence:

    placeholder

  7. added
    status/new
    and removed
    status/ready
    on Nov 2, 2026
  8. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: refactor. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-04. A person decides what this means for the item. The check changes no label and closes no issue.

  9. changed the title [-]refactor(review): no review prompt reads the target's AGENTS.md, and the profile's conventions digest is never set[/-] [+]refactor(review): Pass AGENTS.md to the review prompt and set digest[/+] on Nov 6, 2026
  10. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    The job shortened the title of this item. The summary had 96 characters, and the limit is 60. The type and the scope stay.

    • Before: refactor(review): no review prompt reads the target's AGENTS.md, and the profile's conventions digest is never set
    • After: refactor(review): Pass AGENTS.md to the review prompt and set digest
    • Source of the summary: the background model
  11. added
    status/ready
    and removed
    status/new
    on Nov 9, 2026
  12. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

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

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/mediumpriority/p3-lowscope/reviewsource/agentstatus/readytype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions