Skip to content

Reconcile the residual audit-contract rules from the PR #2313 post-merge review #2362

Open

Description

@josecelano

Parent EPIC: #2278 - Strengthen PR Review Author Self-Audit and Evidence Generation

This subissue of #2278 follows #2308. It settles five contract gaps that the post-merge review of PR #2313 (the #2308 implementation) found still open on develop. #2347 routed them here.

Goal

Make process-pr-review and PR-REVIEW-TEMPLATE.md give exactly one answer for each of the five cases below, so that an author following either document records the same disposition, thread state, and resolution reference.

Background

Issue #2308 reconciled eight contract rules. Reviewer da2ce7's post-merge review of PR #2313 (review 5293099957) found five places where the reconciled contract still gives two answers or none. The #2347 triage re-checked each one on develop at 478516cf, and all five are live:

Finding Case Current state
review-finding:pr-2313-f4 A duplicate thread whose concern was fixed The template says both An outdated thread whose concern was fixed is `FIXED`/`RESOLVED` and that NO_ACTION/SUPERSEDED applies to "a duplicate, superseded, or no-change concern". Nothing orders the two rules. The PR #2313 audit picked FIXED while its log called the item a duplicate.
review-finding:pr-2313-f5 Resolution reference stated three ways The field placeholder <UNIQUE_COMMIT_SUBJECT_OR_REPLY_URL> and the Completion Rules bullet "Cite a fix by its unique Conventional Commit subject or durable reply URL" both contradict the FIXED-only rule Use a unique Conventional Commit subject as the `Resolution reference` for `FIXED`.. agent-review-report-contract pins the placeholder.
review-finding:pr-2313-f6 FIXED by a change outside the repository The skill says `FIXED` resolution references are unique Conventional Commit subjects. A fix made by editing a PR description, a label, or an issue therefore has no admissible value. This is the F76 case, which #2308 listed as reconciled.
review-finding:pr-2313-f7 Policy text inside a copied-verbatim section ## Status Values is marked "Copied verbatim into each audit record", yet its last bullet is a policy sentence (A post-merge `NO_ACTION` requires maintainer approval to decline the follow-up work.). This is the F63 anti-pattern. Records from pr-2320 onward copy the sentence; pr-2313 does not.
review-finding:pr-2313-f9 A consolidated reply covering one review's several findings Step 8 and the checklist govern only responses that cover multiple review rounds. A single-round response covering several findings, as on #2272, is governed by no rule.

The F6 gap already constrained #2347: it declined a PR-description fix (review-finding:pr-2290-f7) partly because no FIXED resolution reference could cite it.

Scope

In Scope

  • F4: state which rule governs a duplicate thread whose concern a change fixed, in both the skill and the template.
  • F5: state the Resolution reference rule once, and make the placeholder and the Completion Rules bullet agree with it. Update the pinned placeholder in agent-review-report-contract. This is a one-string Rust pin change, coordinated with Make agent-review-report-contract state what it reads #2349.
  • F6: define the admissible Resolution reference for a FIXED finding whose fix is not a repository change, for example the durable reply URL that records the edit.
  • F7: move the policy sentence out of the copied-verbatim ## Status Values section into guidance, or reclassify the section's mark. Coordinate with Strengthen PR review author self-audit and evidence generation #2278 order 8, which byte-diffs the copied sections (F63).
  • F9: state whether and how a consolidated response may cover several findings of one review.
  • Bump the process-pr-review skill version, and record focused manual verification.
  • Update the Strengthen PR review author self-audit and evidence generation #2278 EPIC subissue row.

Out of Scope

Architectural Decisions

  • Related ADRs: docs/adrs/20260821172000_establish_ai_agent_context_capability_and_portability_governance.md
  • ADRs to create: None known. The task clarifies the existing review-workflow contract.

Design and Ownership Review

Not applicable. This task changes documentation workflow rules and one pinned string; it adds no process, I/O, or fixture code.

Bug-Fix Process

Not applicable. The findings are contradictory or missing documentation rules, not broken runtime behaviour.

Regression Test Strategy

Not applicable. The existing agent-review-report-contract check guards the pinned text. Focused manual verification checks each rule.

Implementation Plan

