Skip to content

πŸ› attribution: find the trailer when footer lines follow it - #19366

Merged
hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:danathar/attribution-trailer-footer-lines
Nov 20, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:danathar/attribution-trailer-footer-lines

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

Governor "PRs by model", Operations "Most effective models" and the rework and cost figures find a PR's model from its attribution trailer (-- hive: agent=… backend=… model=…). The parser only accepted the trailer when it was the last non-blank line before the identity footer, so any line below it dropped the PR from every count.

On projectbluefin that drops 112 of 707 trailer-carrying PRs (16%). The lines found below the trailer were Refs #N (46), the hive's own <!-- hive:issue-link-fixed --> (22), Closes #N (14), πŸ€– Generated with [Claude Code](…) (11), Fixes #N (2) and free prose (~17). Examples: projectbluefin/utah-packages#949, utah-packages#1014, projectbluefin/website#1040.

What changes

  • Footer lines are skipped. Walking up from the end, the parser now skips:
    • closing and reference keyword lines (Refs, Closes, Fixes, Resolves, Part of and the other GitHub closing keywords, any case, #N, owner/repo#N or an issue URL), with an optional note after a dash, colon or parenthesis (Refs #503 β€” remaining: …);
    • single-line HTML comments;
    • the πŸ€– Generated with … line;
    • an identity footer that a Fixes #N was appended below.
  • Still strict. Any other line after the trailer (prose, code, a quote, a multi-line comment) still means "no trailer", so a trailer quoted in a PR description is not taken as the PR's own. Fixes the flaky test in #7 is prose, not a footer line. If there are two trailers, the last one wins, as before.
  • The hive stops breaking its own attribution. The issue-link repair that rewrites Refs #N to Fixes #N now puts its <!-- hive:issue-link-fixed --> marker above the trailer, not below it. A body with no trailer gets exactly the same output as today.

Every reader goes through ParseAttributionTrailer, so the write-back and blocked-depends-on checks that use it for "is this a hive PR" also see these PRs as hive-attributed now. That's intended: they are hive PRs. No new way to forge it: a trailer as the last line already counted.

Not in this PR

  • The 14-day closed-PR lookback, which drops even more PRs from the 30d and "all" windows, has its own PR.
  • Commit-message parsing (pr_rework) still stops at Signed-off-by: / Co-Authored-By:. Unchanged on purpose.
  • Two other writers append Fixes #N at the very end of a PR body (EnsureIssueStagePRLink, LinkContributorPRToIssue). The parser now tolerates that, so they are left alone; their tests assert the exact output.

Tests

  • One case per footer type, the three real tails above (LF and CRLF), mixed tails, an identity footer below a footer line, prose after the trailer (unattributed), a quoted trailer followed by prose (unattributed), a code fence or multi-line comment after it (unattributed), two trailers (last wins), both prefix spellings.
  • The issue-link rewrite with a trailer (marker lands above it and the result still parses) and without one (byte-identical to today).
  • No existing test expectation was changed.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

Danathar and others added 2 commits November 19, 2026 23:10
ParseAttributionTrailer took the trailer only when it was the last
non-blank line before the identity footer, so a Refs/Closes/Fixes line,
an HTML marker or a "Generated with" line below it dropped the PR from
PRs by model, Most effective models and the rework/cost figures (112 of
707 trailer-carrying projectbluefin PRs). Those footer lines, and one
identity footer that is no longer last, are now skipped; any other line
after the trailer still means no trailer.

rewriteRefsIssueLinkToClosing now inserts its issue-link-fixed marker
above the trailer instead of appending it below.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 20, 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 clubanderson 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 20, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit c06e742 into hivecommons:v6 Nov 20, 2026
81 of 82 checks passed
@hivecommons-hive

hivecommons-hive Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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

Evidence bundle `#19366d80d578` sha256:6485b4ed37e449d2caf24fa89a76eeab04710a7f55c9b400377a672096fd6487 β€” download from the dashboard or `hivectl review evidence #19366`.

merged by Hive trusted-author auto-merge: author Danathar holds role owner and GitHub permission maintain on repo; CI green at d80d578.

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

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant