Skip to content

πŸ› ci: v6 top-up auto-resolves CHANGELOG, scripts-tree pin and index.html conflicts - #18277

Merged
hivecommons-hive[bot] merged 7 commits into
v5from
fix/v6-topup-autoresolve-changelog-pin
Nov 15, 2026
Merged

hivecommons-hive[bot] merged 7 commits into
v5from
fix/v6-topup-autoresolve-changelog-pin

Conversation

@clubanderson

Copy link
Copy Markdown
Member

.github/workflows/v6-topup.yml has failed on every run since 2026-11-15 04:09Z (the 13:52Z run: content conflicts in .github/scripts/integration-governance.cjs, CHANGELOG.md, src/Dockerfile). The v6 line was topped up by hand in #18275. Two of those three conflicts come back on nearly every top-up:

  • CHANGELOG.md: both lines prepend their own release sections under ## Unreleased on every release.
  • TRUSTED_SCRIPTS_TREE in .github/scripts/integration-governance.cjs: it pins git rev-parse HEAD:src/scripts, so the literal differs between v5 and v6 whenever both lines changed src/scripts.

src/pkg/dashboard/static/index.html is a generated file (byte concatenation of static-src/manifest.txt) and conflicts whenever both lines touch the dashboard. The src/Dockerfile conflict was a one-off (both sides edited the same metacopy-rewrite line) and is resolved in #18275.

Change

  • Moves the known-pattern resolution out of the workflow's inline elif into .github/scripts/v6-topup-autoresolve.sh. The workflow copies the script to $RUNNER_TEMP before it checks out v6, so the resolver always runs from the triggering ref, not v6's tree.
  • Keeps the existing patterns (discord/ + discord-syntax.yml deletions, config.go split) and adds:
    • CHANGELOG.md: git merge-file --union, v6's block first, then v5's (the layout v6's CHANGELOG already has).
    • integration-governance.cjs: only when every conflict hunk is exactly one TRUSTED_SCRIPTS_TREE line per side. The script re-pins it to the merged src/scripts tree. Any other hunk in that file still goes to a human.
    • static/index.html: regenerated from the manifest. Any conflict inside static-src/ is outside the patterns and still fails.
  • Anything else still fails loudly with the existing conflict inventory.
  • Adds .github/scripts/test-v6-topup-autoresolve.sh (builds throwaway repos for the all-known case, an unknown conflict, and a real edit in the pin file) and v6-topup-autoresolve-tests.yml to run it on PRs and v5 pushes that touch these files.

Security note on the re-pin: the pinned tree is the merge of two already-reviewed src/scripts trees, and the top-up still lands through a reviewed PR. No caller-supplied SHA gets to pick the verifier tree.

The workflow-file push preflight (#7959) is unchanged. A top-up that carries workflow edits still needs TOPUP_PUSH_TOKEN.

Nothing was run locally. CI runs the new test.

πŸ€– Generated with Claude Code

…tml conflicts

The v5 -> v6 forward-merge failed on every run since 2026-11-15 04:09Z.
Two of its conflicts recur on nearly every top-up: CHANGELOG.md (both
lines prepend release sections) and the TRUSTED_SCRIPTS_TREE literal in
.github/scripts/integration-governance.cjs (pins HEAD:src/scripts, so it
differs whenever both lines touch src/scripts). The generated
static/index.html is mechanically regenerable too.

Move the known-pattern resolution into .github/scripts/v6-topup-autoresolve.sh
(run from a copy taken off the triggering ref) and extend it: union for
CHANGELOG.md, re-pin to the merged src/scripts tree when every hunk in the
pin file is the literal, regenerate index.html from the manifest. Any other
conflict still fails for a human. Add a throwaway-repo test and a workflow
that runs it.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added 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. labels Nov 15, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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

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

Why:

  • the review swarm returned requires_human: it has a question for you, not a fix for the hive
  • the reviewer asked you: clubanderson should decide whether CI may auto-re-pin TRUSTED_SCRIPTS_TREE in .github/scripts/integration-governance.cjs during the v5->v6 top-up.

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.

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

Code looks correct to me; routing because it touches a trust surface.

I read v6-topup-autoresolve.sh, its test script and the v6-topup.yml change. The pin-hunk awk only accepts hunks that are exactly one TRUSTED_SCRIPTS_TREE line per side, the CHANGELOG merge-file --union and manifest regeneration match what the test asserts, and copying the resolver to $RUNNER_TEMP before checking out v6 keeps it running from the triggering ref.

What a person should decide: the script now writes the governance pin itself (v6-topup-autoresolve.sh ~L119, sed ... TRUSTED_SCRIPTS_TREE) from the merged src/scripts tree. The top-up PR still shows the diff, but this turns the pin from a reviewed literal into a CI-computed value, and the PR also edits .github/workflows/v6-topup.yml.

Minor: the header comment (L6) says the script aborts the merge on failure; it only exits 1 and the workflow's else branch aborts.

Evidence bundle `#18277b2e1832` sha256:39840233589c93f4e7b8d33fc9f60e12444810260641f05f867e5df569514452 β€” download from the dashboard or `hivectl review evidence #18277`.

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

Decision needed: @clubanderson should decide whether the v6 top-up may automatically rewrite the TRUSTED_SCRIPTS_TREE trust pin in integration-governance.cjs, or whether that file should keep going to a human.

Read .github/scripts/v6-topup-autoresolve.sh and the v6-topup.yml hunk at the PR head. I found no defect in the conflict-detection logic, but this PR changes a trust surface and needs an owner's call.

Decision needed. v6-topup-autoresolve.sh (the repin block) rewrites TRUSTED_SCRIPTS_TREE to whatever git rev-parse <merged-tree>:src/scripts returns. That pin is what the integration-governance check trusts. After this change, any src/scripts content that arrives through a v5 merge becomes trusted on v6 without a person re-pinning it. The script's header argues that it is a merge of two reviewed trees and that the top-up PR shows it. That is reasonable, but it moves the pin from a human step to an automated one, so I am not approving it.

Smaller observations (verified in the script, not blocking):

  • The header says that on exit 1 it "aborts the merge and reports". The script does not abort. The workflow's else branch does. By then the script may already have run git rm / git add on the known files. The conflict inventory that branch prints is then taken from a partially resolved index, so it may omit the files that were resolved before the unknown one was hit. The up-front known filter makes this unlikely, but a failure inside the CHANGELOG.md or pin-hunk checks can still reach it.
  • The manifest guard /*|..*) only rejects paths that begin with .. or /. a/../../x passes. The manifest is in-repo, so the risk is low.

The tests in test-v6-topup-autoresolve.sh look like they cover each pattern and the refusal case. I did not run them, per AGENTS.md.

β€” hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.325

@hivecommons-hive

Copy link
Copy Markdown
Contributor

hive/scanner: CI triage. release-lines-in-sync fails at the 'Prove the guard still catches a stale allow-list' step with 'RESULT: FAIL β€” the release-line guard is not detecting what it claims to.' Every individual self-test line shows ok, so the final result likely comes from a count or aggregate check in the self-test script, probably affected by the v6 top-up changes. This is PR-local (baseline check: isolated, FIX_DIFF). This PR is human-authored, so I'm not pushing to it. The remaining 34 checks are still running.


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

β€” hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325

@hivecommons-hive

hivecommons-hive Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor
d6871f8

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

Hive flagged this PR (author @clubanderson, head d6871f803e95) 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 3 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • .github/release-lines.yml
    • .github/workflows/v6-topup-autoresolve-tests.yml
    • .github/workflows/v6-topup.yml

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.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge:

  • the reviewer swarm returned requires_human @d6871f8
  • the review found: the reviewer marked this change high-risk
  • reviewer question: @clubanderson should decide whether the v6 top-up job may rewrite the TRUSTED_SCRIPTS_TREE trust pin in .github/scripts/integration-governance.cjs automatically, rather than leaving every pin change to a human.
  • the PR edits CI workflow / action files: awaiting owner approval β€” a hive owner / trusted merger's GitHub Approve review on the current head (or a dashboard /hive decision approve) releases the fence and the hive merges it; approval on an earlier head does not count unless the hive's own merge of the base branch is all that moved the head, so re-approve after a push

Head: verdict requires_human @d6871f8, 11/30 checks green, 19 pending, DCO yes, soak 0s of 10m0s.

How to release it:

  • A hive owner / trusted merger submits a GitHub Approve review on the current head (or approves from the Hive dashboard, which posts /hive decision approve on their behalf); that explicit approval releases the workflow-path fence and the lane merges on its next pass once CI, soak and the other gates are clear. Approval on an earlier head carries over only the hive's own merge of the base branch (which leaves the diff unchanged): re-approve after any other push.
  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed. An ordinary contributor cannot release their own PR.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 15, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described 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

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

Decision needed: @clubanderson should the v6 top-up workflow be allowed to re-pin TRUSTED_SCRIPTS_TREE automatically, given the pin exists to make a change to src/scripts visible to a human?

Needs a maintainer decision (trust surface), not a code defect.

This PR edits .github/workflows/v6-topup.yml, adds a workflow, and teaches the top-up bot to rewrite TRUSTED_SCRIPTS_TREE in .github/scripts/integration-governance.cjs on its own (.github/scripts/v6-topup-autoresolve.sh, the repin=1 branch: git write-tree β†’ git rev-parse "${tree}:src/scripts" β†’ sed -i).

What I verified in the script:

  • The resolver is narrow. pin_hunks_only requires every hunk in the pin file to be exactly one TRUSTED_SCRIPTS_TREE = '<40 hex>' line per side, and anything else still fails. The workflow copies the resolver to $RUNNER_TEMP before checking out v6, so v6 cannot substitute its own copy.
  • The consequence is that after an automated merge the pin equals whatever src/scripts is on the merged tree, by construction. The pin then no longer checks anything for that PR. A v5 change to src/scripts that would normally trip the pin's check arrives with a pin already updated to match. The PR body argues the top-up PR still shows the diff. That is a human-review safeguard, not a mechanical one, so it depends on someone reading src/scripts changes in a forward-merge.

Open question for the owner: is a human-visible diff on the top-up PR enough, or should the re-pin stay a manual step (or require the top-up PR to carry a label or approval before the pin updates)?

Smaller, non-blocking: the header comment says the script "aborts the merge and reports" on failure (v6-topup-autoresolve.sh:6-8), but the script only exit 1s and never runs git merge --abort. Whether that matters depends on what the workflow does after a failure.

I have not merged, approved or closed anything.

β€” hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.325

@kubestellar-prow kubestellar-prow Bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

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

Decision needed: @clubanderson should decide whether the v6 top-up job may rewrite the TRUSTED_SCRIPTS_TREE pin in .github/scripts/integration-governance.cjs automatically.

Routing to a human: this PR touches trust surfaces. It adds a workflow, edits v6-topup.yml, and changes the governance pin. I found no defect in the script itself.

What I read (.github/scripts/v6-topup-autoresolve.sh, test-v6-topup-autoresolve.sh, the v6-topup.yml hunk):

  • The resolver only runs when every unmerged path matches the known regex. The pin file is accepted only if each conflict hunk is exactly one TRUSTED_SCRIPTS_TREE = '<40-hex>' line per side (pin_hunks_only). A real edit to that file still fails, and the test pin-file-real-edit-refused covers it.
  • The resolver is copied to $RUNNER_TEMP before git checkout -B sync/v5-to-v6 origin/v6, so v6's tree cannot replace the script that resolves its own merge. That is the right order.
  • The new test workflow has permissions: contents: read and a SHA-pinned checkout, and it registers in release-lines.yml.

The decision: the pin exists so that src/scripts changes are reviewed. After this PR, the top-up bot re-pins to whatever tree the merge produces (git write-tree then rev-parse :src/scripts, script lines ~120-125). The top-up PR then shows a new pin value, and a reviewer has to check that it matches the merged scripts. The PR body says this is intended. Whether bot-generated pin updates are acceptable is a governance call, not a code one.

Minor, non-blocking: the header comment says the script "aborts the merge" on failure, but it only exits 1. The abort happens in the workflow's else branch. Worth rewording so the contract matches.

Suggestion, not a defect: add a test case where integration-governance.cjs conflicts only in the pin but src/scripts is unchanged on both sides. It would show that the re-pin is a no-op there.

I have not approved or closed anything.

β€” hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.325

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

Decision needed: @clubanderson @hanthor @Danathar should an automated job be allowed to rewrite the TRUSTED_SCRIPTS_TREE pin in .github/scripts/integration-governance.cjs during a v5β†’v6 top-up?

Routing to a code owner, not a defect: this touches trust surfaces that CODEOWNERS covers (.github/workflows/**) and adds an unattended rewrite of the governance verifier pin.

What I read at b2e1832:

  • .github/scripts/v6-topup-autoresolve.sh re-pins TRUSTED_SCRIPTS_TREE to git rev-parse <write-tree>:src/scripts, i.e. the tree of whatever the merge produced, then the workflow commits it (v6-topup.yml). The guard (pin_hunks_only) correctly limits this to hunks that are exactly one pin line per side, and the resolver is copied from the triggering ref before git checkout -B sync/v5-to-v6 β€” both look right to me.
  • The residual risk is policy, not code: the pin becomes "whatever src/scripts is after the merge". If a v5 src/scripts change was not reviewed to the v6 bar, the top-up PR diff shows only a changed 40-hex literal, which a reviewer cannot meaningfully eyeball.
  • Mechanics otherwise look sound: the DU/UD removal, --ours for config.go, merge-file --union for the CHANGELOG (v6 block first), and index.html regeneration from the manifest with the /*|..* path guard. The new test workflow has contents: read only, and its Known-conflict resolver check is green.

Question for the owner: is "pin follows the merged tree, reviewed via the top-up PR" acceptable, or should the pin conflict stay a human step? Everything else here I'd consider fine to land.

β€” hive: agent=reviewer-2 backend=claude model=claude-sonnet-5-5 claude=2.1.325

@hivecommons-hive
hivecommons-hive Bot merged commit f90e0cb into v5 Nov 15, 2026
83 of 84 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/v6-topup-autoresolve-changelog-pin branch November 15, 2026 16:43
@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at b2e1832.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. 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