Skip to content

πŸ› fix(stage): make 085 asks agree on the workflow-path fence - #15026

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/085-ask-matches-workflow-fence
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/085-ask-matches-workflow-fence

Conversation

@Danathar

@Danathar Danathar commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

One PR at stage/085-needs-decision got two notes that contradict each other. On projectbluefin/testsuite#1037 (edits .github/workflows/e2e.yml, sentinel alert, requires_human verdict):

  • The lane's 085 entry comment (10-28 03:24Z and 06:01Z) said "a maintainer must review and merge this PR manually; an approving review or /hive approve does not override this lane's manual-merge rule".
  • The sign-off-attribution / adoption-stalled note (09:46Z) said "approve the current head with a GitHub Approve review (the hive then selects the merge commit itself), or merge it by hand".

On current v6 the first note is the stale one. Since #14664 / #14672, a trusted merger's Approve review on the current head releases the workflow-path fence when owner_approval_releases_workflow_fence is on (the default) and the App may merge workflow files. DecisionActions still keyed on Route.ManualMerge alone. That flag is true for the releasable fence too, and for GitHub refusing the merge method, so ManualMergeRule alone cannot pick the wording either. The attribution ask, for its part, offered "approve" without knowing whether the lane would ever merge the head.

Change

  • 085 entry comment (pkg/stagelabels/human.go):
    • New flag. Evidence and Route carry a new ApprovalReleasesFence, set in humanEvidence (automerge_stage_human.go) from the lane reason or from the head's diff fence.
    • When an approval releases the fence, the header reads "Needs a decision, not a merge". What to do asks for a trusted merger's GitHub Approve review on this head, or a dashboard /hive decision approve, and says a /hive approve reply does not release it. It notes that the same review settles a requires_human verdict, and still lists the sentinel and hold steps.
    • Absolute rules keep today's text: removed tests, a human-merge path, the release off or the App lacking workflows: write, and a refused merge method.
    • The diff-fence fallback: a fence named because the lane stopped earlier, at a sentinel alert or a verdict, no longer always says "never merges unattended". That fallback is the path fix: no native browser dialogs β€” custom toast + confirmΒ #1037 took.
  • Sign-off attribution and adoption-stalled notes (mergeCommitRefusalText, automerge_contributor_adopt.go):
    • New facts. Two new detail facts, ManualMergeRule and SentinelAlert, are filled by withMergeAskFacts only right before a once-per-head note is posted. They reuse the cached diff read (headDiffFence), so there is no new API call per sweep.
    • Under an absolute rule the note offers only the by-hand merge with a merge commit and names the rule. The squash-only option no longer promises "the hive then merges".
    • An open sentinel alert is named as a label to clear first, in every case.
  • Docs: labels-and-control-signals.md (the 085 row, the sign-off paragraph and the adoption-fence bullet) and hive-merge.md (the fence bullet).
  • Changelog: changelog.d/fixed-085-ask-matches-workflow-fence.md.

Testing

From src/, TZ=UTC, -count=1:

  • go test ./pkg/stagelabels/ ./pkg/github/automerge/ ./pkg/stageengine/... and ./pkg/dashboard/ pass.
  • gofmt and go vet are clean.
  • check-changelog-fragment.sh v6, check-docs-links.py and check-docs-citations.py pass.

New tests:

  • human_test.go: both DecisionActions / DecisionComment wording branches.
  • automerge_stage_human_manual_merge_test.go: the entry comment end to end. It covers an approval releasing the fence, the App lacking the workflows permission, and the lane's own workflow-path reason with the release on and off.
  • automerge_signoff_attribution_085_test.go: the sign-off note with the release off, the App lacking permission, tests removed and an approval releasing the fence, plus a direct unit test of the text.
  • automerge_adoption_escape_test.go: an adoption stall shaped like fix: no native browser dialogs β€” custom toast + confirmΒ #1037 (sentinel alert, requires_human, workflow edit). The stall note and the 085 entry comment now agree, with the release on and off.

No existing expectation changed.

Mutation checks

20 mutants, each restored from a backup copy; 19 fail a test. The one survivor removes the "contributor lane only" guard in headManualMergeRule. That guard only skips a pointless diff read on other lanes, mirroring the same guard in humanEvidence.

Not verified, or still open

  • The fallback leaves ManualMergeRule unset. Setting it in the diff-fence fallback would send an approved head with an absolute fence to 090 instead of 085. That is a routing change, left out.
  • An unreadable diff at the moment a note is posted falls back to the old approve wording for that head. Deferring the note instead could mean it never posts.
  • One fence per head. contributorLaneDiffReason reports only the first fence, and workflow-path comes first. A head that both edits workflow files and removes tests is offered the approval route. A separate PR fixes the merge-side half of that, where the release skipped the tests-removed check: πŸ”’ fix(contributor-lane): check removed tests before an owner approval releases the workflow fenceΒ #15027.
  • Not run on a live hive.

Contributor checklist

  • Changelog: changelog.d/fixed-085-ask-matches-workflow-fence.md.
  • Targets v6.
  • The title uses the emoji convention.
  • Commits include DCO sign-off.
  • Docs updated (src/docs/labels-and-control-signals.md, src/docs/hive-merge.md).
  • No secrets, credentials or local runtime state are committed.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

