Skip to content

[Epic] Trust the PR, part 2: review categories and acceptance criteria - #3505

Merged
integry merged 19 commits into
mainfrom
3498-epic-trust-the-arv
Nov 13, 2026
Merged

integry merged 19 commits into
mainfrom
3498-epic-trust-the-arv

Conversation

@propr-dev

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

Copy link
Copy Markdown
Contributor

Trust the PR, part 2: review categories and acceptance criteria

This Epic PR aggregates all changes for the plan: Trust the PR, part 2: review categories and acceptance criteria

Issues in this Epic

Auto-close

When this PR is merged, the following issues will be automatically closed:

Fixes #3498
Fixes #3499


Created automatically by ProPR

propr-dev[bot] and others added 2 commits November 12, 2026 17:46
…requested complexity and placeholder work, and Ultrafix stops when the only blockers left are stylistic. Typecheck passes for the root, `packages/api`, `packages/core` and `propr-ui`. `eslint --max-warnings 0` is clean for root `src/`, `packages/api`, `packages/core` and `packages/shared`; the one `propr-ui` file I touched (a type) was skipped by its lint config, so it was only typechecked. 63 review/Ultrafix/PR-comment test files and 12 API test files pass, all run through `run-test-suite.mjs`.

Categories
- `ActionableFinding` has a `category` field: `correctness`, `requirement`, `security`, `tests`, `complexity` or `style`. The vocabulary and helpers are in a new file, `src/jobs/reviewFindingCategory.ts`.
- The parser accepts the old field sets and the new ones with `category`. A missing category is read as `correctness`. Case and backticks are ignored.
- Decision for you: a category outside the list makes the review invalid rather than being quietly changed to another category. In Ultrafix, that triggers a retry review. If you'd rather map unknown values to `correctness`, it's a one-line change in `parseReviewFindingCategory`.
- The public comment shows `- Category: …` as the first field of each F#. The `/fix` input and the `/fix` agent context also include it.

Review prompt
- `DEFAULT_REVIEW_GUIDANCE` now asks the reviewer to:
  - flag unrequested complexity as `complexity`.
  - flag reduced or placeholder work reported as done as `requirement`.
  - put purely stylistic points in Suggestions, using `style` only for a blocker that breaks an explicit repository rule.
- The fixed (non-overridable) part of the prompt lists the category field and defines each category. For `requirement`, `tests`, `complexity` and `style` blockers, the evidence is the gap between what was asked for and the changed code, not a runtime failure sequence.
- A new "Change size" section gives the whole diff's file count and +/- lines, and the word count of the effective objective. Both are measured before any budget trimming. The wording stays neutral.

Ultrafix
- `determineNextAction` now takes the categories of the remaining blockers. If every one is `style`, the loop stops with the reason "Only stylistic findings remain; no further fix was scheduled", schedules no fix, and posts a stop comment saying so.
- This uses a new outcome, `style_findings_only`. It is added to `UltrafixOutcome`, the operation summary (the receipt shows as completed), the UI type, and `docs/mcp.md`.
- Score rules are unchanged: blockers still cap the score at 6, so the goal is not reached and `jobReachedGoal` stays false. A test checks both stay consistent.

Storage
- A new migration, `20261112000000_add_review_score_blocker_categories.js`, adds a nullable JSON column `review_scores.blocker_categories`. It is safe to re-run in either direction, and existing rows stay null. New rows store a count for every category.

Other changes
- `reviewOutputParser.ts` was over the 400-line lint limit, so I moved the unused-in-production `getNext*Number` helpers to `src/jobs/reviewRecordNumbering.ts`.
- I updated the existing tests that pin the field list or the rendered output.
- New tests are in `test/reviewFindingCategory.test.ts`, plus cases in the Ultrafix entry-point, MCP progress and review-score stats suites. They cover old and new comment parsing, rendering, the stop rule, goal consistency, the prompt text and the migration.

I made no visual previews: the only visible change is one extra line in a markdown bot comment, and the project has no tool for rendering those.
…gory-to-review--20261112-1719-gyi

[3498 by Claude Opus 5.5] Add a category to review findings, an unrequested-complexity lens, and stop Ultrafix on style-only findings
@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Epic progress: Trust the PR, part 2: review categories and acceptance criteria

3 out of 3 PRs merged ✅

██████████ 100%

Merged child PRs: #3502, #3506, #3524

✅ This epic PR has been merged into main.


This comment is updated automatically by ProPR as child PRs merge.

@propr-dev propr-dev Bot added the AI label Nov 12, 2026
propr-dev[bot] and others added 13 commits November 12, 2026 19:12
…affected test files pass through `run-test-suite.mjs`; typecheck is clean for root, `packages/core`, `packages/shared` and `packages/api`; root `src/` and core `src/` pass `eslint --max-warnings 0`. I haven't seen it work on a real agent run: the digest depends on the agent actually ending its summary with the `- AC1: met — …` lines, and that is only covered by tests here.

