Repository navigation
✨ Sandboxed fix kicks push to the agent's own PR; sandbox PRs are credited to their agent - #18587
Merged
Merged
Conversation
A sandboxed fix kick that names one of the agent's open PRs (explicit [hive:target-pr] line, red-PR or red-CI kick header, first FIX-BEFORE-NEW row, or a single topic claim) now checks out that PR's head branch and the push broker adds the kick's commits to it. The push needs the PR open, same-repo, credited to this agent by its agent_pr_created record, still at the checked-out head (re-read before the push and --force-with-lease in the push), and the usual broker scans to pass; otherwise the kick fails with the reason and nothing is pushed. A PR a sandboxed kick opens is credited like a relay-opened PR: attribution trailer, agent_pr_created audit entry and PR-opened hooks through github.Client.CreateAgentPR, or a runtime-emitted agent_pr_created entry when the PR client cannot record it. The governor's head-ref fallback reads the agent out of hive/<agent>/<stamp> work branches. Fixes #18574 Fixes #18575 Signed-off-by: Andy Anderson <andy@clubanderson.com>
Contributor
Open PR overlap check✅ Resolved: no conflicting open PRs or same-file overlaps remain against |
pushbroker.go passed the crux 800-line limit with the lease support. Signed-off-by: Andy Anderson <andy@clubanderson.com>
This was referenced Nov 17, 2026
Contributor
Mutation testing❌ gremlins did not produce a report for 2 package(s), so no verdict can be derived from this run (see the job log):
Verdict: |
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 DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
|
New changes are detected. LGTM label has been removed. |
This was referenced Nov 17, 2026
This was referenced Nov 17, 2026
This was referenced Nov 17, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
#18575: credit sandbox-opened PRs to their agent. The sandbox executor opened its PR through plain
CreatePR, so the PR carried no agent credit. The governor's per-agent signals (FIX-BEFORE-NEW, red-CI kick, review threads, held PRs) read theagent_pr_createdaudit entry, found none, and defaulted toscanner. The head-ref fallback made it worse: it creditedhive/<agent>/<stamp>to an agent namedhive.crux.AgentPRCreator.github.Client.CreateAgentPRruns the same credit steps as the pr-request watcher: the attribution trailer (when on), PR-opened hooks, andagent_pr_created(withvia=sandbox).agent_pr_createdentry through the sandbox audit callback. That entry is never written twice.prFixAgent's branch fallback now readshive/<agent>/<stamp>throughsandbox.WorkBranchAgentSlug.#18574: sandboxed fix kicks push to an existing PR.
SandboxKickSpec.TargetPRis resolved from hive-written kick lines, in this order: an explicit[hive:target-pr <repo>#<n>]first line, the red-PR kick header, the red-CI webhook kick header, the first FIX-BEFORE-NEW row (adopted rows skipped), or a single topic claim. It is set only for kicks that may push, through a client that implementscrux.PRPushTargetReader.[hive:sandbox-target-pr]prompt section.LeaseSHA: commits must descend from it, the scans cover only the kick's commits, and the push carries--force-with-lease=refs/heads/<head>:<sha>. No new PR is opened.ErrSandboxTargetPRRefused, writes asandbox_target_pr_refusedaudit line, and pushes nothing.Tests
crux/agent: success (lease and branch in the push, no new PR, prompt section); refusals for a moved head, a fork, another agent's PR, a non-hive PR, a closed PR, a bad ref, a wrong number, a fetch race, a renamed head, a PR closed during the run, a read error and no reader; scan failure; run-stage refusal; parser table; manager resolution, refusal audit, fallback credit, and no double credit.crux/pushbroker: leased push, a lease that is not an ancestor (refused), a malformed lease, and a lease rejection.pkg/github:CreateAgentPRtrailer, audit and hooks; trailer off; errors;PRPushTarget(own PR, fork, App trailer fallback, a stranger's trailer ignored).pkg/scheduler: regression test. A sandbox-opened PR, credited throughRecordAgentPROpened, resolves to its agent and appears in that agent's FIX-BEFORE-NEW block, not scanner's.cmd/hive:prFixAgentreads the work branch, andauditPRAgentsreads the fallback credit line.Docs:
src/docs/sandbox-isolation.md. Changelog:changelog.d/added-18574-sandbox-existing-pr.md.Fixes #18574
Fixes #18575
cc @joerunde
🤖 Generated with Claude Code