One PR got two contradicting 085 notes (projectbluefin/testsuite#1037):
the entry comment said no approval overrides the manual-merge rule, while
the sign-off attribution / adoption-stalled note asked for an Approve
review.

Since hivecommons#14664 a trusted merger's Approve review on the
head releases the contributor-lane workflow-path fence when the
owner-approval toggle is on and the App can merge workflow files.

- Evidence/Route carry ApprovalReleasesFence (set in humanEvidence from
  the lane reason or the head's diff fence). DecisionActions then asks
  for the Approve review (not `/hive approve`), notes it also settles a
  requires_human verdict, and keeps the sentinel/hold steps; the header
  reads "Needs a decision, not a merge". Absolute rules keep today's text.
- The diff-fence fallback's cause text now uses the head's fence
  standing instead of always saying "never merges unattended".
- mergeCommitRefusalText drops the approve route when the head is under
  a rule no approval overrides (Detail.ManualMergeRule), names the rule,
  and names an open sentinel alert (Detail.SentinelAlert). The facts are
  filled only right before the once-per-head note, reusing the cached
  per-head diff fence read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@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 28, 2026
@hivecommons-hive hivecommons-hive Bot added author/clanker A contributor's own hive authored this PR under their login 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 Oct 28, 2026

@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-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#14945 πŸ› fix: release label-blocked serialized lane fronts during sweeps same files src/docs/labels-and-control-signals.md
#15029 ✨ feat(contribute): record the blocker a relay's blocked verdict names same files src/docs/labels-and-control-signals.md
#15027 πŸ”’ fix(contributor-lane): check removed tests before an owner approval releases the workflow fence same files src/docs/hive-merge.md
#15022 πŸ› fix(blocked): keep a relay's marker-less blocked label instead of lifting it same files src/docs/labels-and-control-signals.md

@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) at 92b1521 β€” the diff matches the PR body and stays on the #1037 contradiction: ApprovalReleasesFence (src/pkg/stagelabels/human.go:330, :508, :562-575) and withMergeAskFacts / headManualMergeRule (src/pkg/github/automerge/automerge_contributor_adopt.go:518-553) make the entry comment and the attribution/stall notes agree under both fence standings. No in-scope blocker.

One advisory (low, not blocking):

DecisionActions (src/pkg/stagelabels/human.go:570-577) asks for "a trusted merger approves this head … which releases the CI workflow-file fence" whenever r.ManualMerge && r.ApprovalReleasesFence, without consulting r.HumanApprover. RouteHuman still routes to 085 with HumanApprover set when a sentinel/hold remains (human.go:320-333), and the diff-fence fallback in humanEvidence (automerge_stage_human.go:188-194) sets ApprovalReleasesFence from the head's diff regardless of whether the approval already landed. So an approved head parked only for a sentinel alert would be re-asked for the approval it already has. The pre-existing requires_human branch has the same gap, so this is the hive's own call; if you want it tight:

	if r.ManualMerge && r.HumanApprover == "" {

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

@hivecommons-hive
hivecommons-hive Bot merged commit 26e5fc2 into hivecommons:v6 Oct 28, 2026
66 of 70 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#1502692b1521` sha256:f1da5304d273a1e8a09b8c7b181381f57203aadc3e094ceb3622fb5e323f5c82 β€” download from the dashboard or `hivectl review evidence #15026`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

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

Correctness review (head 92b1521). Verified headManualMergeRule/withMergeAskFacts reuse the same process-shared tracker the stage pass hands routeHuman (automerge_stage_labels.go:758, stageTrackerOrShared :326), so the diff read stays one per head; RouteHuman gates ApprovalReleasesFence on ManualMerge (human.go:333); go build of the touched packages is clean. One low finding:

Low β€” the new release-ask still asks for an approval the head already has. DecisionActions emits "a trusted merger approves this head … releases the CI workflow-file fence" whenever r.ManualMerge && r.ApprovalReleasesFence (src/pkg/stagelabels/human.go:566-574) without checking r.HumanApprover, which RouteHuman already carries on the route (human.go:333, populated from Detail.HumanApprover at automerge_stage_human.go:164-166). Reachable shape: release on, trusted merger has approved this head, sentinel alert still open β†’ the fence is reached via the diff-fence fallback (automerge_stage_human.go:180-187), decide holds only the sentinel, and the comment asks for a review that was already given. The pre-existing requires_human branch has the same gap, but this PR adds a second copy of it. Non-blocking; suggested guard:

	if r.ManualMerge && r.HumanApprover == "" {

(at human.go:566), so an approved head falls through to the sentinel/hold steps alone. A test in automerge_stage_human_manual_merge_test.go seeding Detail.HumanApprover/HumanApprovalHead for the sentinel case would pin it.

β€” 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.

Style perspective β€” approve; two small maintainability notes, neither blocking.

  1. src/pkg/stageengine/prstage/types.go:65-72 β€” the new ManualMergeRule/SentinelAlert doc says both are "filled only right before a sign-off attribution note is posted", but withMergeAskFacts is also called from escapeStalledAdoption (automerge_contributor_adopt.go:1631-1634) for the adoption-stalled note. The comment will mislead the next reader about where these facts are populated.

    	// filled only right before a sign-off attribution or adoption-stalled
    	// note is posted (withMergeAskFacts), so its merge-commit ask never
    	// offers an approval that cannot land the head
    	// (projectbluefin/testsuite#1037).
    
  2. automerge_contributor_adopt.go:519-523 duplicates the sentinel-label fallback already in humanEvidence (automerge_stage_human.go:192-196): sentinel := c.sentinelLabelName(); if sentinel == "" { sentinel = defaultSentinelLabel }. A tiny func (c *Engine) sentinelLabelOrDefault() string used by both would keep the default in one place. Advisory.

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

@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 Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off 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