Skip to content

πŸ› Audit contributor tier changes; refresh parked PRs' role tier each sweep - #15180

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
fix/tier-audit-history
Oct 29, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
fix/tier-audit-history

Conversation

@clubanderson

Copy link
Copy Markdown
Member

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, or hive:registration; capped at 50 entries).
  • audit.jsonl event action: "contributor-tier-changed" with the same fields (marked sensitive).
  • Wired into PUT /api/contributors/{id}/trust (now accepts optional reason), POST …/revoke, the task_complete newcomerβ†’contributor auto-promotion, and initial registration. Same-tier writes are no-ops (200 unchanged: true, no history, no audit).
  • GET /api/contributors returns tier_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). evaluateContributorLanePR prefilters parked PRs (needs-rebase/hold/excluded/draft) and returned before admitContributor, so no role was noted and ResolveStage fell back to the role/* label a previous pass wrote β€” on weak stages trusted stuck through a demotion. Now:

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, SetContributorTrustTier sync.
  • pkg/github/automerge/automerge_contributor_lane_tier_refresh_test.go: parked PR picks up promotion/demotion on the next sweep; ResolveStage demotion/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.Info line with no actor; audit.jsonl has zero tier events. #14822 was parked on needs-rebase every sweep (stale role label), #14947 deep-evaluated each sweep (registry-trusted).

…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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 29, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15085 ✨ Activity Monitor: Adopt now and Reroute to another clanker for PRs waiting on a contributor's clanker same files src/pkg/dashboard/static/index.html
#14822 πŸ› fix: preserve owner intent through PR decision paths same files src/pkg/github/automerge/automerge_contributor_lane.go
#15122 πŸ› Write-back containment: per-kind gate for every unsolicited GitHub write, with backfill guard same files src/pkg/dashboard/static/index.html
#15192 ✨ Conflict-aware merge train in the automerge lanes same files src/pkg/dashboard/static/index.html
src/pkg/github/automerge/automerge_contributor_lane.go
src/pkg/stageengine/derive_pr_classify.go
#15186 πŸ› Activity Monitor: one coherent post-decision state for Let hive decide rows; 060 reviewed in CI / Review same files src/pkg/dashboard/static/index.html
#15191 πŸ› Let hive decide on a ready-for-human-merge PR approves and lets the sweep merge it same files src/pkg/dashboard/static/index.html
#15134 πŸ› Delegated decision on a capability gap: model the blocker, stop the un-park/re-park loop, name the missing App permission same files src/pkg/dashboard/static/index.html
#14807 ✨ dashboard: stream Job pod logs in the terminal pane for sandbox.runtime: job agents same files src/pkg/dashboard/static/index.html
#15104 πŸ› Activity Monitor: Rebase, then merge as maintainer; fixer owns parked conflicting PRs; dismiss self-inflicted changes_requested same files src/pkg/dashboard/static/index.html
#15157 ✨ Conflict-aware merge train in the automerge lanes same files src/pkg/dashboard/static/index.html
src/pkg/github/automerge/automerge_contributor_lane.go
src/pkg/stageengine/derive_pr_classify.go

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@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.

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 5b34d05 into v5 Oct 29, 2026
85 of 90 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/tier-audit-history branch October 29, 2026 00:31
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#151808c86a60` sha256:842c0bae12d7a2613d010d70ca851eb31caa42eab3c1bbf4c734a196d0b40290 β€” download from the dashboard or `hivectl review evidence #15180`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 8c86a60.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive hivecommons-hive Bot removed the role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) label Oct 29, 2026
@hivecommons-hive hivecommons-hive Bot removed the stage/050-review-pending Review swarm requested; awaiting a verdict for the current head label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› Contributor tier changes are unaudited and parked PRs keep a stale role tier

1 participant