Skip to content

πŸ› needs-sha: exempt owner/detailed issues, overrideable waiver, visible hold on the row - #18873

Merged
hivecommons-hive[bot] merged 5 commits into
v5from
fix/18866-needs-sha-exempt-visible
Nov 18, 2026
Merged

hivecommons-hive[bot] merged 5 commits into
v5from
fix/18866-needs-sha-exempt-visible

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #18866

What

  • Exemptions. The SHA-hold sweep no longer gates: the hive's own accounts; owners/maintainers (author association in reporter_trust.trusted_associations, default OWNER/MEMBER/COLLABORATOR); issues whose body names a concrete repo file path (repo-relative, under a known top-level dir such as src//pkg//docs//.github/, ending in a known extension; absolute paths, URLs, bare file names and comments do not count); issues carrying sha-waived. Exemption is evaluated every sweep, so an already-applied needs-sha is lifted (πŸ› Sessions: a session's Codex/OpenCode login copy can still refresh and diverge from the shared login (follow-up to #18793)Β #18740 is released on the next tick). External reporters with no SHA and no path are still held.
  • Override. sha-waived is a persistent label: the sweep never adds or keeps needs-sha while it is on, and the issue reaches the actionable set / stage-label pass. Row menu "Waive SHA requirement" / "Restore SHA requirement" (POST .../items/{n}/sha-waiver) is gated exactly like the hold toggle (verified owner role or repo write/maintain/admin), removes needs-sha at once, posts one App-authored comment with a hive:sha-waived by=<login> marker. The marker is only trusted from the App bot, so a forged comment cannot name a waiver.
  • Visibility. New sha_hold field on stage-tracker rows (state, pill, tip, note, by). Pill "Held: needs commit SHA" (hover: "Post a commit SHA in the issue, or waive this requirement."), note "held: post a commit SHA" on the lit Open chevron, "SHA waived by " once waived. hold already has its own pill, so it is untouched.
  • Not done: recording the default-branch head at filing time. It would be a guess at the reporter's build rather than evidence of it, so I left it out.

Deviations

None from the requested menu/pill wording. The waiver action is not wrapped in the operator-action ledger (no "acted" badge); the toast and audit entry (repo_item_sha_waiver) still apply.

Tests

Go: exemption invariant table (external held; owner/collaborator/bot/detailed-body not held; lingering needs-sha lifted), path detector table, waiver persists across sweeps and restore re-holds, forged waiver marker ignored, waived issue eligible in EnumerateActionable, endpoint authz (reader 403, anonymous 401, writer/owner ok, repeat no-op, PR 404, audit), sha_hold payload. Node-lifted JS: pill, chevron note, menu item gating, request shape. Two existing cases in sha_hold_soft_test.go changed because members are now exempt. Not run locally (CI only).

static/index.html regenerated by concatenating static-src per manifest.txt (verified byte-identical on the unmodified tree first). Docs: labels reference, glossary, operator reference, API reference, activity-monitor, openapi.json. Fragment: changelog.d/fixed-18866-needs-sha-exempt-visible.md.

πŸ€– Generated with Claude Code

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 18, 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 18, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • relative links and anchors resolve

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

Review follow-ups: 6 open of 6 (below review.backlog.min_severity: P2)

Non-blocking findings below the backlog filing line, listed here instead of as issues. Tick them off as they are fixed; set review.backlog.min_severity: P3 to file every finding.

  • P3 info intent-alignment β€” Pill covers needs-sha/sha-waived only, not other control labels generally (src/pkg/dashboard/stage_tracker_sha_hold.go:1): Issue item 3 says 'and generally for any control label that blocks work'; stage_tracker_sha_hold.go adds only the sha_hold pill (hold already has one per PR body). Acceptance only requires needs-sha …
  • P3 info intent-alignment β€” Waiver endpoint and sha-waived label go beyond the issue's literal asks (src/pkg/dashboard/api_repo_item_sha_waiver.go:55): πŸ› needs-sha hold blocks owner-filed bugs and gives no dashboard signalΒ #18866 asks for exemptions, optional auto-attach of a SHA, and a visible pill with how to lift it. The PR adds a new POST sha-waiver endpoint, a persistent sha-waived label, a waiver comment marker a…
  • P3 info intent-alignment β€” Wanted item 2 (auto-attach default-branch SHA) intentionally not implemented (src/pkg/github/client.go:4845): Issue πŸ› needs-sha hold blocks owner-filed bugs and gives no dashboard signalΒ #18866 'Wanted' item 2 says the sweep 'may' record the default-branch head; PR body declares it 'Not done' with rationale, and it is not in the Acceptance list. Not blocking.
  • P3 info security β€” Path-citation exemption is self-attested by the reporter (src/pkg/github/sha_hold_exempt.go:66): Any external reporter can skip the SHA gate by putting a string like src/pkg/x.go in the issue body; bodyNamesRepoPaths only pattern-matches text and never checks the path exists. This is what show API quota reset time in rate limit bannerΒ #188…
  • P3 info security β€” Waiver marker built from unsanitized X-Hive-User (src/pkg/dashboard/api_repo_item_sha_waiver.go:120): SHAWaivedMarker(by) interpolates the X-Hive-User header into an HTML comment and a backticked comment body without stripping '-->' or newlines. The header is set by auth middleware and stripped from …
  • P3 low security β€” Path-citing body lets any external reporter skip the SHA gate (src/pkg/github/sha_hold_exempt.go:72): bodyNamesRepoPaths is a regex over attacker-controlled issue text and never checks the path exists, so any external reporter can write e.g. src/x.go to leave needs-sha and enter agent work lanes. The…

Review findings from reviewer-2 (folded here because this head already carries its hive review):

Docs-currency review at 8259f87. The PR updates the labels reference, glossary, operator reference, activity-monitor, API reference, openapi.json and changelog fragment, and they agree with each other. One operator-facing text is still stale.

src/hive.yaml.example:170-171 still describes the old behavior. The comment reads "Trusted reporters' SHA-less bugs get this soft label, not hold (#12002)". This PR reverses that: trusted reporters (trusted_associations) are now exempt, and the label goes to outside reporters. Operators copy this file, so the comment tells them the opposite of what happens. The file is not in the PR's changed files, and the operator-reference row for issues.sha_hold_trusted_label was updated but this one was missed.

#   # Soft label for an outside reporter's SHA-less bug (instead of `hold`, #12002).
#   # Owners/maintainers, hive accounts, issues naming a repo file path and
#   # `sha-waived` issues are exempt (#18866).

(Replaces the two lines at 170-171. Keep the # sha_hold_trusted_label: needs-sha line as is.)

Not verified: the Go doc comment on SHAHoldTrustedLabel in src/pkg/config/issues.go:53 may carry the same stale wording; I did not read its comment text. Please check it too.

Findings not on a changed line

Review findings from reviewer (folded here because this head already carries its hive review):

Style review at 8259f87: no blockers. The change follows the repo's existing conventions (label constants, hidden-marker comments, row-action result shape, typeof ... === 'function' guards in the tracker JS). Two small cleanups are inline. One more is in the tracker JS and is not inlined:

  • tracker-row-strip.js (the fullTip array): stageTrackerSHAHoldOf(item) is called three times in one expression. Hoist it into a const shaHold = ... above fullTip.

I did not review the src/docs/api-reference/* churn (about 150 changed lines), which looks regenerated.

Findings not on a changed line

  • src/pkg/github/sha_hold_exempt.go:75: author is never used in shaHoldExempt, so every caller passes a value that is ignored. Drop the parameter, or use it. In the caller in client.go, the magic string "internal-author" is also compared back against reason. A named constant would avoid that string coupling.
  • src/pkg/dashboard/api_repo_item_sha_waiver.go:170: refreshItemLabels is a generic name, but it sits in the feature-specific waiver file and hand-rolls the statusSeq and statusMutationEpoch bump. The hold handler already has applyRepoHoldToStatus for this in api_repo_hold.go:528. Move the helper next to it, or name it for what it does (for example refreshItemSnapshotNow), so the next row action finds it instead of copying it.

Review findings from adjudicator-3 (folded here because this head already carries its hive review):

Docs-currency review at 6c86927. The docs diff is thorough: labels reference, glossary, operator reference, hive.yaml.example, openapi and the changelog fragment all describe the new exemptions, the sha-waived override and the sha_hold pill. I checked the scale-envelope.md line shift (RankActionableIssues now at client.go:5418-5430) and it is correct. One stale statement remains.

Stale paragraph in reference.md:194 (untouched by the diff). It still says the sweep "gives every reporter the needs-sha label" and that trusted-association reporters "get the soft needs-sha row below instead". Since #18866 those reporters are exempt and never get needs-sha, so this contradicts the rewritten needs-sha entry a few lines below it. The issues.sha_hold_trusted_label row in the operator reference was rewritten, so this paragraph is the one left behind. Suggested fix below.

Findings not on a changed line

  • src/docs/labels-and-control-signals/reference.md:194: Stale after πŸ› needs-sha hold blocks owner-filed bugs and gives no dashboard signalΒ #18866: this paragraph says every reporter gets needs-sha and trusted-association reporters get the soft row. They are now exempt (see the needs-sha entry below). Suggest replacing the first and last sentences:

    Since [#18468](https://github.com/hivecommons/hive/issues/18468) the sweep uses the `needs-sha` label below instead of `hold`, and never applies `hold`; `needs-sha` itself keeps the issue out of agent work with reporter trust on or off. Since #18866 it is applied only to outside reporters; owners/maintainers, the hive's own accounts, issues naming a repo path and `sha-waived` issues are exempt. Before #18468, human-filed primary-repo `kind/bug` without a 7-40 hex SHA got `hold` and a notice carrying `<!-- hive:sha-hold -->`; once a SHA appears in body/comments, Hive removes `hold` only if the current hold is its own (newest `hold` event labeled by the App bot, paired with an App-authored notice at or after it). A human's hold, a re-hold, or another subsystem's hold stays. A SHA-hold `hold` already on an issue that is now exempt is swapped for nothing on the next sweep (#12002).
    

hive/awaiting-ci: rebased onto v5 (docs citation drift only), CI pending - sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

Evidence bundle `#18873662e815` sha256:48657a88f305e1277e76b2bb7334cfcbf631541ebfa4f0930255a3ba86659a4c β€” download from the dashboard or `hivectl review evidence #18873`.

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

@github-actions

github-actions Bot commented Nov 18, 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
#19143 πŸ› Reviewer-stated rules: ignore quotes and questions, match more future phrasings, and give the preferences a Settings card same files dashboard/openapi.json
src/docs/api-reference/auth.md
src/docs/api-reference/configuration.md
src/pkg/dashboard/api.go
src/pkg/dashboard/static/index.html
#19063 ✨ PR gate: fail visibly when the Commit statuses grant is missing CONFLICT src/docs/api-reference/auth.md (conflict)
src/docs/api-reference/dashboard-misc.md
src/pkg/dashboard/static/index.html
#19102 πŸ› Let the agent that opened a PR reply on its review threads same files src/docs/labels-and-control-signals/reference.md
#19151 ✨ Close tracker and umbrella issues whose referenced work is done (opt-in) CONFLICT dashboard/openapi.json
src/docs/api-reference/configuration.md (conflict)
src/docs/notifications.md
src/docs/operator-reference/README.md
src/pkg/github/notification_write_sites.go
#19099 ✨ Session taint: observe-only recorder for what a session has read same files src/hive.yaml.example
src/pkg/github/client.go

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

Security perspective: no in-scope blockers at 8259f87.

  • The waiver endpoint is gated like the hold toggle (api_repo_hold.go:99), is size-limited, and only accepts issues in watched repos. The waiver marker is only trusted from the App bot.
  • Advisory, out-of-scope: the path-citation exemption (sha_hold_exempt.go:66) is spoofable by any reporter who writes src/x.go in the body. This is as specified in #18866.
  • Not verified: how the proxy sets X-Hive-User.

β€” hive: agent=adjudicator-2 backend=claude model=claude-sonnet-5-5 claude=2.1.326

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

Delta re-review at 6d8f6d7: refactor and notification-site registration look fine and in scope. Still present: src/hive.yaml.example:170 says "Trusted reporters' SHA-less bugs get this soft label", which contradicts the new behavior (all non-exempt reporters; owners/maintainers/path-citers exempt). #18866 requires docs updated.

#   # Non-exempt reporters' SHA-less bugs get this soft label, not `hold` (#12002).
#   # Owners/maintainers, hive accounts, issues naming repo paths and waived issues are exempt (#18866).

Other prior findings (per-sweep comment listing, path-citation attestation, unused param, helper placement) are untouched by the delta and unchanged; they are out-of-scope and already tracked.

β€” hive: agent=adjudicator-3 backend=claude model=claude-sonnet-5-5 claude=2.1.326

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 18, 2026
@clubanderson
clubanderson force-pushed the fix/18866-needs-sha-exempt-visible branch from 5c159f8 to d111959 Compare November 18, 2026 05:14
@hivecommons-hive

hivecommons-hive Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Scanner: this branch has a merge conflict with v5 (mergeable_state=dirty). It is a human-authored branch, so I have not pushed to it. Please rebase onto origin/v5 and force-push; CI will re-run.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

clubanderson and others added 2 commits November 18, 2026 13:38
…, show the hold on the row (#18866)

The SHA-hold sweep no longer gates the hive's own accounts, owners/maintainers or issues whose body names concrete repo file paths (self-attested, documented), and lifts a needs-sha already applied to them. A persistent sha-waived label (row menu Waive/Restore SHA requirement, gated like hold release) overrides the gate and is never re-added. Held issues show a pill and Open-chevron note via the new sha_hold stage-tracker field.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Co-authored-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive
hivecommons-hive Bot force-pushed the fix/18866-needs-sha-exempt-visible branch from 7158844 to 29e68c1 Compare November 18, 2026 18:38
@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 18, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Scanner note (suggestion only, branch is busy): the failing checks are 'Sign-off survives the squash' and 'native-queue-policy', neither related to the diff content. Please check the DCO squash attribution log for the commit lacking a sign-off and re-sign it in your own signed commit.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

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

Style review: no in-scope blocker (approve). Advisory notes are in the inline threads: misplaced generic helper, overloaded hasSHA name, long handler.

-- hive: agent=adjudicator-5 backend=claude model=claude-sonnet-5-5 claude=2.1.327

return ", `" + strings.Join(removed, "`, `") + "` removed"
}

// refreshItemSnapshotNow re-reads one item and patches the status snapshot so the

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.

This helper is documented as generic but lives in the SHA-waiver file and logs 'SHA waiver:' on failure. Move it next to the other row-action helpers (e.g. api_repo_hold.go) and use a neutral log message.

Comment thread src/pkg/github/client.go
} else {
c.RecordSHAWaiver(owner+"/"+repo, issue.GetNumber(), "")
}
hasSHA := exempt || shaPattern.MatchString(issue.GetBody())

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.

hasSHA is now true for exempt issues with no SHA. Suggest renaming:

Suggested change
hasSHA := exempt || shaPattern.MatchString(issue.GetBody())
gateMet := exempt || shaPattern.MatchString(issue.GetBody())

(and updating later uses).

target := rowActionTarget(repoFull, rowActionTargetIssue, number)
out := repoSHAWaiverResponse{OK: true, Repo: repoFull, Number: number, Waived: body.Waived, Added: []string{}, Removed: []string{}}

if body.Waived {

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.

Advisory: split the waive and restore branches into helpers, and give the "owner" fallback login (line 127) a named constant.

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 18, 2026
Conflicts were api-reference route citation line numbers only
(auth.md, configuration.md): kept v5's rows (including the new
parent-autoclose routes) and re-anchored citations with
check-api-reference-citations.sh --fix. static/index.html verified
byte-identical to the concatenation of static-src per manifest.txt.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@hivecommons-hive
hivecommons-hive Bot merged commit a01e60a into v5 Nov 18, 2026
90 of 91 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/18866-needs-sha-exempt-visible branch November 18, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. merge-method/merge Hive merges this PR with a merge commit (mixed authorship, each commit self-signed); never squash size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› needs-sha hold blocks owner-filed bugs and gives no dashboard signal

1 participant