Skip to content

refactor: replace WASM plugin system with static DI#12

Merged
markovejnovic merged 7 commits into
mainfrom
refactor/static-di
May 24, 2026
Merged

refactor: replace WASM plugin system with static DI#12
markovejnovic merged 7 commits into
mainfrom
refactor/static-di

Conversation

@markovejnovic
Copy link
Copy Markdown
Contributor

@markovejnovic markovejnovic commented May 24, 2026

No description provided.

Replace the WASM plugin indirection with a native DockerRunner that calls
Bollard directly through RunContext. Merges the orchestration flow from
hm-plugin-docker (cache decision, image resolution, container lifecycle)
with the host-function implementations from docker_host_fns (pull, extract,
exec with StepLogWriter streaming, commit, cleanup).

Key design changes from the plugin system:
- StepLogWriter stores step_id + Arc<EventBus> instead of reading globals
- All long operations (pull, extract, exec) race against CancellationToken
- Container cleanup is unconditional via split run_in_container pattern
- BTreeMap<String,String> env converted to Vec<"K=V"> at call boundary
Rewire the dataflow scheduler to use RunnerRegistry + OutputRenderer
instead of the WASM PluginRegistry. Remove OrchestratorState from the
scheduler (host_fns still use it), replace plugin pool dispatch with
RunContext + StepRunner::execute, and simplify output_subscriber to a
direct renderer loop. Move the ctrl-c signal handler to
orchestrator::signal. local.rs now builds the RunnerRegistry and
renderer at the call site.
Remove the entire Extism/WASM plugin infrastructure:
- Delete plugin module (host, host_fns, pool, registry, embedded, etc.)
- Delete WASM plugin crates (sdk, docker, output-human, output-json, fixtures)
- Delete build.rs (WASM cross-compilation)
- Delete docker_host_fns.rs and state.rs (host-function indirection)
- Delete External CLI variant and external.rs dispatcher
- Simplify cli/plugin.rs to list static runners
- Simplify cli/version.rs (no more plugin API version)
- Remove extism dependency from workspace
- Remove cloud crate from workspace temporarily (pending migration)
- Delete plugin-specific tests and cloud CLI tests
- Fix clippy nursery warnings in output renderers
Convert hm-plugin-cloud from an Extism cdylib WASM plugin to a
regular Rust library crate with direct dependencies:

- Replace extism-pdk HTTP with reqwest (async)
- Replace host::keyring_* with file-backed credentials.toml
- Replace host::kv_* with file-backed cloud-state.json
- Replace host::spawn_loopback with tokio TcpListener
- Replace host::write_stdout/stderr with print!/eprint!
- Replace host::browser_open with webbrowser crate
- Replace host::tty_prompt with dialoguer crate
- Make all verb functions async
- Replace PluginError with anyhow throughout
- Wire CloudCommand into hm binary's CLI enum
- Remove extism-pdk and hm-plugin-sdk dependencies
- Delete protocol modules: error, hook, host_abi, manifest, subcommand
- Remove HM_PLUGIN_API_VERSION constant
- Remove Plugin* error variants from HmError (PluginLoad, PluginManifest,
  PluginMissingHostFn, PluginPanic, PluginTimeout, PluginConflict,
  UnknownVerb) and their exit code categories
- Delete schema snapshot tests and insta dev-dependency
- Remove unused semver, thiserror deps from protocol crate
- Remove unused hm-plugin-protocol, semver deps from cloud crate
- Update CLAUDE.md to reflect static DI architecture
@markovejnovic markovejnovic marked this pull request as ready for review May 24, 2026 05:08
@markovejnovic markovejnovic merged commit ff30a8e into main May 24, 2026
24 checks passed
markovejnovic added a commit that referenced this pull request May 25, 2026
…ss engines

All four workflow files (ci, examples, release) no longer reference
wasm32-wasip1 or build embedded WASM plugins -- those were removed in
PR #12. Integration job now installs croniter + python-dateutil for
the Python DSL subprocess engine. CLAUDE.md files updated to document
the new DSL engine architecture (subprocess-based, no WASM).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant