Repository navigation
π [v6] attribution: a description that mentions "β hive:" still gets signed - #17368
Conversation
AppendTrailer skipped the trailer when the body contained "β hive:" anywhere, so a PR whose description talked about the repos' agent audit (Danathar/arch-bootc#473, Danathar/atomic-image-builder#640 and hivecommons#678, none ever edited) was opened unsigned, and the audit, which reads a line beginning with "β hive:", failed on it. The gh wrapper's body-edit guard (hivecommons#16256) had the same substring test. HasAttributionLine reads the line the way the audit does. AppendTrailer (so the PR-request watcher, ReconcilePRAttribution and the issue and review relays) and the wrapper's _keep_pr_attribution use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Douglas Baggett <doug.baggett@gmail.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 |
ed279fb
βΉοΈ Sentinel notice β informational; author is trusted (owner), merge is not blockedHive flagged this PR (author @Danathar, head
Hive did not add the |
Review follow-ups (below
|
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Evidence bundle `#17368ed279fb` sha256:230229f0294c7df126a75d90e95b6ccdd082579f5777791e0f2a8ec6baf6b5d4 β download from the dashboard or `hivectl review evidence #17368`.Review findings from Read the diff against the What I verified
One deliberate asymmetry worth knowing (not a defect of this PR)
Minor: |
There was a problem hiding this comment.
Read the change against the v6 tree at ed279fb, including the callers of AppendTrailer and the wrapper's _keep_pr_attribution. It looks correct to me and does what the description says.
What I verified:
src/pkg/github/attribution.go:365-391βAppendTrailernow gates onHasAttributionLine, which only matches a line that starts withβ hive:(CRLF tolerated). All sixAppendTrailercall sites (pr_request_watcher.go:523,review_request_watcher.go:549,790,issue_request_watcher.go:634,advisory.go:257, dashboardapi_acmm_eval.go:300/nous_verdict.go:451) inherit the fix, andReconcilePRAttribution(attribution.go:751) decides "nothing to do" fromAppendTrailer's return value, so the reconciler also stamps a prose-mention body now rather than skipping it.HasAttributionTrailer(attribution.go:403) is deliberately left asstrings.Contains; it feeds the "is this hive-mediated" checks inpr_comments.go,pr_request_claims.go:408andtask_list_sweep.go:1098, none of which are touched. Good call keeping the two semantics apart.bin/gh-wrapper.sh:1716β[[ $'\n'"$val" == *$'\nβ hive:'* ]]handles a trailer on the first line (the prepended\n) and CRLF bodies (\r\nβ hive:still contains\nβ hive:). The old-trailer extraction a few lines below (^[[:space:]]*β hive:) is slightly more permissive than the Go side (it accepts an indented line), but it only reads the existing trailer back, so there is no behavioural gap.- Tests cover the exact regression (prose mention β line appended) on both the Go and wrapper sides.
One nit, not blocking: the ReconcilePRAttribution doc comment at attribution.go:720 still says "if the body already contains the trailer prefix"; it is now "has a line starting with the prefix".
Open point for the maintainer, not a defect: the body refers to "the issue's acceptance criteria" but the PR has no Closes/Refs line, so nothing will close on merge.
Summary
Some PRs the Hive App opens never get their
β hive:signature line, and the repos' monthly agent audit then fails. This happens when the PR's own description mentionsβ hive:in a sentence. The watcher saw the prefix and decided the body was already signed. Now only a line that starts withβ hive:counts as a signature, which is how the audit reads it.What happened
I checked every PR the audits flagged in Danathar/arch-bootc and Danathar/atomic-image-builder against GitHub's edit history (
userContentEdits). They fall into two groups:gh pr edit --bodyreplaced the body and dropped the lineβ hive:(they are PRs about the audit), soAppendTrailerskippedSince #16256 merged, 18 Hive-app PRs were opened across the two repos and none is missing the line.
Root cause
AppendTrailerskipped whenstrings.Contains(body, "β hive:")was true (src/pkg/github/attribution.go:365). The PR-request watcher calls it atpr_request_watcher.go:523.[[ "$val" == *"β hive:"* ]]in_keep_pr_attribution.agent-audit.yml:120in those repos) only accepts a line that starts withβ hive::split("\n") | map(select(startswith("β hive:"))). arch-bootc#473's description holds the prefix only inside a sentence, so the audit flagged it correctly; nothing edited the body.The fix
HasAttributionLine(body)inattribution.go: true when some line starts withβ hive:, the audit's rule. A quoted (> β hive:) or indented line does not count, again matching the audit.AppendTraileruses it. That covers the PR-request watcher,ReconcilePRAttribution, and the issue and review relays that call the same function.bin/gh-wrapper.sh_keep_pr_attributionchecks for a line that starts withβ hive:in the new body. It uses a bash pattern rather than a pipe, because the wrapper runs underpipefail.HasAttributionTrailer, the separate "was this hive-mediated" test used by review threads and the clanker check, is unchanged.Not done here (from the issue's acceptance criteria)
gh api, or the realghbinary. The proxy still allowsPATCH /pulls/{n}at ISSUES_AND_PRS. A pre-merge "ensure the line" check in the automerge path would close that for merged PRs, which are what the audit reads. Left for a follow-up if it shows up.Files
src/pkg/github/attribution.go:HasAttributionLine;AppendTraileruses it.bin/gh-wrapper.sh:_keep_pr_attributionuses a line test.src/docs/hive-open-pr.md: the stacking guard is a line, and mentioning the prefix in a sentence is fine.changelog.d/fixed-hive-line-mentioned-in-text.md.Tests
CI is the verdict. Locally, only
gofmt -landbash -nwere run.TestAppendTrailer: a body that mentionsβ hive:in a sentence gets the line appended.TestHasAttributionLine: a trailer line at the end, the only line, with CRLF, or before the identity footer counts; a sentence, a quote, an indented line or an empty body does not.bin/gh-wrapper.test.sh: an own-PR edit whose new body mentions the prefix in a sentence gets the PR's line re-appended. The existing π gh-wrapper: a body edit of the hive's own PR keeps its β hive: lineΒ #16256 cases are unchanged, including "new body carries its own line: left as written".π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1