Skip to content

✨ Sandboxed agents open issues and keep topic claims through the request spool - #18586

Merged
kubestellar-prow[bot] merged 4 commits into
v5from
feat/18572-sandbox-spool-relays
Nov 17, 2026
Merged

kubestellar-prow[bot] merged 4 commits into
v5from
feat/18572-sandbox-spool-relays

Conversation

@clubanderson

Copy link
Copy Markdown
Member

What

The sandbox review spool becomes a typed sandbox request spool. Besides PR reviews it now carries issue and topic requests, so an agent whose kicks run in a Podman or Kubernetes Job sandbox can open, comment on, claim, close and label issues, and keep its one-PR-per-topic claims.

  • Envelope kinds. {"kind": "issue"|"topic", "request": "...", "mac": "..."}. Every kind except review MACs "<kind>\n" + request under the per-kick key, so a request signed as one kind is rejected as any other. The seen-MAC replay guard is shared across kinds, and an unknown kind is set aside as .rejected. A kindless envelope is still a review MACed over the request alone, so hive-review is unchanged and an older copy still works.
  • Issue kind (✨ Sandboxed agents can open and comment on issues through the sandbox request spool (hive-open-issue) #18573). Each kind is staged in its own dir beside the manifest. Issue requests run through handleOneIssueRequestFrom, the pod-local issue handler, with every gate: repo gate, ACMM CanCreateIssues, lane write allowlist, repo pause, repo scope, title dedupe and consolidation, canary scan and audit. They are attributed to the manifest's agent with uid 0. The spool uses the issue authorizer installed through SetSandboxSpoolRelays before the watchers start, and it never reads the issue watcher's field, which another goroutine writes.
  • Topic kind (✨ Sandboxed agents can create and release topic claims through the sandbox request spool #18572). Topic requests are applied to the manifest agent's own bead store by a handler in cmd/hive. The manifest now also records the kick's repo and branch. hive-topic claim <key> without --pr records a pending claim on that branch, and syncTopicClaims binds it to the PR opened from that branch on the next eval cycle. A review-only kick records no branch, so a claim from it needs --pr.
  • Relays. hive-open-issue writes signed requests to the spool when HIVE_SANDBOX_REQUEST_DIR and HIVE_SANDBOX_SPOOL_KEY are set (the HIVE_REVIEW_* names also work). The new hive-topic mirrors bd topic: in the pod it runs bd topic, and in a sandbox it writes to the spool, waits for the reply and uses the same exit codes as bd topic. Both are added to sandbox.RelayNames, so they reach the sandbox PATH through the Podman bind mount and the Job init container. hive-topic is also added to the Dockerfile.

Tests

  • pkg/github/sandbox_spool_relays_test.go: each kind end to end with fakes (issue create, dedupe and comment; topic claim, get, list, release, explicit PR and refusal). Also attribution from the manifest agent, gate refusals (mode gate, fail-closed authorizer, placeholder repo, repo scope, missing topic handler, malformed topic requests), and MAC rejection (review MAC on an issue envelope, another run's key, unknown kind) plus replay.
  • crux: MAC kind binding and kind normalization. crux/agent: the manifest records the repo and branch, the generic env names carry the spool, and review-only kicks have no branch.
  • crux/sandbox, crux/kubejob: the relays are staged and on PATH in the Podman args and the Job init container command.
  • pkg/beads, cmd/hive, pkg/scheduler: pending claims are created, moved and bound, the sync binds them by branch, the topic handler is covered, and the kick shows a pending claim.
  • bin/test_hive_open_issue.sh covers spool signing. The new bin/test_hive_topic.sh is wired into v2-ci.

Docs: src/docs/sandbox-isolation.md, src/docs/beads-cli.md. Changelog: changelog.d/added-18572-sandbox-issue-topic-spool.md.

Fixes #18572
Fixes #18573

cc @joerunde

🤖 Generated with Claude Code

@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 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
#18594 🐛 Meetings: consent posted only on a confirmed delivery; speak it or leave same files src/Dockerfile
#18576 ✨ Owner-only Send to on model-owned stage-tracker rows same files src/cmd/hive/main.go
#18603 ✨ Settings: "Post on other projects as" control for remote write identity same files src/cmd/hive/main.go
#18616 ✨ Review follow-ups, trust-only 090 and issue pr-link notes become status-card sections (quiet mode) same files src/docs/notifications.md
src/pkg/github/notification_write_sites.go
#18617 🌱 ci: no mutation comment on error verdicts; no reopen hint for bot or maintainer reporters same files src/docs/notifications.md
#18592 🐛 Betty closes the loop on deep dives; research agents survive config reloads same files src/cmd/hive/main.go
#18615 ✨ Meetings: delete finished meetings and stale join requests same files src/cmd/hive/main.go
#18604 🌱 ci: size overlayfs-exec-guard timeout for the cold whisper-cache path same files .github/workflows/integration-candidate.yml
.github/workflows/integration-technical-v2-ci.yml
.github/workflows/v2-ci.yml

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Mutation testing

⏱️ The 900s mutation budget ran out, so 1 package(s) were not fully mutated and the results below do not cover them:

  • pkg/scheduler: skipped (not started)

❌ gremlins did not produce a report for 2 package(s), so no verdict can be derived from this run (see the job log):

  • crux: gremlins exited 1
  • pkg/github: gremlins exited 137

gremlins found 1 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.

File Line Mutation
src/pkg/beads/topic.go 263 CONDITIONALS_BOUNDARY

Verdict: error (#17349).

@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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

ℹ️ Sentinel: informational, author is trusted (owner), merge is not blocked. Head 5ae49d9133e9 matched:

  • sensitive_path: changes 4 sensitive path(s) (.github/workflows/integration-candidate.yml, .github/workflows/integration-technical-v2-ci.yml, .github/workflows/v2-ci.yml, src/Dockerfile)

No sentinel-alert label was added. The finding is recorded in the dashboard Security tab and /api/sentinel; set sentinel.trusted_authors_block: true to block trusted authors too.

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

Failing checks:

  • overlayfs-exec-guard

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.

hive/awaiting-ci: rebased onto v5 (dropped the docs-citation refresh commit, which conflicted and is now stale; CI's citation guard will report any remaining drift). CI pending — sweep will merge when green.


🐝 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 force-pushed the feat/18572-sandbox-spool-relays branch from 5ae49d9 to 5ac25bb Compare November 17, 2026 01:58
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 17, 2026
Generalize the sandbox review spool into a typed request spool. Envelopes
now name a kind (review, issue, topic); every kind but review binds its
name into the MAC, so a request signed as one kind is refused as another,
and the seen-MAC replay guard covers all kinds. Kindless envelopes are
reviews MACed as before, so hive-review is unchanged.

- issue requests run through the issue relay's own handler with every
  gate, attributed to the manifest's agent and authorized by the issue
  authorizer installed for the spool.
- topic requests are applied to the manifest agent's bead store. A claim
  without a PR is pending on the kick's branch (now recorded in the
  manifest) and the governor binds it to the PR opened from that branch.
- hive-open-issue writes signed requests to the spool when
  HIVE_SANDBOX_REQUEST_DIR and HIVE_SANDBOX_SPOOL_KEY are set; the new
  hive-topic relay mirrors bd topic and falls back to bd in-pod.
- Both ship on the sandbox PATH (Podman bind mount, Job init container).

Fixes #18572
Fixes #18573

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
…fusal test

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@clubanderson clubanderson added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 17, 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

Copy link
Copy Markdown
Contributor

Review follow-ups (below review.backlog.min_severity: P2)

Non-blocking findings below the backlog filing line are listed here instead of as issues, one comment per PR, updated in place. Tick them off as they are fixed; set review.backlog.min_severity: P3 to file every finding.

  • P3 low correctness — Pending claim can bind to a stale terminal PR if a caller-supplied branch is reused (src/cmd/hive/topic_claims.go:140): bindPendingTopicClaim (src/cmd/hive/topic_claims.go) binds to any PR with a matching HeadRef, including terminal ones, and the next cycle releases the claim. Default branches are timestamped (sandbox…

@kubestellar-prow
kubestellar-prow Bot merged commit 4270b8e into v5 Nov 17, 2026
114 of 116 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/18572-sandbox-spool-relays branch November 17, 2026 03:02
joerunde pushed a commit to joerunde/spyre-inference that referenced this pull request Nov 17, 2026
Checks in the hive `deps` agent's prompt, definition and dependency
targets under `.hive/`, where hive's repo agent discovery looks for
them. The flow is unchanged: bump one dependency group, compile it, open
an issue if that fails, open one PR on success, fix our side when CI is
red, file dependency bugs upstream, recommend a refresh only when a
newer release may fix the bug, never run the test suite and never wait
for CI.

Hive features this now uses, all merged in hive v5:

- `hive-topic claim` from the sandbox, so each group keeps its one-PR
claim (hivecommons/hive#18586).
- `hive-open-issue` from the sandbox for dependency bugs (on
torch-spyre) and compile failures (here). This replaces the `known_bad`
ledger PR. `known_bad` stays in `targets.yaml` as a cap maintainers can
set by hand (hivecommons/hive#18586).
- Fix kicks on the agent's own red bump PR commit on top of it, and
sandbox PRs are credited to `deps`, so red CI kicks `deps` and not
`scanner` (hivecommons/hive#18587). PRs opened before that fix still get
the fix as a patch in the report.
- `${NEW_RELEASES}` from the release-feed watcher
(hivecommons/hive#18507).
- `.hive/agents/` discovery (hivecommons/hive#18505).

Files:

- `.hive/agents/deps.md`: the kick template (`prompt_source`).
- `.hive/agents/deps.yaml`: optional presentation-only definition.
- `.hive/deps/targets.yaml`: dependency groups. Only `deps-torch-spyre`
is enabled.
- `.gitignore`: keeps hive's per-run scratch under `.hive/` ignored and
tracks only `.hive/agents/` and `.hive/deps/`.

This overlaps torch-spyre#1626, which puts the prompt at
`.github/hive/prompts/deps.md` and ignores all of `.hive/`. Its prompt
content is merged into `.hive/agents/deps.md` here. If this lands first,
torch-spyre#1626 can drop its prompt and `.gitignore` hunks.

## Setup after merge (hive owner)

1. **Approve the prompt source.** Settings, Security, Prompt sources. On
the `torch-spyre/spyre-inference` row, click **Approve…** and confirm.
Leave `allow_github_prompt` and `github_prompt_allowlist` alone.
2. **Point the agent at the prompt.** Agents, `deps`, General tab,
**Prompt from GitHub repo**: Owner `torch-spyre`, Repo
`spyre-inference`, File path `.hive/agents/deps.md`, Ref `main`. Save.
Keep the current kick template as the cold-start fallback, and replace
its text with this file so the fallback runs the same flow.
3. **Variables tab** (static, template scope):
- `DEPS_LOCAL_CHECK`: `uv sync --frozen --inexact && uv run --no-sync
python -c 'import torch_spyre, spyre_inference;
print(torch_spyre.__version__)'`
   - `DEPS_MAX_REFRESHES`: `2`
   - `DEPS_UPSTREAM_REPO`: `torch-spyre/torch-spyre`
4. **Cadences tab.** idle, quiet and busy `24h`, surge `pause`.
5. **Optional, release-feed kicks** (YAML only, no Settings control
yet): `governor.release_feeds.agents.deps.sources: [{kind: github_tag,
repo: torch-spyre/torch-spyre}]`, with `cooldown_s: 21600`. Keep the
daily cadence for CI follow-up.
6. **Import tab.** `deps.yaml` will show under "Declared in your repos".
Leave it pending or reject it, because approving it would create a
second `deps` agent.
7. Unpause `deps`.

cc @joerunde

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Andy Anderson <andy@clubanderson.com>
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. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

1 participant