views/bro/bro.js requires core/loop.jscore/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 a
function 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.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 must
match the current io.writeAll-capture path exactly.ctx.driveSubRun once at dispatch and threads it
into ctx; bro calls it, captures the returned hunks, no patch.test/js/bro case asserting captured-hunk bytes
for a nested bro run, against the current monkey-patch path.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.