Status values: TODO, IN_PROGRESS, BLOCKED, DONE.

ID Status Task Notes / Expected Output
T1 TODO Propose the five rules One proposed wording per finding, approved by the maintainer before editing; recorded in the progress log.
T2 TODO Resolution-reference rules (F5, F6) Skill and template state one rule, with a non-repository FIXED case; placeholder and pin updated; contract check passes.
T3 TODO Disposition and response rules (F4, F9) Skill and template give one answer for a fixed duplicate and for a single-round consolidated response.
T4 TODO Copied-section content (F7) ## Status Values holds only what records copy, or its mark says otherwise.
T5 TODO Evidence and tracking manual-verification-evidence.md V1-V3 recorded; skill version bumped; #2278 EPIC row updated.

Commit Points

Task Coherent change set Commit policy
T2 Resolution-reference rules and pin One signed docs(pr-reviews) commit, or one for F5 and one for F6 if they touch different sentences.
T3 F4 and F9 rules One signed docs(pr-reviews) commit per finding.
T4 Status Values content One signed docs(pr-reviews) commit.
T5 Evidence and tracking One signed docs(issues) commit.

One finding per commit keeps each finding's FIXED resolution reference precise (review-finding:pr-2300-f12 describes the failure mode).

Progress Tracking

Workflow Checkpoints

  • Folder-style spec drafted in docs/issues/drafts/2278-reconcile-residual-audit-contract-rules/ISSUE.md
  • Spec reviewed and approved by user/maintainer
  • GitHub issue created, linked as a sub-issue of Strengthen PR review author self-audit and evidence generation #2278, and issue number added to this spec
  • Implementation completed
  • Automatic verification completed (linter all, relevant tests, and any pre-push checks)
  • Manual verification scenarios executed and recorded in issue-local manual-verification-evidence.md
  • Acceptance criteria reviewed after implementation and updated with evidence
  • Evidence-based implementation completion review recorded: issue-local retrospective created for material discoveries, or progress log states why none was needed
  • Reviewer validated acceptance criteria and updated checkboxes
  • Independent reviewer reports recorded in issue-local agent-review-reports.md when reviewers received this folder-style specification
  • Committer verified spec progress is up to date before commit
  • Issue closed and spec moved from docs/issues/open/ to docs/issues/closed/

Progress Log

Acceptance Criteria

  • AC1: For a duplicate thread whose concern a change fixed, the skill and the template give the same single disposition and thread state (F4).
  • AC2: The Resolution reference rule is stated once. The template placeholder and the Completion Rules bullet agree with it, and the contract check pins the new placeholder (F5).
  • AC3: A FIXED finding whose fix is not a repository change has a stated admissible Resolution reference (F6).
  • AC4: Every line in a section marked copied verbatim is content that records copy, or the mark names the exception (F7).
  • AC5: The skill and the template state whether and how one response may cover several findings of a single review (F9).
  • AC6: cargo run --package agent-review-report-contract passes, and validate-audit-record.py still passes for the three most recent audit records.
  • linter all exits with code 0
  • Relevant tests pass
  • Manual verification scenarios are executed and documented in issue-local manual-verification-evidence.md
  • Acceptance criteria are re-reviewed after implementation and reflect actual behavior
  • Documentation is updated when behavior/workflow changes

Verification Plan

Automatic Checks

  • linter all
  • cargo run --package agent-review-report-contract (stable Rust toolchain)
  • python3 .github/skills/dev/pr-reviews/process-pr-review/scripts/validate-audit-record.py --pr-number <N> for the three most recent audits
  • Pre-push checks

Manual Verification Scenarios

Status values: TODO, IN_PROGRESS, DONE, FAILED, BLOCKED.

ID Scenario Human-oriented command/steps Expected Result Status Evidence
M1 One answer per case For each of F4, F5, F6, and F9, search the skill and the template for the rule with a recorded rg pattern that matches every statement of it. Each case has one rule, stated consistently in both documents. TODO manual-verification-evidence.md section V1
M2 Worked cases Apply the new rules to the PR #2313 F2 thread (a fixed duplicate) and to review-finding:pr-2290-f7 (a fix outside the repository). Each gets one unambiguous row shape. TODO manual-verification-evidence.md section V2
M3 Copied sections Compare ## Status Values in the template with the same section in the newest audit record. Only copied content remains in the section, or the mark names the exception. TODO manual-verification-evidence.md section V3

