Loop Orchestration
A demo of the pattern the loop-orchestration package describes. The package
is in skill/. Beside it, loop-host.mjs is the outer loop host, an
application script that submits governed runs of that package, and run.sh
runs it. The host is not part of the package.
Run It
sh examples/loop-orchestration/run.sh
The script runs three demonstrations:
- success: two governed runs complete a tiny build-review loop;
- refusal: a requested tool is outside the loop policy, so the loop stops
before another run is submitted;
- context gate: an agent turn pauses with digest-bound skill context and
the tools its allowance names, read from the turn's view that the paused
request points to: what a host or an agent harness would receive, without a
model key.
The output prints each iteration's run id, receipt id, decision, and the
reason for or against another iteration.
Check The Tests
For the package's repeatable tests, use a fresh receipt store, so its
receipts are not mixed with earlier runs'.
tmpdir="$(mktemp -d)"
"${RUNX_BIN:-crates/target/debug/runx}" test examples/loop-orchestration/skill \
--receipt-dir "$tmpdir" \
--json
Adapting The Example
Replace loop-host.mjs with your real orchestrator and keep the same
shape:
load projection -> submit runx run -> read receipt/result -> check stop policy
Do not move product-specific scheduling or state into the kernel. If a loop
needs to wake up later, persist the loop state in the host and submit another
runx run when policy allows.