fix(workflows): build kernel + restore +x on preflight fixtures before build-1 (unblocks drive loop) - #64
fix(workflows): build kernel + restore +x on preflight fixtures before build-1 (unblocks drive loop)#64kjgbot wants to merge 1 commit into
Conversation
…e build-1 PRs #60-#63 all shipped as NEEDS_HUMAN docs reporting "19 SDK test failures". A clean checkout run by hand shows the SDK suite is ACTUALLY GREEN (188 passed / 9 skipped / 1 file failed only because kernel/target/debug/relayflowd is not built). The prior agent's attempt to fix sdk/src/ was the wrong direction: the tests are correct, the environment was wrong. Two sandbox faults explain every one of the "19 SDK test failures": 1. The kernel binary the SDK's live-kernel cases exec is never built before build-1's `npm test` runs. verify-1 builds it, but that is AFTER build-1. The SDK cases fail with ENOENT. 2. The sandbox strips +x from tracked scripts (ops/cargo.sh) and testdata/preflight/*-cli fixtures on materialization. Tests that exec a fixture as a CLI get EACCES. verify-1 already documents and repairs the ops/cargo.sh symptom (invoking via `sh`). The fix adds a deterministic `pre-build` step between `assess-gate` and `build` that: * builds the kernel (bounded, fatal on failure — no point continuing without a binary the SDK can exercise); * restores +x on ops/cargo.sh; * restores +x on testdata/preflight/*-cli fixtures; * restores +x on sdk/node_modules/.bin and esbuild binaries if node_modules is already present; * prints PRE_BUILD_READY on success. Also updates ops/gen-drive-cloud.py's BASE_STEPS to include `pre-build` so the new step propagates to workflows/drive-cloud.yaml. Without that one-line change, the fix does not reach the cloud sandbox where the fault actually lives — defeating the entire point of the PR. Files changed: * workflows/drive.yaml — authored the new `pre-build` step * ops/gen-drive-cloud.py — added `pre-build` to BASE_STEPS * workflows/drive-cloud.yaml — regenerated (8 steps total) Verified: both YAML files parse; the pre-build shell command passes `sh -n` syntax check; step ordering is sync -> assess-1 -> assess-gate-1 -> pre-build-1 -> build-1 -> verify-1 -> commit-1 -> handoff.
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds a deterministic pre-build stage to drive workflows. The stage restores executable permissions, builds the kernel with a bounded timeout, reports status, and runs before the build step. ChangesPre-build workflow integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR adds a bounded pre-build workflow step and updates its generator output; no actionable merge-blocking risk remains beyond normal checks and review. Poem
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 #64Concerns1. Kernel build + sandbox repair is now duplicated between 2. Implicit contract that the builder will not modify 3. Silent chmod failures make the OK tokens misleading. Notes
Nothing here is a blocker: the change is a targeted environment repair that unblocks the drive loop, the generator regeneration is right, and the pre-build failure mode is loud where it matters (kernel build fatal, chmods best-effort). REVIEW_PASSED |
history lens — FAILBlockers
Concerns
Notes
REVIEW_FAILED |
structure lens — PASS→ Read AGENTS.md Structure review — PR #64Scope. Adds a Concerns
Notes
No blockers: behavior is fail-closed and the intent (unblock build-1's SDK tests) is correct. The only material issue is shape — duplicated helper logic that belongs in a shared REVIEW_PASSED |
|
🎯 review-swarm: FAILED (M:pass H:fail S:pass) Lens transcripts posted as sibling comments above. |
|
Closing per swarm feedback: codex history lens correctly identified that cloud sandbox steps do NOT share filesystem state (per ops/BACKLOG.md:688-707). A kernel binary built in pre-build stays in the pre-build sandbox and is invisible to build-1. Respinning as an in-build-1 fix. |
… 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>
Diagnosis
The autodrive loop has been stuck. PRs #60, #61, #62, and #63 all
shipped as NEEDS_HUMAN docs reporting "19 SDK test failures" — the
same 19, run after run, with the loop unable to make progress. Prior
attempts to fix
sdk/src/were the wrong direction. A clean checkoutrun by hand shows the SDK suite is ACTUALLY GREEN:
The tests are correct. The environment is wrong.
Root cause: two sandbox faults in the cloud materialization
Kernel binary is never built before
build-1runsnpm test.The SDK's live-kernel cases exec
kernel/target/debug/relayflowd,and
cargo testdoes not produce that binary.verify-1alreadybuilds the kernel, but that runs AFTER
build-1. So build-1'snpm testsees ENOENT on every live-kernel case.The sandbox strips +x from tracked scripts and preflight fixtures
on materialization.
verify-1already documents and repairs thesymptom for
ops/cargo.sh(invokes viash) and forsdk/node_modules/.bin(chmod afternpm ci). Buttestdata/preflight/*-clifixtures are untouched, so any test thatexecs a fixture as a CLI gets EACCES.
Together, these account for every one of the "19 SDK test failures"
seen on PRs #60-#63 — without a single change to
sdk/src/or anytest.
The fix
New deterministic step
pre-buildinserted betweenassess-gateandbuildinworkflows/drive.yaml. It:cd kernel && sh ../ops/cargo.sh build(bounded with the same
run_boundedidiomverify-1uses;failure here is fatal — no point running
build-1without abinary the SDK can exercise).
testdata/preflight/*-clifixtures (guarded so itis a no-op if the dir does not exist).
ops/cargo.shitself (the sandbox strips it).sdk/node_modules/.binand esbuild binaries ifnode_modulesis already present (guarded).PRE_BUILD_READYon success so the step's contract islegible in logs.
build-1'sdependsOnis retargeted fromassess-gate-1topre-build-1.Generator change (required)
ops/gen-drive-cloud.pyhardcodes the per-cycle step list asBASE_STEPS = ["assess", "assess-gate", "build", "verify"]. Withoutadding
pre-buildto that list, the new step never propagates toworkflows/drive-cloud.yaml— and the cloud is exactly where thefault lives. This is a single-line change and it is required for the
fix to reach the sandbox. Cited here per the brief's rule about
modifying the generator.
Files changed
workflows/drive.yaml— authored the newpre-buildstep; retargetedbuild.dependsOn.ops/gen-drive-cloud.py— addedpre-buildtoBASE_STEPS.workflows/drive-cloud.yaml— regenerated. Final step order:sync -> assess-1 -> assess-gate-1 -> pre-build-1 -> build-1 -> verify-1 -> commit-1 -> handoff(8 steps).Validation
python3 -c "import yaml; yaml.safe_load(open('workflows/drive.yaml'))"— passespython3 -c "import yaml; yaml.safe_load(open('workflows/drive-cloud.yaml'))"— passespython3 ops/gen-drive-cloud.py— writes 8 steps, exit 0sh -non the extractedpre-buildcommand — passespre-build-1is betweenassess-gate-1andbuild-1, withbuild-1.dependsOn == ['pre-build-1'].yamllintandactionlintwere not installed in this environment.Not touched
Per brief constraints:
sdk/,kernel/,ops/AUTODRIVE_BRIEF.md,.github/,docs/, and no tests. The generator was modified only forthe single-line
BASE_STEPSupdate, which is required to propagatethe new step.
Not merging
Per brief: this PR is not merged, not force-pushed, not amended, not
rebased. A human owns the merge gate.