feat(m0.6-r6): release examples, public schemas and cross-platform CI

- add runnable examples for an unknown-name Tool, multi-export plugin,
  external kernel provider and same-name multi-version packages
- add JSON Schemas for Analysis v1, Trace v1 and Tool v1 and validate them in CI
- extend CI with protocol/consumer smoke tests and a Windows/macOS cargo check
- add --kernel provider descriptors and R6 example integration tests
- document the examples and update M0.6 status
This commit is contained in:
cflmy committed 2026-11-20 11:50:27 +08:00
1 parent 54c7b43d15
commit 4ce37afb39
31 files changed
+537 -5

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
# Multi-export plugin example
One native library exports two complete names: `solver.add` and `solver.neg`.
Both are registered and callable; there is no "first prefix wins" namespace.
```sh
./examples/plugin-multi-export/build.sh
marqdo check examples/plugin-multi-export/plugin-call.mq.md \
--plugin examples/plugin-multi-export
marqdo run examples/plugin-multi-export/plugin-call.mq.md \
--plugin examples/plugin-multi-export \
--trust-native-plugin --allow-plugin demo.solver
```
`check --plugin` validates both signatures without loading the library. The
runtime still requires the explicit in-process trust decision; a C ABI is not a
sandbox, and an isolated worker transport is not part of this build.
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
here="$(cd "$(dirname "$0")" && pwd)"
repo="$(cd "$here/../.." && pwd)"
cd "$repo"
cc -std=c11 -O2 -shared -fPIC -I include -DMQ_SOLVER_MULTI_EXPORT \
-o "$here/solver.so" examples/plugin-demo/solver.c
hash="$(sha256sum "$here/solver.so" | cut -d' ' -f1)"
python3 - "$here/plugin.yaml" "$hash" <<'PY'
import pathlib, re, sys
path, digest = sys.argv[1], sys.argv[2]
p = pathlib.Path(path)
text = p.read_text()
text = re.sub(r'(?m)^(\s*sha256:\s*")[0-9a-fA-F]{64}(")', r'\g<1>' + digest + r'\g<2>', text)
p.write_text(text)
PY
echo "built $here/solver.so"
@@ -0,0 +1,9 @@
## main
**和 = solver.add(a=20, b=22)**
**相反数 = solver.neg(a=7)**
> 打印(和)
> 打印(相反数)
+18
View File
@@ -0,0 +1,18 @@
# Two exports under different prefixes, built from the shared C demo with
# -DMQ_SOLVER_MULTI_EXPORT. Installing grants nothing; loading requires trust.
plugin:
name: demo.solver
version: 0.1.0
abi: "^1.0"
kind: native
exports:
- name: solver.add
signature: "($a: Int, $b: Int) -> Int"
- name: solver.neg
signature: "($a: Int) -> Int"
requires:
- math.compute
artifacts:
- target: x86_64-unknown-linux-gnu
file: solver.so
sha256: "0000000000000000000000000000000000000000000000000000000000000000"