Skip to content

πŸ› fix(dco): only flag hive-identity DCO splits so a later ai_author config triggers the re-read - #16709

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-16707
Nov 5, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-16707

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #16707

Store.NoteDCO set DCOSplitHiveIdentity unconditionally, even when the split was computed App-only (policy.HiveAuthor == nil). stageDCO's re-read guard only fires when the flag is absent, so configuring project.ai_author later never triggered the one-time re-read for in-flight heads.

NoteDCO now takes hiveIdentity (policy.HiveAuthor != nil) and sets the flag only when true. Tests and changelog fragment added.

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

…onfig triggers the re-read

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@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 5, 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 danathar 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 Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 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

hivecommons-hive Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

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

hive/awaiting-ci: CI pending β€” sweep will merge when green.


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

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

Hive filed review findings that do not block this PR as backlog items:

Cap: 10 backlog item(s) per PR per day.

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

Correctness review (head 2140cdd) β€” fix matches #16707's remediation; go build of both packages passes; the only production caller (automerge_stage_labels.go:1193) is updated. Approving with one advisory.

Advisory (low, in-scope edge case): the marker is set-only, so it survives a hive→App-only head change. store.go:2495-2497 only ever sets DCOSplitHiveIdentity; nothing clears it, and the record is reused across heads (store.go:2493 overwrites DCOHead in place). Sequence: head a cached with hiveIdentity=true (flag set) → project.ai_author removed → head b cached with hiveIdentity=false (flag stays true) → ai_author re-added. stageDCO (automerge_stage_dco.go:146) sees rec.DCOSplitHiveIdentity true and serves the App-only split for b without the re-read — the same symptom, under a narrower config toggle. Trivial fix if wanted: r.DCOSplitHiveIdentity = hiveIdentity with r.DCOSplitHiveIdentity == hiveIdentity in the no-op guard at store.go:2490; TestStoreNoteDCOAppOnlySplitNotMarked would then also want a true→false assertion. Not blocking: the issue's stated scenario (never configured → configured) is fully handled.

Could not run go test here (disabled on agent pods); relying on CI for the new TestStoreNoteDCOAppOnlySplitNotMarked.

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

Looks correct to me. Read the guard and the only production caller:

  • src/pkg/github/automerge/automerge_stage_dco.go:146 serves the cache only when policy.HiveAuthor == nil || rec.DCOSplitHiveIdentity. Before this PR Store.NoteDCO set the flag unconditionally, so an App-only split (no project.ai_author) was marked and the later-configured identity never got its one-time re-read. With hiveIdentity=false the flag now stays unset, the guard falls through, the commits are read once, and the follow-up NoteDCO(..., true) marks it β€” store.go:2490 deliberately skips the early return when the numbers match but the flag is missing, so that follow-up write actually lands.
  • automerge_stage_labels.go:1193 is the sole non-test caller and passes policy.HiveAuthor != nil, the same predicate the guard uses. The two sides agree.
  • TestStoreNoteDCOAppOnlySplitNotMarked fails on the old r.DCOSplitHiveIdentity = true line; the existing TestStageDCORereadsSplitCachedBeforeHiveIdentities still covers the guard side.

One low note, not blocking: the flag is per record, not per head. Once set (store.go:2496) it is never cleared, so if an operator configures ai_author, later removes it, and a new head is cached App-only in between, re-adding ai_author serves that head from cache without a re-read. Resetting the flag when head != r.DCOHead would close it; it only matters on a config flip-flop, so fine to leave for a follow-up.

stage-labels.md:1180 ("a split cached before hive identities counted is read again once") remains accurate for the new case too.

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

Looks correct to me β€” read the store and the only production caller at head 2140cdd.

Mechanism verified. stageDCO's cache guard at src/pkg/github/automerge/automerge_stage_dco.go:146 serves the cached split only when policy.HiveAuthor == nil || rec.DCOSplitHiveIdentity. Before this PR, Store.NoteDCO set that flag unconditionally (store.go:2493 on base), so an App-only split taken while project.ai_author was unset satisfied the guard forever once ai_author was configured. With this PR:

  • automerge_stage_labels.go:1193 passes policy.HiveAuthor != nil β€” the same policy value stageDCO receives at :1013, so caller and guard agree on what "hive identity configured" means.
  • store.go:2490 early-return now reads (r.DCOSplitHiveIdentity || !hiveIdentity): an App-only re-note of identical numbers is still a no-op write, while the first hive-identity note after a re-read falls through and sets the flag at :2495-2497. That is exactly the transition TestStoreNoteDCOAppOnlySplitNotMarked pins.

Implements the remediation #16707 spelled out verbatim; base already contains #16706 (e3f54c2), so there is no conflict with the PR the issue was blocked on. go build of both packages passes locally; CI test shards are green on this head.

One scope note (info, not a defect): records already persisted with dco_split_hive_identity: true from App-only runs before this deploys will still satisfy the guard and are not re-read β€” the fix helps heads cached from now on, plus the legacy no-flag case #16701 covered. If an operator has already hit the symptom on in-flight heads, a new push (or clearing the record) is still needed for those. Worth a line in the changelog fragment if you want operators to know; not blocking.

Evidence bundle `#167092140cdd` sha256:4cc8e29703d9db636843140b30e58efbf45da3d6ba4b7cee49607ed2469e8191 β€” download from the dashboard or `hivectl review evidence #16709`.

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR 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 Nov 5, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style review (head 2140cdd) β€” approve, one advisory note.

The change matches the remediation stated in #16707 (NoteDCO takes hiveIdentity, set from policy.HiveAuthor != nil at src/pkg/github/automerge/automerge_stage_labels.go:1193, the same policy passed to stageDCO at line 1013), and the new TestStoreNoteDCOAppOnlySplitNotMarked covers both directions.

Advisory (low): src/pkg/stagelabels/store.go:2477-2479 says an App-only split "leaves the marker unset", but the code at 2495-2497 only ever sets the flag and never clears it β€” an App-only re-note on a record already marked keeps DCOSplitHiveIdentity = true. In the configure β†’ remove β†’ reconfigure project.ai_author sequence on the same head, the removal pass overwrites DCOUnsignedHive with the App-only share while the marker stays true, so the reconfigure pass is served from cache by the guard at automerge_stage_dco.go:146 instead of re-reading. If that round-trip matters, r.DCOSplitHiveIdentity = hiveIdentity (with the early-return term becoming r.DCOSplitHiveIdentity == hiveIdentity) is simpler and makes the doc comment literally true; otherwise reword the comment to "leaves the marker as it was".

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

@hivecommons-hive
hivecommons-hive Bot merged commit 1b1d4a6 into v5 Nov 5, 2026
86 of 93 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-16707 branch November 5, 2026 03:23
@github-actions

github-actions Bot commented Nov 5, 2026

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

@hivecommons-hive hivecommons-hive Bot removed 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 Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

0 participants