Parser (`packages/shared/src/acceptanceCriteria.ts`)
- `extractAcceptanceCriteria` reads the list items under the first "Acceptance criteria" heading. Any heading level and any letter case work, and a trailing colon or emphasis is fine. The list ends at the next heading of the same or higher level, so items under a sub-heading like `### Backend` still count.
- Each top-level item is one criterion with an id by position (AC1, AC2, …). Nested items are folded into their parent, checkboxes and HTML comments are dropped, and list items inside code fences are ignored.
- It keeps at most 20 criteria of up to 300 characters each. With no heading it returns nothing, and nothing else changes.
- Only a real heading counts. A bold line like `Acceptance criteria:`, which many hand-written issues use, is not picked up, because the issue asked for a heading. Planner Studio issues use `## Acceptance Criteria`, so they work.
- `evaluateAcceptanceCriteria` pairs each criterion with the agent's last statement about it. It accepts lines like `- AC1: met — file`, `AC2 - not met: reason` or a table row. A criterion with no statement is marked `not_addressed`.

Implementation prompt (`promptGenerator.ts`): when the issue has criteria, the prompt lists them with their ids. It asks the agent to end its summary with one line per criterion: met, not met or not applicable, plus the file or test that shows it.

Review digest and timeline
- `buildReviewDigest` now takes the criteria and the agent's summary. The digest shows an "Acceptance criteria" block first, e.g. "(1 of 3 met, as stated by the agent)", with each criterion as met, not met, not applicable or not addressed.
- The criteria text and the agent's evidence are redacted and shown as code.
- Issue runs pass the issue body through `createPullRequest`, so the criteria with their status are saved in the `review.digest` `task_history` event. The timeline line also says how many were met.
- Follow-up and `/fix` comments don't get the checklist, because their prompts don't list the criteria.

`/review`
- `fetchLinkedIssueContext` parses the criteria from the first linked issue's full body. The copy of the issue used as the review objective is cut at 1,000 characters, so criteria lower down would otherwise be lost.
- The criteria go to every reviewer prompt, and budget trimming never removes them. The reviewer is asked to state each id in the Overall Evaluation, and to report every unmet criterion as a `requirement` blocker whose title and `violatedRequirement` start with the id.

Tests and docs
- New tests cover the parser (heading variants, nested lists, checkboxes, fences, limits, slow-input safety and statement parsing), the prompt section and the digest rendering.
- I extended the existing tests for the PR description, the timeline event, linked-issue parsing and the review prompt.
- The PR template and PR command docs now describe the checklist.

Two small refactors: to stay under the 400-line lint limit, I collapsed one comments-fetch statement in `prCommentJobHelpers.ts` and joined two lines in `issueJobHelpers.ts`. I also split the parser into small functions to stay under the complexity limit; `packages/shared` has no lint config of its own, so I checked it with the core config.

I didn't create a visual preview: the change is generated Markdown text, not app UI.
…teria.ts`. Hidden comments no longer become criteria, and fenced examples no longer change a criterion's status.

I fixed both findings in `packages/shared/src/acceptanceCriteria.ts`. Hidden comments no longer become criteria, and fenced examples no longer change a criterion's status.

**F1: hidden comments became criteria.** A new `visibleLines` step runs on the whole body before any heading or list item is read. It removes `<!-- … -->` comments, including ones that span several lines. Every line stays in place, and a line that held only a comment counts as blank. Inside fenced code, `<!--` and `-->` are plain text and hide nothing. An unclosed comment still hides everything after it. The old per-item comment removal in `cleanItemText` is gone because nothing reaches it any more.

**F2: fenced examples overwrote real results.** `evaluateAcceptanceCriteria` now runs the agent's summary through the same `visibleLines` step and skips fenced lines. A later real statement still wins, as before. I also made it ignore statements inside HTML comments in the summary. That is the same flaw as F1 in the other function that reads statements: a multi-line comment holding `- AC1: met` would otherwise count.

**Regressions** (added to `packages/shared/test/acceptanceCriteria.test.ts`):
- A hidden criteria section placed before the real one now gives only the real requirement. The test also covers comments that span list items and a heading, an unclosed comment, and comment markers inside fences.
- A summary with `- AC1: not met — implementation missing`, followed by a fenced example (both ``` and `~~~` fences) and a commented-out `met` line, keeps AC1 as not met. A real `met` line added after them still wins.

**Checks:** I ran the new test file against the original parser, and both new tests fail there. With the fix, 11 of 11 pass. The six downstream test files also pass: the prompt section, review digest publication, linked-issue parsing, the review prompt, and the review budget. All tests went through `run-test-suite.mjs`, with `packages/shared` rebuilt first. `packages/shared` typechecks, and the parser file passes `eslint --max-warnings 0` under the core config.

I made no preview, because this changes text parsing, not anything a user sees.

PR: #3506
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
…onger becomes part of a criterion. In the issue from the finding, AC1 is now `Validate input: Reject malformed input, including this example:` and AC2 `Document usage.` stays separate. The fence delimiters and the `- Accept malformed input.` line are left out.

I fixed F3: a fenced example inside a nested list item no longer becomes part of a criterion. In the issue from the finding, AC1 is now `Validate input: Reject malformed input, including this example:` and AC2 `Document usage.` stays separate. The fence delimiters and the `- Accept malformed input.` line are left out.

**The fix** (`packages/shared/src/acceptanceCriteria.ts`): the old check only treated a line as a fence if it had at most three leading spaces. A new `FenceTracker` keeps track of which list items are open and where each one's text starts. A fence now counts if it is indented up to three columns past that point. A fence closes when a matching closing line appears, or when a line indented less than its list item ends that item. A fence at the start of a line also ends the list. Outside a list, a line with four spaces of indentation is still not a fence.

**Same problem in the other caller:** both parsing passes and `evaluateAcceptanceCriteria` had the same indentation limit. That function reads the agent's `- AC1: met — …` lines, so a sample statement inside a fence in a nested list in the agent's summary would have counted as a real one. All three now take fenced lines from the same tracker, which fixes that path too. Callers of `extractAcceptanceCriteria` in `promptGenerator.ts`, `issueJobHelpers.ts` and `prCommentJobHelpers.ts` get the fix without changes.

**Regressions** (`packages/shared/test/acceptanceCriteria.test.ts`):
- The nested example from the finding, checking AC1 and AC2 exactly.
- A fence inside a top-level numbered item.
- A fence that ends because a less-indented list item follows it.
- A four-space-indented fence outside a list, which must still not count.
- A sample statement fenced inside a nested list in the agent's summary, which must not count.

Run against the previous version of the parser, the two new tests fail (the nested-list fence test and the agent-summary statement test); with the fix they pass.

**Checks:**
- The parser test file passes: 12 of 12 tests.
- The 5 test files that use acceptance criteria pass through `run-test-suite.mjs`: the review digest, review budget, linked-issue and review prompt tests, plus the core prompt test.
- `tsc --noEmit` is clean for `packages/shared`.
- `eslint --max-warnings 0` passes with the core config. `packages/shared` has no lint config of its own, so I linted a temporary copy of the file inside `packages/core/src`.

There's no visual preview because this changes parsing, not anything on screen.

PR: #3506
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
…s after a fenced example now stays in its parent criterion. Before, the fence closed the criterion and the requirement after it was dropped.

I fixed F4. A nested requirement or indented text that comes after a fenced example now stays in its parent criterion. Before, the fence closed the criterion and the requirement after it was dropped.

**Cause:** the parser treated every fenced line as a break that closes the current criterion, even when the fence sat inside that criterion's list item. A nested item after the fence then had no parent and was thrown away.

**Fix** (`packages/shared/src/acceptanceCriteria.ts`):
- The fence tracker now records whether a fence sits inside a list item or at the top level.
- A fence inside a list item now reads like blank lines, so the criterion carries on after it. Nested items and indented text after the fence are kept. An unindented paragraph after it still ends the criterion, as Markdown does.
- A top-level fence and a sub-heading still end the criterion. Statement parsing in `evaluateAcceptanceCriteria` is unchanged.

**Other places with the same problem:** besides fences, only sub-headings close a criterion this way, and they really do end a list item, so they stay as they are. Lines that are only an HTML comment already read as blank, so they don't close a criterion.

**New tests** (in `packages/shared/test/acceptanceCriteria.test.ts`):
- **The finding's case:** a fence at the top-level item's indent, followed by a nested `- Reject malformed input`, more indented text and an indented line at the item's level. It now gives `Validate input: Reject malformed input with a clear error. Log each rejection.` and AC2 stays `Document usage.`
- A fence inside a nested item, followed by more text for that item and a sibling nested item. Both are kept.
- Two cases that must still end the criterion: a top-level fence, and an unindented paragraph after a fence inside an item.

**Checks:**
- The updated test file fails on the previous parser and passes on the new one.
- The six test files that use the parser all pass through `run-test-suite.mjs` (digest publication, linked-issue parsing, review budget, review prompt, the core prompt section, and the parser itself).
- `packages/shared` typechecks and builds.
- The parser passes `eslint --max-warnings 0` under the core lint config.

There's no visual preview, because the change only affects parsed text.

PR: #3506
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
…teria.ts`. The shared parser tests (14) pass, and the 7 consumer suites pass through `run-test-suite.mjs`: digest, review prompt, linked issue, PR template and prompt. The shared typecheck is clean, and the file passes `eslint --max-warnings 0` under the core config. Run against the HEAD parser, the new tests fail, so they do catch the bugs.

I fixed both findings in `packages/shared/src/acceptanceCriteria.ts`. The shared parser tests (14) pass, and the 7 consumer suites pass through `run-test-suite.mjs`: digest, review prompt, linked issue, PR template and prompt. The shared typecheck is clean, and the file passes `eslint --max-warnings 0` under the core config. Run against the HEAD parser, the new tests fail, so they do catch the bugs.

**F5: fences that start on a list-item line**
- A line like ``- ```md`` now opens a fence. Its column is the item's content column, so the example lines below it are fenced and its closing delimiter closes it rather than opening a new fence. This also works when one line opens several items, like ``- 1. ~~~``.
- The item itself still starts on that line; only its content is fenced. So text after the fence stays in that item instead of being added to the previous criterion.
- In your example the real `AC1: not met — missing implementation` is now kept, and the `met` line in the example is ignored. A real statement after the example is still read.
- Regressions cover both the criteria list and the status check.

**F6: list indentation after a sub-heading**
- The indentation baseline now resets at a sub-heading, so the next list's first item is top-level again. With your example, `Usage is documented` becomes AC2, and items nested under it fold in as usual.
- The regression uses lists with different indentation under sibling `###` subsections.

**Same defect in nearby code, also fixed**
- **Top-level fence or paragraph:** these end a list too, but the old indentation stayed. So in ``- Backend works`` / `Operations:` / `   1. Alert added`, the item was silently dropped. The baseline now resets there as well.
- **Fence tracking after a heading:** the code that tracks fences didn't treat a heading as ending a list. So a top-level fence after a sub-heading could close early, and list items in the example became criteria. Headings now end the list for fences too.

**Behaviour changes to know about**
- **One existing test now expects different output.** It used ``- First`` / a top-level fence / ``  - Orphan`` / ``- Second`` and expected `Orphan` to be dropped. In Markdown the fence ends the list, so that line shows as its own top-level bullet. It is now its own criterion: `First`, `After the fence` (renamed in the test), `Second`. It still doesn't merge into `First`.
- **Inline code in an item isn't a fence.** Because list-item lines can now open fences, a criterion like ``- ```npm test``` passes`` could have hidden everything below it. A backtick fence whose text contains another backtick is now treated as inline code, as in CommonMark, both on list-item lines and elsewhere.
- **One line opens at most 8 items.** Without this cap, a long run like `- - - …` was slow to parse. The adversarial-input test now includes such a line.

**Found but not changed:** a closing fence that has text after it (for example ```` ``` foo ````) still closes the fence. In CommonMark it doesn't. This was already the case before this PR and is outside F5/F6.

No visual preview: this is a text parser with no UI change.

PR: #3506
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
…xample` or ```` ``` example ````, no longer closes a fence. In both your examples, `AC1` now stays `not met — implementation missing`, and the `- Fenced` item is no longer read as a criterion.

I fixed F7: a fence line with text after it, such as `~~~ example` or ```` ``` example ````, no longer closes a fence. In both your examples, `AC1` now stays `not met — implementation missing`, and the `- Fenced` item is no longer read as a criterion.

**Cause.** The code that closes a fence was using the same check as the one that opens one, and that check allows text after the run.

**Fix** (in `packages/shared/src/acceptanceCriteria.ts`):
- A new `closingFenceRun` accepts a closing fence only when the run is followed by nothing but spaces or tabs.
- `continueFence` now uses it.
- The other rules are unchanged: same character, a run at least as long as the opening one, and at most three columns of indentation past the list item's content.
- Both exported parsers go through this one tracker, so extraction and evaluation are both fixed. Opening a fence still uses the old check, which is correct there.

**Same bug, further down.** Once the fake delimiter had closed the fence, the real closing fence opened a new one that never closed. That hid everything after it: a genuine `- AC2: met` statement came out as `not addressed`, and `- Second` was dropped from extraction. The same change fixes this.

**Other places checked.** The tracker is the only fence detection the PR adds; nothing else in the PR's changes parses fences. I found nothing unrelated to report.

**New tests** (in `packages/shared/test/acceptanceCriteria.test.ts`), each run with `~~~` and with ```` ``` ````:
- **Extraction:** a top-level fence and a fence inside a list item (with a longer run plus text). After each fence, `- Second` and a nested item are still kept.
- **Evaluation:** a top-level fence and a fence inside a list item. The example's `met` does not replace the real `not met`, and a real statement after the closing fence still counts.
- **Trailing whitespace:** a closing fence followed by spaces and a tab still closes, so the check isn't too strict.

**Verification**
- Run against the HEAD parser, both new tests fail. Each case gives the wrong result there except the trailing-whitespace one, which is a guard and passes either way.
- With the fix, the parser tests (16) and the 7 consumer suites pass through `run-test-suite.mjs`: digest publication, review digest, review prompt, linked issue, PR template (two suites) and the criteria prompt. I rebuilt the shared package first so suites that read its built output test the new code.
- The shared typecheck is clean, and the file passes `eslint --max-warnings 0` under the core config. I linted a temporary copy inside `packages/core/src` and deleted it afterwards.

There is no visual preview: the change only affects how Markdown text is parsed.

PR: #3506
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
…a.ts`. The 19 parser tests pass, and so do the 10 parser and consumer suites I ran through `run-test-suite.mjs`. The three new tests fail against the HEAD parser, so they do catch the bugs.

I fixed F8 and F9 in `packages/shared/src/acceptanceCriteria.ts`. The 19 parser tests pass, and so do the 10 parser and consumer suites I ran through `run-test-suite.mjs`. The three new tests fail against the HEAD parser, so they do catch the bugs.

**F8: quoted fenced examples.** The fence tracker now reads block quotes: it removes the `>` markers and tracks fences inside the quote. In your example, `AC1` stays `not met — implementation missing`. The same handling covers:
- nested quotes (`> > ~~~`).
- a list inside a quote (`> - ```md`).
- a quote inside a list item.
- a quote that opens on an item's own line (`- > ```md`).

A blank or unquoted line ends the quote and closes any fence in it, so a statement after it counts again. A quoted statement outside a fence (`> - AC1: met — x`) still counts, as before.

**F9: headings inside list items.** A heading inside a list item is now part of that item and no longer ends the section. Your issue now gives `AC1: Document usage: Examples; Include a working example.` and `AC2: Add automated tests.`. A heading outside the list still ends the section as before.

**Related cases fixed by the same changes, with tests:**
- A lower-level (`###`) or underlined heading inside an item didn't drop anything, but it split the nested requirement into its own criterion and shifted the later ids. It now stays in the parent.
- In an issue body, a quoted fenced example was folded into the criterion's text (`Validate input: > ```text > - Accept malformed input. > ````). It's now dropped like any other fenced example.

**Other behaviour to know about:**
- **Nesting limit:** quotes nested more than 8 deep are treated as fenced code, which keeps parsing fast on hostile input. A statement that deep shows as "not addressed", never a false "met".
- **Section heading inside a list item:** a heading in that same item still ends the section. Code fences in that item now end the current criterion. The usual case, a top-level heading, is unchanged.

**Not changed:**
- A heading indented 4 or more spaces inside a nested item isn't recognised as a heading. Its text stays in the criterion with the `###` (for example `First ### Examples`), but nothing is lost.
- A quoted line right after an item is still added to that item's text (`- a` then `> note` gives `a > note`).

Typecheck for `packages/shared` is clean. The parser has 0 warnings under the core lint config. The first lint run silently skipped the file because it sits outside `packages/core`, so I linted a temporary copy inside `packages/core/src` and then deleted it. There's no visual preview, because the change only affects parsed text.

PR: #3506
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
… Sibling top-level items with differing indentation, such as `- Backend works` followed by ` - Documents usage`, are now two criteria, AC1 and AC2, instead of one combined criterion.

I fixed F10 in `packages/shared/src/acceptanceCriteria.ts`. Sibling top-level items with differing indentation, such as `- Backend works` followed by ` - Documents usage`, are now two criteria, AC1 and AC2, instead of one combined criterion.

**What was wrong.** `criteriaSection` already knew from the fence tracker which list item held each line, but it passed ordinary lines on as plain strings. `listItems` then compared each marker's indentation with the first item's indentation, so any marker indented more than the first item was folded into the previous criterion even when Markdown makes it a sibling.

**The correction**
- Section lines now carry an `inItem` flag: whether a list item that opened inside the section holds the line. That is the tracker's container column compared with the heading's column, which `criteriaSection` already computed for fenced lines and headings.
- `listItems` starts a new criterion for any list item not held by another item, and folds held items in. The first-item indent bookkeeping is gone. Nesting follows the list structure: a marker left of the previous item's content column is a sibling, a marker at or right of it is a child.
- Fenced lines inside an item keep their blank placeholder, now in the new shape.

**Sibling check.** `listItems` was the only consumer of the section lines and the only place that used marker indentation to decide nesting. The statement parser in `evaluateAcceptanceCriteria` has no list structure to get wrong. Nothing else needed changing.

**Regression test.** A new test in the shared suite covers the finding's exact input, a four-item mix of indents in bullet and ordered lists, and a sibling that follows the first item's children. Against the HEAD parser it fails with `Backend works; Documents usage`, so it catches the bug. The existing test for uniformly indented siblings still passes.

**Verification**
- The shared parser suite passes, 20 tests, 0 failures.
- The parser and six consumer suites pass through `run-test-suite.mjs`: PR template, core prompt section, digest publication, linked-issue repository, reviewer budget and review prompt builder.
- Shared typecheck is clean. The parser file passes `eslint --max-warnings 0` under the core config, checked through a temporary copy inside `packages/core/src` since the shared package has no lint config.

No visual preview: the change is Markdown parsing with no UI surface.

PR: #3506
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Fable 5.1
…hared/src/acceptanceCriteria.ts` with an mdast/GFM syntax tree. All the checks you listed pass. To get there I changed the expected result in four existing test cases, and I added input-size limits because micromark is slow on some inputs. Both are explained below.

I've replaced the hand-written line scanning in `packages/shared/src/acceptanceCriteria.ts` with an mdast/GFM syntax tree. All the checks you listed pass. To get there I changed the expected result in four existing test cases, and I added input-size limits because micromark is slow on some inputs. Both are explained below.

**What the module does now**
- It parses both the issue body and the agent's report with `mdast-util-from-markdown`, using the GFM extension. These come from the same remark 4 family the UI already uses, at the versions already in the lockfile. They are now dependencies of `@propr/shared`, with `@types/mdast` as a dev dependency, and the lockfile entry is updated to match.
- **Finding the section:** it finds the first "Acceptance criteria" heading, either at top level or inside a list item. The section runs to the next sibling heading of the same or higher level.
- **Criteria:** they are the top-level items of the lists in that section. Nested items, and headings inside an item, are folded into their parent criterion.
- **Wording:** the text is sliced from the original string, so links, emphasis and code appear as the author wrote them. Only HTML nodes are cut out.
- **What never counts:** code (fenced or indented), HTML and block quotes are never a source of criteria or statements.
- **Statements in the report:** they are read from paragraphs, headings and real GFM table rows.
- All the fence, indentation, quote and comment tracking is deleted; the file is 264 lines, down from 496. The public functions, return shapes and the criteria count and length limits are unchanged, and an issue with no heading still returns nothing.

**Test expectations I changed.** In each case the old test expected something CommonMark doesn't do:
1. In `   3. Third` followed by `      4. Child of third`, the `4.` line is not a nested item. A list starting at 4 can't interrupt a paragraph, so GitHub shows it as part of the text. The test now uses `1.` for the nested case, and I added a separate assertion for the `4.` reading.
2. An inline `<!--` with no `-->` in the same paragraph isn't a comment, so GitHub shows it and the lines after it. I changed that case to a real comment block spanning several lines, which is still hidden. A new assertion pins down what happens with the unclosed one.
3. Two cases expected a statement written inside a block quote to count. Under your rule they don't, so they now expect `not_addressed`.
4. The parser reads a bare `- [ ]` with nothing after it as the text `[ ]`, while GitHub shows an empty checkbox. This is the one place I kept a small text check, so such items are still dropped as the existing test expects.

**Input limits (needs your call).** micromark has quadratic cases. Some timings I measured:
- 8,000 lazy continuation lines: 3.5s
- 8,000 table rows: 9s
- items nested on one line (`- > - > …`) overflow the stack at about 2,000 levels

So only the text before the first line past one of these limits is parsed:
- 65,536 characters (GitHub's issue-body limit; the old limit was 200,000)
- 2,000 lines
- nine or more nested markers on one line (a `- - - -` thematic break is exempt)

This is a behaviour change for very long issues: criteria past those limits are lost. It's the same for very long agent reports, where the statements at the end would show as "not addressed". One worst case is still slow: about 3s for a single 64 KB paragraph of `[a](` or `[^a`.

**New tests** cover: wording kept as written, a quoted heading, indented code, a thematic break, a real table in the report, and the limits on long and deeply nested input.

**Verification**
- **Tests:** 8 files through `run-test-suite.mjs` all pass: the shared parser (22 tests), core prompt, PR template and review digest, and root linked-issue, review prompt, budget and digest publication.
- **Typecheck:** root, `packages/core`, `packages/shared` and `packages/api` are clean.
- **Build:** the shared and core builds pass, and the `propr-ui` build succeeds.
- **Lint:** the new source passes `eslint --max-warnings 0` under the core config, since shared has none of its own. The test file isn't covered by any lint config, so it wasn't linted. Root `src/` is unchanged.

There's no preview, since nothing in the UI changed.

PR: #3506
Comment by: @integry (ID: 6838228689)
Model: Claude Opus 5.5
…earlier. It was stopped at its background time limit while timing the largest nesting depths. I already had the numbers I needed from its earlier output, the probe file has been removed from the workspace, and nothing in the delivered change depends on it. No further action is needed.

That notification is the depth-measurement probe I started earlier. It was stopped at its background time limit while timing the largest nesting depths. I already had the numbers I needed from its earlier output, the probe file has been removed from the workspace, and nothing in the delivered change depends on it. No further action is needed.

PR: #3506
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Fable 5.1
…I run it locally.

I fixed the failing Shard 2/4 test, and it now passes when I run it locally.

**What failed:** one test failed: `test/notificationPublicEntrypoint.test.ts`, with `Cannot find package 'mdast-util-from-markdown' imported from …/node_modules/@propr/shared/dist/acceptanceCriteria.js`. That test builds `@propr/shared` into a temporary `node_modules` folder to mimic an installed copy of the package. It only linked `zod` there, because `zod` used to be the only runtime package the built code imported. The switch to the mdast parser added four more (`mdast-util-from-markdown`, `mdast-util-gfm`, `mdast-util-to-string`, `micromark-extension-gfm`), so the test's import of the built package failed.

**Fix:** the test now reads `packages/shared/package.json` and links every listed dependency that is installed in the workspace `node_modules`, instead of linking `zod` alone. If the shared package gains another dependency later, this test won't need editing again. The parser and its dependency list are unchanged.

**Checked:** no other test builds the package this way. I only ran this one test file, not the whole shard.

There's no visual preview because this is a test-only change.

PR: #3506
Comment by: @propr-dev[bot] (ID: 6839691949)
Model: Claude Opus 5.5
… applies, since the change is in Markdown parsing with no UI.

The fix for F13 is complete and verified. No visual preview applies, since the change is in Markdown parsing with no UI.

**What was wrong.** The depth safeguard in `packages/shared/src/acceptanceCriteria.ts` replaced any line opening nine or more containers with a blank line before parsing. A blank line ends the block it sits in. So a report like the one in the finding, with `> > > > > > > > > Example:` followed by an unprefixed `AC1: met — illustrative example`, lost its quote, and the lazy continuation became a top-level paragraph that overwrote the real `not_met`. I reproduced that, and also the sibling case the same assumption breaks: a deep line inside an HTML block, where blanking ended the block early and exposed the lines after it.

**The correction.** A too-deep line is no longer blanked. Its containers are capped at eight instead: the first seven markers are kept as written, the eighth is kept too unless any dropped marker was a block quote, in which case it becomes a quote. The text after the markers becomes that container's content. The consequences:

- A quoted paragraph stays quoted, so its lazy continuations stay quoted and are excluded.
- An HTML block is no longer cut short by a synthetic blank line.
- The leading markers and indentation are preserved, so a deep line that is literal fenced-code content inside a quote or list item stays code, and still hides nothing after it.
- A blank line or a list item after the deep line still ends the quote, as in CommonMark, so a real statement there still counts.

**Cost.** The HEAD parser already accepted eight-deep lines uncapped. I timed the capped worst cases, including 2,000 capped lines and an incremental nesting of depth 712, against the HEAD parser on equivalent eight-deep input. They are within the same range, so no new cost envelope opened. The existing two-second bound test still passes.

**Regressions added** in `packages/shared/test/acceptanceCriteria.test.ts`: the exact finding scenario, a repeated quoted statement, mixed list and quote chains, a quote only beyond the cap, the HTML-block variant, a deep line inside a quoted fence, the cases where a blank line or list item legitimately ends the quote, and an extraction case showing a capped list line reads as nested content. The new test fails against the HEAD parser and passes now.

**Verification.** All 25 parser tests pass, and the six parser and consumer suites pass through the suite runner after rebuilding the shared package output. The shared package typechecks. The parser source passes the core ESLint config with zero warnings.

**Independent observation, not changed.** The core ESLint config does not cover test files in the shared package, so that test file has no lint gate at all, which was also true before this change.

PR: #3506
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Fable 5.1
…ceptance-criter-20261112-1853-mye

[3499 by Claude Opus 5.5] Extract acceptance criteria from the issue and report evidence per criterion
@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

✅ Epic ready for final merge: Trust the PR, part 2: review categories and acceptance criteria

All 2 child PRs have been merged into this epic branch. This epic PR is ready for final review and merge.


Posted automatically by ProPR

@integry
integry marked this pull request as ready for review November 13, 2026 07:17
@integry

integry commented Nov 13, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR implements finding categories, style-only Ultrafix termination, and acceptance-criteria reporting across prompts, digests, and review context. No merge-blocking defect was verified in the supplied diff. It is ready to merge within the reviewed scope, conditional on pending checks completing successfully.

✅ Backward compatibility — Both finding parsers accept missing categories as correctness, with tests covering legacy public comments and category round trips.

✅ Distinct termination semantics — Style-only findings stop further fixes without satisfying the review goal or enabling auto-merge; continuation and MCP tests cover the new outcome.

✅ Structured checklist reporting — Criteria and agent statements flow into the published digest and persisted timeline metadata, with unreported criteria explicitly marked not_addressed.

Verification was static only; no commands were run. The linked issue descriptions contain explicit truncation notices, so requirements beyond their visible text could not be assessed. The supplied checks report no failures and five pending checks.

Merge blockers

No merge blockers.

Suggestions

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

S1: 🟢 Update the public review example

In docs/docs/features/pr-commands.md, the “Review Output Format” example still omits Category, and the accompanying paragraph describes findings as carrying three fields. Update these to match formatPublicFindings, and mention style-only termination in the Ultrafix completion documentation. This is optional documentation alignment; the implementation and its tests already establish the behavior.

Score

The visible requirements have substantial implementation and regression coverage, with no verified code blocker. Final merge readiness remains conditional on the pending checks; this review did not execute tests.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 22s
  • Tokens: 85,097 (84,338 in / 759 out)
  • Cost: $0.77

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

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

🔀 Resolved merge conflicts from main into 3498-epic-trust-the-arv in commit 37c2bb9

Conflicting Files

  • packages/shared/src/reviewPrompt.ts

Resolution Summary

I resolved the one merge conflict, in packages/shared/src/reviewPrompt.ts. A search of the whole repository found no other conflict markers.

What the conflict was about: Both branches rewrote DEFAULT_REVIEW_GUIDANCE, the default /review guidance that the Settings UI also shows. They started from the same text and each added something different:

  • The PR added scope-fit checks. The review compares the size and shape of the change with the objective. Unrequested complexity is a complexity blocker, a stubbed or placeholder delivery is a requirement blocker, and a style blocker is allowed only when it cites an explicit repository rule.
  • main added one sentence telling the reviewer to check whether new helpers, functions or modules duplicate code the repository already has, and to flag that under complexity.

How I resolved it: I kept the PR's full text and inserted main's sentence where main put it, right after "Report those separately as suggestions." It still ends with "Your response MUST contain exactly the four sections specified below."

Why: The two changes don't contradict each other. They add separate checks to the same paragraph, so the merged text keeps both. I copied main's sentence word for word, including "when the review uses that category", because test/weeklyCodebaseDriftReportTemplate.test.ts checks for that exact sentence and for the closing line. The PR's assertions in test/reviewFindingCategory.test.ts still match because none of its wording changed.

Verification: No conflict markers remain. test/reviewFindingCategory.test.ts, test/weeklyCodebaseDriftReportTemplate.test.ts and test/reviewPromptBuilder.test.ts pass (48 of 48). They need PROPR_DEMO_MODE=true: a first run without it reported two of the three files as failed.


🤖 Resolution Details

  • Model: Claude Opus 5.5
  • Time: 2m 51s

View Task Execution


System-triggered merge conflict resolution

@integry

integry commented Nov 13, 2026

Copy link
Copy Markdown
Owner

/fix all

Automatically resolved merge conflicts after merging target branch into PR branch.
Resolved conflicts in:
- packages/shared/src/reviewPrompt.ts

PR: #3505
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 08ed2cc

Addressed 1 AI review comment (IDs: 6846800046)

Addressed suggestion S1

Summary of Changes

I updated the /review documentation in docs/docs/features/pr-commands.md so it matches what the code produces. Only S1 was in scope, so no code changed.

  • Review Output Format example: each F# record now has a - **Category:** <correctness | requirement | security | tests | complexity | style> line before Required behavior. That is the same field order formatPublicFindings uses in src/jobs/reviewOutputParser.ts.
  • Paragraph under the example: findings now carry "four fields" instead of three. It also explains the category list (with complexity described as unrequested complexity) and says that review comments written before categories existed have no Category line and are read as correctness.
  • Ultrafix Completion:
    • The "Stopped before the goal" bullet now lists a review whose remaining blockers are all style as one of the stop causes.
    • A new Style-only findings bullet says that in that case no further fix is scheduled. The stop comment says only stylistic findings remain, and the goal is not counted as reached. It also notes that a review mixing style with any other category keeps the loop going. This follows hasOnlyStyleFindings and the stop message in ultrafixLoopContinuationHelpers.ts.

Verification: test/reviewFixSelection.test.ts is the one test that reads pr-commands.md, and it still passes (41 pass, 0 fail). I didn't add a test that checks the docs example against the code, because the behaviour is already covered by the existing implementation tests.

I found no other places in the docs with the same three-field description or missing style-only stop. The change is documentation only, so there is no visual preview.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 4m 50s
  • Tokens: 413,512 (410,426 in / 3,086 out)
  • Cost: $0.36

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6846873488✓

propr-dev[bot] and others added 3 commits November 13, 2026 07:34
…s/pr-commands.md` so it matches what the code produces. Only S1 was in scope, so no code changed.

I updated the `/review` documentation in `docs/docs/features/pr-commands.md` so it matches what the code produces. Only S1 was in scope, so no code changed.

- **Review Output Format example:** each `F#` record now has a `- **Category:** <correctness | requirement | security | tests | complexity | style>` line before **Required behavior**. That is the same field order `formatPublicFindings` uses in `src/jobs/reviewOutputParser.ts`.
- **Paragraph under the example:** findings now carry "four fields" instead of three. It also explains the category list (with `complexity` described as unrequested complexity) and says that review comments written before categories existed have no Category line and are read as `correctness`.
- **Ultrafix Completion:**
  - The "Stopped before the goal" bullet now lists a review whose remaining blockers are all `style` as one of the stop causes.
  - A new **Style-only findings** bullet says that in that case no further fix is scheduled. The stop comment says only stylistic findings remain, and the goal is not counted as reached. It also notes that a review mixing `style` with any other category keeps the loop going. This follows `hasOnlyStyleFindings` and the stop message in `ultrafixLoopContinuationHelpers.ts`.

**Verification:** `test/reviewFixSelection.test.ts` is the one test that reads `pr-commands.md`, and it still passes (41 pass, 0 fail). I didn't add a test that checks the docs example against the code, because the behaviour is already covered by the existing implementation tests.

I found no other places in the docs with the same three-field description or missing style-only stop. The change is documentation only, so there is no visual preview.

PR: #3505
Comment by: @integry (ID: 6846873488)
Model: Claude Opus 5.5
…adroom

The test asserted the bounded parse finished within 2 seconds of wall
clock. The bounded work takes about 2 seconds on a busy machine, so the
assertion failed intermittently. Unbounded, the same inputs take
minutes, so a 20 second limit still catches a regression.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…bound

test(shared): give the acceptance criteria input-bound test timing headroom
@integry
integry merged commit 0ad17d1 into main Nov 13, 2026
44 checks passed
@integry
integry deleted the 3498-epic-trust-the-arv branch November 13, 2026 09:40
@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

✅ Epic merged: Trust the PR, part 2: review categories and acceptance criteria

Epic PR #3505 has been merged into main.

3 out of 3 PRs merged into main through this epic PR.

All planned epic work is now merged.

Posted automatically by ProPR

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

Labels

Projects

None yet

2 participants