Summary
Extend ww run to accept multiple positional arguments, each a path (local filesystem or IPFS-family). The runtime merges them into a unified FHS root via per-file union before loading bin/main.wasm.
ww run <path> [<path> ...]
Later arguments override earlier arguments at the file level. Directories merge, files replace. No deletes.
Motivation
This enables overlay patterns where a base image provides defaults and overlays customize specific parts (e.g. swap boot/ peers for local dev without forking the whole image). It also lays the groundwork for --stem integration, where the contract's head CID becomes the base layer.
Design
See docs/architecture.md (on feat/ww-run-image) — "Configuration" and "Layer resolution" sections.
Key rules:
- Per-file union: each layer contributes files, later layers win on conflict
- Directories merge, files replace
- No deletes — to remove something from a lower layer, publish a new version without it
- The union must contain
bin/main.wasm — no single layer needs to be complete
Implementation sketch
- Change
ww run's image: String to images: Vec<String> (one or more positional args)
- Add a
UnionLoader (or LayeredLoader) to src/loaders.rs that stacks multiple image roots and resolves paths top-down
CellBuilder takes the merged root instead of a single path
- Unit tests for layer resolution (override, merge, missing
bin/main.wasm error)
Depends on
Summary
Extend
ww runto accept multiple positional arguments, each a path (local filesystem or IPFS-family). The runtime merges them into a unified FHS root via per-file union before loadingbin/main.wasm.Later arguments override earlier arguments at the file level. Directories merge, files replace. No deletes.
Motivation
This enables overlay patterns where a base image provides defaults and overlays customize specific parts (e.g. swap
boot/peers for local dev without forking the whole image). It also lays the groundwork for--stemintegration, where the contract's head CID becomes the base layer.Design
See
docs/architecture.md(onfeat/ww-run-image) — "Configuration" and "Layer resolution" sections.Key rules:
bin/main.wasm— no single layer needs to be completeImplementation sketch
ww run'simage: Stringtoimages: Vec<String>(one or more positional args)UnionLoader(orLayeredLoader) tosrc/loaders.rsthat stacks multiple image roots and resolves paths top-downCellBuildertakes the merged root instead of a single pathbin/main.wasmerror)Depends on