Repository navigation
🐛 fix: require clanker label for dashboard directions - #15298
hivecommons-hive[bot] merged 3 commits into
Conversation
Reject author-controlled PR-body markers as standalone evidence for the dashboard contributor direction lane. Cover all three marker types with no classification and with author/human, asserting no stored decision or GitHub/stage writes. Hive-Run: hivecommons#15268 Hive-Plan: dashboard-direction-classification Hive-Spec: hivecommons#15268#body-marker-trust Signed-off-by: thatguywob <thatguywob@users.noreply.github.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 |
|
@thatguywob 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. |
There was a problem hiding this comment.
The security direction is right — #15256 is merged and v5 HEAD still has the || authorkind.Detect(...) fallback at src/pkg/github/pr_decision_operator.go:297-298, so #15268 still applies — but one thing I verified makes this change a regression for configured deployments.
Medium — label name mismatch becomes fatal once the fallback is gone (src/pkg/github/pr_decision_operator.go:298 at 305adbd)
- The author-kind label name is configurable:
governor.labels.author.clanker(src/pkg/config/config.go:2648,AuthorLabelsConfig). The stage reconciler stamps PRs with the configured name —policy.AuthorKindLabelsis threaded intoensureStageLabelsatsrc/pkg/github/automerge/automerge_stage_labels.go:1104,1131, andautomerge_merge_forward.go:64reads it back withauthorkind.FromLabels(labels, c.stagePolicy().AuthorKindLabels). - This path, before and after the PR, checks only the hard-coded default:
labelPresent(t.labels, authorkind.Clanker.Label()), andKind.Label()isDefaultNames.Label(k)(src/pkg/authorkind/authorkind.go:85). - On
v5today that mismatch is masked: a repo that renamed the clanker label still getst.clanker = truefrom the body-markerDetect. With this diff, every contributor direction on such a repo returnsErrPullRequestNotHiveAuthored(409) — the whole 072 returned-to-contributor lane silently stops working for that deployment, with nothing in the error pointing at the label config.
Suggested fix: resolve the label through the configured authorkind.Names here (the same way automerge_merge_forward.go:64 does) rather than authorkind.Clanker.Label(). The same hard-coded lookup exists for authorkind.Hive.Label() at line 293 but is backstopped by isHiveAccount, so it isn't load-bearing.
Everything else checks out: the new test is the only coverage that depended on marker-only detection (the existing thatguywob case at pr_decision_operator_test.go:304 already carries author/clanker), the refused path writes nothing (asserted on store, comments, labels and stage facts), and the fragment filename follows the security-<slug>.md rule.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
There was a problem hiding this comment.
The code change is correct and does what #15268 cites: openPullRequestDecisionTarget now sets t.clanker from the author/clanker label only (src/pkg/github/pr_decision_operator.go:298), the body-marker fallback is gone, and the new table test asserts a 409 with no store/GitHub/stage writes for all three markers with and without author/human. CI is green on this head. Looks correct to me.
One thing a maintainer should know before treating this as closing the finding: the label this PR now requires is itself derived from the same body markers. The sweep sets obs.AuthorKind = c.stageAuthorKind(...) (src/pkg/github/automerge/automerge_stage_labels.go:879), which calls authorkind.Explain on obs.Body (:777), and rules 3–5 return Clanker for the foreign origin marker, the — hive: trailer and the 🐝 footer (src/pkg/authorkind/authorkind.go:227,230,233). That kind is then written as the author/<kind> label (automerge_stage_labels.go:1100-1104, Kind: obs.AuthorKind). So a person who pastes a marker into their own PR body is stamped author/clanker by the next sweep, and the dashboard will accept the direction via the label. The PR moves the trust decision to one place (the sweep, which can also weigh RelayKnown), which is a reasonable consolidation — but the changelog line "author-controlled body markers alone no longer enable the contributor direction lane" overstates it; they still do, one sweep later. Suggest rewording the fragment to say the dashboard now defers to the sweep's classification, and leaving #15268 open (or noting the residual) if the intent was to stop body-only evidence end to end. Not a defect in this diff.
|
@thatguywob this PR is back in your court ( Review asks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity. |
Resolve dashboard decision authorship through the live governor.labels.author names, wired through shared client configuration so rebuilt clients retain the policy. Cover renamed and partial configurations and reject stale default labels without writes. Clarify that sweep body-marker classification remains unchanged. Hive-Run: hivecommons#15268 Hive-Plan: dashboard-direction-classification Hive-Spec: hivecommons#15268#body-marker-trust Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
The CI citation guard reported drift; its fixer could not resolve AgeMinutes as a top-level declaration. Reanchor the range to RankActionableIssues and its age comparison. Hive-Run: hivecommons#15268 Hive-Plan: dashboard-direction-classification Hive-Spec: hivecommons#15268#body-marker-trust Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
|
stage 095-pre-merge-soak → 050-review-pending: required-check-pending:Sign-off survives the squash |
There was a problem hiding this comment.
Read the diff against the tree at 4a87229; this looks correct to me and does what #15268 asked.
src/pkg/github/pr_decision_operator.go:301-311:t.clankernow comes solely fromauthorkind.FromLabels(t.labels, names), so an origin marker /— hive:trailer / 🐝 footer in a person's PR body no longer satisfies the direction path;RecordOperatorPullRequestDecisionfalls through toErrPullRequestNotHiveAuthoredas the contract says. The body-marker heuristic is untouched for the sweep (authorkind.Explain,authorkind.go:202-211).- Side benefit:
selfAuthoredpreviously matched only the defaultauthor/hive(authorkind.Hive.Label()); it now honoursgovernor.labels.authorvia the resolver wired insrc/cmd/hive/github_client_config.go:96-98, which is the same resolver the stage reconciler uses to stamp labels (automerge/automerge_stage_labels.go:1100-1104,KindLabels: policy.AuthorKindLabels). Nil resolver →Names{}.Normalize()→ defaults, so untouched callers keep today's behaviour. - One consequence worth stating for operators (info, not a defect): a contributor-hive PR that the stage reconciler has not yet labelled will be refused with the 409 until the next reconcile pass stamps
author/clanker. That window is the intended trade-off per #15268 and the reply tells the operator why.
Tests TestRecordOperatorPullRequestDecisionRefusesBodyOnlyClankerEvidence and …ConfiguredAuthorLabels cover the three markers with/without author/human, custom names, partial config, and stale default names. Body matches the diff.
|
Merged by hive contributor-lane auto-merge: CI green for ≥30m, reviewer verdict approve, @thatguywob was auto-promoted after 5 clean merged PRs in this hive's repositories. |
Summary
Require the repository's
author/clankerlabel before accepting dashboard directions for contributor PRs. A person's PR containing only an origin marker, attribution trailer, or identity footer now returnsErrPullRequestNotHiveAuthored(the dashboard's 409) before any decision, comment, label, or stage writes.The shared sweep classification heuristic remains unchanged; this fix removes the dashboard's direct body-marker fallback. Existing labeled Clanker and hive-authored direction paths remain covered by their existing tests.
Related issues
Fixes #15268
Testing
gofmt -lon both changed Go files returned no output;git diff --checkpassed.author/human, asserting rejection and no stored decision, GitHub writes, or stage decision.Contributor checklist
v5.— hive: backend=codex
🐝 Hive Agent:
contributor| SHA:305adbd98