views/bro/bro.js requires core/loop.js
core/loop -> views/bro/bro -> core/loop is a require cycle broken only by a LAZY in-body require. A leaf view re-entering the whole dispatcher — driving the loop and capturing fd-1 via a monkey-patch of io.writeAll — is a layering inversion: the BRO view should consume a sub-run capability, not own one. Pairs with JS-081 (the fd-1 patch). Method: Issues.
const loop = require("core/loop.js"); inside afunction body — the cycle is only "OK" because it's deferred.
io.writeAll to capture fd 1
(chunks.push(b.data().slice())) around the sub-run.
be/loop.js ENTRY shim self-runs and recurses (JAB-028) — so it must reach for the core/loop.js MODULE, deepening the inversion.
ctx.driveSubRun(argv) returning the captured hunks, so bro consumes an INJECTED callback instead of requiring core/loop.
be bro … output: the captured-hunks stream mustmatch the current io.writeAll-capture path exactly.
bro never imports core — the arrow points down only.
ctx.driveSubRun once at dispatch and threads itinto ctx; bro calls it, captures the returned hunks, no patch.
so a future caller doesn't reintroduce the entry-shim require.
test/js/bro case asserting captured-hunk bytes
for a nested bro run, against the current monkey-patch path.
+ the io.writeAll patch.
views/bro/bro.js:105 in-body
require("core/loop.js") + the io.writeAll global patch (:106-118) persist; no ctx.driveSubRun seam exists. JSQUE-020's opts2.reentry marker mitigates the nested pager (see JS-081) but does NOT break the cycle or remove the monkey-patch.