fix: align reaper scan with reap eligibility#3455
Open
Bella-Giraffety wants to merge 3 commits intogastownhall:mainfrom
Open
fix: align reaper scan with reap eligibility#3455Bella-Giraffety wants to merge 3 commits intogastownhall:mainfrom
Bella-Giraffety wants to merge 3 commits intogastownhall:mainfrom
Conversation
Author
|
Rebuilt this PR on a clean upstream main base and force-pushed it so it now contains only the scan/reap eligibility alignment fix and focused tests. |
585cc3d to
5a795f6
Compare
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.
Summary
Scan()exclude agent wisps using the same stale-wisp eligibility thatReap()already usesScan()function body specifically must contain the agent-bead exclusionRelated Issue
gs-mn3Bug
A live reproduction on
hqshowed:gt reaper scan --db hq --max-age=24hreported 4 reap candidatesgt reaper reap --db hq --max-age=24hclosed 0The root cause was a predicate mismatch:
Scan()counted all stale open wispsReap()explicitly excludedissue_type='agent'So scan could report candidates that reap would never close, especially when the candidates were all agent wisps.
Why this fix
This is the smallest safe fix: keep the existing
Reap()behavior and makeScan()use the same eligibility predicate. That makes the operator-facing scan count truthful without widening the change into purge or stale-issue logic.Testing
Focused command run:
GOTOOLCHAIN=auto go test ./internal/reaper -run 'TestReap|TestScanExcludesAgentBeads'Coverage:
TestScanExcludesAgentBeadsnow scopes its assertion to theScan()function body specifically, so it cannot pass just becauseReap()already had the agent exclusion.Review process
This branch went through pre-implementation review and a second review wave against the implementation branch. Incorporated findings covered:
Scan()instead of matching the broader file text