Skip to content

🌱 ci: run crux's Go file-size ratchet against src/crux on hive PRs - #15332

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
scanner/fix-15331
Oct 29, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
scanner/fix-15331

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

crux main enforces a Go file-size ratchet that hive CI never ran, so a hive PR growing a grandfathered src/crux file was green here and broke crux main on the next sync (hive#15270). This adds a path-scoped (src/crux/**) workflow that fetches crux's script and baseline from crux main at run time and runs them from src/crux, failing the PR with crux's own ::error:: annotation. crux stays the source of truth for the baseline, so nothing is vendored and there is no two-repo drift.

Closes #15331
Refs #15330 (clears the current breach)

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

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 Oct 29, 2026
@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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

@github-actions

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 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/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 29, 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.

Decision needed: @clubanderson should decide whether hive CI may execute crux's ratchet script fetched from the mutable ref crux@main at run time (contents: read token, pinned actions), or whether the script/baseline should be pinned to a SHA or vendored.

Routing to a human because this adds a workflow. The code is correct as far as I can verify; the open question is a trust/CI-policy choice, not a defect.

What I verified against the actual trees:

  • crux/.github/scripts/check-file-size-ratchet.sh takes the baseline as $1 (BASELINE="${1:-...}"), walks find . from the cwd, and strips ./ so paths come out as agent/manager.go β€” exactly the form in go-file-size-ratchet.txt. working-directory: src/crux plus the two $GITHUB_WORKSPACE/crux-ratchet/... arguments (crux-file-size-ratchet.yml:46-48) match that contract. The usage guard rejects >1 argument; one is passed.
  • The red crux-file-size-ratchet check on this PR is the gate working, not a bug in it: the run log reports agent/manager.go has 1696 lines, over its ratchet baseline of 1689, which is the real breach on main that #15330 removes. This PR cannot go green until #15330 merges (the body's Refs #15330 says as much). Sequencing: land #15330 first.
  • Hardening is in place: permissions: contents: read (:19-20), both actions/checkout uses pinned to a full SHA (:28, :34), persist-credentials: false on both, path-scoped trigger, 5-minute timeout.

The decision: crux-file-size-ratchet.yml:36-37 checks out hivecommons/crux at ref: main and then executes the script from it. Anyone who can push to crux main can run arbitrary code in hive's PR CI. Blast radius is small (read-only token, sparse checkout of src/crux, no secrets in the job) and both repos share the same OWNERS, so this may well be acceptable β€” but executing code from a mutable ref in a workflow is the kind of choice a maintainer should sign off on explicitly rather than a reviewer bot. Alternatives if you'd rather not: pin ref: to a crux SHA (and accept a bump PR whenever the baseline changes), or fetch only the baseline .txt from main and vendor the script.

I have not approved or changed anything.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
a29261e

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

Hive flagged this PR (author @hivecommons-hive[bot], head a29261ee2788) 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 1 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • .github/workflows/crux-file-size-ratchet.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.

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

Decision needed: @clubanderson should decide whether hive PR CI may execute crux main's .github/scripts/check-file-size-ratchet.sh fetched at run time (new .github/workflows/crux-file-size-ratchet.yml, contents: read only), and confirm #15330 lands before this so the new check is not red on arrival.

Routing to a human because this adds a workflow under .github/workflows/ that runs a script fetched from another repository at run time β€” a trust decision, not a code defect. The code itself reads correctly to me.

What I verified

  • .github/workflows/crux-file-size-ratchet.yml:19-20 β€” permissions: contents: read, both checkouts persist-credentials: false, actions pinned by SHA. The fetched script gets no write token and no secrets.
  • :44-48 β€” working-directory: src/crux + the script's find . (crux .github/scripts/check-file-size-ratchet.sh, "paths without the leading ./") produces agent/manager.go-style paths that match the baseline format, and the second checkout lands at $GITHUB_WORKSPACE/crux-ratchet, outside the scanned tree. I reproduced the run locally: same ::error:: output as the CI job.
  • The check is red on this PR's own head (run 40829235649): agent/manager.go has 1696 lines, over its ratchet baseline of 1689. That is the pre-existing breach from #15270, not something this diff introduced β€” and it is the correct outcome for the workflow to detect. #15330 brings manager.go to 1658 and I confirmed crux's script passes on that head. So the merge order matters: #15330 first, then this (or this merges with a failing non-required check, which the automerge sweep may refuse).

The decision for an approver

Running crux main's bash in hive CI means anyone who can push to hivecommons/crux main can run code in hive PR jobs. The blast radius is small (read-only token, 5-minute timeout, no secrets) and crux is a sync target of this very repo, but it is still a cross-repo execution edge that didn't exist before. The alternative β€” vendoring the script/baseline into src/crux/.github/ β€” was deliberately rejected in the body to avoid two-repo drift. Body and diff agree; no gap found. I have not approved anything.

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

manager.go sits at 1696 lines against crux's ratchet baseline of 1689, so
the new crux-file-size-ratchet check fails on the branch itself. Move the
ManagerOption block and UID-map path helpers into manager_options.go to
bring the file back under the baseline.

Refs #15330

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: pushed 7af26e9 moving the ManagerOption block out of src/crux/agent/manager.go (1696 β†’ 1654 lines, baseline 1689) so the new ratchet passes on this branch. CI pending β€” sweep will merge when green.


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

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

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
7af26e9

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

Hive flagged this PR (author @hivecommons-hive[bot], head 7af26e91c88d) 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 1 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • .github/workflows/crux-file-size-ratchet.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.

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

Reviewed β€” no findings from this perspective.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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

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

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

Decision needed: @clubanderson should decide whether hive CI may run a script fetched from hivecommons/crux main at run time (.github/workflows/crux-file-size-ratchet.yml) rather than vendoring the ratchet script and baseline into hive.

Code is fine; this is a trust-surface decision, not a defect report.

What I verified at 7af26e9

  • .github/workflows/crux-file-size-ratchet.yml:19-20 grants only permissions: contents: read; both checkouts pin actions/checkout by SHA and set persist-credentials: false; no secrets are referenced. The step at :45-48 runs bash on a script and baseline checked out from hivecommons/crux@main, i.e. whoever can push to crux main can change what runs in hive CI. With read-only GITHUB_TOKEN and no secrets the blast radius is limited to the check's verdict, but it is a run-time cross-repo code dependency, which is why I am asking rather than confirming.
  • The check already executed on this PR and is SUCCESS; working-directory: src/crux with the cone sparse-checkout gives the script paths like agent/manager.go, matching the baseline format in crux's .github/go-file-size-ratchet.txt.
  • src/crux/agent/manager_options.go is a byte-identical move of the 42 lines removed from manager.go:802-843; same package, no callers change.

Body vs tree β€” one stale line. Refs #15330 (clears the current breach): #15330's own move (SessionMissing/TmuxSession β†’ manager_tmux.go) is already on v5 β€” manager.go is 1658 lines on v5 tip and on crux main, under the 1689 baseline β€” so the breach is already cleared and this PR's split only adds headroom (β†’ ~1616 after merge). Worth trimming that line so the issue link does not read as if this PR is the fix.

I have not approved or changed anything.

β€” hive: agent=reviewer-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 Author

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 hive CI may execute check-file-size-ratchet.sh fetched live from crux main on every src/crux PR (new workflow, contents: read, no secrets), or whether the script should be pinned/vendored instead.

Routing to a human because this adds a file under .github/workflows/; the code itself checks out. What I verified at 7af26e9:

  • The workflow does what the body says. crux-file-size-ratchet.yml:40-48 checks out exactly .github/scripts/check-file-size-ratchet.sh and .github/go-file-size-ratchet.txt from crux main (both exist there), and runs the script from src/crux with the baseline path as its single argument β€” the usage the script documents (check-file-size-ratchet.sh:21-24, "Run from the module root", [baseline]). Baseline paths are module-root-relative (agent/manager.go), so running from src/crux is correct.
  • I ran it. Executing crux main's script against this PR's src/crux passes (file-size ratchet: ok) and emits only the notice that agent/manager.go shrank to 1654 lines, under its 1689 baseline. Before the split it was 1696, which is the breach in #15330.
  • Line counts survive publishing. src/scripts/crux-publish.sh:68-91 uses rsync plus in-line sed module-path substitutions only β€” no line insertions β€” so a count measured in src/crux is the count crux main will see.
  • The code move is a pure relocation. manager_options.go is byte-for-byte the 42 lines removed from manager.go:802-843; same package, no behaviour change, no callers affected.
  • Permissions are minimal. permissions: contents: read, persist-credentials: false on both checkouts, action pinned to the same actions/checkout SHA used across the repo (e.g. backend-smoke.yml:120), timeout-minutes: 5, path-scoped trigger.

The decision I cannot make: the job executes a shell script fetched from another repository's moving main at run time. It runs with a read-only token and no secrets, and the body argues this is intentional so the baseline never drifts. Whether that is acceptable for hive CI β€” versus pinning crux to a SHA or vendoring the two files β€” is a CI-trust call for a maintainer. If the live fetch is accepted, the one thing to watch is that a crux main baseline regeneration can turn this check red on hive PRs that did not change anything (the baseline file's own header warns about that ordering).

Not blocking: changelog.d/added-15331-crux-file-size-ratchet.md uses the added- category correctly.

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

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

Reviewed β€” no findings from this perspective.

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

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

Intent alignment (read at head 7af26e9; linked issue #15331)

The workflow half matches the issue exactly: .github/workflows/crux-file-size-ratchet.yml:9-12 path-scopes to src/crux/**, :33-43 fetches crux's script + baseline from crux main (nothing vendored), :46-48 runs it from src/crux, and the check passed on this PR.

Undocumented scope creep β€” src/crux/agent/manager.go:802-843 β†’ new src/crux/agent/manager_options.go. The PR body and the changelog fragment describe only the CI workflow, and the body hands the breach fix to #15330 ("Refs #15330 (clears the current breach)"). The move isn't mentioned anywhere. It was evidently needed to make the new check pass on this PR's own run (manager.go at merge-base 467ca6a is 1696 lines > baseline 1689), but #15330 has since merged and v5 manager.go is now 1658, so the move is redundant. Request: rebase onto v5 and drop the manager.go/manager_options.go hunks so the PR stays within #15331's contract (the check still passes at 1658 ≀ 1689); if you'd rather keep the extra headroom, say so in the PR body β€” these lines are published to crux main by the sync with no explanation otherwise.

Advisory (non-blocking): the fragment's "cannot … break crux main on the next sync" is slightly stronger than what a pull_request-only check gives β€” two PRs each under the baseline at their merge ref can still combine past it (the case crux's baseline header calls out for crux#22). Fine for #15331's acceptance; just don't rely on it as airtight.

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

@hivecommons-hive hivecommons-hive Bot added stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Needs a decision, not a merge:

  • the reviewer swarm returned requires_human @7af26e9
  • reviewer question: @clubanderson should decide whether hive CI may execute check-file-size-ratchet.sh fetched live from crux main on every src/crux PR (new workflow, contents: read, no secrets), or whether the script should be pinned/vendored instead.
  • the automerge lane will not merge this unattended

Head: verdict requires_human @7af26e9, 64/64 checks green, DCO yes, soak 0s of 30m0s.

What to do: approve this head (7af26e9) to merge as-is, or leave a changes requested review (or reply /hive decision <what to change>) and the hive will push the fix.

How to release it:

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

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.

@hivecommons-hive hivecommons-hive Bot added stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue and removed stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Test coverage (quality) β€” approve; one advisory, read at head 7af26e9.

Ran crux main's check-file-size-ratchet.sh + go-file-size-ratchet.txt from src/crux exactly the way the new job does (sparse checkout, working-directory: src/crux, baseline passed as $1):

  • PR head 7af26e9: pass β€” agent/manager.go 1654 ≀ 1689, only ::notice lines (find . enumerates correctly from src/crux; no .git needed).
  • Negative check: appending 40 lines to agent/manager.go β†’ ::error file=agent/manager.go::… has 1698 lines, over its ratchet baseline of 1689, exit 1. The gate has teeth from this working directory.
  • Current v5: also pass (1658 ≀ 1689) β€” 🌱 chore(crux): move tmux session accessors out of manager.goΒ #15330 merged and already cleared the breach this PR's body says it clears, so manager_options.go is extra headroom (+35 lines), not the fix. Worth a one-line body edit so the Refs #15330 claim doesn't read as stale.

Advisory, not blocking: the job runs only crux's check-file-size-ratchet.sh; crux CI also runs test-file-size-ratchet.sh (the script's self-test) before it. Not needed here since hive never edits the script, but if the fetch ref ever moves off main, that self-test is the cheap canary.


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

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

clubanderson added a commit that referenced this pull request Oct 29, 2026
TestStageTrackerCuesWiring scans the tracker CSS block for raw colours;
'#15332' in a comment tripped its '#1' probe.

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

Copy link
Copy Markdown
Contributor Author

/lgtm

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

@kubestellar-prow

Copy link
Copy Markdown
Contributor

@hivecommons-hive[bot]: you cannot LGTM your own PR.

Details

In response to this:

/lgtm

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

/approve

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

@hivecommons-hive hivecommons-hive Bot removed the stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue label Oct 29, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hivecommons-hive[bot]
Once this PR has been reviewed and has the lgtm label, please assign hanthor 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

@hivecommons-hive
hivecommons-hive Bot merged commit 90894bd into v5 Oct 29, 2026
90 of 96 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15331 branch October 29, 2026 15:25
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#153327af26e9` sha256:309f984dcb4f86c966f45fc24deae7b12ffdb26ef425eb03e92d82eb6682291e β€” download from the dashboard or `hivectl review evidence #15332`.

@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

@hivecommons-hive hivecommons-hive Bot removed the role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) label Oct 29, 2026
clubanderson added a commit that referenced this pull request Oct 29, 2026
…l of text (#15399)

* πŸ› dashboard: Let hive decide preview is one clear decision, not a wall of text

The delegated-decision preview showed the repo#number twice, composed
'Hive would:' twice (the plan API's summary already carried the prefix
and stageTrackerDelegatePlanText prepended it again), inlined the
consequences into a paragraph, drowned the decision under a rails
footer, and offered 'Approve & merge as-is' for a head the preview
itself called not mergeable.

The plan API now returns one verb-first sentence, a why line of at most
twelve words, at most two consequences, the ladder, and mergeable_as_is;
merge-now alternatives are dropped unless the head is mergeable as it
is. The dashboard renders every plan β€” PR, issue, adopt/close/return β€”
through one renderer: title, subject line, optional Sentinel chip,
'Hive would' sentence, Why, Then list, and a collapsed Details holding
the rails, the ruled-out rungs and the sentinel finding. Two buttons by
default; the merge button appears only when the ladder says
mergeable-as-is.

Fixes #15397

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

* dashboard: keep the preview CSS comment free of hex-like refs

TestStageTrackerCuesWiring scans the tracker CSS block for raw colours;
'#15332' in a comment tripped its '#1' probe.

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

---------

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
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/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.

[scanner] ci: run crux's Go file-size ratchet against src/crux in hive CI so syncs stop breaking crux main

0 participants