🌱 refactor(cmd/hive): extract runEvalCycle's ioscan canary gate behind a seam (#7232) - #7316
Conversation
…d a seam (#7232) Refs #7232 (one increment of step 1; runEvalCycle's remaining collaborators and main() are still to extract). runEvalCycle's advisory-findings ingestion embedded the ioscan canary gate — the decision that a leaked canary token in a finding's report text is always recorded (audit entry + critical bead) and withholds the finding from persistence only under ioscan.fail_closed — inline against the process-global canary registry, a live dashboard, and real bead stores, so none of it was testable. Same split as the #7232 kick-dispatch seam: the decisions move to gateAdvisoryFindings in eval_cycle_seams.go, the effects stay injected at the call site. Pinned behavior, each mutation-tested (4/4 killed): - canaries disabled => nil scanner, everything passes, no effects fire - fail-closed blocks ONLY the leaking finding; batch-mates still persist - fail-open records the leak but keeps the finding - audit entry names rule/agent/source exactly - the scan text is title\ndetail\nfile\ntype\nseverity — dropping any field fails the test go test ./cmd/hive/ passes; gateAdvisoryFindings at 100%. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "scanner" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Changelog: this PR changes code but carries no changelog entry If it is user-visible — a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
clubanderson
left a comment
There was a problem hiding this comment.
Canary gate seam extraction is a pure move with the test seam threaded through — behavior pinned by the new table tests. LGTM.
|
LGTM label has been added. DetailsGit tree hash: 48a10c5c8eb0bc9451096a1735503e77946c931f |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Refactor
Refs #7232 — one increment of its step 1 (
runEvalCycleseams); deliberately non-closing:runEvalCycle's remaining collaborators and all ofmain()are still to extract, per the issue's own sequencing.Claimed ground:
src/cmd/hive/eval_cycle_seams.go(newgateAdvisoryFindings+advisoryIngestDeps), the advisory-findings ingestion block ofrunEvalCycleinsrc/cmd/hive/main.go(~L6434), and new test filesrc/cmd/hive/eval_cycle_advisory_gate_7232_test.go. Disjoint from hold PR #7312 (dashboard fleet-report files only).What moved
runEvalCycle's ioscan canary gate — the decision that a leaked canary token in an advisory finding's report text is always recorded (audit entry + critical bead) and withholds the finding from persistence only underioscan.fail_closed— was inline against the process-global canary registry, a live dashboard, and real bead stores, so none of it was reachable by tests. It now follows the exact split of the earlier #7232 kick-dispatch seam: decisions ingateAdvisoryFindings(eval_cycle_seams.go), effects injected at the call site inmain.go, order preserved verbatim.Behavior pinned (mutation-tested, 4/4 killed)
canary.leak, the leak's agent, and theadvisory-findingsource exactlytitle\ndetail\nfile\ntype\nseverity— dropping any field fails the testVerification
go vet ./cmd/hive/clean;go test ./cmd/hive/ -count=1passes (44.3% → 44.6%,gateAdvisoryFindingsat 100%)Filed by scanner agent (ACMM L5 — hold-gated mode). Hold-gated: human review required.
— hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.78