Repository navigation
π Audit contributor tier changes; refresh parked PRs' role tier each sweep - #15180
Conversation
β¦ch sweep
Every contributor trust-tier change (operator PUT /trust and /revoke,
newcomerβcontributor auto-promotion, registration) now appends
{tier, prev, at, by, reason, source} to the profile's tier_history and
writes a contributor-tier-changed audit event; same-tier writes are
no-ops. GET /api/contributors exposes tier_history and the Contributors
view shows "tier since β¦ Β· by β¦ Β· reason" on the tier chip.
The contributor lane's prefilter path (needs-rebase/hold/excluded/draft)
returned before admitContributor, so parked PRs never had a role noted
and ResolveStage fell back to the role/* label a previous pass wrote,
with trusted kept sticky on weak stages. The lane now notes the current
registry tier on that path too, and a fresh lane tier beats a stale
label unless the lane merely cannot vouch for the author.
Fixes #15177
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply. |
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 8c86a60. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
There was a problem hiding this comment.
Reviewed (correctness) β one low, advisory; no blocker.
src/pkg/github/automerge/automerge_contributor_lane.go:1215-1218 β the new prefilter path notes the author's registry tier for every parked PR, but the trusted-author lane only notes RoleTrusted after its own prefilter (automerge_sweep.go:2111-2119), so for a parked PR it notes nothing. A maintainer who also holds a registry profile at a lower tier (e.g. a spoke registered as newcomer) will therefore have their held/draft/excluded PR flip to role/newcomer while parked β ResolveStage now lets a known lane tier beat the role/trusted label (derive_pr_classify.go:577-579) β and back to role/trusted once un-parked (noteStageRole merges, trusted wins). Cosmetic label flap on a niche population; fine to land and follow up, or guard in noteRegistryRole by skipping the note when c.trustedAuthorDecision(author, β¦).Allowed.
β hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
Fixes #15177
What
Tier provenance. Every contributor trust-tier change now records who/when/why:
ContributorProfile.tier_history: [{tier, prev, at, by, reason, source}](by= operator login,hive:auto-promotion, orhive:registration; capped at 50 entries).audit.jsonleventaction: "contributor-tier-changed"with the same fields (marked sensitive).PUT /api/contributors/{id}/trust(now accepts optionalreason),POST β¦/revoke, the task_complete newcomerβcontributor auto-promotion, and initial registration. Same-tier writes are no-ops (200unchanged: true, no history, no audit).GET /api/contributorsreturnstier_history; the Contributors view shows "trusted since β¦ Β· by β¦ Β· reason" under and on hover of the tier chip (uses existing classes, no new inline styles; shared timezone helper).Lane tier refresh (#14822 vs #14947).
evaluateContributorLanePRprefilters parked PRs (needs-rebase/hold/excluded/draft) and returned beforeadmitContributor, so no role was noted andResolveStagefell back to therole/*label a previous pass wrote β on weak stagestrustedstuck through a demotion. Now:noteRegistryRole, re-reading the registry tier every sweep;ResolveStagelets a lane-reported tier beat the stale label; anUntrusted-only lane opinion (cannot vouch) still does not override a label another lane wrote (π labels: role/trusted flaps on and off every ~5 minutes on owner-authored PRsΒ #13637 guard).Tests
pkg/dashboard/contribute_tier_history_test.go: helper no-op/bounds, registration seeding, operator PUT (history + audit +GET /api/contributors+ no-op), revoke, auto-promotion,SetContributorTrustTiersync.pkg/github/automerge/automerge_contributor_lane_tier_refresh_test.go: parked PR picks up promotion/demotion on the next sweep;ResolveStagedemotion/promotion vs stale label.go test ./pkg/dashboard/ ./pkg/dashboard/webstatic/ ./pkg/github/automerge/ ./pkg/stageengine/... ./pkg/stagelabels/pass; gofmt/vet clean.Evidence
On hive's hosted spoke the 2026-10-28 19:27 ET demotion of thatguywob left only a
slog.Infoline with no actor;audit.jsonlhas zero tier events. #14822 was parked onneeds-rebaseevery sweep (stale role label), #14947 deep-evaluated each sweep (registry-trusted).