Skip to content

Add a risk-ranked digest section to agent PR descriptions and completion comments #3461

Closed

Description

@integry

Problem

Agent PRs carry a run summary and validation text, but nothing tells a reviewer where to look. Reviewers either read every line or rubber-stamp. protected_paths exists but is only used for auto-merge.

Goal

Add a compact "Review digest" section to the PR description (issue runs) and the completion comment (follow-up and /fix runs) that ranks the change by risk and shows the evidence.

Acceptance criteria

  • A new digest section exists in the PR template section model, with a fixed position after summary, a placeholder, scaffold text and propr repo validate support, documented in docs/docs/features/pr-templates.md.
  • The digest contains, in this order: (1) risk-tiered paths: changed files grouped as high / normal / low risk; (2) validation evidence: per-command status from the structured validation result of Keep repository validation results in structured form on the run result and task timeline #3429; (3) diff size: files and lines added/removed.
  • Risk tiers come from built-in defaults (CI and workflow files, .propr/, agent configuration files, lockfiles and dependency manifests, database migrations, auth- and payment-looking paths as high; docs and tests as low) plus an optional review.risk_paths list of globs in .propr/workflow.yml that marks additional high-risk paths. The key follows the existing optional-key pattern (runtime validator, JSON schema parity, propr init scaffold, docs). Glob matching reuses the protected_paths matcher.
  • New dependencies added to a manifest are listed by name.
  • The section is omitted entirely (empty string) when there is no diff, so existing byte-identical PR-body tests pass unchanged for those cases; tests for the new section are added.
  • Output is bounded (file lists capped like the existing files_changed section) and contains no raw diff content.
  • The digest data is also written as one task_history metadata event so later features can read it.

Out of scope

  • Scope-vs-issue analysis, shortcut detection, acceptance criteria (separate issues in this plan).
  • UI rendering beyond the markdown.

Implementation

Key files: packages/shared/src/prTemplate.ts (PR_TEMPLATE_SECTIONS, PrBodyPiece, placeholders, scaffold), packages/core/src/workflow/prTemplate.ts, packages/core/src/utils/github/logFiles.ts (CompletionCommentParts, generateCompletionCommentParts, generateCompletionComment), src/jobs/issueJobHelpers.ts (buildIssuePullRequestBodyPieces), src/jobs/prCompletionComment.ts (buildCompletionComment), packages/core/src/workflow/autoMergePolicy.ts (compileProtectedPathGlob, findProtectedPaths), packages/core/src/workflow/repositoryWorkflow.ts (schema), packages/core/src/services/worktreeMonitorService.ts (getWorktreeChanges, FileChange), src/jobs/prDiffFormatting.ts (private classifiers isLockfile, isDocumentationFile etc. — export or move to a shared module), packages/cli/src/commands/repoValidate.ts.

Approach: a pure buildReviewDigest(changes, validationResult, riskConfig) in core returning a structured value plus a markdown renderer; call it where the completion parts are generated. Tests: test/prTemplateDescription.test.ts, packages/shared/test/prTemplate.test.ts, packages/core/test/prTemplate.test.ts, test/issueJobHelpers.test.ts, packages/core/test/repositoryWorkflow.test.ts. Verify with npm run test:prepare, npm run typecheck, the changed test files via node scripts/run-test-suite.mjs, and eslint --max-warnings 0 per touched package.

Activity

  1. propr-dev commented on Nov 12, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3461/claude-opus-5-5-add-a-risk-ranked-digest--20261112-1026-g7s
    • Base Branch: 3461-epic-trust-the-prq
    • Worktree: issue-3461-20261112-1026-claude-opus-5-5-g7s

    🔍 Track Task Execution

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions