Skip to content

[3461 by Claude Opus 5.5] Add a risk-ranked digest section to agent PR descriptions and completion comments - #3466

Merged
integry merged 1 commit into
3461-epic-trust-the-prqfrom
3461/claude-opus-5-5-add-a-risk-ranked-digest--20261112-1026-g7s
Nov 12, 2026
Merged

integry merged 1 commit into
3461-epic-trust-the-prqfrom
3461/claude-opus-5-5-add-a-risk-ranked-digest--20261112-1026-g7s

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3461

Branch: 3461/claude-opus-5-5-add-a-risk-ranked-digest--20261112-1026-g7s
Commits: ✅ Changes committed (8e8ab86)


AI Processing Completed

Execution Details:

Summary:
Agent PR descriptions (issue runs) and the completion comments of follow-up and /fix runs now include a "Review digest" section. It groups the changed files into high, normal and low risk, then shows per-command validation results, then the diff size. With no diff it renders as an empty string, so existing PR bodies are unchanged. Typecheck and eslint --max-warnings 0 are clean for root src/, core, cli and shared. The new and affected test files all pass, and so do the 45 test files that import the job modules I touched.

Template section and docs

  • digest is a new section in PR_TEMPLATE_SECTIONS, fixed after summary. It has a {{digest}} placeholder, which is treated as untrusted text so HTML in it gets escaped.
  • The propr init template scaffold has a commented-out ## digest example, and propr repo validate accepts the section.
  • docs/docs/features/pr-templates.md has a new "Review digest" section.

What the digest contains (packages/core/src/workflow/reviewDigest.ts, reviewDigestMarkdown.ts, reviewDependencies.ts)

  • High risk by default: CI and workflow files, .propr/, agent config files (CLAUDE.md, AGENTS.md, .claude/, .mcp.json…), lockfiles, dependency manifests and migrations.
  • Low risk: docs and tests. A test or doc about auth stays low risk.
  • Auth- and payment-looking paths are checked after docs and tests, and are high risk.
  • Everything else is normal risk.
  • New dependencies are listed by name for npm/composer, requirements files, pyproject/Cargo/Pipfile, go.mod, Gemfile, Gradle, Maven, .NET and pubspec. Version bumps and moved entries are not listed. This works from the diff text alone, so it can miss an entry when a diff hunk starts in the middle of a dependency block.
  • Limits: at most 50 files are listed across all tiers, then "…and N more". The structured data keeps counts and up to 200 files per tier. No diff content is included. Paths, package names and commands are shown as code and checked for secrets.

review.risk_paths (.propr/workflow.yml)

  • It is a list of extra high-risk globs. Matching uses the same matcher as protected_paths, so the patterns behave the same way.
  • I moved the glob-list check into a shared validatePathGlobList that both keys use. The auto_merge.protected_paths error messages are unchanged.
  • It is in the runtime validator, the JSON schema (with a test that the schema and the validator accept the same files), the propr init scaffold and repository-workflow.md.

Where it's computed

  • Issue runs: createPullRequest diffs from the task's starting commit and passes the result to generateCompletionCommentParts. That returns digest (markdown) and reviewDigest (structured data).
  • Follow-up and /fix runs: the digest covers the run's own commit and is built before the push. Building it after a push that has to merge in other commits would diff the merge commit instead. The rendered section is saved with the publication checkpoint, so a restart that recovers the publication posts the same digest.
  • Timeline: each digest is written once to task_history with metadata.event: 'review.digest'. A failed write is logged and never fails the run.

Other changes

  • Several existing tests replace @propr/core with a fixed list of exports, so new direct imports would break them. The new job code (reviewDigestLazy.ts / reviewDigestRun.ts) loads core on demand instead, and any failure there just means no digest.
  • I moved the file classifiers out of prDiffFormatting.ts into @propr/shared (changedFileKinds.ts).
  • I moved two history-metadata helpers out of prCommentPostExecution.ts into prCommentPostExecutionHistory.ts to keep that file under the 400-line lint limit.

Tests: new packages/core/test/reviewDigest.test.ts and test/reviewDigestPublication.test.ts run against real temporary git repos, plus new cases in the shared and core prTemplate tests, repositoryWorkflow.test.ts and cliInitCommand.test.ts. As a check, removing the digest from the PR body makes the new PR-description tests fail.

Preview: the screenshot comes from real digest output for a sample commit. The Markdown was rendered locally with micromark and GitHub-like CSS in headless Chromium, not by GitHub itself.

Detailed Logs:

  • Conversation: 143 messages
  • Session: f0ede1a7-c9e6-442a-ab6e-dfb1c28a9d11

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3461-2026-11-12T10-52-25-029Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3461-2026-11-12T10-52-25-029Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: Agent PR descriptions (issue runs) and the completion comments of follow-up and `/fix` runs now include a "Review digest" section. It groups the changed files into high, normal and low risk, then show...


This PR was created automatically by ProPR after processing issue #3461.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!


Visual preview

Review digest in a PR description

Review digest in a PR description

Real renderReviewDigest output for a sample commit in a throwaway git repository (CI workflow, package.json adding stripe and zod, a billing file, a migration, a review.risk_paths match, a doc and a test), with validation evidence from a structured result. The Markdown was rendered locally with micr

Connect sign-in required. Original retained until 2027-02-10T10:52:29.390Z.

View the full-resolution original in ProPR Connect

…low-up and `/fix` runs now include a "Review digest" section. It groups the changed files into high, normal and low risk, then shows per-command validation results, then the diff size. With no diff it renders as an empty string, so existing PR bodies are unchanged. Typecheck and `eslint --max-warnings 0` are clean for root `src/`, core, cli and shared. The new and affected test files all pass, and so do the 45 test files that import the job modules I touched.

Template section and docs
- `digest` is a new section in `PR_TEMPLATE_SECTIONS`, fixed after `summary`. It has a `{{digest}}` placeholder, which is treated as untrusted text so HTML in it gets escaped.
- The `propr init` template scaffold has a commented-out `## digest` example, and `propr repo validate` accepts the section.
- `docs/docs/features/pr-templates.md` has a new "Review digest" section.

What the digest contains (`packages/core/src/workflow/reviewDigest.ts`, `reviewDigestMarkdown.ts`, `reviewDependencies.ts`)
- High risk by default: CI and workflow files, `.propr/`, agent config files (`CLAUDE.md`, `AGENTS.md`, `.claude/`, `.mcp.json`…), lockfiles, dependency manifests and migrations.
- Low risk: docs and tests. A test or doc about auth stays low risk.
- Auth- and payment-looking paths are checked after docs and tests, and are high risk.
- Everything else is normal risk.
- New dependencies are listed by name for npm/composer, requirements files, pyproject/Cargo/Pipfile, go.mod, Gemfile, Gradle, Maven, .NET and pubspec. Version bumps and moved entries are not listed. This works from the diff text alone, so it can miss an entry when a diff hunk starts in the middle of a dependency block.
- Limits: at most 50 files are listed across all tiers, then "…and N more". The structured data keeps counts and up to 200 files per tier. No diff content is included. Paths, package names and commands are shown as code and checked for secrets.

`review.risk_paths` (`.propr/workflow.yml`)
- It is a list of extra high-risk globs. Matching uses the same matcher as `protected_paths`, so the patterns behave the same way.
- I moved the glob-list check into a shared `validatePathGlobList` that both keys use. The `auto_merge.protected_paths` error messages are unchanged.
- It is in the runtime validator, the JSON schema (with a test that the schema and the validator accept the same files), the `propr init` scaffold and `repository-workflow.md`.

Where it's computed
- Issue runs: `createPullRequest` diffs from the task's starting commit and passes the result to `generateCompletionCommentParts`. That returns `digest` (markdown) and `reviewDigest` (structured data).
- Follow-up and `/fix` runs: the digest covers the run's own commit and is built before the push. Building it after a push that has to merge in other commits would diff the merge commit instead. The rendered section is saved with the publication checkpoint, so a restart that recovers the publication posts the same digest.
- Timeline: each digest is written once to `task_history` with `metadata.event: 'review.digest'`. A failed write is logged and never fails the run.

Other changes
- Several existing tests replace `@propr/core` with a fixed list of exports, so new direct imports would break them. The new job code (`reviewDigestLazy.ts` / `reviewDigestRun.ts`) loads core on demand instead, and any failure there just means no digest.
- I moved the file classifiers out of `prDiffFormatting.ts` into `@propr/shared` (`changedFileKinds.ts`).
- I moved two history-metadata helpers out of `prCommentPostExecution.ts` into `prCommentPostExecutionHistory.ts` to keep that file under the 400-line lint limit.

Tests: new `packages/core/test/reviewDigest.test.ts` and `test/reviewDigestPublication.test.ts` run against real temporary git repos, plus new cases in the shared and core `prTemplate` tests, `repositoryWorkflow.test.ts` and `cliInitCommand.test.ts`. As a check, removing the digest from the PR body makes the new PR-description tests fail.

Preview: the screenshot comes from real digest output for a sample commit. The Markdown was rendered locally with micromark and GitHub-like CSS in headless Chromium, not by GitHub itself.
@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=10
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 12, 2026
@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds risk-ranked digests to issue PR descriptions and follow-up completion comments, with configurable risk paths and timeline metadata. It is merge-ready within scope, conditional on the two pending checks completing successfully. This review used static analysis only, as requested.

✅ Consistent rendering — Both publication paths use the same digest builder and renderer, with bounded file lists and explicit validation provenance.

✅ Recovery preservation — Follow-up digest Markdown is included in publication completion data, which the existing checkpoint and recovery paths preserve.

✅ Configuration integration — The new setting is wired through runtime validation, schema, scaffolding, documentation, and focused tests.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Expand dependency parser edge cases

Consider additional fixtures for reviewDependencies.ts, particularly multiline TOML requirements containing extras such as "uvicorn[standard]>=0.30". The current ] handling can prematurely close a requirement list. The JSON unknown-block fallback can also identify version-like nondependency values as packages. These are optional accuracy improvements to the deliberately heuristic dependency listing; they do not affect risk classification or publication.

S2: 🟢 Exercise checkpoint recovery directly

The publication tests verify digest construction and completion-comment rendering separately. An additional test that serializes a publication checkpoint and resumes through recovery would strengthen the guarantee that the original digest survives restart unchanged. Static tracing supports the current implementation, so this is additional coverage rather than a merge requirement.

Score

The implementation is cohesive and has focused coverage across classification, rendering, configuration, and publication. No merge-blocking defect was established; the authoritative status reports no failures and two pending checks.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 38s
  • Tokens: 79,271 (78,604 in / 667 out)
  • Cost: $0.71

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S1 S2

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 12, 2026
@integry
integry merged commit 2c11b09 into 3461-epic-trust-the-prq Nov 12, 2026
65 checks passed
@integry
integry deleted the 3461/claude-opus-5-5-add-a-risk-ranked-digest--20261112-1026-g7s branch November 12, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant