Skip to content

✨ feat: let a sandboxed reviewer post reviews through a workspace spool - #14989

Merged
hivecommons-hive[bot] merged 7 commits into
v5from
feat/relay-sandbox-verdict-14986
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 7 commits into
v5from
feat/relay-sandbox-verdict-14986

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

A reviewer whose kicks run in a sandbox couldn't post a review. That covers Podman, and on hardware spokes such as a1-vllm-spyre it covers sandbox.runtime: job on the card node. The sandbox never sees the pod-local relay dir (/var/run/hive-metrics/review-requests). This PR implements the bounded proposal in #14986:

  1. Spool in the workspace. Every sandbox kick gets .hive/review-requests in its workspace. The sandbox gets HIVE_REVIEW_REQUEST_DIR=/workspace/.hive/review-requests, and hive-review now writes there when that variable is set. The schema is unchanged.
  2. Attribution from a manifest, not the file. Before launch, the executor registers the spool in a manifest under <work_dir>/sandbox-review-spools/. That directory is outside every workspace and owner-only (0700). The relay attributes each spooled request to the manifest's agent and overwrites the file's agent field. It ignores a manifest dir or manifest file that isn't owned by its own uid or that others can write. The UID forge check is skipped for staged files, because hive owns them; the manifest is the proof instead.
  3. Same policy path. The watcher moves spooled requests into a hive-owned staging dir next to the manifest and runs them through the existing handleOneReviewRequest. So max_reviews_per_head, repo pause, the lane write allowlist, the sentinel block, the contributor COMMENT-only guard, the canary scan, verdict validation and the audit all apply unchanged. Results are copied back into the spool so the agent can read them, for example to fix a bad --verdict-file and resubmit within the same kick.
  4. sandbox.runtime: job for reviewers. No config gate refused it. sandbox-isolation.md now documents the setup and says the review runs on the card node.

Hardening and lifecycle

  • Symlink containment. The spool is writable by the sandbox, so the relay only touches it through an os.Root opened at the workspace. A planted symlink can't redirect a read, rename or result write outside the workspace. A request that is a symlink, FIFO or oversized is renamed to .rejected. All renaming, quarantine and retries happen in staging, which only hive can write.
  • Cadence. fsnotify does not fire for writes made to a shared PVC from another node. So while any spool is registered, the watcher keeps its short poll interval.
  • End of run. After the sandbox exits, the executor waits up to 60s for the relay to take any request still in the spool. Without that wait, a run-stage worktree is removed while the request is still in it. The manifest is then marked ended. The relay drops it once nothing is left to deliver, or after 24h.

Out of scope, as the issue says: the quality and deps lanes are unchanged, and nothing inside a Job writes to GitHub directly.

Tests

  • pkg/github/review_request_sandbox_spool_test.go:
    • a spooled comment is posted, authorized and audited as the manifest's agent (uid 0), and its result is copied back into the spool
    • a denial is copied back and nothing is posted
    • a world-writable manifest dir is ignored
    • a spool symlinked out of the workspace is not followed (the outside file is neither posted, moved nor given a result)
    • a symlinked request is renamed to .rejected
    • pruning removes only manifests that are ended and drained
    • invalid or stale manifests are dropped
  • crux/agent/sandbox_review_spool_test.go:
    • registration: env, owner-only dir, manifest present during the run and marked ended after
    • positive control with no manifest dir
    • the drain wait blocks Run until the relay takes the request
    • the drain timeout
    • the manager wiring for a job-runtime kick under HIVE_WORK_DIR
  • bin/test_hive_review.sh: HIVE_REVIEW_REQUEST_DIR redirects the request (run locally: 27 passed, 0 failed).

Following AGENTS.md, I didn't run the Go tests locally; CI is the verdict. gofmt -l is clean on every changed Go file.

Closes #14986

🤖 Generated with Claude Code

— hive: backend=claude model=claude-opus-5-5


🐝 Hive Agent: contributor | SHA: c373d3898

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 28, 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 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.

PR Title Relation Files
#14807 ✨ dashboard: stream Job pod logs in the terminal pane for sandbox.runtime: job agents same files src/crux/agent/manager_sandbox.go
src/crux/agent/sandbox_executor.go
src/crux/agent/sandbox_executor_test.go
src/docs/sandbox-isolation.md

@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 stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@Danathar this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Failing checks:

  • build-and-test

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Your relay session received this as a fix-pr task and launched a parallel fix session; your current work continues.

Danathar and others added 2 commits October 28, 2026 16:20
A reviewer whose kicks run in a sandbox (Podman, or a Kubernetes Job on
an accelerator node via sandbox.runtime: job) had no path to the pod-local
review relay, so it could not post a verdict.

Every sandbox kick now gets a review spool at .hive/review-requests in its
workspace; hive-review writes there when HIVE_REVIEW_REQUEST_DIR is set.
The executor registers the spool with a manifest under
<work_dir>/sandbox-review-spools, outside every workspace and owner-only.
The review-request watcher moves spooled requests into hive-owned staging
through an os.Root at the workspace, runs them through the same handler
as the pod-local drop box (per-head cap, pause, lane allowlist, sentinel
block, audit unchanged), attributes them to the manifest's agent rather
than the file's, and mirrors results back into the spool. A finished kick
waits briefly for the relay to drain the spool before returning.

Closes #14986

Hive-Run: #14986
Hive-Plan: issue-14986 proposal (relay accepts verdict files from the sandbox workspace)
Hive-Spec: #14986#proposal-1-4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
review_request_thread_test.go already declares readReviewResult with the
same signature and behaviour, so the package failed to compile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@Danathar
Danathar force-pushed the feat/relay-sandbox-verdict-14986 branch from c373d38 to eebe283 Compare October 28, 2026 16:20

@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 c373d38)

  1. pkg/github test package does not compile — none of the relay tests in the PR body ran. src/pkg/github/review_request_sandbox_spool_test.go:61 declares readReviewResult(t, reqPath), which already exists with the identical signature and body in src/pkg/github/review_request_thread_test.go:35. CI: build-and-test, golangci-lint, test (rest 3/4) all fail with readReviewResult redeclared in this block / FAIL github.com/hivecommons/hive/pkg/github [build failed]. Fix: delete the duplicate in the new file (lines 61–72); the existing helper is a drop-in.
--- a/src/pkg/github/review_request_sandbox_spool_test.go
+++ b/src/pkg/github/review_request_sandbox_spool_test.go
@@
-func readReviewResult(t *testing.T, reqPath string) ReviewResponse {
-	t.Helper()
-	b, err := os.ReadFile(strings.TrimSuffix(reqPath, ".json") + ".result.json")
-	if err != nil {
-		t.Fatalf("no result file mirrored into the spool: %v", err)
-	}
-	var resp ReviewResponse
-	if err := json.Unmarshal(b, &resp); err != nil {
-		t.Fatal(err)
-	}
-	return resp
-}
-
  1. Sleep ratchet. src/crux/agent/sandbox_review_spool_test.go adds two time.Sleep( calls in TestSandboxExecutorWaitsForTheRelayToDrainTheSpool (the fake-relay goroutine). internal/testutil TestSleepRatchet fails in test (rest 2/4): 200 "time.Sleep(" calls ... above the baseline of 198. Replace the busy-wait with a ticker:
 	go func() {
-		deadline := time.Now().Add(5 * time.Second)
-		for time.Now().Before(deadline) {
+		deadline := time.NewTimer(5 * time.Second)
+		defer deadline.Stop()
+		tick := time.NewTicker(time.Millisecond)
+		defer tick.Stop()
+		for {
 			matches, _ := filepath.Glob(filepath.Join(root, "*", crux.SandboxReviewSpoolRelPath, "r.json"))
 			if len(matches) == 1 {
-				time.Sleep(50 * time.Millisecond)
+				<-time.After(50 * time.Millisecond)
 				consumed.Store(true)
 				_ = os.Remove(matches[0])
 				return
 			}
-			time.Sleep(time.Millisecond)
+			select {
+			case <-deadline.C:
+				return
+			case <-tick.C:
+			}
 		}
 	}()

Advisory (out of scope, non-blocking): hasSandboxReviewSpools (review_request_sandbox_spool.go) only checks for *.json in the manifest dir, while pruning of stale/untrusted manifests happens in loadSandboxReviewSpools. If the manifest dir is ever rejected by untrustedOwnerReason, nothing is pruned and the watcher stays on its short poll cadence indefinitely.

Checked and found sound: LaunchSpec.Env reaches both launchers (sandbox.go:113, kubejob.go:410); fileUID = 0 correctly skips the forge check in AuthorizeReviewRequest (manager.go:1701); nil reviewSpoolHandle is safe through sandboxEnv/awaitDrain/end.

— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

HUMAN DECISION NEEDED — @Danathar: accept that any in-pod agent sharing hive's group can post a review as a sandboxed reviewer via its spool, or require the spool-file owner to be checked before attribution.

Security perspective. Read at head c373d38.

Spooled requests are attributed to the manifest's agent, but any group member can write the spool (high, in-scope)

The pod-local relay resists forgery by requiring the request file's owning UID to be the claimed agent (src/crux/agent/manager.go:1701-1708). This PR disables that for spooled requests — src/pkg/github/review_request_watcher.go:286 overwrites req.Agent with the manifest's agent and :353 sets fileUID = 0, which the authorizer treats as "no owning UID, skip the forge check". The PR body's safety argument is that the manifest is the proof. That holds for the manifest (0700, euid-checked). It does not hold for the spool the request is read from:

  • src/crux/agent/sandbox_review_spool.go:42 creates the spool 0o770, inside a workspace tree that is itself 0o770 (src/crux/agent/sandbox_executor.go:319, src/crux/sandbox/worktree.go:56) under work_dir.
  • src/pkg/github/review_request_sandbox_spool.go:261-276 ingests every *.json in that spool and stages it under hive's uid; the owning uid returned by readRootFile (fi) is discarded.

On a shared-uid host (the deployment the uid map exists for), all agents and hive share one primary group and work_dir is group-writable (/data/agents is drwxrwxr-x dev node here; agents have gid=1000(node)). So while reviewer R has a sandbox kick running, any in-pod agent A — including one whose ACMM level forbids reviewing — can echo '{"repo":…,"number":N,"event":"approve",…}' > <R-workspace>/.hive/review-requests/x.json and the relay posts it as R, passing R's authorization, lane allowlist, and audit attribution. This is a regression of the forge-resistance the review relay currently has, and it is the one property the #14986 contract calls out ("attributed to the owning agent … not from the file contents").

Suggested fix: keep the spool file's owning uid and deny a file owned by a different registered agent; hive's own euid (Podman --userns=keep-id) and an unregistered uid (Job image user) remain acceptable.

--- a/src/pkg/github/review_request_sandbox_spool.go
+++ b/src/pkg/github/review_request_sandbox_spool.go
@@ func (c *Client) ingestSandboxSpool(root *os.Root, rel, staging string, now time.Time) {
 		data, fi, err := readRootFile(root, src, requestMaxBytes)
 		...
+		// Forge check (mirrors the pod-local relay): the spool is group-writable,
+		// so a request owned by a registered in-pod agent other than the manifest's
+		// agent is a forgery, not a sandbox write. Hive's own uid (Podman keep-id)
+		// and an unregistered uid (the Job image's user) are the sandbox's.
+		if uid := fileOwnerUID(fi); uid != os.Geteuid() && c.reviewSpoolOwnerIsOtherAgent(uid) {
+			_ = root.Rename(src, src+".rejected")
+			c.logger.Warn("review-request watcher: REJECTED sandbox spool file (owned by another agent)",
+				slog.String("path", src), slog.Int("uid", uid))
+			continue
+		}

reviewSpoolOwnerIsOtherAgent needs a hook into the manager's uidMap.LookupByUID (an extra authorizer or a func(uid int) (agent string, ok bool) on the Client), and the uid 0 test in review_request_sandbox_spool_test.go would then cover the owner path too. Alternatively, if the operators decide group-writable workspaces already make this moot (an in-pod agent can also inject commits into a sandbox worktree), say so in sandbox-isolation.md so the attribution claim in the PR/changelog is not stronger than the guarantee.

— hive: agent=adjudicator-3 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/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act 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.

Decision needed: @clubanderson should decide whether review requests from sandboxed kicks may bypass the file-UID forge check and be attributed solely by the executor-written spool manifest (crux/agent/manager.go:1701 skips the check when fileUID is 0; review_request_watcher.go:353 forces 0 for spooled requests).

Read the relay half (src/pkg/github/review_request_sandbox_spool.go, the review_request_watcher.go diff) and the authorizer it lands in. The code is careful and I found no defect; what it changes is trust policy, which is a human call.

What this changes, concretely

  • review_request_watcher.go:350-354: a request drained from a sandbox spool has fileUID forced to 0 and req.Agent overwritten from the manifest (:283-286).
  • crux/agent/manager.go:1701: AuthorizeReviewRequest runs the owner-UID forge check only when fileUID > 0, so spooled requests skip it entirely. The push-capability gate, per-head caps, sentinel block and audit trail still apply because the same handleOneReviewRequest runs (review_request_sandbox_spool.go:109).
  • Attribution therefore rests on the manifest in crux.SandboxReviewSpoolsDir, which the sandbox cannot reach; loadSandboxReviewSpools refuses manifests not owned by the relay's uid or group/world-writable (:206), and all spool I/O goes through os.Root opened at the workspace (:105-106) so a planted symlink cannot escape it.
  • Side effect worth knowing: while any manifest is registered, the watcher drops fsnotify and keeps the short poll cadence (review_request_watcher.go:179, :206).

Why a human must decide: this is a new path by which a process the hive deliberately does not trust (a Podman/K8s Job) gets reviews posted under the App installation token, with identity asserted by a file the executor wrote rather than by the kernel. The mechanism is sound as written; whether the hive wants manifest-asserted identity for GitHub writes is a policy question, not a code one. I have not found anything that would block merging on correctness grounds.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@Danathar this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Failing checks:

  • test (rest 2/4)

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (0 waiting): fixes are handed out before new work as soon as you have capacity.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Triage of test (rest 2/4) at eebe283: internal/testutil.TestSleepRatchet fails because src/crux/agent/sandbox_review_spool_test.go adds two new time.Sleep( calls (50ms and 1ms) in a _test.go file, which pushes the repo-wide sleep count above the ratchet baseline. Replace the polling sleeps with a channel/select on a timeout (or testutil wait helpers used elsewhere in the package) and the shard goes green; the base is not implicated.


🐝 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

TestSleepRatchet failed: the spool drain test added two sleeps. Its relay
goroutine now takes the request path from the fake launcher over a
channel instead of polling the workspace; the one remaining hold is a
deliberate negative wait and says so. The four poll loops in
sandbox_executor_test.go use the package's ticker-based waitFor, and the
ratchet baseline drops from 198 to 195.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act labels Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added the stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act label Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@Danathar this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the branch conflicts with the base and needs a rebase

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Your relay session received this as a fix-pr task; your current task is parked (claim kept alive) until this PR is green.

@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 review relay (the hive's GitHub write gate) may accept requests from sandboxed reviewers authenticated by a per-run HMAC key that, on sandbox.runtime: job, is readable by anything with Pods/Jobs read in the namespace (src/docs/sandbox-isolation.md, "Posting reviews from a sandbox", last paragraph).

This extends the review relay — the hive's only GitHub write path — to accept requests from inside a sandbox. I found no defect in the parts I read; the trust decision is the part that needs a person, and the PR is also conflicting with v5 (mergeable_state=dirty) so it needs a rebase before it can land either way.

What I verified at head 59acb97 (I read the relay-side ingestion, the podman env change, the ratchet and the doc; I did not read all 1593 lines):

  • Attribution is relay-owned, not sandbox-asserted. src/pkg/github/review_request_sandbox_spool.go:162-200 reads manifests only from <work_dir>/sandbox-review-spools/, and untrustedOwnerReason (:221-233) rejects a manifest dir or file that is a symlink, not owned by the relay's euid, or group/world-writable. The request's own agent field is overridden by the manifest's (:84-90).
  • Spool reads are confined. Every spool access goes through an os.Root at the workspace; readRootFile (:432-465) Lstats first, sets aside symlinks/FIFOs, opens with O_NONBLOCK (read_untrusted_unix.go:54), and caps at requestMaxBytes.
  • Replay/forgery. sandboxSpoolEnvelope (:313) requires an HMAC over the request with this run's key (min length enforced at :244), and markSpoolMACSeen (:329) refuses a second copy of an accepted MAC. Manifests older than sandboxReviewSpoolMaxAge are refused (:247).
  • Key never on a command line. src/crux/sandbox/sandbox.go:113-120 now passes --env NAME only; the value comes from cmd.Env, which Run sets from the same spec.Env (sandbox.go:66). Podman reads a name-only --env from its own environment, so this works.
  • Sleep ratchet moves down 198 → 195 (src/internal/testutil/sleep_ratchet_test.go:24) — a tightening, not a bypass.
  • Doc states the residual exposures plainly: a group member can delete/alter a spooled request (loses the review, cannot post one), and on runtime: job the key sits in the pod spec.

Open question for the owner, not a finding: whether "agents must not hold Pods read in the namespace" is an acceptable precondition to rely on for the write gate, or whether the key should be delivered another way (e.g. a mounted Secret) before this lands.

— 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

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 review relay may attribute sandbox-spooled reviews by executor manifest + per-kick HMAC key (delivered to the sandbox as the HIVE_REVIEW_SPOOL_KEY env var) in place of the file-owner UID forge check.

Code read looks sound; the trust-model change itself needs an owner's yes.

What I verified in src/pkg/github/review_request_sandbox_spool.go at 59acb97:

  • The spool is only ever touched through an os.Root opened at the workspace (readRootFile/writeRootFile/root.Rename), with Lstat refusing symlinks and non-regular files, so a sandbox-planted symlink cannot redirect a read or write outside its own workspace.
  • The manifest dir and each manifest are checked with untrustedOwnerReason: symlink, non-regular, fileOwnerUID != Geteuid(), or any group/other write bit → ignored. Manifests live under <work_dir>/sandbox-review-spools/ (0700), outside every workspace.
  • A spooled request must be a SandboxReviewEnvelope whose HMAC verifies under the manifest's key (hmac.Equal), and markSpoolMACSeen rejects a replayed MAC; failures are renamed .rejected, never staged. The key is 256 random bits minted per kick (rand.Read) and the manifest refuses keys below sandboxReviewSpoolKeyMinLen.
  • Staged requests then go through the existing processReviewRequestDir with reviewRequestSource{agent: manifest.Agent} overriding the file's agent, so max_reviews_per_head, the lane allowlist, sentinel block, COMMENT-only guard and canary scan apply unchanged — the body's claim matches the code.
  • sleep_ratchet_test.go: baseline lowered 198 → 195; no new time.Sleep added.

The decision a person owns: this is the first path where a review's attribution does not rest on the writing file's UID. It rests on (a) the relay's own 0700 manifest and (b) a secret the sandbox holds in its environment. For sandbox.runtime: job that env var is in the Pod spec, readable by anyone with pod-read in the namespace, and by anything inside the kick that dumps env. Blast radius is bounded to "post a COMMENT review as that one agent during that one kick" — but it is a new trust surface on the write gate, and the documented threat model (src/docs/github-write-surface.md) changes with it.

Also: the branch is CONFLICTING against v5 and sits at stage/072-returned-to-contributor; the rebase is on the author. I have not approved or changed anything.

— hive: agent=reviewer 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/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge:

  • the reviewer swarm returned requires_human @59acb97
  • reviewer question: @clubanderson should decide whether the review relay may attribute sandbox-spooled reviews by executor manifest + per-kick HMAC key (delivered to the sandbox as the HIVE_REVIEW_SPOOL_KEY env var) in place of the file-owner UID forge check.
  • the automerge lane will not merge this unattended

Head: verdict requires_human @59acb97, 63/63 checks green, DCO yes, soak 0s of 30m0s.

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.

@kubestellar-prow kubestellar-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act and removed stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue labels Oct 28, 2026
Resolves the one conflict, src/docs/scale-envelope.md: v5 reworded the
RankActionableIssues citation to "oldest first within each tier" while
this branch had "descending `AgeMinutes`". Both describe the code at
client.go:4780-4790 (tier, then descending AgeMinutes); kept the cited
lines and combined the wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SnzFs53Qcer1xDySyxv1Vj
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act labels Oct 28, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 3e9edae into v5 Oct 28, 2026
77 of 79 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/relay-sandbox-verdict-14986 branch October 28, 2026 20:56
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#14989bb49a5b` sha256:ec2ec0ac2fe021e6719330ef5ad91cd5483808c7693ce8d789f418f97a661d00 — download from the dashboard or `hivectl review evidence #14989`.

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

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

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

@hivecommons-hive hivecommons-hive Bot removed the stage/050-review-pending Review swarm requested; awaiting a verdict for the current head label 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.

HUMAN DECISION NEEDED — @Danathar / @clubanderson: accept the second review-relay ingress where sandbox-spooled requests are attributed by hive-owned manifest + per-kick HMAC (HIVE_REVIEW_SPOOL_KEY) with the file-owner UID check bypassed (fileUID = 0, src/pkg/github/review_request_watcher.go:350-357), in place of the pod-local file-owner forge check.

Delta re-review at bb49a5b (previous head 59acb97), intent-alignment perspective:

  • The delta is solely Merge branch 'v5' (11 v5 commits, 114 files); none of the PR's 20 files changed between heads, so no new scope entered the PR. Previous finding "branch conflicts with v5" is fixed (PR now MERGEABLE).
  • Previous attribution finding (src/pkg/github/review_request_sandbox_spool.go) is unchanged in code and remains the open policy question above. For the decider: #14986 item 2 explicitly asks for attribution "from the Job's sandbox manifest, not from the file contents", so the design matches the issue; what the issue did not pre-decide is dropping the UID check, which the HMAC envelope (bin/hive-review.sh, review_request_sandbox_spool.go sandboxSpoolEnvelope/markSpoolMACSeen) now substitutes for.
  • Diff covers all four bounded items of #14986 (workspace spool via HIVE_REVIEW_REQUEST_DIR, manifest attribution, same handleOneReviewRequest policy path, sandbox.runtime: job documented in src/docs/sandbox-isolation.md); quality/deps lanes untouched. sleep_ratchet_test.go baseline 198→195 follows the sleeps removed from sandbox_executor_test.go, not scope creep.
  • Advisory (non-blocking): the PR body's "Attribution" paragraph still says "the manifest is the proof instead" and omits the per-run MAC added in 59acb97; the changelog fragment changelog.d/added-14986-sandbox-review-spool.md is current. Consider updating the body so the squash message describes the shipped trust model.

— hive: agent=adjudicator-3 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.

Security re-review (delta 59acb97→bb49a5b; read at head bb49a5b)

The delta is a Merge branch 'v5': the PR's own 20-file diff is byte-identical to 59acb97 (diff-of-diffs is empty) and the only conflict resolution is one doc line in src/docs/scale-envelope.md:37. It now merges clean onto v5.

Previous findings at the new head:

  • Relay attribution without file-owner UID — addressed. Spooled files are only staged after the envelope MAC verifies against the per-run key (src/pkg/github/review_request_sandbox_spool.go:289-321, hmac.Equal), with an O_EXCL seen-marker blocking replays (:329-343). The key is 32 random bytes minted per kick (src/crux/agent/sandbox_review_spool.go:59), stored only in the 0700/euid-owned manifest (:243 drops manifests without a ≥32-byte key), and reaches Podman by name only (src/crux/sandbox/sandbox.go:119), so it is not in /proc/*/cmdline. isCredentialName (sandbox.go:154) does not strip HIVE_REVIEW_SPOOL_KEY, so it does reach the sandbox. fileUID = 0 (review_request_watcher.go:356) is now only reachable post-MAC. Group members can still delete/garble a spooled request (DoS, not forgery), as the author documents.
  • Branch conflicts with v5 — fixed by the merge commit.

No new security findings in the delta.

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

Reviewed (docs-currency, delta re-review at bb49a5b) — no in-scope findings.

Delta since 59acb97 is the v5 merge (11 upstream commits + merge commit); the only PR-owned hunk it touched is src/docs/scale-envelope.md:37, a conflict resolution. Previous findings:

  • [correctness] branch conflicts with v5 — fixed by merge commit bb49a5b (mergeable: MERGEABLE; PR squash-merged as 3e9edaec9).
  • [security] review_request_sandbox_spool.go:42 attribution not on file-owner UID — unchanged by the delta (file untouched); the manifest + per-run HMAC spool key design is documented as such in src/docs/sandbox-isolation.md:217-223.

Docs verified against code at head: 24h manifest prune (review_request_sandbox_spool.go:72), .rejected + rejected: result (:280,:347,:354), poll cadence while a spool is registered (review_request_watcher.go, hasSandboxReviewSpools), 60s drain (crux/agent/sandbox_review_spool.go:24), <work_dir>/sandbox-review-spools wiring (manager_sandbox.go:156), env by name only in crux/sandbox/sandbox.go:113-119.

Advisory, out of scope: src/docs/scale-envelope.md:37 is an unrelated one-line rewording (oldest first within each tier → descending AgeMinutes within each tier); it is accurate (src/pkg/github/client.go:4788) and says the same thing, so no action needed.

— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Let a Job-sandboxed reviewer post reviews: relay accepts verdict files from the /data sandbox workspace

1 participant