refactor: move the plugin SDK to its independent repository (issue #15)
ci/woodpecker/push/main Pipeline was successful
ci/woodpecker/pr/main Pipeline was successful

Implements ADR-0072 and the SDK physical migration tracked by issue #15:

- remove crates/marqdo-plugin-sdk, tests/sdk-plugin and the CLI-side
  check_plugin_sdk.py; the public cflmy/marqdo-plugin-sdk repository now owns
  the SDK workspace, lock, fixture, docs, AGENTS rules and CI definition.
- SDK consumes marqdo-plugin-abi at the exact CLI contract rev
  2585915e16906dac75f8571bed02e7f6f868c6bc; no path/submodule/copied contract.
- CLI does not depend on the SDK and must not re-add it as a workspace member
  or copy; dependency/architecture gates enforce this.
- docs: ADR-0072, CURRENT responsibility map/dependency graph, ADR-0071
  amendment, indexes, README, spec/plugin-abi, CI and developer entries.
- evidence: clean-clone SDK build/tests and real frozen 3.0.0-rc.4 CLI
  invocation (Int 42; tampered digest rejected).

CLI workspace: 631 passed / 0 failed / 0 ignored; fmt/clippy/docs/architecture/
dependency gates green.

Refs #15, #13
This commit is contained in:
cflmy committed 2026-11-26 19:48:24 +08:00
1 parent 2585915e16
commit 3ab4aaa861
35 files changed
+272 -1454

No files matched your search

-2
View File
@@ -33,7 +33,6 @@ tests/
│ ├── warnings/ 2 × warning-model/control fixtures + *.expected.json
│ └── runtime/ 20 × runtime-error fixtures + *.expected.json
├── embedding/ Independent Engine consumer (own workspace + lock)
├── sdk-plugin/ Third-party plugin built only with the public Rust SDK
└── README.md this file
```
@@ -53,7 +52,6 @@ Rust harnesses (all in `crates/cli/tests/`):
| `negative.rs` | Current-syntax diagnostics are **hard errors** (never prose fallbacks): exact sorted `sem.*`/`symbol.*`/`call.*`/`frontmatter.*` code lists, the `sem.inferred_signature` warning model with inert-knowledge controls, and runtime error codes — each asserted in its own suite. |
| `properties.rs` | Blueprint §14.2 prose invariance: inserting/removing pure narration paragraphs never changes the executable function IR (modulo source spans) and diagnostics stay error-free. |
| `embedding/` + `tools/ci/check_engine_boundary.py` | Independent Cargo consumer builds without the native host, executes the real Markdown→frontend→IR→runtime path with bounded budgets and refusal cases, and its terminal Value Wire result matches a real CLI invocation on the same file (issue #13 / ADR-0071). |
| `sdk-plugin/` + `tools/ci/check_plugin_sdk.py` | A third-party plugin builds against only the public SDK, is loaded/invoked by the real CLI with explicit trust/grant, and a tampered artifact digest is rejected. |
| `integration_cli.rs` | Real CLI contract: `init`, `check`, `run`, `call`, `inspect`, `fmt`, multi-module imports/cycles, `lock`/`sync --locked`, plugin inspection and explicitly trusted plugin invocation. |
| `execution_events.rs` | Execution Events v1 black-box contract: pure JSONL, seq/terminal ordering, byte-exact base64 chunks, live delivery before exit, value redaction/selection, trace coexistence, truncation, output budget and broken-pipe failure. |
-198
View File
@@ -1,198 +0,0 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "autocfg"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
[[package]]
name = "itoa"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
[[package]]
name = "marqdo-plugin-abi"
version = "3.0.0-rc.4"
dependencies = [
"marqdo-value",
"serde",
"serde_json",
"thiserror",
]
[[package]]
name = "marqdo-plugin-sdk"
version = "3.0.0-rc.4"
dependencies = [
"marqdo-plugin-abi",
"serde",
"serde_json",
]
[[package]]
name = "marqdo-sdk-plugin-fixture"
version = "0.1.0"
dependencies = [
"marqdo-plugin-sdk",
]
[[package]]
name = "marqdo-span"
version = "3.0.0-rc.4"
dependencies = [
"serde",
]
[[package]]
name = "marqdo-value"
version = "3.0.0-rc.4"
dependencies = [
"marqdo-span",
"num-bigint",
"num-traits",
"serde",
"serde_json",
]
[[package]]
name = "memchr"
version = "2.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
[[package]]
name = "num-bigint"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367"
dependencies = [
"num-integer",
"num-traits",
"serde",
]
[[package]]
name = "num-integer"
version = "0.1.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
dependencies = [
"num-traits",
]
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "proc-macro2"
version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
dependencies = [
"proc-macro2",
]
[[package]]
name = "serde"
version = "1.0.229"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
dependencies = [
"serde_core",
"serde_derive",
]
[[package]]
name = "serde_core"
version = "1.0.229"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.229"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_json"
version = "1.0.154"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
dependencies = [
"itoa",
"memchr",
"serde",
"serde_core",
"zmij",
]
[[package]]
name = "syn"
version = "3.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "thiserror"
version = "2.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "2.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "unicode-ident"
version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
[[package]]
name = "zmij"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
-16
View File
@@ -1,16 +0,0 @@
[package]
name = "marqdo-sdk-plugin-fixture"
version = "0.1.0"
edition = "2021"
publish = false
# Independent workspace: this fixture must build with only the public SDK
# artifacts, exactly as a third-party plugin would.
[workspace]
[lib]
crate-type = ["cdylib"]
path = "src/lib.rs"
[dependencies]
marqdo-plugin-sdk = { path = "../../crates/marqdo-plugin-sdk" }
-5
View File
@@ -1,5 +0,0 @@
## @exec main
`结果 = sdk.add(a=20, b=22)`
`return 结果`
-33
View File
@@ -1,33 +0,0 @@
//! Minimal third-party plugin built only against the public Rust SDK.
//!
//! It exercises the typed wire helpers (`decode_request`, `int_arg`,
//! `success`) and a `Value::Int` result. Real negotiation, loading and
//! invocation are performed by the frozen CLI in
//! `tools/ci/check_plugin_sdk.py`.
use marqdo_plugin_sdk::wire;
use marqdo_plugin_sdk::{mq_plugin_entry, CallContext, PluginError, Value};
fn add(_ctx: &mut CallContext, args: &[u8]) -> Result<Vec<u8>, PluginError> {
let request = wire::decode_request(args)?;
let values = request.typed_args()?;
let a = wire::int_arg(&values, "a")?;
let b = wire::int_arg(&values, "b")?;
wire::success(Some(Value::Int((a + b).into())))
}
fn echo_text(_ctx: &mut CallContext, args: &[u8]) -> Result<Vec<u8>, PluginError> {
let request = wire::decode_request(args)?;
let values = request.typed_args()?;
let text = wire::text_arg(&values, "text")?;
wire::success(Some(Value::text(text)))
}
mq_plugin_entry! {
name: "sdk.demo",
version: "0.1.0",
exports: {
"sdk.add" => "($a: Int, $b: Int) -> Int" => add,
"sdk.echo" => "($text: Text) -> Text" => echo_text,
}
}