Repository navigation
[3461 by Claude Opus 5.5] Add a risk-ranked digest section to agent PR descriptions and completion comments - #3466
Conversation
…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.
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe 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 blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Expand dependency parser edge casesConsider additional fixtures for S2: 🟢 Exercise checkpoint recovery directlyThe 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. ScoreThe 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
Copy and edit to choose records from this review: 🤖 Review by ProPR |
AI Implementation Summary
Closes #3461
Branch:
3461/claude-opus-5-5-add-a-risk-ranked-digest--20261112-1026-g7sCommits: ✅ Changes committed (8e8ab86)
AI Processing Completed
Execution Details:
Summary:
Agent PR descriptions (issue runs) and the completion comments of follow-up and
/fixruns 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 andeslint --max-warnings 0are clean for rootsrc/, 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
digestis a new section inPR_TEMPLATE_SECTIONS, fixed aftersummary. It has a{{digest}}placeholder, which is treated as untrusted text so HTML in it gets escaped.propr inittemplate scaffold has a commented-out## digestexample, andpropr repo validateaccepts the section.docs/docs/features/pr-templates.mdhas a new "Review digest" section.What the digest contains (
packages/core/src/workflow/reviewDigest.ts,reviewDigestMarkdown.ts,reviewDependencies.ts).propr/, agent config files (CLAUDE.md,AGENTS.md,.claude/,.mcp.json…), lockfiles, dependency manifests and migrations.review.risk_paths(.propr/workflow.yml)protected_paths, so the patterns behave the same way.validatePathGlobListthat both keys use. Theauto_merge.protected_pathserror messages are unchanged.propr initscaffold andrepository-workflow.md.Where it's computed
createPullRequestdiffs from the task's starting commit and passes the result togenerateCompletionCommentParts. That returnsdigest(markdown) andreviewDigest(structured data)./fixruns: 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.task_historywithmetadata.event: 'review.digest'. A failed write is logged and never fails the run.Other changes
@propr/corewith 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.prDiffFormatting.tsinto@propr/shared(changedFileKinds.ts).prCommentPostExecution.tsintoprCommentPostExecutionHistory.tsto keep that file under the 400-line lint limit.Tests: new
packages/core/test/reviewDigest.test.tsandtest/reviewDigestPublication.test.tsrun against real temporary git repos, plus new cases in the shared and coreprTemplatetests,repositoryWorkflow.test.tsandcliInitCommand.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:
f0ede1a7-c9e6-442a-ab6e-dfb1c28a9d11Log files stored at:
/usr/src/app/logs/executions/issue-3461-2026-11-12T10-52-25-029Z-conversation.json/usr/src/app/logs/executions/issue-3461-2026-11-12T10-52-25-029Z-output.txtLatest Conversation Messages
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
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