refactor(test): add BootScenario and Refusal boot helpers - #85
Merged
Conversation
mfw78
force-pushed
the
refactor/t1-test-manifest
branch
from
August 5, 2026 04:27
67ddd6b to
9d2b291
Compare
mfw78
force-pushed
the
refactor/t2-boot-scenario
branch
from
August 5, 2026 05:04
4f28f18 to
8e52b74
Compare
mfw78
force-pushed
the
refactor/t1-test-manifest
branch
from
August 5, 2026 05:53
9d2b291 to
0a3e96b
Compare
mfw78
force-pushed
the
refactor/t2-boot-scenario
branch
from
August 5, 2026 05:53
8e52b74 to
a86fe8e
Compare
mfw78
force-pushed
the
refactor/t1-test-manifest
branch
from
August 5, 2026 06:37
0a3e96b to
ae5496b
Compare
mfw78
force-pushed
the
refactor/t2-boot-scenario
branch
from
August 5, 2026 06:37
a86fe8e to
3886080
Compare
Collapse the tempdir, write-manifests, engine-config and boot ritual into one builder over the real Supervisor::boot path, with chains, state_dir and clock knobs, a temp-redb plus empty-pool component default, and a Refusal wrapper that centralises error-chain contains assertions behind names and lacks. AI Assistance: Claude (Fable 5) used for implementation and tests
Promote ManifestSource out of the harness so one enum covers a written manifest, an explicit path that may not exist, and no path at all, which is what the discovery refusals need; the harness now shares it instead of keeping a private copy. Give each entry its own component and, for an adapter, its operator http and messaging grants, so a multi-component or granted-adapter boot is expressible. Add the limits and extensions knobs, wiring extensions to both the linker and the boot gates. Drop the duplicate RedbTypes lattice for the CoreRuntime preset, and drop the chains default and knob: Supervisor::boot reads only modules, adapters and limits, so the table was inert and its tests tautological. Pin the clock override on the guest reading back the wall time it booted under, replacing an assertion that held whether or not the override threaded. AI Assistance: Claude Opus 5 used for red-team review, the rework, and mutation testing
AI Assistance: Claude Fable used for the comment sweep.
mfw78
force-pushed
the
refactor/t2-boot-scenario
branch
from
August 5, 2026 07:12
3886080 to
8319dda
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
BootScenario,Entry,BootedandRefusalincrates/nexum-runtime/src/test_utils/scenario.rs, a new 636-line module that collapses the tempdir, write-manifests, engine-config and boot ritual into one builder over the realSupervisor::bootpath.BootScenario::new()roots a scenario on theCoreRuntimepreset with a fresh redb store and an empty provider pool;over()takes caller-suppliedComponents<T>for other lattices.module()/adapter()accept anything convertible intoEntry, and each entry can name its own wasm component plus, for adapters, HTTP and messaging operator grants.boot()builds the linker and callsSupervisor::bootdirectly;expect_refusal()panics if boot succeeds and otherwise wraps the error inRefusal, which centralisesnames/lackscontext-chain assertions.ManifestSourceis promoted out ofharness.rsintomanifest.rsso both the harness and the new scenario share one enum, renamed fromNone/Path/InlinetoBeside/Path/Tomlto describe what each variant does rather than its shape, plus aresolvemethod andFromimpls forTestManifest,StringandPathBuf.test_utils/mod.rsre-exports the newscenariomodule and its public types.Why
Part of #83.
T1 introduced the shared manifest builder; T2 gives the module tree work an equivalent for booting, so later slices in #83 can express a multi-component or granted-adapter boot, or a discovery/path/section refusal, without hand-rolling the tempdir and config wiring each time.
This PR retargets to
mainonce the chain-backend PR ahead of it in the stack merges.Testing
New tests in
test_utils/scenario.rsandtest_utils/manifest.rscover a single-component scenario boot, dispatch and alive-count; two entries with distinct per-entry components booting side by side; a WASI clock override reaching the booted guest via a pinned wall-clock readback; an unknown module capability and an unregistered adapter kind each refusing before compile; a component with no manifest anywhere refusing on the discovery path; a nonexistent explicit manifest path refusing by name; a wired extension claiming a manifest section that an unwired one refuses;expect_refusalpanicking when boot succeeds; the scenario store living under the scenario directory; entries carrying their component, manifest and operator grants throughsplit(); and theManifestSourceresolve/Fromconversions round-tripping forBeside, an explicit path and inline TOML.AI Assistance
Implement claude-fable-5, red-team claude-opus-5, PR claude-sonnet-5