No disposable verification script is planned.

Acceptance Verification

AC ID Status (TODO/DONE) Evidence
AC1 TODO M1, M2
AC2 TODO M1; contract check
AC3 TODO M1, M2
AC4 TODO M3
AC5 TODO M1
AC6 TODO Automatic checks

Risks and Trade-offs

  • F5 changes a pinned placeholder while Make agent-review-report-contract state what it reads #2349 changes pin granularity. Mitigation: whichever lands second rebases, and the pin change here is one string.
  • Moving the policy sentence (F7) makes the template's ## Status Values differ from the section that records from pr-2320 onward copied. Mitigation: historical records stay valid; order 8's byte-diff applies to records created after the change.

Implementation Completion Review

References

Activity

  1. da2ce7 commented on Oct 3, 2026

    @da2ce7
    Contributor

    This is T1 of issue #2362: one proposed rule for each of review-finding:pr-2313-f4, -f5, -f6, -f7 and -f9, giving the exact sentences process-pr-review and PR-REVIEW-TEMPLATE.md will carry after T2–T4. Approval of these wordings is requested before either document is edited. Line numbers are at the head of develop (Merge torrust/torrust-tracker#2419: ci(workflows): [#2402] cancel superseded PR runs); SKILL.md is .github/skills/dev/pr-reviews/process-pr-review/SKILL.md and PR-REVIEW-TEMPLATE.md is docs/templates/PR-REVIEW-TEMPLATE.md. Proposed sentences are shown unwrapped; each edit wraps them like the surrounding lines. docs/templates/REVIEW-FINDINGS.md and the review-pr, fetch-review-threads and resolve-review-threads skills state none of the five rules.

    F4: a duplicate thread whose concern a change fixed

    Current: each document gives two answers, FIXED/RESOLVED and NO_ACTION/SUPERSEDED, and nothing orders them.

    • SKILL.md:87-89: “If a code or documentation change fixed the concern, record Disposition=FIXED and Thread state=RESOLVED even when GitHub marks the original thread outdated after the push.”
    • SKILL.md:89-92: “For a duplicate, superseded, or no-change thread, reply exactly Superseded by <FindingId>: <reason>., record Disposition=NO_ACTION and Thread state=SUPERSEDED, then resolve it.”
    • PR-REVIEW-TEMPLATE.md:40-41: “An outdated thread whose concern was fixed is FIXED/RESOLVED, even when GitHub marks the original thread outdated after the push.”
    • PR-REVIEW-TEMPLATE.md:41-42: “For in-PR feedback, use NO_ACTION/SUPERSEDED only for a duplicate, superseded, or no-change concern.”
    • PR-REVIEW-TEMPLATE.md:119-120: “For an outdated thread whose concern was fixed, record Disposition=FIXED and Thread state=RESOLVED, even if GitHub marks the thread outdated after the push.”
    • PR-REVIEW-TEMPLATE.md:120-123: “For a duplicate, superseded, or no-change in-PR thread, reply exactly Superseded by <FindingId>: <reason>., record Disposition=NO_ACTION and Thread state=SUPERSEDED, then resolve it.”

    Skill: these two sentences replace the two quoted at SKILL.md:87-92.

    If a code or documentation change fixed the concern, record `Disposition=FIXED` and `Thread state=RESOLVED` even when the thread duplicates an earlier finding or GitHub marks it outdated after the push. For a duplicate, superseded, or no-change thread that no change fixed, reply exactly `Superseded by <FindingId>: <reason>.`, record `Disposition=NO_ACTION` and `Thread state=SUPERSEDED`, then resolve it.

    Template: these two sentences replace the two quoted at PR-REVIEW-TEMPLATE.md:119-123.

    For a thread whose concern a change fixed, record `Disposition=FIXED` and `Thread state=RESOLVED`, even if the thread duplicates an earlier finding or GitHub marks it outdated after the push. For a duplicate, superseded, or no-change in-PR thread that no change fixed, reply exactly `Superseded by <FindingId>: <reason>.`, record `Disposition=NO_ACTION` and `Thread state=SUPERSEDED`, then resolve it.

    Rationale: when a change fixed the concern, FIXED lets the Resolution reference be the commit subject that proves it. NO_ACTION/SUPERSEDED would cite a reply URL in its place, which the EPIC's Decision Record excludes (EPIC.md:92-93: “reply URLs alone are not a substitute for a repository change”). The duplicate is already recorded in its own row as RE_RAISE_OF:<FindingId> (step 3), so the worked case, PR #2313 F2 (RE_RAISE_OF:F1, FIXED, RESOLVED), stays valid.

    Carried by T3, in one docs(pr-reviews) commit. Co-changing: the ## Status Values bullet at PR-REVIEW-TEMPLATE.md:40-42 repeats this pair, and F7 deletes that bullet. If T3 lands before T4, T3 puts the two template sentences there too. Neither agent-review-report-contract nor validate-audit-record.py reads a disposition.

    F5: Resolution reference stated three ways

    Current: the skill states the rule once. In the template the rule binds FIXED to a commit subject, while the placeholder and the Completion Rules bullet allow subject-or-URL for any fix.

    • SKILL.md:197-199: “FIXED resolution references are unique Conventional Commit subjects; NO_ACTION, SUPERSEDED, and FOLLOW_UP resolution references are durable reply URLs.”
    • PR-REVIEW-TEMPLATE.md:96: “- Resolution reference: <UNIQUE_COMMIT_SUBJECT_OR_REPLY_URL>”
    • PR-REVIEW-TEMPLATE.md:100: “Use a unique Conventional Commit subject as the Resolution reference for FIXED.”
    • PR-REVIEW-TEMPLATE.md:100-102: “Use a durable reply URL for NO_ACTION, SUPERSEDED, or FOLLOW_UP; record a follow-up pull request only in the separate Follow-up PR URL field.”
    • PR-REVIEW-TEMPLATE.md:128-129: “Cite a fix by its unique Conventional Commit subject or durable reply URL, never by a branch SHA that can change after a rebase.”

    Skill: no change. SKILL.md:197-199 stays its one statement, amended by F6. Template: PR-REVIEW-TEMPLATE.md:100-102 stays its one statement. The first line below replaces PR-REVIEW-TEMPLATE.md:96, and the second replaces the bullet at PR-REVIEW-TEMPLATE.md:128-129.

    - Resolution reference: <UNIQUE_COMMIT_SUBJECT_OR_DURABLE_REPLY_URL>
    - Never cite a branch SHA as a `Resolution reference`; it can change after a rebase.

    Rationale: AC2 fixes the shape: one statement of the rule, which the placeholder and the Completion Rules bullet agree with. The placeholder names the field's two forms in the rule's own words, and the sentence below it says which form applies. The bullet keeps only its branch-SHA ban, so the copied section stops restating the rule in a looser form.

    Carried by T2, in its own docs(pr-reviews) commit, because F5 and F6 touch different sentences. Co-changing: the placeholder pins at contrib/dev-tools/checks/agent-review-report-contract/src/main.rs:50 and :599. SKILL.md:83-84 governs repository fixes and stays. validate-audit-record.py:162-168 checks only commit-subject references and does not change.

    F6: FIXED by a change outside the repository

    Current: both documents bind FIXED to a commit subject (SKILL.md:197-199 and PR-REVIEW-TEMPLATE.md:100, quoted under F5). In neither does a fix that changes no repository file have an admissible Resolution reference.

    Skill: this sentence replaces the one quoted at SKILL.md:197-199.

    `FIXED` resolution references are unique Conventional Commit subjects, or, for a fix that changes no repository file (a pull-request description, label, issue, or comment edit), the durable reply URL that records the edit; `NO_ACTION`, `SUPERSEDED`, and `FOLLOW_UP` resolution references are durable reply URLs.

    Template: this sentence replaces the one quoted at PR-REVIEW-TEMPLATE.md:100.

    Use a unique Conventional Commit subject as the `Resolution reference` for `FIXED`, or, for a fix that changes no repository file (a pull-request description, label, issue, or comment edit), the durable reply URL that records the edit.

    Rationale: the EPIC keeps the commit-subject or durable-URL form and adds no field. A fix outside the repository therefore takes the durable-URL form, and the reply that records the edit is the one durable URL every such fix has. The clause applies only where no repository change exists, so a fix that changes a file still cites its commit, and the N/A-with-reason option F76 also offered is not taken because N/A is neither form.

    Carried by T2, in its own docs(pr-reviews) commit. Co-changing: none. validate-audit-record.py:165 already passes every reference that starts with http, and F5's placeholder already admits the URL form.

    F7: policy text inside a copied-verbatim section

    Current: the template marks ## Status Values as copied verbatim, yet its last bullet holds three disposition rules. The skill has no copied sections.

    • PR-REVIEW-TEMPLATE.md:26: “<!-- Copied verbatim into each audit record. -->”
    • PR-REVIEW-TEMPLATE.md:42-43: “A post-merge NO_ACTION requires maintainer approval to decline the follow-up work.” (with :40-41 and :41-42, quoted under F4)

    Template: delete the bullet at PR-REVIEW-TEMPLATE.md:40-43 and insert nothing. PR-REVIEW-TEMPLATE.md:119-124 keeps the same rules, in F4's wording, and the identical post-merge sentence at :123-124. Skill: no change; step 7 (SKILL.md:87-93) states these rules.

    Rationale: AC4 allows either moving the text or naming the exception in the mark. Every rule in the bullet already lives in ## Completion Rules, a section records copy, so deleting the bullet loses no rule from a new record and leaves ## Status Values as vocabulary only, with no exception for order 8's byte-diff to carry. The OPEN clause at PR-REVIEW-TEMPLATE.md:32-34 qualifies a status value rather than stating a disposition rule, so it stays.

    Carried by T4, in one docs(pr-reviews) commit. Co-changing: none. agent-review-report-contract pins only the Author class and category lines of this section (main.rs:136, :140 and :144), and validate-audit-record.py does not read the section.

    F9: a consolidated reply covering one review's several findings

    Current: all three statements allow a consolidated response only across multiple review rounds. A response covering several findings of one review is governed by no rule.

    • SKILL.md:94-96: “A PR conversation response may cover multiple review rounds only when it names every review ID and every finding ID with its disposition and resolution reference.”
    • SKILL.md:289-291: “Consolidated responses that cover multiple review rounds name every covered review and finding ID with its disposition and resolution reference, with the durable response URL in each related row”
    • PR-REVIEW-TEMPLATE.md:125-126: “A consolidated PR conversation response may cover multiple review rounds only when it names every review ID and every finding ID with its disposition and resolution reference.”

    Skill: the first line below replaces the sentence quoted at SKILL.md:94-96, and the second replaces the checklist item at SKILL.md:289-291.

    A PR conversation response may cover several findings, from one review or several review rounds, only when it names every review ID and every finding ID with its disposition and resolution reference.
    - [ ] Consolidated responses name every covered review and finding ID with its disposition and resolution reference, with the durable response URL in each related row

    Template: this sentence replaces the one quoted at PR-REVIEW-TEMPLATE.md:125-126.

    A consolidated PR conversation response may cover several findings, from one review or several review rounds, only when it names every review ID and every finding ID with its disposition and resolution reference.

    Rationale: naming each covered review and finding with its disposition is what makes one shared URL traceable to every row, and that need does not depend on the number of rounds. The #2272 response covered one review's two findings and named neither. Allowing such a response under this condition, rather than forbidding it, leaves step 7's per-thread replies untouched. It therefore does not decide the matrix row that defers batching (retrospective-improvement-matrix.md:66: “Batching may reduce fixed overhead, but must retain a finding-specific reply URL or explicitly define an equivalent durable relationship.”).

    Carried by T3, in its own docs(pr-reviews) commit. Co-changing: the checklist item above; the durable-URL sentences at SKILL.md:96-97 and PR-REVIEW-TEMPLATE.md:126-127 stay. validate-audit-record.py:147-149 reads only thread replies and does not change.

    Approval

    Are the five wordings approved as written, or which case should change, and how? Once they are approved, T2–T4 apply them as written and the spec's progress log links this comment.

  2. added 4 commits that reference this issue on Oct 6, 2026
  3. added a commit that references this issue on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions