[PR #8142] [MERGED] fix(dottore): start every finder at once and carry unjudged candidates #8125

Closed
opened 2026-10-24 04:10:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8142
Author: @Promansis
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @Promansis

Base: staging ← Head: fix(review)/8141-dottore-large-reviews


📝 Commits (4)

  • 873f518 fix(dottore): start every finder at once and carry unjudged candidates
  • 8bdb469 fix(dottore): rank carried candidates by severity and keep their repair
  • 88976d4 fix(dottore): keep the unjudged marker within its budget
  • 952895c Merge branch 'staging' into fix(review)/8141-dottore-large-reviews

📊 Changes

3 files changed (+286 additions, -37 deletions)

View changed files

📝 .github/dottore-review/README.md (+11 -5)
📝 .github/dottore-review/dottore_review.py (+159 -30)
📝 scripts/regressions/dottore-stream-progress.regression.mjs (+116 -2)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8141

Why this change

  • Dottore cannot finish a PR that splits into more packets than DOTTORE_CONCURRENCY (default 4). The late finders wait behind roughly 11-minute xhigh finders. They then time out on the 180 s silence floor or run into the checker's 8-minute reserve. The walkthrough records last-reviewed-sha=unrecorded, so every later run is a full review that hits the same timing, and the required Dottore Review status never passes. Pasta-Devs/Marinara-Agents#1595 (7 packets) failed this way four runs in a row and needed a manual incremental dispatch to merge.
  • Four finder calls on those runs reported exactly 63,999 of 64,000 output tokens without taking the cap path. The log had no stop reason, so there was no way to tell whether they were cut short.

What changed

 agentic_review
   scout_bundles(ctx, pool)                 # DOTTORE_CONCURRENCY workers
-  run_finders(ctx, pool)                   # the same 4 workers: finder 5+ waits
+  run_finders(ctx)                         # own pool, one worker per finder, up to 16
-  verify_candidates(ctx, claims, pool)
+  verify_candidates(ctx, by_severity(carried + claims), pool)  # also returns the unjudged ones
 render_walkthrough
-  any candidate unjudged          -> last-reviewed-sha=unrecorded (next run: full)
+  some judged, some unjudged      -> last-reviewed-sha=<head> + dottore:unjudged=<candidates>
   failed, skipped or none judged  -> unrecorded (unchanged)
+  a removed line left unjudged    -> unrecorded (its number is in this examination's old file)
 produce_review, incremental
+  carried_candidates: read the marker from the walkthrough recording that head, follow each line to HEAD,
+                      drop candidates whose file is gone, log taken-up and dropped counts
-  no new diff                     -> "No New Diff Reviewed"
+  no new diff and nothing carried -> "No New Diff Reviewed"
  • Finders start at once. run_finders runs on its own pool sized to the finder count, up to MAX_CONCURRENCY (16). Scouts and checkers keep DOTTORE_CONCURRENCY.
  • Stop reason in the log. Claude, Chat Completions and Responses replies keep their stop reason, and every Dottore call: line ends with stop_reason=….
  • Unjudged candidates carry over. The commit status still fails and the head is not discharged until they are judged. A carried candidate is checked against the PR's whole diff; one whose file is in no packet of the new run is checked without a packet. Carried candidates join the new claims in severity order, so the 20-candidate cap still drops the least severe. Each keeps its fix hint and a compact repair contract, and a cut body ends in an ellipsis. Past 24,000 characters of JSON the contracts go, the least severe candidate's first; unjudged candidates that still do not fit are not carried, so the head stays unrecorded and a Dottore unjudged: line logs the size.
  • .github/dottore-review/README.md: the DOTTORE_CONCURRENCY row, the Dottore call: and Dottore carried: log lines, and the Examination Incomplete verdict.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Agent-run evidence on 88976d48 (boxes above left for the human checklist):

  • pnpm check: exit 0. node scripts/run-regressions.mjs --filter dottore: 2/2 passed.
  • scripts/regressions/dottore-stream-progress.regression.mjs gains five cases and one assertion. Run against the original reviewer (5b00fa2a5), six of the eleven error; with this change all eleven pass:
    • Before: 7 packets on the default 4-worker pool, with a 7-party barrier in the finder: 4 of 7 finders start together, and the barrier breaks.
      After: all 7 start together (test_every_finder_starts_at_once_whatever_the_packet_count).
    • Before: replies have no stop_reason.
      After: Claude end_turn and Chat Completions length are kept.
    • Before: a carried candidate with no packet crashes the checker sort (None < int), and any unjudged candidate leaves the head unrecorded.
      After: a partial examination renders the head SHA and the unjudged marker and still reads as a completed review, so the next auto run is incremental. A review that judged nothing stays unrecorded. carried_candidates reads only the marker for the matching head, also when a newer failed walkthrough exists, and in a real git history a line below 3 inserted lines moves 5 → 8, a rewritten line moves to its hunk, and a candidate in a deleted file is dropped (Dottore carried: candidates=2; dropped=1). An unjudged removed line leaves the head unrecorded.
    • Before (873f5184): 20 carried low candidates took every cap slot ahead of a fresh high claim, and a carried candidate lost its fix hint and repair contract.
      After: the fresh high claim is judged and the 20th carried one is capped (test_carried_candidates_take_their_place_by_severity_under_the_cap); hint and contract survive the marker and a confirmation without new prose.
    • Before (8bdb4691): 19 unjudged candidates whose text escapes heavily produced a marker of about 174,000 characters, past GitHub's 65,536-character comment limit.
      After: 19 full-length candidates still fit; the heavily escaped set is not carried and the walkthrough records unrecorded (test_carried_entries_mark_a_cut_body_and_fit_their_budget).

Manual verification notes

  • After the Agents pin, manually verify on a PR with 5+ packets: every Dottore call: line shows stop_reason=, and all finder calls start within the first few seconds of the finder stage.
  • Manually verify that a review leaving candidates unverified writes a head SHA and a dottore:unjudged= marker into the walkthrough header, and that the next /dottore run logs Dottore carried: candidates=N; dropped=M and judges them, including when the head has no new diff.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

The only doc change is .github/dottore-review/README.md, which is outside docs/, so no translated pack applies. There is no version bump. Marinara-Agents needs its usual follow-up PR pinning this Engine SHA.

Merge Danger

Door: two-way

Reverting restores the shared pool and the unrecorded walkthrough. A walkthrough written in the meantime with a carried marker reads to the old code as a reviewed head, so its leftover candidates would not be re-checked.

Blast Radius: Dottore

Only reviews running this tooling are affected: Engine after merge, Agents after the pin. A large PR now sends up to 16 finder calls to the provider at once instead of 4. Total calls and cost per review are unchanged, but the burst is larger. A carried marker adds at most about 32,000 characters to the walkthrough comment.

UI evidence (if applicable)

Not applicable: no UI change.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8142 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(review)/8141-dottore-large-reviews` --- ### 📝 Commits (4) - [`873f518`](https://github.com/Pasta-Devs/Marinara-Engine/commit/873f518457fdc7bb8928997c14bfe11978e7db05) fix(dottore): start every finder at once and carry unjudged candidates - [`8bdb469`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8bdb4691b2279c940504f772ea7c29a83ceaca57) fix(dottore): rank carried candidates by severity and keep their repair - [`88976d4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/88976d480ae7cf89b9887636edbd4f71dbf6f289) fix(dottore): keep the unjudged marker within its budget - [`952895c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/952895cf290fd7ff38fef54d22ca7110c78000e4) Merge branch 'staging' into fix(review)/8141-dottore-large-reviews ### 📊 Changes **3 files changed** (+286 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `.github/dottore-review/README.md` (+11 -5) 📝 `.github/dottore-review/dottore_review.py` (+159 -30) 📝 `scripts/regressions/dottore-stream-progress.regression.mjs` (+116 -2) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #8141 ## Why this change - Dottore cannot finish a PR that splits into more packets than `DOTTORE_CONCURRENCY` (default 4). The late finders wait behind roughly 11-minute `xhigh` finders. They then time out on the 180 s silence floor or run into the checker's 8-minute reserve. The walkthrough records `last-reviewed-sha=unrecorded`, so every later run is a full review that hits the same timing, and the required `Dottore Review` status never passes. Pasta-Devs/Marinara-Agents#1595 (7 packets) failed this way four runs in a row and needed a manual incremental dispatch to merge. - Four finder calls on those runs reported exactly 63,999 of 64,000 output tokens without taking the cap path. The log had no stop reason, so there was no way to tell whether they were cut short. ## What changed ```diff agentic_review scout_bundles(ctx, pool) # DOTTORE_CONCURRENCY workers - run_finders(ctx, pool) # the same 4 workers: finder 5+ waits + run_finders(ctx) # own pool, one worker per finder, up to 16 - verify_candidates(ctx, claims, pool) + verify_candidates(ctx, by_severity(carried + claims), pool) # also returns the unjudged ones ``` ```diff render_walkthrough - any candidate unjudged -> last-reviewed-sha=unrecorded (next run: full) + some judged, some unjudged -> last-reviewed-sha=<head> + dottore:unjudged=<candidates> failed, skipped or none judged -> unrecorded (unchanged) + a removed line left unjudged -> unrecorded (its number is in this examination's old file) produce_review, incremental + carried_candidates: read the marker from the walkthrough recording that head, follow each line to HEAD, + drop candidates whose file is gone, log taken-up and dropped counts - no new diff -> "No New Diff Reviewed" + no new diff and nothing carried -> "No New Diff Reviewed" ``` - **Finders start at once.** `run_finders` runs on its own pool sized to the finder count, up to `MAX_CONCURRENCY` (16). Scouts and checkers keep `DOTTORE_CONCURRENCY`. - **Stop reason in the log.** Claude, Chat Completions and Responses replies keep their stop reason, and every `Dottore call:` line ends with `stop_reason=…`. - **Unjudged candidates carry over.** The commit status still fails and the head is not discharged until they are judged. A carried candidate is checked against the PR's whole diff; one whose file is in no packet of the new run is checked without a packet. Carried candidates join the new claims in severity order, so the 20-candidate cap still drops the least severe. Each keeps its fix hint and a compact repair contract, and a cut body ends in an ellipsis. Past 24,000 characters of JSON the contracts go, the least severe candidate's first; unjudged candidates that still do not fit are not carried, so the head stays unrecorded and a `Dottore unjudged:` line logs the size. - `.github/dottore-review/README.md`: the `DOTTORE_CONCURRENCY` row, the `Dottore call:` and `Dottore carried:` log lines, and the Examination Incomplete verdict. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Agent-run evidence on 88976d48 (boxes above left for the human checklist): - `pnpm check`: exit 0. `node scripts/run-regressions.mjs --filter dottore`: 2/2 passed. - `scripts/regressions/dottore-stream-progress.regression.mjs` gains five cases and one assertion. Run against the original reviewer (5b00fa2a5), six of the eleven error; with this change all eleven pass: - **Before:** 7 packets on the default 4-worker pool, with a 7-party barrier in the finder: 4 of 7 finders start together, and the barrier breaks. **After:** all 7 start together (`test_every_finder_starts_at_once_whatever_the_packet_count`). - **Before:** replies have no `stop_reason`. **After:** Claude `end_turn` and Chat Completions `length` are kept. - **Before:** a carried candidate with no packet crashes the checker sort (`None < int`), and any unjudged candidate leaves the head unrecorded. **After:** a partial examination renders the head SHA and the unjudged marker and still reads as a completed review, so the next auto run is incremental. A review that judged nothing stays unrecorded. `carried_candidates` reads only the marker for the matching head, also when a newer failed walkthrough exists, and in a real git history a line below 3 inserted lines moves 5 → 8, a rewritten line moves to its hunk, and a candidate in a deleted file is dropped (`Dottore carried: candidates=2; dropped=1`). An unjudged removed line leaves the head unrecorded. - **Before (873f5184):** 20 carried low candidates took every cap slot ahead of a fresh high claim, and a carried candidate lost its fix hint and repair contract. **After:** the fresh high claim is judged and the 20th carried one is capped (`test_carried_candidates_take_their_place_by_severity_under_the_cap`); hint and contract survive the marker and a confirmation without new prose. - **Before (8bdb4691):** 19 unjudged candidates whose text escapes heavily produced a marker of about 174,000 characters, past GitHub's 65,536-character comment limit. **After:** 19 full-length candidates still fit; the heavily escaped set is not carried and the walkthrough records `unrecorded` (`test_carried_entries_mark_a_cut_body_and_fit_their_budget`). ### Manual verification notes - After the Agents pin, manually verify on a PR with 5+ packets: every `Dottore call:` line shows `stop_reason=`, and all finder calls start within the first few seconds of the finder stage. - Manually verify that a review leaving candidates unverified writes a head SHA and a `dottore:unjudged=` marker into the walkthrough header, and that the next `/dottore` run logs `Dottore carried: candidates=N; dropped=M` and judges them, including when the head has no new diff. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) The only doc change is `.github/dottore-review/README.md`, which is outside `docs/`, so no translated pack applies. There is no version bump. Marinara-Agents needs its usual follow-up PR pinning this Engine SHA. ## Merge Danger **Door:** two-way Reverting restores the shared pool and the unrecorded walkthrough. A walkthrough written in the meantime with a carried marker reads to the old code as a reviewed head, so its leftover candidates would not be re-checked. **Blast Radius:** Dottore Only reviews running this tooling are affected: Engine after merge, Agents after the pin. A large PR now sends up to 16 finder calls to the provider at once instead of 4. Total calls and cost per review are unchanged, but the burst is larger. A carried marker adds at most about 32,000 characters to the walkthrough comment. ## UI evidence (if applicable) Not applicable: no UI change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:10:35 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8125
No description provided.