Repository navigation
[Epic] Trust the PR: risk digest, shortcut scan, review categories, acceptance criteria - #3476
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.
…-ranked-digest--20261112-1026-g7s [3461 by Claude Opus 5.5] Add a risk-ranked digest section to agent PR descriptions and completion comments
Epic progress: Trust the PR: risk digest, shortcut scan, review categories, acceptance criteria1 out of 1 PRs merged ✅
Merged child PRs: #3466 3 planned issues were closed without a merge and are not counted. ✅ This epic PR has been merged into main. This comment is updated automatically by ProPR as child PRs merge. |
|
/merge |
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryI resolved both conflicted files and no conflict markers are left anywhere in the repository. Core typecheck and 1.
|
Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - docs/docs/features/repository-workflow.md - packages/core/src/workflow/autoMergePolicy.ts PR: #3476 Model: Claude Opus 5.5
|
CI failed: CodeQL Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit 1b0f89a Summary of ChangesI fixed the slow regular expression CodeQL flagged in Cause: the pattern Fix:
The directory-based checks and the other patterns are unchanged. Checks:
There's no visible change, so I didn't create a preview. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…stFile` (`packages/shared/src/changedFileKinds.ts`). The shared package typechecks and the review digest tests pass (11 of 11). I fixed the slow regular expression CodeQL flagged in `isTestFile` (`packages/shared/src/changedFileKinds.ts`). The shared package typechecks and the review digest tests pass (11 of 11). **Cause:** the pattern `/[._-](?:test|spec)\.[^/]+$/` was tested against the whole path. At every `-spec.` it re-read the rest of the string to the end, so a path like `-test.` followed by many `-spec.` and ending in `/` took time that grew with the square of its length. **Fix:** `isTestFile` now takes the last path segment first and checks the file-name patterns only against that: - `/[._-](?:test|spec)\../i` — a `.test.`/`.spec.`-style marker followed by at least one character. This matches the same names as before. - `/^test_.+\.py$/i` — the `test_*.py` check had the same kind of tail, so I gave it the same treatment and anchored it to the start of the name. The directory-based checks and the other patterns are unchanged. **Checks:** - **Same answers:** I compared old and new versions on 16 sample paths, including edge cases like a trailing `/`, `a/test_.py`, `x-spec.y/z` and an empty string. Results are identical. - **Speed:** the old version took 113 ms on an input with 5,000 repeats. The new one took under 1 ms with 50,000 repeats. - **Lint:** I couldn't lint the file. ESLint skips it because no lint configuration covers `packages/shared/src`. There's no visible change, so I didn't create a preview. PR: #3476 Comment by: @github-advanced-security[bot] (ID: 4552640125) Model: Claude Opus 5.5
|
ℹ️ Analyzed the follow-up request by @propr-dev[bot] Analysis SummaryThis is already fixed on the branch, so I made no changes. CodeQL failed on commit
I checked the current code against CodeQL's example input: 50,000 repeats took 0.25 ms and 500,000 took about 2 ms, so the time now grows linearly. No other file changed on this branch has the same kind of regex. The CodeQL check should pass on its next run against No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
✅ Epic merged: Trust the PR: risk digest, shortcut scan, review categories, acceptance criteriaEpic PR #3476 has been merged into main. 1 out of 1 PRs merged into main through this epic PR. All planned epic work is now merged. Posted automatically by ProPR |
Trust the PR: risk digest, shortcut scan, review categories, acceptance criteria
This Epic PR aggregates all changes for the plan: Trust the PR: risk digest, shortcut scan, review categories, acceptance criteria
Issues in this Epic
Auto-close
When this PR is merged, the following issues will be automatically closed:
Fixes #3461
Fixes #3462
Fixes #3463
Fixes #3464
Created automatically by ProPR