Phase 3 (Q5+Q6): min-bump-to-engage policy + grouped-PR supersession#4
Merged
Conversation
Q5 — per-repo engage threshold. Replace the hardcoded "skip only patch" with a `--min-bump-to-engage` policy (default `major`). A PR is skipped out of policy when its bump ranks below the threshold (models.BumpRank: major>minor>patch> unknown). Because `unknown` ranks lowest, the default also skips unparseable- title PRs — closing the Phase-0 finding that a non-bump PR from the trusted author currently reaches the agent. Grouped PRs are ranked by their highest member bump, so a group engages iff that max meets the threshold. The skip and its reason are recorded on the dashboard (ActionSkippedPatch → ActionSkippedPolicy). Q6 — grouped-PR supersession. FindSupersedingGroup decomposes open grouped PRs into member (package, version) pairs and closes an individual PR when a group already covers its package at >= its version. Asymmetric by design: a group can supersede an individual, but an individual never closes a whole group (it still bumps the group's other members); equal version → the group wins. This removes the duplicate-work / duplicate-replacement-PR path between an individual and a group bumping the same package. Config: new MinBumpToEngage field (default major) with validation (major|minor| patch; rejects unknown), a WithMinBumpToEngage option, and the worker flag. Tests: TestBumpRank, TestBelowMinBump (incl. unknown→skip), TestFindSupersedingGroup (>=, lower-kept, asymmetry, non-semver, highest-wins), TestValidateMinBumpToEngage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4b661ab to
a666b3c
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.
Phase 3 sub-items Q5 and Q6 (
docs/WORKPLAN.md). Self-contained pre-analysis steps, independent of the analyser-removal rework (seedocs/questions.mdsequencing note).Q5 — per-repo
min-bump-to-engage(defaultmajor)Replaces the hardcoded "skip only patch." A PR is skipped out of policy when its bump ranks below the threshold, using a new
models.BumpRank(major > minor > patch > unknown).unknownranks lowest, the defaultmajoralso skips unparseable-title PRs — this closes the Phase-0 finding that a non-bump PR from the trusted author currently reaches the (expensive) agent. (Validates the Q14 author-filter-only safety.)maxGroupedBump), so a group engages iff that max meets the threshold (an all-patch group is now correctly skipped undermajor).ActionSkippedPatch→ActionSkippedPolicy("SKIPPED (policy)").--min-bump-to-engageflag +MinBumpToEngageconfig (validated tomajor|minor|patch;unknownrejected as a threshold).Q6 — grouped-PR supersession
FindSupersedingGroupdecomposes open grouped PRs into member(package, version)pairs and closes an individual PR when a group already covers its package at ≥ its version.Asymmetric by design (Q6 → a):
A group is never closed as stale (it bumps its other members too). Kills the duplicate-work / duplicate-replacement-PR path. Package match is exact string equality, mirroring
FindNewerPRForPackage(a known caveat where group-table names and individual package names differ in formatting).Tests
TestBumpRank— ordering, unknown lowest, unrecognised == unknown.TestBelowMinBump— the engage decision across thresholds, incl.unknown → skip.TestFindSupersedingGroup— ≥ rule, lower-version-kept, asymmetry (a group is never superseded), non-semver guards, highest-version-wins, individual-ahead-kept.TestValidateMinBumpToEngage— config validation.Local:
go build/vet/test ./...,gofmt,staticcheckall clean.🤖 Generated with Claude Code