fix(pre-pr-review-wts): stop false-positive finding-beads (po-formulas-software-dev-8q5)#22
Open
ryanholtschneider2 wants to merge 1 commit into
Open
fix(pre-pr-review-wts): stop false-positive finding-beads (po-formulas-software-dev-8q5)#22ryanholtschneider2 wants to merge 1 commit into
ryanholtschneider2 wants to merge 1 commit into
Conversation
…s-software-dev-8q5) pre-pr-review-wts filed 13 P1 false-positive finding-beads across one epic series. Three independent root causes, all fixed in pre_pr_review.py (backend-agnostic; verified on beads-rust): 3a — quiescence gate: block early (validation=blocked, no finding-beads) when the worktree has uncommitted tracked changes or any epic child is still open, so the cumulative review only runs against the final committed state. 3b — dedup across retries: skip a finding whose bead title already exists as an open child of the epic (title is the signature; beads-rust has no finding-key metadata), and dedup within a batch. 3c — tool-errors stay tool-errors: _baseline_checkout now cleans the tree (git reset --hard, lossless via stash snapshot) before checkout so a dirty worktree no longer aborts it; a failed cumulative-diff computation surfaces the real git error as the pillar-2 verdict instead of an empty diff the agent reads as "zero work". Adds 11 unit tests covering each fix and its error paths.
ryanholtschneider2
marked this pull request as ready for review
June 14, 2026 18:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
pre-pr-review-wtsfiled 13 P1 false-positive finding-beads across one epic series (po-formulas-software-dev-8q5) — every one a false positive, a stale finding the agent already fixed, or a cross-retry duplicate. Three independent root causes, all fixed inwts/po_formulas_wts/pre_pr_review.py(backend-agnostic; verified on the current beads-rust backend).3a — timing / quiescence gate
A new gate blocks the run early (
validation=blocked, no finding-beads) when the worktree still has uncommitted tracked changes or any epic child is still open. The cumulative review now only runs against the final, committed state — so it can't file findings the agent will (or already did) resolve in a later commit._quiescence_block_reason/_worktree_dirty_paths/_open_child_ids.Chose the gate over reordering
epic_wtsbecauseepic_finalizecloses the epic; filing child finding-beads after the epic is closed would be wrong.3b — dedup across retries
po retry/ a freshepic-wtsre-discovered the same findings and re-filed identical beads with new ids._file_findings_as_beadsnow skips a finding whose constructed[source] titlealready exists as an open child of the epic (the title is the signature — beads-rust has nofinding-keymetadata), and dedups within a batch._existing_open_finding_titles.3c — tool-errors must not masquerade as data-findings
_baseline_checkoutis now lossless:git stash createonly snapshots, so the old code'sgit checkoutaborted on a dirty tree. It nowgit reset --hard HEAD(restored viastash applyinfinally) before checkout, and raises the actual git error if checkout still fails.could not compute cumulative diff: …) with no findings, instead of writing an empty diff the agent reports as "zero work".Tests
11 new unit tests (each fix + its error paths); all existing
pre_pr_reviewtests stay green.26 pre_pr_review+111full wts unit tests pass; ruff clean.Closing the loop (real-setting, no mocks)
pre_pr_reviewflow against a genuinely dirty worktree →validation=blocked, accurate reason,bead_ids=[]._baseline_checkoutin a real temp repo with the exact incident shape (dirty tracked file) → checkout no longer aborts, baseline checked out, uncommitted edit losslessly restored.Evidence:
.planning/software-dev-agentic/po-formulas-software-dev-8q5/review-artifacts/close-the-loop.md.