fix(workflows): build agent preps kernel + fixtures inside its own sandbox (v2 — replaces #64, #65) - #68
fix(workflows): build agent preps kernel + fixtures inside its own sandbox (v2 — replaces #64, #65)#68kjgbot wants to merge 2 commits into
Conversation
…x (replaces #64, #65) PR #64 tried a separate pre-build STEP — cloud steps have per-step sandboxes (ops/BACKLOG.md:688-707), so the binary never reached build-1. PR #65 put the prep in build's prompt but got two real swarm findings: 1. Comment hardcoded kernel/target/debug/relayflowd — PR #38 fixed that pattern; ops/cargo.sh:42-52 redirects builds via CARGO_TARGET_DIR and exposes RELAYFLOWD_BIN. Prompt now references RELAYFLOWD_BIN. 2. `cd kernel && ...` followed by `cd .. && find` broke when the agent ran commands as separate tool calls — cd doesn't persist. Now uses `( cd kernel && sh ../ops/cargo.sh build )` subshell and `find testdata/preflight ...` (no cd needed). Also drops the `|| true` failure-hiders — a silent skip here reproduces the exact stall we're trying to fix.
|
Warning Review limit reachedNext included review available in 25 minutes. View limit detailsLimit details: You’ve used the included review currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (2)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/settings/billing. Comment |
maintainability lens — PASSMaintainability review — PR #68Blockers: none. Concerns
Notes
REVIEW_PASSED |
history lens — FAILBlocker
Concern
Notes
REVIEW_FAILED |
structure lens — PASS→ Read AGENTS.md $ grep -n "RELAYFLOWD_BIN|cargo.sh|preflight|BUILD_DONE" workflows/drive-cloud.yaml workflows/drive.yaml $ wc -l workflows/drive-cloud.yaml workflows/drive.yaml; ls ops/cargo.sh testdata/preflight 2>/dev/null testdata/preflight: → Read workflows/drive-cloud.yaml [offset=205, limit=40] $ ls -la sdk/tests/live-kernel.test.ts 2>/dev/null; echo "---"; grep -rn "RELAYFLOWD_BIN" ops/cargo.sh 2>/dev/null | head
|
…nel failure Codex history lens found: - The "runs 60-63, 65-67 stalled on the 19 failures" claim was too broad. Only #63 explicitly reported the 19 failures; #60-#62 had different blockers, #66 was auth, #67 landed changes. Narrowed to #63. - The "fix the actual failure" wording could authorize out-of-scope kernel repair when ops/NEXT.md excludes it. Changed to STOP without BUILD_DONE on build failure — kernel repair is explicitly out of scope.
maintainability lens — PASSMaintainability Review — PR #68Context checked: Concerns (non-blocking, real maintainability drag)
Notes
Intent is defensible — surface sandbox exec-bit strip loudly before DoD commands confuse the builder — but the implementation puts a load-bearing gate inside a soft contract. Recommend a follow-up that promotes preflight to a REVIEW_PASSED |
history lens — FAILBlocker — fix occurs after the recorded failure. PR #63’s Concern — repeats a recorded trust-in-prose mistake. The three load-bearing commands are agent instructions, while verification remains only Concern — evidence wording is broader than established. The prompt says the sandbox “strips” fixture modes ( Notes. The diff correctly avoids the mistakes in superseded PRs #64/#65: it uses REVIEW_FAILED |
structure lens — PASS→ Read docs/RFC-0001-everything-is-a-relayflow.md $ ls -la /Users/khaliqgant/AgentWorkforce/flows-ops/workflows/ && echo "---NEXT---" && ls -la /Users/khaliqgant/AgentWorkforce/flows-ops/ops/ 2>/dev/null && echo "---CARGO---" && ls -la /Users/khaliqgant/AgentWorkforce/flows-ops/ops/cargo.sh 2>/dev/null → Read workflows/drive-cloud.yaml [offset=160, limit=60] Structure lens review — PR #68Scope. The diff touches only the Blockers. None. Concerns.
Notes. The fail-closed discipline is sound and welcome: "Do NOT swallow errors with REVIEW_PASSED |
|
🎯 review-swarm: FAILED (M:pass H:fail S:pass) Lens transcripts posted as sibling comments above. |
|
Pivoting: swarm found 3rd real issue (assess step parks on red tests before build ever runs, so the in-build preamble was too late). Trying a smaller sdk/package.json pretest hook that fixes assess + build + verify simultaneously. |
… drive loop, replaces #64/#65/#68) (#69) * fix(sdk): build kernel + restore fixture +x before npm test (unblocks drive loop) Root cause the drive loop has been stalling on since PR #63 (2026-08-30): sdk/tests/live-kernel.test.ts requires a built relayflowd binary (ops/cargo.sh's toolchain-external target), and the cloud sandbox does not build it before running npm test. Result: the assessor observes red tests, writes ops/NEEDS_HUMAN.md, assess-gate parks the run, and no build/verify step ever fires. Fix moves the prep INSIDE npm test itself so it's correct for every caller — the drive assessor, drive builder, verify step, and humans on a laptop. Superseded PRs (all closed): - #64: separate pre-build step — steps have per-step sandboxes, prep invisible to build (BACKLOG.md:688-707) - #65, #68: prep in build's task prompt — assess parks first, so build never runs This lands the prep at a lower layer that all three stages hit. * fix(sdk): fail-closed on fixture chmod (address swarm blocker on #69) Both lenses on #69 correctly flagged `2>/dev/null || true` as failure-hiding: fixtures are tracked, chmod errors should surface. Replaced with `[ ! -d ../testdata/preflight ] || find ...` — tolerant of an absent dir, but any real error (missing find, permission denied, typo in flag) fails test:prep loudly. Maintainability lens's exact recommendation. --------- Co-authored-by: kjgbot <kjgbot@agentrelay.dev>
Summary
Third attempt at the same fix. PRs #64 and #65 both got swarm-rejected for legitimate reasons; this PR addresses all of them.
What the diff does
Prepends a preamble to the
buildagent's task inworkflows/drive.yamlso it runs inside the same sandbox asnpm test:Why this replaces #64 and #65
#64 (separate pre-build step) — cloud workflow steps have per-step sandboxes (
ops/BACKLOG.md:688-707), so a kernel binary built in pre-build was invisible to build-1. Codex history lens correctly rejected it.#65 (in-prompt fix, first attempt) — two real bugs the swarm caught:
SDK live-kernel tests exec kernel/target/debug/relayflowd— butops/cargo.sh:42-52explicitly redirects builds viaCARGO_TARGET_DIRand exposes the correct path asRELAYFLOWD_BIN. PR fix: build outside the propagated tree — this is the silent file loss #38 fixed exactly this pattern. Comment removed; prompt now referencesRELAYFLOWD_BIN.cd kernel && sh ../ops/cargo.sh buildfollowed bycd .. && find testdata/preflight— thecddidn't persist between the agent's separate tool calls, sofindsearched the wrong directory and|| truehid the failure. Now uses( cd kernel && ... )subshell and drops the|| truefailure-hiders (per the swarm's own concern that silent skips reproduce the exact stall we're fixing).Test plan
python3 -c "import yaml; yaml.safe_load(open('workflows/drive.yaml')); yaml.safe_load(open('workflows/drive-cloud.yaml'))"— both files parsepython3 ops/gen-drive-cloud.pyregenerated the cloud file cleanly (7 steps)