Skip to content

🐛 fix: require clanker label for dashboard directions - #15298

Merged
hivecommons-hive[bot] merged 3 commits into
hivecommons:v5from
thatguywob:fix/15268-clanker-direction
Oct 29, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
hivecommons:v5from
thatguywob:fix/15268-clanker-direction

Conversation

@thatguywob

Copy link
Copy Markdown
Contributor

Summary

Require the repository's author/clanker label before accepting dashboard directions for contributor PRs. A person's PR containing only an origin marker, attribution trailer, or identity footer now returns ErrPullRequestNotHiveAuthored (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

  • Not run locally: CI runs validation for agent-authored PRs (AGENTS.md forbids local builds/tests in agent panes).
  • gofmt -l on both changed Go files returned no output; git diff --check passed.
  • Added regression coverage for all three body markers, with no author label and with author/human, asserting rejection and no stored decision, GitHub writes, or stage decision.

Contributor checklist

  • Added security changelog fragment.
  • PR targets v5.
  • Title uses the repository emoji convention.
  • Commit includes matching DCO sign-off and Hive trailers.
  • Updated classification comments to reflect the required label.
  • No secrets, credentials, or local runtime state committed.

— hive: backend=codex


🐝 Hive Agent: contributor | SHA: 305adbd98

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>
@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 nicholasjackson 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

@hivecommons-hive hivecommons-hive Bot added author/clanker A contributor's own hive authored this PR under their login 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 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.

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.AuthorKindLabels is threaded into ensureStageLabels at src/pkg/github/automerge/automerge_stage_labels.go:1104,1131, and automerge_merge_forward.go:64 reads it back with authorkind.FromLabels(labels, c.stagePolicy().AuthorKindLabels).
  • This path, before and after the PR, checks only the hard-coded default: labelPresent(t.labels, authorkind.Clanker.Label()), and Kind.Label() is DefaultNames.Label(k) (src/pkg/authorkind/authorkind.go:85).
  • On v5 today that mismatch is masked: a repo that renamed the clanker label still gets t.clanker = true from the body-marker Detect. With this diff, every contributor direction on such a repo returns ErrPullRequestNotHiveAuthored (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

@github-actions

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.

No conflicting open PRs or same-file overlaps were found.

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

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.

@hivecommons-hive hivecommons-hive Bot added stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the review swarm requested changes

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.

@hivecommons-hive hivecommons-hive Bot added stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted and removed stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act labels Oct 29, 2026
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>
@kubestellar-prow kubestellar-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 29, 2026
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>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 095-pre-merge-soak → 050-review-pending: required-check-pending:Sign-off survives the squash

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

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.clanker now comes solely from authorkind.FromLabels(t.labels, names), so an origin marker / — hive: trailer / 🐝 footer in a person's PR body no longer satisfies the direction path; RecordOperatorPullRequestDecision falls through to ErrPullRequestNotHiveAuthored as the contract says. The body-marker heuristic is untouched for the sweep (authorkind.Explain, authorkind.go:202-211).
  • Side benefit: selfAuthored previously matched only the default author/hive (authorkind.Hive.Label()); it now honours governor.labels.author via the resolver wired in src/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.

@hivecommons-hive
hivecommons-hive Bot merged commit 79f2ff4 into hivecommons:v5 Oct 29, 2026
64 of 66 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#152984a87229` sha256:90361e64da0dbe56eb61e036522db014c5af1061b69dab8a982b156c4665b47e — download from the dashboard or `hivectl review evidence #15298`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review backlog (security): Clanker classification for dashboard direction trusts PR-body markers

1 participant