[PR #8238] [MERGED] fix(dottore): stop re-raising disposed threads and findings from missing context #8200

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

📋 Pull Request Information

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

Base: staging ← Head: fix/dottore-false-positives-8237


📝 Commits (7)

  • 6dc87cd chore(dottore): start false-positive fixes (#8237)
  • fc833c3 fix(dottore): stop re-raising disposed findings and widen the review bundle
  • 238a9b9 fix(dottore): take dispositions only from maintainers and close review gaps
  • 711fdde fix(dottore): send linked issues' intent to the finder and checker only
  • 6ec2bb4 fix(dottore): read issue sections from CRLF bodies and decorated headings
  • 98a294b fix(dottore): keep an issue's scope under the budget and label what is guessed
  • c1e8f6c Merge branch 'staging' into fix/dottore-false-positives-8237

📊 Changes

6 files changed (+420 additions, -51 deletions)

View changed files

📝 .github/dottore-review/README.md (+25 -5)
📝 .github/dottore-review/dottore_review.py (+186 -35)
📝 .github/dottore-review/reviewer-prompt.md (+8 -6)
📝 .github/dottore-review/rules.json (+6 -5)
📝 .github/workflows/dottore-review.yml (+2 -0)
➕ scripts/regressions/dottore-thread-dispositions.regression.mjs (+193 -0)

📄 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 #8237

Why this change

  • Dottore keeps raising findings that a maintainer has already answered or resolved. A prior finding's repair contract stays in the walkthrough header and is shown to the finder on every later review with nothing to say it was settled, so the same point comes back in other files and rounds (about 20 of the disputed findings in #8237, for example 8 on #8151 and 8 on #8153).
  • Other findings rest on context the packet never shows, so "not in the packet" is read as "doesn't exist" or "is a bug":
    • the linked issue: GitHub fills closingIssuesReferences only for PRs into the default branch, and these PRs target staging;
    • tests that already exist;
    • repository variables such as DOTTORE_AUTO_REVIEW.
  • A confirmation whose quoted evidence didn't match the code was published as an "Unresolved Hypothesis", which then walked the finding back in public.
  • Each false positive opens a thread that holds the verdict until someone answers it.

What changed

Harness (dottore_review.py, dottore-review.yml)

  • One GraphQL call now lists every Dottore thread with its state: resolved, answered, and the last reply a person left.
    • A prior contract whose thread is resolved is dropped.
    • A contract whose thread an owner, member or collaborator replied to is marked disposed and carries the reply. The finder sees it under a "Disposed by a maintainer" heading. Replies from anyone else, or from bots, settle nothing and never reach the prompt.
    • Repair Check and the approval gate keep the same thread sets as before. An answered but unresolved thread still holds approval.
    • If the thread listing fails, the contracts keep their recorded state, as before.
  • The finder and checker, but not the scouts, see the first two issues named by Closes/Fixes/Resolves #N in the PR body. Of each they see only the title and the sections that say what the change must do or leave alone (Expected behavior, Requested behavior, Proposed solution, Scope, Not in scope and common variants), up to 1,000 characters, or the first 500 characters of an issue without them. These sections were chosen from the 150 most recent issues in each repo; the extracted text is about 600 characters at the median.
  • The bundle adds:
    • the tracked test files named after a changed file, by name only and capped at 30;
    • for a PR that changes .github/, the repository's Actions variables, never secrets. The workflow passes toJSON(vars) as DOTTORE_VARS_JSON.
  • A confirmation whose evidence doesn't match the head is now unmatched. It is withheld and counted under Verification Coverage and in Lab Notes instead of being published as a hypothesis.
  • If the PR head moved while the review ran, post_review appends a note naming the examined and current commits. carry_walkthrough strips that note on the next carry.

Prompt and rules (reviewer-prompt.md, rules.json)

  • Finder:
    • name the caller or producer that supplies the input;
    • combine only concerns that share a premise;
    • treat out-of-packet tests, settings, variables and docs as "not visible in the review packet";
    • don't raise a disposed contract again unless new code changes the input the reply names.
  • Checker confirmed: the evidence must name the caller or producer that reaches the cited line, in the order it runs.
  • Checker rejected also covers:
    • behaviour that matches the PR description, a linked issue, a schema or a doc, as long as it breaks no caller or stored data that contract leaves out;
    • claims that rest on an absence nobody has shown;
    • a pattern that already appears unchanged in the touched module;
    • a migration demanded for a format that exists only in this PR;
    • a ponytail: note that names the failing input. This counts as a decision unless the PR sends that code new inputs the note doesn't name. A general ceiling still leaves the candidate standing.
  • Checker step 7:
    • list the existing guards a fix must keep;
    • a heuristic finding must name one concrete wrongly matched or missed input.
  • Calibration: avoid "forever/every/always/never" without evidence.
  • rules.json:
    • a missing test is a proof gap (a pre-merge check), not a medium/low finding, and the matching repo_concerns line and prompt focus list say the same;
    • medium requires an ordinary action to reach the bug;
    • docs rules stop repeat placement and rewording requests, and group the remaining prose nits into one nitpick per file.

Docs and proof

  • .github/dottore-review/README.md documents the new bundle sections, unmatched confirmations, the moved-head note, dropped and disposed contracts, and that every repository variable reaches the review step.
  • New scripts/regressions/dottore-thread-dispositions.regression.mjs (9 cases). It fails all 9 on the previous harness and passes on this one.

Deviations from the plan in #8237

  • P2. The finder isn't told to move uncertain-reachability claims to open_questions, because that conflicts with its existing rule to report a suspicion so the checker reads it. The reachability requirement goes on the checker's confirmed verdict instead.
  • H2. Linked issues are read from closing keywords in the PR body, because closingIssuesReferences is empty for staging PRs. An issue linked only from the sidebar or by a plain mention is not read.
  • H5. The moved-head note doesn't claim a re-review is queued, because automatic review may be off.

Validation

  • pnpm check passes locally
  • node scripts/run-regressions.mjs --filter dottore passes (on Windows, with PYTHONUTF8=1)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Agent-run locally (not a substitute for the items below): pnpm check exited 0; PYTHONUTF8=1 node scripts/run-regressions.mjs --filter dottore passed 4/4; py_compile passed.

Local review. The CodeRabbit CLI is not installed on the authoring machine, so the local CodeRabbit review has not run. Two independent agent reviews ran in its place, and the maintainer approved marking the PR ready on that basis. Fixed in 238a9b910 after the first review:

  • Any non-bot commenter could dispose a contract and put text into the finder prompt. Replies now count only from OWNER, MEMBER or COLLABORATOR.
  • Lab Notes left unmatched confirmations out of its count.
  • CLOSING_ISSUE_RE matched auto-fix #N.
  • A gh timeout on the new head or issue calls could abort the run.
  • rules.json repo_concerns and the prompt focus list still invited missing-test findings.
  • Grouped docs nits were graded low, which opens a thread and holds the verdict; they are now one nitpick per file.
  • The description-match rejection could excuse a broken caller contract.

Fixed in 6ec2bb400 after the second review, which covered the whole diff:

  • An issue body with CRLF line endings, or a heading written bold or ending in a colon, matched no section and fell back to the opening of the body.

Dottore's findings on 6ec2bb400, fixed in 98a294b49:

  • Truncation took the issue budget in section order, so a long Expected behavior section could cut Not in scope. The budget is now shared, shortest section first.
  • An issue with no kept section showed its opening unlabelled, so symptoms could read as requirements. It is now labelled as the opening of the issue.
  • An unpassed DOTTORE_VARS_JSON was reported as "None set." It now says "Not passed to this run."
  • review_packet_chars measured only the bundles. It now counts the whole packet, linked issues included.

Dottore finding dismissed in part: ### headings and bold labels are not read as sections. In the 150 most recent issues of each repo, no issue holds a kept section under ###, and the one bold **Not in scope:** label sits inside a ## section, so reading bold labels as headings would split it. Both repos' issue templates use ##.

Dismissed after the second review:

  • A ## line inside a code fence in an issue starts a new section, cutting the section short. Template sections rarely hold fenced headings, and the result is less context, not wrong context.
  • A carried candidate whose file this diff leaves alone is judged with no packet, so its checker sees neither the PR description nor the linked issues. This predates the PR (verify_file passes no packet when packet is None) and is unchanged by it.
  • Hand-written ### Expected behavior headings are not read. Accepting ### would end a kept section at its own subheadings; the repo's templates use ##.

Kept as a documented ceiling (ponytail: in dispose_contracts):

  • A finding raised again after its only thread was resolved gets no new thread. The inline duplicate filter counts resolved threads' markers, and that filter predates this PR. Its contract is therefore dropped the round after. Telling this case apart from a plain resolve needs either a re-post or a record of which round raised the finding, and GraphQL does not expose when a thread was resolved.

To do:

  • Manually run /dottore on a test PR where a person has replied to a Dottore thread. Confirm the new walkthrough header carries that contract as disposed with the reply, and that the finder does not raise it again.
  • Manually resolve a Dottore thread and re-review. Confirm its contract disappears from the header and Repair Check no longer lists it.
  • Manually confirm that an answered, unresolved thread still holds approval.
  • Manually open a test PR whose body says Closes #N. Confirm the finder's packet shows "Issue #N" with only its Expected behavior (or Proposed solution) section, and that the scout bundle does not.
  • Manually push to a PR while a Dottore review is running. Confirm the walkthrough carries the "PR head has since moved" note, and that the next carried walkthrough drops it.
  • Manually confirm that a PR touching .github/ shows the "Repository Variables" section, and that a PR touching nothing under .github/ does not.

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)

Only .github/dottore-review/README.md changed, which is not under docs/, so no translation follow-up applies.

Follow-up (after merge): a Marinara-Agents PR that applies the rules.json severity change there and bumps its wrapper's pinned Engine workflow SHA. Its wrapper already grants issues: write, which the linked-issue read needs.

Risk:

  • Every repository variable is passed to the review step, though it is shown to the model only for .github/ PRs.
  • A maintainer's "fix coming" reply also marks a contract disposed; its thread still holds approval until it is resolved.
  • Linked-issue bodies are written by issue authors and now reach the model (redacted and truncated like the PR body).
  • The re-raised-after-resolve ceiling above.

🤖 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/8238 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix/dottore-false-positives-8237` --- ### 📝 Commits (7) - [`6dc87cd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6dc87cd8465595cb346f33e3080171d2da614aea) chore(dottore): start false-positive fixes (#8237) - [`fc833c3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fc833c3574c9de56591bbd253ff99efbf358bec7) fix(dottore): stop re-raising disposed findings and widen the review bundle - [`238a9b9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/238a9b910f1fd0f1804e00410b96f9fc8682b346) fix(dottore): take dispositions only from maintainers and close review gaps - [`711fdde`](https://github.com/Pasta-Devs/Marinara-Engine/commit/711fdde842d308e7166f7a49fdf0795376557913) fix(dottore): send linked issues' intent to the finder and checker only - [`6ec2bb4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6ec2bb400e8bab13eb1180800fdf46134cee526e) fix(dottore): read issue sections from CRLF bodies and decorated headings - [`98a294b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/98a294b492cb68acb4d8c8b823d1d21560c36d63) fix(dottore): keep an issue's scope under the budget and label what is guessed - [`c1e8f6c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c1e8f6c4abe8a0d641a63d28e07a499b7ae7f45a) Merge branch 'staging' into fix/dottore-false-positives-8237 ### 📊 Changes **6 files changed** (+420 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `.github/dottore-review/README.md` (+25 -5) 📝 `.github/dottore-review/dottore_review.py` (+186 -35) 📝 `.github/dottore-review/reviewer-prompt.md` (+8 -6) 📝 `.github/dottore-review/rules.json` (+6 -5) 📝 `.github/workflows/dottore-review.yml` (+2 -0) ➕ `scripts/regressions/dottore-thread-dispositions.regression.mjs` (+193 -0) </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`. ## Linked issue Closes #8237 ## Why this change - Dottore keeps raising findings that a maintainer has already answered or resolved. A prior finding's repair contract stays in the walkthrough header and is shown to the finder on every later review with nothing to say it was settled, so the same point comes back in other files and rounds (about 20 of the disputed findings in #8237, for example 8 on #8151 and 8 on #8153). - Other findings rest on context the packet never shows, so "not in the packet" is read as "doesn't exist" or "is a bug": - the linked issue: GitHub fills `closingIssuesReferences` only for PRs into the default branch, and these PRs target `staging`; - tests that already exist; - repository variables such as `DOTTORE_AUTO_REVIEW`. - A confirmation whose quoted evidence didn't match the code was published as an "Unresolved Hypothesis", which then walked the finding back in public. - Each false positive opens a thread that holds the verdict until someone answers it. ## What changed **Harness (`dottore_review.py`, `dottore-review.yml`)** - One GraphQL call now lists every Dottore thread with its state: resolved, answered, and the last reply a person left. - A prior contract whose thread is resolved is dropped. - A contract whose thread an owner, member or collaborator replied to is marked `disposed` and carries the reply. The finder sees it under a "Disposed by a maintainer" heading. Replies from anyone else, or from bots, settle nothing and never reach the prompt. - Repair Check and the approval gate keep the same thread sets as before. An answered but unresolved thread still holds approval. - If the thread listing fails, the contracts keep their recorded state, as before. - The finder and checker, but not the scouts, see the first two issues named by `Closes`/`Fixes`/`Resolves #N` in the PR body. Of each they see only the title and the sections that say what the change must do or leave alone (Expected behavior, Requested behavior, Proposed solution, Scope, Not in scope and common variants), up to 1,000 characters, or the first 500 characters of an issue without them. These sections were chosen from the 150 most recent issues in each repo; the extracted text is about 600 characters at the median. - The bundle adds: - the tracked test files named after a changed file, by name only and capped at 30; - for a PR that changes `.github/`, the repository's Actions variables, never secrets. The workflow passes `toJSON(vars)` as `DOTTORE_VARS_JSON`. - A confirmation whose evidence doesn't match the head is now `unmatched`. It is withheld and counted under Verification Coverage and in Lab Notes instead of being published as a hypothesis. - If the PR head moved while the review ran, `post_review` appends a note naming the examined and current commits. `carry_walkthrough` strips that note on the next carry. **Prompt and rules (`reviewer-prompt.md`, `rules.json`)** - Finder: - name the caller or producer that supplies the input; - combine only concerns that share a premise; - treat out-of-packet tests, settings, variables and docs as "not visible in the review packet"; - don't raise a disposed contract again unless new code changes the input the reply names. - Checker `confirmed`: the evidence must name the caller or producer that reaches the cited line, in the order it runs. - Checker `rejected` also covers: - behaviour that matches the PR description, a linked issue, a schema or a doc, as long as it breaks no caller or stored data that contract leaves out; - claims that rest on an absence nobody has shown; - a pattern that already appears unchanged in the touched module; - a migration demanded for a format that exists only in this PR; - a `ponytail:` note that names the failing input. This counts as a decision unless the PR sends that code new inputs the note doesn't name. A general ceiling still leaves the candidate standing. - Checker step 7: - list the existing guards a fix must keep; - a heuristic finding must name one concrete wrongly matched or missed input. - Calibration: avoid "forever/every/always/never" without evidence. - `rules.json`: - a missing test is a proof gap (a pre-merge check), not a medium/low finding, and the matching `repo_concerns` line and prompt focus list say the same; - `medium` requires an ordinary action to reach the bug; - docs rules stop repeat placement and rewording requests, and group the remaining prose nits into one nitpick per file. **Docs and proof** - `.github/dottore-review/README.md` documents the new bundle sections, unmatched confirmations, the moved-head note, dropped and disposed contracts, and that every repository variable reaches the review step. - New `scripts/regressions/dottore-thread-dispositions.regression.mjs` (9 cases). It fails all 9 on the previous harness and passes on this one. **Deviations from the plan in #8237** - **P2.** The finder isn't told to move uncertain-reachability claims to `open_questions`, because that conflicts with its existing rule to report a suspicion so the checker reads it. The reachability requirement goes on the checker's `confirmed` verdict instead. - **H2.** Linked issues are read from closing keywords in the PR body, because `closingIssuesReferences` is empty for `staging` PRs. An issue linked only from the sidebar or by a plain mention is not read. - **H5.** The moved-head note doesn't claim a re-review is queued, because automatic review may be off. ## Validation - [ ] `pnpm check` passes locally - [ ] `node scripts/run-regressions.mjs --filter dottore` passes (on Windows, with `PYTHONUTF8=1`) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Agent-run locally (not a substitute for the items below): `pnpm check` exited 0; `PYTHONUTF8=1 node scripts/run-regressions.mjs --filter dottore` passed 4/4; `py_compile` passed. **Local review.** The CodeRabbit CLI is not installed on the authoring machine, so the local CodeRabbit review has **not run**. Two independent agent reviews ran in its place, and the maintainer approved marking the PR ready on that basis. Fixed in 238a9b910 after the first review: - Any non-bot commenter could dispose a contract and put text into the finder prompt. Replies now count only from OWNER, MEMBER or COLLABORATOR. - Lab Notes left unmatched confirmations out of its count. - `CLOSING_ISSUE_RE` matched `auto-fix #N`. - A `gh` timeout on the new head or issue calls could abort the run. - `rules.json` `repo_concerns` and the prompt focus list still invited missing-test findings. - Grouped docs nits were graded low, which opens a thread and holds the verdict; they are now one nitpick per file. - The description-match rejection could excuse a broken caller contract. Fixed in 6ec2bb400 after the second review, which covered the whole diff: - An issue body with CRLF line endings, or a heading written bold or ending in a colon, matched no section and fell back to the opening of the body. Dottore's findings on 6ec2bb400, fixed in 98a294b49: - Truncation took the issue budget in section order, so a long Expected behavior section could cut Not in scope. The budget is now shared, shortest section first. - An issue with no kept section showed its opening unlabelled, so symptoms could read as requirements. It is now labelled as the opening of the issue. - An unpassed `DOTTORE_VARS_JSON` was reported as "None set." It now says "Not passed to this run." - `review_packet_chars` measured only the bundles. It now counts the whole packet, linked issues included. Dottore finding dismissed in part: `###` headings and bold labels are not read as sections. In the 150 most recent issues of each repo, no issue holds a kept section under `###`, and the one bold `**Not in scope:**` label sits inside a `##` section, so reading bold labels as headings would split it. Both repos' issue templates use `##`. Dismissed after the second review: - A `## ` line inside a code fence in an issue starts a new section, cutting the section short. Template sections rarely hold fenced headings, and the result is less context, not wrong context. - A carried candidate whose file this diff leaves alone is judged with no packet, so its checker sees neither the PR description nor the linked issues. This predates the PR (`verify_file` passes no packet when `packet is None`) and is unchanged by it. - Hand-written `### Expected behavior` headings are not read. Accepting `###` would end a kept section at its own subheadings; the repo's templates use `##`. Kept as a documented ceiling (`ponytail:` in `dispose_contracts`): - A finding raised again after its only thread was resolved gets no new thread. The inline duplicate filter counts resolved threads' markers, and that filter predates this PR. Its contract is therefore dropped the round after. Telling this case apart from a plain resolve needs either a re-post or a record of which round raised the finding, and GraphQL does not expose when a thread was resolved. To do: - Manually run `/dottore` on a test PR where a person has replied to a Dottore thread. Confirm the new walkthrough header carries that contract as `disposed` with the reply, and that the finder does not raise it again. - Manually resolve a Dottore thread and re-review. Confirm its contract disappears from the header and Repair Check no longer lists it. - Manually confirm that an answered, unresolved thread still holds approval. - Manually open a test PR whose body says `Closes #N`. Confirm the finder's packet shows "Issue #N" with only its Expected behavior (or Proposed solution) section, and that the scout bundle does not. - Manually push to a PR while a Dottore review is running. Confirm the walkthrough carries the "PR head has since moved" note, and that the next carried walkthrough drops it. - Manually confirm that a PR touching `.github/` shows the "Repository Variables" section, and that a PR touching nothing under `.github/` does not. ## 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) Only `.github/dottore-review/README.md` changed, which is not under `docs/`, so no translation follow-up applies. **Follow-up (after merge):** a Marinara-Agents PR that applies the `rules.json` severity change there and bumps its wrapper's pinned Engine workflow SHA. Its wrapper already grants `issues: write`, which the linked-issue read needs. **Risk:** - Every repository variable is passed to the review step, though it is shown to the model only for `.github/` PRs. - A maintainer's "fix coming" reply also marks a contract disposed; its thread still holds approval until it is resolved. - Linked-issue bodies are written by issue authors and now reach the model (redacted and truncated like the PR body). - The re-raised-after-resolve ceiling above. 🤖 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-25 04:04:39 +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#8200
No description provided.