Skip to content

Share the Attestation Marker and Reviewer Logins Between the Gate and the Metrics Report #3880

Open

Description

@ptr727

scripts/backlog_metrics.py now reads two things the review gate already reads, from its own copies:

  • The local-review attestation marker. It copies the ATTESTATION regex from scripts/pr_review_rounds.py and re-implements attestation()'s trust rules: a trusted author association, not minimized, a matching base, and a marker outside a fence.
  • The reviewer logins. It reads scripts/reviewers/*.json directly instead of going through pr_review_copilot.VOCABULARIES.

It keeps copies because pr_review_rounds.py imports pr_review_copilot, which imports markdown_it at load. backlog_metrics.py is a plain python3 script with no dependencies. So a change to either rule now has to land in two places, and nothing fails when only one is edited.

Done when: both readers come from one small stdlib-only module that the gate and the metrics script both import. That module holds the attestation marker, its trust rules, and the login lookup. A test then fails if either side diverges. The gate's READER_IMPORTS allowlist in tests/test_pr_review.py names the new module.

Filed from the local strict review of the review-metrics change, which deferred this consolidation rather than touch the gate in the same pull request.

Activity

  1. added
    script
    on Nov 5, 2026
  2. ptr727 commented on Nov 5, 2026

    @ptr727
    OwnerAuthor

    One more site for this consolidation, from #3881's last local pass: side_asks in scripts/pr_review_side.py repeats the trusted-and-shown comment filter that trusted_comments in scripts/pr_review_rounds.py owns. Building both on one node-level trusted-comment reader keeps one definition of a comment the gate trusts.

  3. ptr727 commented on Nov 5, 2026

    @ptr727
    OwnerAuthor

    Scope update from #3886, which now runs backlog_metrics.py as a uv script and imports the gate's own readers. That leaves one restatement for this issue.

    • The report's reviewed-heads set in review_pr restates pr_review_rounds.reviewed_heads's filter (reviewer_nodes, refusals excluded, commit present), since the report needs the set of head SHAs and the gate returns only a count. Exposing the set takes pr_review_rounds.py past its 700-line ceiling. The maintainer chose on 2026-11-05 to leave the restatement in Measure PR Review Return on Cost in the Backlog Report #3886 and expose the set here when this issue splits that file.

    The attestation marker, the reviewer logins, the trigger commands, and the thread readers are already shared by #3886.

  4. ptr727 commented on Nov 25, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-25): this group merged into develop as #4458 (the reviewed-heads restatement) and its branch and worktree were cleaned up, so the claim holds no files. #3880 stays open: whether the side_asks filter in scripts/pr_review_hold.py is still in scope is for the next ranking to read from the 2026-11-05 comments.

    Backlog burndown claim (away run 2026-11-25, round 1, refill group H): branch burndown/metrics-reviewed-heads-set, issue #3880, its one remaining restatement per the 2026-11-05 scope update.

    Predicted files:

    • scripts/pr_review_rounds.py: expose the set of reviewed head SHAs that reviewed_heads already counts (reviewer nodes, refusals excluded, commit present), with reviewed_heads returning that set's size, so the filter is stated once. The file stays under its 700-line ceiling in tests/test_pr_review_size.py, which is not raised.
    • scripts/backlog_metrics.py: review_pr reads that set from the gate instead of restating its filter.
    • tests/test_backlog_metrics.py: a constructed case pinning that the report's reviewed heads and the gate's count agree, refusals and commit-less reviews included.
    • tests/test_pr_review.py, only where its reader tests or READER_IMPORTS allowlist need the new function named.

    Not claimed: scripts/README.md and tests/test_pr_review_size.py. Splitting pr_review_rounds.py would need both, so a worker that cannot fit the change under the ceiling stops and reports rather than splitting.

    Any other group needing one of these files waits for this branch to merge.

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

    script

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions