refactor: extract neutral host contract and decouple plugin ABI (issue #13)
Implements the core M0-M3 boundary work from issue #13 / ADR-0071 without changing language semantics or any public protocol: - add marqdo-host-contract owning Host/HostOp/ExecutionContext/ResourceRead and the runtime observation facts; the engine depends on it only. - marqdo-runtime no longer links marqdo-host; the native host implements the contract and has no reverse edge to runtime/frontend/IR. - reduce marqdo-plugin-abi to the public C ABI/wire/error contract; move manifest/artifact/loader/worker execution into marqdo-host::plugin so the SDK carries no loader/worker/host dependency. - add a real independent consumer (tests/embedding, own workspace+lock) that runs Markdown -> frontend -> IR -> runtime with bounded budgets and explicit effect refusal, plus differential CLI comparison. - add an SDK-only third-party plugin fixture and real CLI invocation gate. - replace the frozen-crate architecture test with a reviewed responsibility graph enforced from Cargo metadata, with negative unit cases. - consolidate current docs/entry: ADR-0071, CURRENT responsibility map, developers/architecture indexes, historical banners, STATUS and evidence. - record keep-in-workspace for Engine/Native Host; no empty candidate repo. Evidence: docs/evidence/2026-11-26-issue-13-engine-host-boundary.md Refs #13
This commit is contained in:
1 parent
4bbefc9244
commit
d713aa068a
89 files changed
+3490
-545
No files matched your search
+3
-3
@@ -155,7 +155,7 @@ plugin:
|
||||
sha256: "<64 lowercase hex>"
|
||||
```
|
||||
|
||||
Validation (`crates/marqdo-plugin-abi/src/manifest.rs::PluginManifest::validate`):
|
||||
Validation (`crates/marqdo-host/src/plugin/manifest.rs::PluginManifest::validate`):
|
||||
|
||||
* `name`: dotted segments, each starting with a lowercase ASCII letter and
|
||||
containing only lowercase letters, digits, `-`/`_`; ≤ 256 bytes; package
|
||||
@@ -199,7 +199,7 @@ filesystem access (artifact verification is a separate step).
|
||||
|
||||
## 6. Loader lifecycle (host side)
|
||||
|
||||
`crates/marqdo-plugin-abi/src/loader.rs::LoadedPlugin::open_with`:
|
||||
`crates/marqdo-host/src/plugin/loader.rs::LoadedPlugin::open_with`:
|
||||
|
||||
1. `manifest.validate()`;
|
||||
2. require `kind == native` (otherwise `plugin_kind_not_loadable_in_process`);
|
||||
@@ -445,7 +445,7 @@ it (`cc -shared -fPIC -I include`) and rewrites the `sha256` in `plugin.yaml`
|
||||
`examples/plugin-demo/README.md` walks through the security model, build,
|
||||
inspect and call flow.
|
||||
|
||||
The integration test `crates/marqdo-plugin-abi/tests/loader_unix.rs` compiles
|
||||
The integration test `crates/marqdo-host/tests/loader_unix.rs` compiles
|
||||
this exact `solver.c` with `cc`, loads it with `libloading`, round-trips a wire
|
||||
request, and rebuilds it with `-DMQ_SOLVER_REPORT_ABI_MAJOR=2` to prove that a
|
||||
wrong ABI major fails the load. It also covers a missing entry symbol, missing
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ Normative implementation:
|
||||
| Observation events (effects included) | `crates/marqdo-host/src/observe.rs`, `crates/cli/src/observation.rs` |
|
||||
| Foreign adapter | `crates/marqdo-host/src/kernels.rs` |
|
||||
| Foreign child processes | `crates/marqdo-foreign/src/lib.rs` |
|
||||
| Plugin loading / in-process plugin calls | `crates/marqdo-host/src/host.rs` (`load_plugin`, `op_plugin_invoke`), `crates/marqdo-plugin-abi/src/loader.rs` |
|
||||
| Plugin loading / in-process plugin calls | `crates/marqdo-host/src/host.rs` (`load_plugin`, `op_plugin_invoke`), `crates/marqdo-host/src/plugin/loader.rs` |
|
||||
| CLI flags and capability construction | `crates/cli/src/main.rs`, `crates/cli/src/commands.rs` |
|
||||
|
||||
## 1. Modes
|
||||
@@ -331,7 +331,7 @@ inheritance is future work (ADR-0021).
|
||||
* The only plugin transport implemented in this build is **in-process native
|
||||
loading** (`libloading`) after `manifest.validate()`, exact target-triple
|
||||
artifact resolution, sha256 verification, ABI negotiation and export
|
||||
metadata cross-checking (`crates/marqdo-plugin-abi/src/loader.rs`).
|
||||
metadata cross-checking (`crates/marqdo-host/src/plugin/loader.rs`).
|
||||
* Loading requires **three** independent things:
|
||||
1. `--plugin <manifest-or-dir>` names the plugin;
|
||||
2. `--trust-native-plugin` is an explicit unsafe trust decision;
|
||||
|
||||
Reference in new issue
Block a user