Skip to content

πŸ› issues the hive files carry the filing agent in the title - #15673

Merged
clubanderson merged 5 commits into
v5from
fix/issue-title-agent-prefix
Oct 30, 2026
Merged

clubanderson merged 5 commits into
v5from
fix/issue-title-agent-prefix

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15672

Every issue the hive files now carries its filer in the title ([reviewer] Review backlog (security): …, [governor] refactor: … is a merge hotspot …).

  • Shared helper: crux/issueshape.TitleFor(agent, title) (+ HasAgentPrefix, AgentPrefix, StripAgentPrefix, SameTitle), re-exported from pkg/issueshape. Idempotent: an existing leading [tag] (same agent, or a filer-chosen [Tests]/[DCO]) is kept, never doubled.
  • Applied at every filing site: CreateIssue (the one create path for the watcher/hive-open-issue, review backlog, fleet report, forge/convergence, hotspot, dashboard ACMM) tags with CreateIssueRequest.TitleFiler() β€” Origin lane (reviewer-2β†’reviewer), else a non-lane origin label (convergence through the forge seam), else the Origin source (governor, selfreport, dashboard). Title builders reviewBacklogIssueTitle, hotspot.Title, upstreamwatch render tag explicitly too, so callers see the final title.
  • Proxy: an agent's raw gh issue create has its title tagged with the lane alongside the existing agent/<lane> label injection.
  • Dedupe compat: exact-title match in scanOpenIssues and the FoldMatch exact-title guard compare with the tag ignored; reviewBacklogTitleCategoryRE accepts an optional tag; hotspot (body marker + store) and selfreport (fingerprint) dedupe were already title-independent. Canonical-subject dedupe already stripped the role tag.
  • Prompts/docs: dedupe policy triage template now [dedupe] triage: …; hive-open-issue.md and review-swarm.md state the convention.
  • Not changed: the 🐝 Hive Advisory Report and recommendations living documents, which are found by exact title.

Tests: TestTitleForTagsOnceAndKeepsExistingTag, TestStripAgentPrefixAndSameTitle (crux), TestHiveFiledIssueTitlesCarryTheFilingAgent (helper walk + TitleFiler), TestCreateIssueTagsTitleAndDedupesAgainstUntaggedTwin (dedupe compat), proxy inject cases.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 30, 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 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.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

Failing checks:

  • test (rest 2/4)
  • test (rest 3/4)

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.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission β†’ 071-needs-author: optional-check-failing:test (rest 2/4)

@hivecommons-hive

Copy link
Copy Markdown
Contributor
a13e2d5

ℹ️ Sentinel notice β€” informational; author is trusted (owner), merge is not blocked

Hive flagged this PR (author @clubanderson, head a13e2d516530) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation β€” a maintainer should confirm the change is intended before it merges.

  • sensitive_path β€” changes 2 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • src/pkg/policies/defaults/dedupe-issues.md
    • src/policies/dedupe-issues.md

Hive did not add the sentinel-alert label because this author is trusted. The finding remains recorded for audit and the dashboard Security tab; set sentinel.trusted_authors_block: true to require the blocking label for trusted authors too.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission β†’ 050-review-pending: required-check-pending:build-and-test

Every hive-filed issue title now starts with [<filer>]: one shared
issueshape.TitleFor helper (idempotent, never double-prefixes) is applied
in CreateIssue for every Go filing site, in the review-backlog, hotspot and
upstream-watch title builders, and in the egress proxy for an agent's raw
gh issue create. Title dedupe ignores the tag so open items filed before
the convention still match their prefixed re-filing.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
… title expectations

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
… tagged

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 30, 2026
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson force-pushed the fix/issue-title-agent-prefix branch from c43547b to 8cfcf5c Compare October 30, 2026 05:13

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

Reviewed (security) β€” no blocker; one advisory on the proxy trust boundary.

Low β€” proxy title tag is agent-controlled, unlike the label it mirrors (src/crux/proxy/github_proxy_violations.go:190-200, src/crux/issueshape/issueshape.go TitleFor). The label path enforces provenance: config.WithAgentLaneLabel rewrites any agent-supplied agent/<other> to the caller's lane (src/crux/config/origin_labels.go:321-326). The new title path does not: TitleFor(lane, title) returns the title unchanged when it already starts with any [tag], so a scanner lane can gh issue create --title "[reviewer] …" through the proxy and the title β€” which this PR documents as "so a reader can tell which agent filed it" β€” names the wrong agent. agent/scanner is still applied, so the label stays authoritative; this only weakens the new human-facing signal. Suggested tightening, keeping filer-chosen non-lane tags ([Tests], [DCO]) as intended:

 	if raw, present := payload["title"]; present {
 		var title string
 		if err := json.Unmarshal(raw, &title); err == nil && title != "" {
+			// A leading tag naming a *different known lane* is the caller
+			// impersonating another agent; replace it, as the label path does.
+			if existing := config.OriginLaneFromAgent(issueshape.AgentPrefix(title)); existing != "" && existing != lane && config.IsKnownOriginLane(existing) {
+				title = issueshape.StripAgentPrefix(title)
+			}
 			if tagged := issueshape.TitleFor(lane, title); tagged != title {

β€” hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

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

Reviewed (intent-alignment) β€” the diff does what #15672 asks: one shared helper (src/crux/issueshape/issueshape.go:116), applied at the single create path (src/pkg/github/issue_request_watcher.go:1292), in the proxy's raw gh issue create (src/crux/proxy/github_proxy_violations.go:190), and dedupe is tag-blind (issue_request_watcher.go:1340, :1819). The living documents (pkg/github/advisory.go:282, pkg/github/recommendations.go:98) call Issues.Create directly, so they stay untagged as the body states. Non-blocking:

  • Low (in-scope): HasAgentPrefix treats any leading […] as the agent tag, so the dashboard ACMM filing [ACMM L0] Add … (src/pkg/dashboard/api_acmm_eval.go:429) never gets a filer β€” the owner rule in #15672 is [<agent name>], and "ACMM L0" is not an agent. The test at src/crux/issueshape/issueshape_test.go:114 codifies this. If you want the rule to hold there too, either prepend anyway for that site or narrow the idempotency check to a known origin lane/source:
	title = fmt.Sprintf("[dashboard] [ACMM L%d] Add %s", criterion.Level, criterion.Name)

β€” hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

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

docs-currency (read at head c43547b)

The three docs the PR touches match the code (hive-open-issue.md:55, review-swarm.md:105, both dedupe-issues.md copies). Two operator-facing descriptions of titles this PR changes were not updated:

  1. src/docs/operator-reference.md:1442 still documents the hotspot issue title as refactor: <path> is a merge hotspot β€” split into <N> units; src/pkg/hotspot/issue.go:32 now returns issueshape.TitleFor(config.OriginSourceGovernor, …), so the filed title starts with [governor]. An operator searching by the documented title will not find the issues.
    - **One issue per file.** Title `[governor] refactor: <path> is a merge hotspot β€” split into <N> units` (the `[governor]` tag is the filing-agent prefix every hive-filed issue title carries, `issueshape.TitleFor`), labels `agent/ci-maintainer` + `kind/cleanup`, origin `governor`, body marker `<!-- hive:hotspot file=<path> -->`, evidence table, the top-level units, a concrete split proposal and the don't-splinter rule. While that issue is open no second one is filed; after it closes the file waits `hotspot_refile_days` before it can be filed again. Issues go through the writeback gate as `issue_file` (a paused repo or `writeback.per_repo[<repo>].mode: off` stops them) and are skipped when the GitHub budget governor is skipping optional sweeps.
    
  2. src/pkg/policies/defaults/ci-maintainer.md:133 (and the -advisory/-full/-holdgated variants plus their src/policies/ mirrors β€” the PR already updates dedupe-issues.md in both trees) tells the ci-maintainer "The hive files one refactor: <path> is a merge hotspot issue per file". Suggest one [governor] refactor: is a merge hotspot issue per file so the agent recognises the title it is assigned.

Advisory (low): src/docs/github-write-surface.md:172-174 describes the proxy's POST /repos/{o}/{r}/issues rewrite as label-only ("stripping redundant origin/<lane> and bare <lane> aliases"); src/crux/proxy/github_proxy_violations.go:190-202 now also rewrites title. One clause there ("…and tags the title with [<lane>]") would keep that write-surface inventory accurate.

β€” hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

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

Reviewed (style) β€” approve; two advisory maintainability notes, neither blocking.

  1. Two definitions of "the agent tag" that already disagree β€” src/pkg/github/review_backlog_routing.go:163 re-encodes the tag shape as \[[^\]\s]+\] (no spaces), while the shared agentTitlePrefixRE at src/crux/issueshape/issueshape.go:106 deliberately allows spaces ([ACMM L0]). The two will drift; reviewBacklogItemCategory (review_backlog_routing.go:198) can reuse the shared helper instead of a second regex:
-	reviewBacklogTitleCategoryRE = regexp.MustCompile(`^\s*(?:\[[^\]\s]+\]\s*)?Review backlog \(([^)]+)\):`)
+	reviewBacklogTitleCategoryRE = regexp.MustCompile(`^\s*Review backlog \(([^)]+)\):`)
 ...
 func reviewBacklogItemCategory(title, body string) string {
-	if m := reviewBacklogTitleCategoryRE.FindStringSubmatch(title); m != nil {
+	// Items filed before titles carried the filer have no tag; strip it so both match.
+	if m := reviewBacklogTitleCategoryRE.FindStringSubmatch(issueshape.StripAgentPrefix(title)); m != nil {
  1. TitleFiler fallback chain (src/pkg/github/issue_request_watcher.go:1226-1247) has five tiers; tier 4 (OriginSourceOf(r.OriginLabel())) is only reached when Origin yields no lane, where OriginLabel() reduces to FirstOriginLabel(r.Labels) β€” a subset of what tier 5's label loop already returns (they differ only when an agent/* label precedes an origin/* one). Dropping tier 4 leaves behaviour for every case in TestHiveFiledIssueTitlesCarryTheFilingAgent intact and makes the precedence readable as: known lane β†’ caller's non-lane origin β†’ unknown lane β†’ first provenance label.

Nit: src/pkg/github/issue_request_watcher.go:1819 candidate == title || issueshape.SameTitle(candidate, title) β€” the first clause is implied by the second.

β€” hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

Why:

  • the branch conflicts with the base and needs a rebase

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.

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@clubanderson
clubanderson merged commit a8b4e2a into v5 Oct 30, 2026
73 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/issue-title-agent-prefix branch October 30, 2026 05:54
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

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.

πŸ› hive-filed issues do not carry the filing agent in the title (reviewer backlog, hotspot)

1 participant