merge: bring master (issue #13 boundary + SDK revert) into issue #11 Phase A
ci/woodpecker/push/main Pipeline was successful
ci/woodpecker/pr/main Pipeline was successful

This commit is contained in:
cflmy committed 2026-11-26 23:00:32 +08:00
commit f8b82d4143
94 files changed
+3905 -546

No files matched your search

+9 -1
View File
@@ -1,10 +1,18 @@
# Marqdo CLI:语言规范、架构与开发总纲
> **Historical planning input (not current requirements).** This blueprint is an
> archived design baseline, not current architecture or status. The current
> architecture and dependency rules are
> [`architecture/CURRENT.md`](architecture/CURRENT.md) and
> [ADR-0071](adr/0071-engine-host-contract-boundary.md); executed state is
> [`STATUS.md`](STATUS.md). Do not derive a current gate or a crate split from
> this file.
>
> **状态**:架构基线提案 M0.5 / 新仓库实施蓝图(不是已实现功能清单)
> **面向**:语言设计者、编译器/运行时开发者、插件开发者、贡献者及自动化编码智能体
> **日期**:2026-11-20
> **建议仓库位置**:`docs/DEVELOPMENT_BLUEPRINT.md`
> **优先阅读**:本文件 → `spec/` 形式规范 → `tests/conformance/` 金样 → 相关模块源码
> **优先阅读(归档语境)**:本文件 → `spec/` 形式规范 → `tests/conformance/` 金样 → 相关模块源码。当前入口请改用 `docs/architecture/CURRENT.md`、`docs/architecture/RFC-LANG-0002-unified-semantics.md` 与 `docs/developers/README.md`。
> **约定**:**[D]** 已确定的设计方向;**[P]** 本文提出的可实现细节,须经形式化测试和 ADR 批准后冻结;**[F]** 后期能力,不应阻塞首个独立运行版本。
> **语言映射状态(2026-11-21,必读)**:本文档原本是 M0.5/M0.6 期的架构蓝图,其中关于 Markdown 程序角色的描述(旧映射:`Strong`=执行、`Emph`=返回、有序列表=分支、无序列表=循环、引用块=调用、首个独立 CodeSpan=签名)**已被废止,仅作为历史设计记录**。现行唯一语言语义权威是
+80 -2
View File
@@ -115,6 +115,83 @@ Runtime discovery is unchanged: `MARQDO_STDLIB_DIR` (invalid values still fail
hard), then `stdlib/` next to the executable, then the debug-only source
fallback. Phase B is gated on ecosystem issue #2 and the extension replacement
evidence named by issue #11.
## 0.12 Engine / Host Contract boundary — issue #13 (unreleased candidate)
This is an **internal architecture candidate**, not a release. The product
version stays `3.0.0-rc.4`; no new tag or release claim is made. Baseline is
`master` at `4bbefc92449ee480c8a2c89b0308feb4cda8d0e7`; the PR records the exact
candidate SHA and evidence is
[`evidence/2026-11-26-issue-13-engine-host-boundary.md`](evidence/2026-11-26-issue-13-engine-host-boundary.md).
Implemented in the candidate:
- `marqdo-host-contract` owns the only Host trait/HostOp/ExecutionContext/
ResourceRead and runtime observation facts. `marqdo-runtime` depends on it,
never on `marqdo-host` in normal/build edges. `marqdo-host` implements it and
has no reverse dependency on runtime/frontend/IR.
- `tests/embedding` is a real independent Cargo workspace/lock consumer that
builds without the native host, executes the real Markdown→frontend→IR→runtime
path with real fuel/stack/deadline/memory limits and explicit effect
refusals, and matches a real CLI invocation on the same `.mq.md` for `Int` and
structural values.
- `marqdo-plugin-abi` is a contract crate only (C ABI, wire, errors);
manifest/artifact validation, `dlopen` and worker process live in
`marqdo-host::plugin`. `marqdo-plugin-sdk` transitively carries no loader,
worker, host or sandbox dependency.
- `tests/sdk-plugin` builds a third-party plugin with only the public SDK; the
real CLI loads/invokes it with explicit trust/grant and rejects a tampered
artifact digest.
- Dependency direction is enforced from Cargo metadata by
`tools/ci/check_dependency_boundaries.py` (with negative unit cases) and
`cargo test -p marqdo-cli --test architecture_boundaries`.
- The current architecture/developer entry and ADR-0071 record the
**keep-in-workspace** repository decision; no empty candidate repository was
created.
Executed in this environment (Linux x86_64, Rust 1.100): formatting, clippy,
locked workspace tests (**636 passed / 0 failed / 2 ignored**;
baseline `4bbefc9` 633 passed / 0 failed / 2 ignored, so no regression), docs/architecture gates, dependency gate, engine
differential gate and SDK gate PASS. The Windows GNU cross-target compile check
passes; it is not a native Windows runtime claim. Woodpecker PR pipeline #101
for code SHA `9b4f0a0` is **success**, including the `build` step (release
archive from that SHA, archive smoke, frozen external conformance) and the
`minimum-rust` lane; that is same-candidate CI evidence, not a release tag.
Deliberately **UNVERIFIED** here: Windows/macOS native lanes, strict VM, WASM
probe (target std not installed; `E0463`, not a forbidden native dependency)
and performance/RSS. RC.4 evidence is not reused.
Remaining, separately owned work at that snapshot: stdlib Bundle Phase B (issue #11/#12),
SDK physical repository after S07/S08 (**superseded by §0.13 — the split was
reverted and the remote repository deleted**), regex/compression replacement
under ADR-0062, foreign F-B (ADR-0063), platform and strict evidence, and the
Engine/Native Host split only if the ADR-0071 reopening conditions appear.
## 0.13 Plugin SDK remains in the CLI workspace — split reverted (unreleased candidate)
This is an architecture correction, not a product/protocol change. Decision:
[ADR-0073](adr/0073-sdk-stays-in-cli-workspace.md) (supersedes
[ADR-0072](adr/0072-sdk-independent-repository.md)). Evidence:
[`evidence/2026-11-26-issue-15-sdk-split-reverted.md`](evidence/2026-11-26-issue-15-sdk-split-reverted.md).
- The public `cflmy/marqdo-plugin-sdk` repository was **deleted**. The SDK
source is restored as the CLI workspace crate `crates/marqdo-plugin-sdk`, with
the same contract-only dependency graph (`marqdo-plugin-abi` + serde); it is
not a remote repository, mirror or submodule.
- The CLI keeps the atomic plugin-development surface: C header, `spec/`, the
`marqdo-plugin-abi` contract, SDK helpers, fixture and real CLI invocation
test change in one workspace/lock/candidate SHA. No cross-repository `rev`
pin remains.
- `tests/sdk-plugin` and `tools/ci/check_plugin_sdk.py` are restored; the gate
builds the fixture with only the public SDK and invokes it through the real
CLI with explicit trust/grant, rejecting a tampered artifact digest.
- Logical ADR-0071 boundaries are unchanged: the runtime depends only on the
neutral contract, `marqdo-plugin-abi` is a pure contract, loader/worker live
in `marqdo-host::plugin`, CLI is the single assembly point.
- External plugin access is unchanged: the CLI product and public repository
carry the header/spec/SDK/loader; plugin authors compile their plugin, not the
CLI. Engine/Native Host remain in the workspace; no other split is planned.
- ADR-0072 and the old issue-#15 evidence carry Superseded banners. The remote
replica is gone; Git history retains the decision/implementation record.
## 0.10 Closed public Analysis boundary — issue #10 (RC.4 released)
@@ -746,8 +823,9 @@ This is still a **local VM lane**, not a self-hosted GitHub Actions security URL
- Test and documentation migration (review RFC-CM P0/P2):
`crates/cli/tests/docs_consistency.rs` pins one current overview, the
status/index links and SHA-pinned evidence; `crates/cli/tests/architecture_boundaries.rs`
pins the workspace graph, `marqdo-runtime -> marqdo-host`, the bundled stdlib
digest and the stdio/file/TCP endpoints; `crates/cli/tests/stdlib_product.rs`
pins the workspace graph, `marqdo-runtime -> marqdo-host` (historical at that
snapshot; the current edge is `marqdo-runtime -> marqdo-host-contract` under
ADR-0071), the bundled stdlib digest and the stdio/file/TCP endpoints; `crates/cli/tests/stdlib_product.rs`
runs every public stdlib module (`clock/compress/console/csv/datetime/demo/env/format/fs/http/io/json/path/process/random/regex/stream/table/text/utf8`)
through `std:` imports over `stdlib/tests/*.mq.md` resolved from the pinned
Bundle (`crates/cli/tests/support/stdlib.rs`). `tools/pack-stdlib.py`
@@ -0,0 +1,156 @@
# ADR-0071 — Engine / Host Contract / Native Host / CLI boundaries
Status: **Accepted** for the pre-stable 3.0 line (2026-11-26).
Supersedes the historical review-RFC position that a Host contract crate is a
second-step, optional move. It does not supersede the language contract
(ADR-0052 / RFC-LANG-0002), the resource/operation ownership rules (ADR-0062),
the foreign F-A boundary (ADR-0063), the single-contract policy (ADR-0068) or
the explicit stdlib Bundle build input (ADR-0070 where landed). It replaces only
the old architecture-gate constraints that asserted `marqdo-runtime ->
marqdo-host` and a frozen crate count.
## Context
Issue #13 audited the tree at `4bbefc9…` and found:
- the runtime linked the native host (`marqdo-host`) even though the interpreter
already accepted `&mut dyn Host`;
- the `Host` trait, `HostOp` and `StdHost` lived in one module, and
`ResourceRead` sat beside real file/TCP/TLS implementations;
- the plugin ABI crate contained the C contract, the wire envelope, manifest
validation, artifact selection, `dlopen` and the worker process, so the
third-party SDK transitively carried execution-side dependencies;
- old architecture gates froze sixteen crate names and the
runtime-to-native-host edge, so the intended boundary could not be tested;
- historical planning documents competed with the current overview as a source
of truth.
The same audit fixed the scope: one language implementation, one contract per
public boundary, no second interpreter, no new runtime protocol, no mandatory
remote repository split, and no empty candidate repositories. Missing
independent-consumer evidence means "keep in the workspace" is the correct
repository decision.
## Decision
### Responsibilities
| Layer | Owns | Must not own |
|---|---|---|
| Engine | Span, Value, expression, the one Markdown profile, IR, frontend mapping/static binding, Runtime evaluation and `Memory`, and the neutral Host contract | concrete OS I/O, sandbox launch, plugin loading, project filesystem, CLI commands |
| `marqdo-host-contract` | `Host` trait, `HostOp`, `ExecutionContext`, `ResourceRead`, `FrameId`, `ParameterSource`, `LoopTransfer`, `RuntimeObservation` | native implementation, grant policy, the public Observation wire encoding, any wire/RPC protocol |
| Native Host (`marqdo-host` and its sandbox/foreign support crates) | capability broker, resources and handles, OS adapters, budgets/deadlines, observation sink, trusted plugin/provider/foreign execution | language parsing/evaluation, a second static binder, CLI projection |
| `marqdo-plugin-abi` | C ABI v1 layout/assertions, wire envelope and protocol errors | `dlopen`, worker/process management, artifact/manifest file execution, capability grants |
| `marqdo-host::plugin` | manifest/artifact validation, native loading, worker process, invocation dispatch | a second ABI or wire definition |
| `marqdo-plugin-sdk` | third-party developer helpers over the public contract | host, loader, CLI, worker execution, sandbox |
| CLI | arguments, single `project_prepare`, command routing, product Analysis/Observation projection, Tool install/dispatch, Host+Runtime assembly | language evaluation, domain algorithms, a second binding path |
### Dependency rules
- `marqdo-runtime -> marqdo-host-contract` only. The engine crates must not reach
`marqdo-host`, sandbox, foreign, plugin ABI/SDK, worker, package, CLI,
`libloading`, `rustls` or other native/domain dependencies on normal or build
edges.
- `marqdo-host-contract -> marqdo-value, marqdo-span` only.
- The native host may implement the contract and consume the public ABI, but it
must not depend back on runtime, frontend, IR or the CLI.
- The CLI is the only composition root allowed to combine engine + native host +
package. `check`/`inspect` never load a native library, start a worker or
access the network.
- `marqdo-plugin-sdk` consumes only `marqdo-plugin-abi`; it must not depend on a
loader, host, worker process, sandbox or CLI.
- There is no second `Host`/`HostOp`, no second Value encoding, no
`EngineValue`/`HostValue`/`WireIR`, no HTTP/RPC/JSON handshake for the
engine-to-host edge and no `legacy` feature. The Rust trait is an internal
compile-time interface inside one codebase.
### Invariants preserved (not moved, not weakened)
- Fuel, stack depth, deadline, output budget and `Memory` limits stay owned and
checked exactly where they were; replacing the host must not remove a check.
The contract carries the calls, not platform-neutral defaults that silently
grant unlimited budgets.
- Capability grants, resource identity/handles, cleanup, provider registration,
strict isolation, plugin trust, foreign supervision and observation privacy
stay owned by the native host and CLI. `check`/`inspect` stay non-executing.
- Static binding remains single: one registry, one `bind_program_calls`, one
`CallBindingTable`; the runtime never re-resolves names.
- Public protocols are unchanged: Analysis revision 3, Observation revision 1,
Tool revision 1, Plugin ABI 1.0, Value Wire 1, Provider v2, lock v4. Moving
Rust modules is not a protocol change.
- Stdlib runtime contract is unchanged. Phase A/B of issue #11/#12 remain a
separate delivery; the CLI does not gain a second Bundle format or a dev
fallback authority.
### Repository decision
The Engine and Native Host stay in this workspace. Issue #13 §9.2 admission is
not met: there is no real external Engine consumer or independent platform
maintainer, and an empty candidate repository would be a prohibited boundary
violation. This ADR records **keep in workspace** as the legal conclusion and
names the reopening conditions in `docs/architecture/CURRENT.md` §7.
The plugin SDK's physical move is a follow-up: the contract is decoupled now,
and the move requires a clean-directory build against a fixed contract revision
(issue #13 S07/S08). No gitlink/submodule or empty `marqdo-cli-*` repository is
created by this ADR.
## Verification
The acceptance gates are executable, not documentary:
- `tools/ci/check_dependency_boundaries.py` reads Cargo metadata for the
workspace and the independent consumer, checks the reviewed crate allowlist and
the forbidden transitive edges, and is itself covered by
`tools/ci/test_dependency_boundaries.py` negative cases.
- `tests/embedding` is a separate workspace and lock file; it executes a real
`.mq.md` through Markdown → frontend → static binding → runtime with a bounded
test host, and rejects fuel/stack/deadline/memory/resource violations.
- `tools/ci/check_engine_boundary.py` builds and runs that consumer, builds the
real CLI, executes the same file and compares terminal Value Wire results, and
checks the runtime build tree.
- `tools/ci/check_plugin_sdk.py` builds the SDK fixture with the public SDK and
loads it through the real CLI with explicit trust/grant, then rejects a
tampered artifact digest.
- `cargo test -p marqdo-cli --test architecture_boundaries` keeps the semantic
gates (single Host trait, plugin contract split, engine-only consumer, reviewed
HostOp/Value/builtin/resource-operation catalogues) and the existing security
and product checks.
- Evidence for the candidate commit lives in
`docs/evidence/2026-11-26-issue-13-engine-host-boundary.md` and
`docs/STATUS.md`. Platform lanes not executed here stay `UNVERIFIED`; no old
release evidence is reused as a new PASS.
## Rejected alternatives
- **Create `marqdo-engine`/`marqdo-host` remote repositories now.** No real
consumer, no ownership/release boundary, prohibited empty candidates; would
also create a cross-repository atomic-semantics tax.
- **Keep the runtime linked to `marqdo-host` and only rename the crate.** Does
not close the dependency edge; an embedded consumer would still link native
TLS, loading and process code.
- **Move the whole `observe` module or CLI projection into the contract.** The
interpreter needs only the emitted facts; the sink, redaction and public
envelope belong to the host/CLI, and moving them would create a second
protocol centre.
- **Leave manifest/artifact in the ABI crate.** The SDK would transitively keep
`serde_yaml`/digest/native-adjacent code and the contract crate would again own
execution-side choices.
- **Add a compatibility re-export of the old `marqdo_host::{Host, ...}` paths.**
Creates a second active path; all in-tree consumers are updated atomically.
- **Loosen the old gates instead of replacing them.** Security, product,
protocol and negative tests are retained; only the frozen crate-name and
runtime-to-native-host assertions are replaced by the responsibility graph.
## Consequences
- An independent consumer can build and compute without the native host or CLI.
- Adding a host capability does not change engine code; adding an engine semantic
change does not change host code.
- The workspace gains one small contract crate and one plugin module move; crate
count is explicitly not a KPI.
- Unfinished ecosystem work (stdlib Phase B, SDK physical repository, regex/
compression migration, foreign F-B, WASM probe, Windows/macOS/strict evidence)
remains open and honestly recorded; none of it is required to close the core
M0–M4 boundary work.
+108
View File
@@ -0,0 +1,108 @@
# ADR-0072 — Independent `marqdo-plugin-sdk` repository
Status: **Superseded by [ADR-0073](0073-sdk-stays-in-cli-workspace.md)**
(2026-11-26). The independent repository was deleted and the SDK returned to
the CLI workspace; this document is kept as decision history only.
Complements [ADR-0071](0071-engine-host-contract-boundary.md) and implements the
SDK follow-up tracked by issue [#15](https://git.cflmy.cn/cflmy/marqdo-cli/issues/15)
after the contract decoupling of issue #13.
## Context
Issue #13 / ADR-0071 separated the public plugin contract from its execution
side:
- `marqdo-plugin-abi` (CLI repository) now contains only the C ABI v1 layout,
the wire envelope and protocol errors;
- `dlopen`, manifest/artifact file handling, worker management and invocation
dispatch live in `marqdo-host::plugin`;
- `marqdo-plugin-sdk` consumed only the contract and was verified by a real
fixture loaded through the CLI.
The SDK is a leaf with a different consumer group (third-party plugin authors),
a different change cadence and an independent release need. Keeping it in the
CLI workspace made the architecture map imply that the CLI product owns SDK
publication and forced every SDK change through the CLI build. Issue #15
required either fixing the distribution input or recording a blocking ticket.
The CLI repository is public, so a fixed Cargo git `rev` is a fetchable
contract input; there is no need for a submodule, a vendored contract copy or a
second wire implementation.
This is a **deliberate, narrow repository split**, not a mechanical projection
of every crate: engine and native host remain in the CLI workspace (ADR-0071
reopening conditions unchanged), and no empty candidate repository is created.
## Decision
### Topology
| Item | Decision |
|---|---|
| SDK repository | Public `cflmy/marqdo-plugin-sdk` (`main`), own Cargo workspace and lock |
| Contract input | `marqdo-plugin-abi` from `https://git.cflmy.cn/cflmy/marqdo-cli.git` at exact `rev = 2585915e16906dac75f8571bed02e7f6f868c6bc` (the merge commit that landed ADR-0071) |
| CLI dependency on SDK | **None**. CLI normal/build/test lanes do not fetch or build the SDK |
| CLI workspace | `crates/marqdo-plugin-sdk` removed; the SDK is not a workspace member |
| Submodule/gitlink | **Not used** for this split; the SDK leaf must not create a CLI↔SDK identity cycle |
| Acceptance fixture | `tests/fixture` in the SDK repository only; real invocation uses a **frozen released CLI binary** via `tools/check_with_frozen_cli.py` |
| Contract authority | Unchanged: CLI owns the C header, Rust layout, Value Wire and error encodings; the SDK never defines a second contract |
| Publication | SDK releases are versioned independently against a contract generation; bumping the pinned CLI `rev` is a reviewed change |
### Rules
- The SDK repository must resolve and build from a clean clone without the CLI
checkout; only its fixed git dependency may reach the CLI repository.
- It must not depend on `libloading`, a native host, worker execution, sandbox
or CLI code.
- The SDK's fixture is a third-party plugin built with only the public SDK. It
is verified against a frozen CLI archive (same ABI 1.0 contract), not against a
locally rebuilt CLI.
- The CLI repository must not reintroduce the SDK as a workspace member, a
copied source tree or a compatibility path; `tools/ci/check_dependency_boundaries.py`
and `architecture_boundaries.rs` fail if it does.
- The CLI's public contract is authoritative; the SDK repository README and
AGENTS rules point back to `include/marqdo_plugin_abi_v1.h`,
`spec/plugin-abi.md` and the pinned commit.
- The existing security statement remains: a C ABI is not a sandbox, and native
loading requires explicit trust; the SDK grants no capability.
## Verification (candidate)
- SDK repository commit `b31187a` on `main`:
- clean-clone `cargo build --locked` and `cargo test --locked` pass;
- the fixture builds with only the SDK;
- `tools/check_with_frozen_cli.py --marqdo-bin <released marqdo 3.0.0-rc.4>`
returns `Int 42` and rejects a tampered artifact digest.
- CLI candidate removes the SDK crate, fixture and CLI-side gate; workspace
tests, architecture boundaries, docs consistency and dependency gates pass;
the SDK no longer appears in the workspace or lock file.
- Full evidence: `docs/evidence/2026-11-26-issue-15-sdk-independent-repository.md`.
## Rejected alternatives
- **Keep the SDK in the CLI workspace** while calling the contract "decoupled":
leaves two release cadences and ownership in one repo; issue #15 cannot close.
- **Git submodule/gitlink into the CLI repo**: CLI does not consume the SDK, so
a submodule would create an unnecessary recursive identity and checkout
failure mode.
- **Relative path dependency `../cli`**: not an independent build; forbidden by
issue #13 §6.2.
- **Copy `marqdo-plugin-abi`/Value Wire into the SDK repo**: would create a
second contract and wire encoder authority.
- **Publish the contract to a registry first**: no registry/release channel is
approved here; the public git `rev` is the available precise input. A future
published artifact can replace the git `rev` without changing authority.
## Consequences and rollback
- The architecture map now shows one CLI contract producer and one independent
SDK consumer; CLI CI no longer carries SDK-only checks, and SDK CI owns them.
- The SDK remains pinned to a CLI merge commit. Changing the contract or
advancing the pin is a deliberate cross-repository change with its own
evidence; a contract change must land in the CLI first, then the SDK pin is
bumped.
- Rollback is a complete known-good combination: keep the CLI commit and the SDK
pin that were verified together; do not restore a copied SDK or an old ABI.
- External SDK consumers can fetch the public CLI contract today. If a
registry-published contract or a different visibility policy is later chosen,
that is a new ADR, not an implicit change.
@@ -0,0 +1,99 @@
# ADR-0073 — Keep the plugin SDK in the CLI workspace; defer the repository split
Status: **Accepted** (2026-11-26).
Supersedes [ADR-0072](0072-sdk-independent-repository.md).
## Context
ADR-0072 split `marqdo-plugin-sdk` into the public repository
`cflmy/marqdo-plugin-sdk` and pinned it to one CLI contract `rev`. The
implementation itself was technically sound (clean-clone build, frozen-CLI
integration, no second ABI), but a re-evaluation against the pre-stable project's
architecture showed that the **repository boundary was premature**, even though
the **logical contract boundary is correct and stays**.
The relevant facts at this point in the prerelease line:
- the SDK is a small, contract-only consumer (six source files; dependencies are
`marqdo-plugin-abi`, `serde`, `serde_json`);
- plugin ABI 1.0, Value Wire 1 and the C header are frozen; the SDK has no
independent version or release story beyond the ABI generation;
- the C header, `spec/plugin-abi.md`, the `marqdo-plugin-abi` contract, the
loader/worker and the SDK helpers evolve together and are owned by the same
maintainers;
- no registry publication or independent maintenance exists for the SDK;
- the CLI product supports external plugin integration without the SDK (C ABI +
loader are in the CLI), so the SDK is a developer kit, not a runtime feature.
Under issue #13's own criteria, "keep in workspace" is a legal conclusion when
independent consumer/release evidence is absent. The split added a cross-repo
`rev` pin, a second CI lane, a second source location and a documentation
integrity burden (stale in-repo paths, weak entry links) without a current
release or consumer benefit. The CLI's developer-facing contract, header, spec,
SDK and examples should form one atomic change domain.
## Decision
1. **The plugin SDK returns to the CLI workspace** as
`crates/marqdo-plugin-sdk`, a contract-only crate. It keeps its current clean
dependency graph: `marqdo-plugin-abi` + `serde`/`serde_json`; no loader,
worker, host, sandbox or CLI dependency.
2. **The independent repository is deleted.** Its source was restored from CLI
Git history; no second copy of the SDK or contract remains. The SDK must not
be reintroduced as a remote repository or as a submodule in this stage.
3. **Logical boundaries stay exactly as ADR-0071 defined them**: the runtime
depends only on `marqdo-host-contract`; `marqdo-plugin-abi` is a pure
contract; execution-side loader/worker/manifest/artifact live in
`marqdo-host::plugin`; the CLI is the single assembly point.
4. **Atomicity is the priority for the pre-stable line.** ABI layout, header,
spec, contract crate, SDK helpers, fixture and the real CLI invocation test
land in one commit/PR/lock. There is no cross-repository pin to bump and no
second current source tree.
5. **External access remains in the CLI product.** The release archive and
repository carry the C header, public plugin spec, loader/worker and the SDK
source; plugin authors build their plugin against this repository (or use
the header from another language). The CLI itself is not compiled by plugin
users.
6. **Future extraction is a new decision, not an implicit step.** It requires
new evidence: independent SDK release (for example a published contract
artifact), a real non-CLI consumer/maintainer, or a distribution need that
the atomic workspace cannot serve. It then needs a new Accepted ADR and must
not create a CLI↔SDK gitlink cycle.
## Verification
- SDK crate, fixture, CLI-side SDK gate and workspace/lock are restored; the
CLI builds and tests them in the same workspace.
- `tools/ci/check_dependency_boundaries.py` enforces the SDK's contract-only
normal/build dependencies and its presence in the workspace as a reviewed
crate.
- `tools/ci/check_plugin_sdk.py` builds the SDK fixture with only the public SDK
and loads it through the real CLI with explicit trust/grant; a tampered
artifact digest is rejected.
- The remote split repository was deleted after this decision; no temporary
branch was created for the revert.
- Full evidence: `docs/evidence/2026-11-26-issue-15-sdk-split-reverted.md`.
## Rejected alternatives
- **Keep the split because it was already implemented.** Sunk-cost reasoning;
it does not satisfy the "necessary split" criterion for this stage.
- **Keep the remote repository as a mirror/copy.** Two current SDK sources and
a second contract consumer tree are explicitly forbidden; Git history already
preserves ADR-0072's implementation.
- **Make the SDK a submodule of the CLI.** Inverts the dependency direction and
risks the CLI gitlink ↔ SDK → CLI contract cycle; the CLI does not consume
the SDK at build time.
- **Turn the SDK into a prebuilt binary so users need not compile.** Native
plugins are compiled by their authors by definition; the SDK is a source-level
helper. A prebuilt SDK is neither a plugin nor a compiler target.
## Consequences
- One atomic language/plugin-development change domain; one lock and one
candidate SHA for ABI/header/spec/SDK/loader changes.
- External plugin integration keeps working through the CLI's contract and
loader; the SDK is discoverable in the same public repository as the header
and spec.
- The split work remains in Git history (ADR-0072, former PR #16) as decision
history; it is not current architecture.
+8
View File
@@ -73,3 +73,11 @@ Files: `0001`–`0050`, plus:
* [0070](0070-explicit-stdlib-bundle-build-input.md) — Phase A of the stdlib
extraction: one required `--stdlib-dir` build input, one pinned Bundle
identity for tests/perf/release CI; runtime contracts unchanged.
* [0071](0071-engine-host-contract-boundary.md) — Engine / Host Contract /
Native Host / CLI responsibilities, dependency rules, plugin ABI contract split
and the keep-in-workspace repository decision.
* [0072](0072-sdk-independent-repository.md) — **superseded**: the independent
public SDK repository was deleted and the SDK returned to the CLI workspace.
* [0073](0073-sdk-stays-in-cli-workspace.md) — keep the plugin SDK in the CLI
workspace for the pre-stable atomic line; repository split deferred.
+86 -10
View File
@@ -9,6 +9,52 @@ replace `spec/` or a recorded test log.
- This is the **single current overview**. Do not add a second running "current state" file;
update this file, `docs/STATUS.md` and an evidence file together.
## Engine / Host Contract / Native Host boundary (issue #13, ADR-0071)
The language engine is independent of every concrete native platform
implementation. `marqdo-host-contract` owns the only side-effect interface the
runtime knows (`Host`, `HostOp`, `ExecutionContext`, `ResourceRead` and the
runtime observation facts); `marqdo-host` implements it with capabilities,
resources, OS adapters and trusted extension execution; `crates/cli` remains the
single product assembly. The plugin ABI crate is a public contract only: native
loading, artifact/manifest execution and worker processes live in
`marqdo-host::plugin`. The SDK depends on the contract, not on a loader or a
host, and stays in this workspace as a contract-only developer crate
([ADR-0073](../adr/0073-sdk-stays-in-cli-workspace.md)).
The Engine and the Native Host stay in **this workspace**. Issue #13 §9.2
admission for a separate repository is not met yet: there is no real external
Engine consumer outside the in-repo acceptance fixture, and no independent
platform maintainer. A candidate empty `marqdo-engine`/`marqdo-host` repository
would violate the issue's boundary conditions. The decision and its reopening
conditions are recorded in [ADR-0071](../adr/0071-engine-host-contract-boundary.md).
## Workspace crate responsibility map
This is the reviewed allowlist for workspace members. A new crate must be added
here, in `tools/ci/check_dependency_boundaries.py`, and with its dependency edges
in the same change.
| Crate | Layer | Responsibility |
|---|---|---|
| `marqdo-span` | Engine | UTF-8 position and diagnostic base types |
| `marqdo-value` | Engine | `Value`, `RuntimeError`, the one Value Wire encoding |
| `marqdo-expression` | Engine | Expression grammar |
| `marqdo-markdown` | Engine | The only Markdown profile and AST |
| `marqdo-ir` | Engine | IR, function/binding identity, builtin inventory |
| `marqdo-frontend` | Engine | Document mapping, signatures, static binding |
| `marqdo-runtime` | Engine | Evaluator, control flow and `Memory` |
| `marqdo-host-contract` | Engine boundary | Neutral `Host` trait and runtime observation facts |
| `marqdo-host` | Native Host | Capabilities, resources, OS adapters, plugin loader and trusted execution |
| `marqdo-sandbox` | Native Host support | OS isolation probe and strict launch |
| `marqdo-foreign` | Native Host support | Controlled one-shot foreign kernels (F-A) |
| `marqdo-plugin-abi` | Public contract | C ABI v1 layout, wire envelope and protocol errors |
| `marqdo-plugin-sdk` | Public contract consumer | Third-party plugin development helpers |
| `marqdo-worker-ipc` | Shared plumbing | One bounded worker frame transport |
| `marqdo-provider-worker` | Shipped worker | Provider helper process |
| `marqdo-package` | Product support | Project manifest, lock and dependency resolution |
| `marqdo-cli` | Composition root | Arguments, prepare, commands, product projection |
> **Language contract and implementation.** The language contract is
> [RFC-LANG-0002](RFC-LANG-0002-unified-semantics.md) (adopted by ADR-0052) and
> `spec/mapping.md`. The frontend, `marqdo-expression`, IR lowering, runtime and
@@ -159,11 +205,14 @@ Layer rules:
Current Rust dependency edges (documented, not proposed):
```text
marqdo-cli -> marqdo-runtime -> marqdo-host
marqdo-cli -> marqdo-package, marqdo-sandbox, marqdo-frontend, ...
marqdo-cli -> marqdo-runtime -> marqdo-host-contract
marqdo-cli -> marqdo-host, marqdo-package, marqdo-sandbox, marqdo-frontend, ...
marqdo-runtime -> marqdo-ir, marqdo-expression, marqdo-value
marqdo-host -> marqdo-plugin-abi, marqdo-foreign, marqdo-sandbox, marqdo-worker-ipc
marqdo-plugin-abi -> marqdo-worker-ipc
marqdo-host-contract -> marqdo-value, marqdo-span
marqdo-host -> marqdo-host-contract, marqdo-plugin-abi, marqdo-foreign,
marqdo-sandbox, marqdo-worker-ipc
marqdo-plugin-abi -> marqdo-value, serde/serde_json (contract only)
marqdo-plugin-sdk -> marqdo-plugin-abi (contract only)
marqdo-provider-worker -> marqdo-worker-ipc
```
@@ -173,10 +222,13 @@ copy of bounded worker framing, deadlines and process teardown
host, the plugin ABI, or a worker binary; sharing plumbing must not share
capabilities. Foreign kernels and CLI Tools stay outside it.
`marqdo-runtime -> marqdo-host` is the current direction. Do not add a second
execution backend or a `marqdo-stdlib` crate by implication. A future embedded
runtime or a second backend needs the thin `ExecutionPort` contract described in the
review RFC, not a new crate per provider.
`marqdo-runtime -> marqdo-host-contract` is the only engine-to-host edge. The
engine must never link `marqdo-host`, sandbox, foreign, plugin loading or the
CLI in normal/build dependencies. The native host must not depend back on the
runtime/frontend/IR. `tools/ci/check_dependency_boundaries.py` enforces the
transitive graph from Cargo metadata; `tests/embedding` proves a real
platform-neutral consumer. Do not add a second execution backend, a per-provider
crate, or a `marqdo-stdlib` crate by implication.
| Public contract | API (`.mq.md`) | State | Tests |
|---|---|---|---|
@@ -234,6 +286,7 @@ that a phase is complete.
| P0 | **Language syntax migration**: RFC-LANG-0002 single contract | **closed at `9c1723d`**; implementation, stdlib digest, examples and fixtures green; platform/strict evidence remains separate |
| P0 | Stdlib extraction (issue #11): explicit `--stdlib-dir` + one pinned Bundle for tests/perf/release CI | **Phase A implemented** (ADR-0070); Phase B (ecosystem assembly, source removal) waits on ecosystem issue #2 and the extension replacement evidence |
| P0 | Documentation drift between `STATUS.md`, the architecture index and the evidence | being fixed by this migration and the docs gate |
| P1 | Domain service ownership ledger (issue #13 §7): host-held `regex.*` and `compress.*` are ADR-0062 services, not a precedent for new domain operations | **DEFERRED** to the responsible `marqdo-ext-regex`/`marqdo-ext-archive` replacement issues; old entries stay until a real replacement passes authorization/negative tests |
| P1 | `std:fs/file` read/write/copy, metadata/directory, append/read_at/walk are implemented; watch and binary offset reads remain open | open |
| P1 | No file watch or binary `read_at` | open; future Resource Operation extension |
| P1 | JSON/CSV product parsers are implemented with depth bound and multi-value/multi-row; no incremental streaming parser | open |
@@ -271,7 +324,25 @@ that a phase is complete.
current contract, replace in place, reject retired inputs, no compatibility
path or version negotiation, and no version bump without a shape change.
## 7. References
## 7. Repository decision and split admission
| Component | Decision for this round | Reopen condition (issue #13 §9.2) |
|---|---|---|
| Engine (`span`/`value`/`expression`/`markdown`/`ir`/`frontend`/`runtime`/`host-contract`) | **Keep in this workspace** as one atomic semantic-change domain | A real, non-in-repo consumer needs independent build/release, and the semantic change cost is acceptable |
| Native Host (`host`/`sandbox`/`foreign`/plugin loader) | **Keep in this workspace**, dependent on the neutral contract | An independent platform maintainer or second product consumes it; security/conformance can be verified separately |
| `marqdo-plugin-sdk` | **Keep in this workspace** as a contract-only developer crate. The ADR-0072 independent repository was deleted and the source restored ([ADR-0073](../adr/0073-sdk-stays-in-cli-workspace.md)); atomic ABI/header/spec/SDK changes are the priority for the pre-stable line | Independent SDK release/registry publication, a real non-CLI consumer or maintainer, and a new Accepted ADR. No submodule/gitlink |
| Stdlib | Separate issue #11/#12 (Phase A build input); runtime contract unchanged | Ecosystem-assembled Bundle and extension replacement accepted; then retire the in-repo source authority |
| Regex/compression domain services | **DEFERRED** under ADR-0062 ownership; no new domain operation may be added | A separately installable extension replaces the host-held service and the old entries are removed atomically |
| Foreign F-A | Retained; no F-B, session or new transport in this change | Separate ADR and milestone |
No candidate empty `marqdo-engine`, `marqdo-host` or `marqdo-cli-*` repository
is created by this decision. The former independent SDK repository was deleted
under ADR-0073; the SDK is back in this workspace and no remote copy is kept.
Git repository boundaries are ownership and release boundaries, not a mechanical
projection of Cargo crates. The engine, native host and plugin developer kit are
one source tree until the reopening evidence above exists.
## 8. References
- [Architecture index](README.md) — RFC/ADR/evidence history.
- [Protocol convergence policy](PROTOCOL_CONVERGENCE_POLICY.md) — one-contract rules, anti-patterns and review checklist.
@@ -291,7 +362,12 @@ that a phase is complete.
- [ADR-0050: host regex extension](../adr/0050-host-regex-extension.md) — accepted project-mode groups/alternation/captures.
- [ADR-0052: byte-exact HTTP framing](../adr/0051-byte-exact-http-framing.md) — accepted byte-list HTTP/1.1 parser/builder.
- [Compute-machine RFC-0001](../MARQDO_COMPUTE_MACHINE_RFC_0001.md) and [core/stdlib RFC-0002](../MARQDO_COMPUTE_CORE_STDLIB_MIGRATION_RFC_0002.md) — design input.
- [Architecture audit and refactor RFC](Marqdo_CLI_Latest_Architecture_Audit_and_Refactor_RFC.md) — review input for this migration.
- [Architecture audit and refactor RFC](Marqdo_CLI_Latest_Architecture_Audit_and_Refactor_RFC.md) — historical review input; the current boundary decision is ADR-0071.
- [ADR-0071: Engine / Host Contract / Native Host boundaries](../adr/0071-engine-host-contract-boundary.md) — accepted responsibility split and keep-in-workspace decision for issue #13.
- [ADR-0073: Keep the plugin SDK in the CLI workspace](../adr/0073-sdk-stays-in-cli-workspace.md) — current decision: SDK atomicity, no split, no remote copy; supersedes ADR-0072.
- [ADR-0072: Independent SDK repository](../adr/0072-sdk-independent-repository.md) — **superseded** decision history; the repository was deleted.
- [Issue #13 engine/host evidence](../evidence/2026-11-26-issue-13-engine-host-boundary.md) — executed candidate commands and results.
- [Issue #15 SDK split-revert evidence](../evidence/2026-11-26-issue-15-sdk-split-reverted.md) — repository deletion, source restoration and gates.
- [RFC-EXT-0001](RFC-EXT-0001.md) — extensibility closure task specification (implementation status tracked here and in STATUS).
- [ADR-0054: single callable binding](../adr/0054-callable-binding-single-source.md) — one registry/binding pass, runtime dispatch by identity.
- [ADR-0055: resource provider CLI v2](../adr/0055-resource-provider-cli-v2.md) — provider v2 manifest/worker CLI closure and trust boundary.
+10 -1
View File
@@ -8,6 +8,12 @@ input and evidence. It is not a second running-status page.
- Public-contract convergence rules and review checklist:
[`PROTOCOL_CONVERGENCE_POLICY.md`](PROTOCOL_CONVERGENCE_POLICY.md)
([ADR-0068](../adr/0068-single-current-public-contracts.md)).
- **Current internal boundaries:** the Engine / Host Contract / Native Host /
CLI responsibilities, dependency edges, plugin ABI contract split and the
keep-in-workspace repository decision are in
[ADR-0071](../adr/0071-engine-host-contract-boundary.md) and
[`CURRENT.md`](CURRENT.md) §7. Issue #13 closure evidence lives in
[`../evidence/2026-11-26-issue-13-engine-host-boundary.md`](../evidence/2026-11-26-issue-13-engine-host-boundary.md).
- **Current language contract:**
[`RFC-LANG-0002-unified-semantics.md`](RFC-LANG-0002-unified-semantics.md),
adopted by [ADR-0052](../adr/0052-unified-markdown-semantics.md) and
@@ -23,7 +29,7 @@ input and evidence. It is not a second running-status page.
| Document | Status | What it is |
|---|---|---|
| [Unified semantics RFC-LANG-0002](RFC-LANG-0002-unified-semantics.md) | **Adopted and implemented** | Single syntax: heading modes, unified payloads, keyword control flow, breaking migration and acceptance gates. |
| [Architecture audit and refactor RFC](Marqdo_CLI_Latest_Architecture_Audit_and_Refactor_RFC.md) | **Review input (historical)** | Responsibility convergence, stdio/file/stream correctness, CLI/Host split and the migration order at the time. Its language examples predate RFC-LANG-0002. |
| [Architecture audit and refactor RFC](Marqdo_CLI_Latest_Architecture_Audit_and_Refactor_RFC.md) | **Review input (historical)** | Responsibility convergence, stdio/file/stream correctness, CLI/Host split and the migration order at the time. Its language examples predate RFC-LANG-0002 and its "contract crate only later" position is superseded by ADR-0071. |
| [Runtime observability RFC-OBS-0001](RFC-OBS-0001-runtime-observability.md) | **Historical: superseded by Observation (ADR-0068)** | Its event vocabulary and privacy model fed the current [Observation](../../spec/observation.md) contract; the Execution Events v1 name/options are retired. |
| [Compute machine RFC-0001](../MARQDO_COMPUTE_MACHINE_RFC_0001.md) | **Proposed** | Opaque `Memory`, addressable regions, wire/host rejection. Compute semantics are unchanged by the syntax rewrite; its `.mq.md` examples are historical spelling. |
| [Core and stdlib migration RFC-0002](../MARQDO_COMPUTE_CORE_STDLIB_MIGRATION_RFC_0002.md) | **Proposed** | Minimum core, `.mq.md` stdlib and system-capability migration. The stdlib source migration is complete; current status is recorded in ../STATUS.md. |
@@ -77,6 +83,9 @@ The implemented first slices of these RFCs are recorded in `CURRENT.md` and
| Resource operations and core kinds | [0062](../adr/0062-resource-operation-ownership-and-core-kinds.md) | Accepted and implemented; architecture gate pins the reviewed lists |
| Foreign F-A transition | [0063](../adr/0063-foreign-kernel-transition-fa.md) | Accepted: retained F-A primitive; F-B deferred |
| Stable core inventory and external gate | [0064](../adr/0064-stable-core-extension-boundary.md) | Accepted and wired into Linux CI |
| Independent plugin SDK repository | [0072](../adr/0072-sdk-independent-repository.md) | **Superseded by ADR-0073**: repository deleted, SDK restored to the CLI workspace |
| Plugin SDK stays in the CLI workspace | [0073](../adr/0073-sdk-stays-in-cli-workspace.md) | Accepted: atomic pre-stable changes, no split, no remote copy |
| Engine / Host Contract / Native Host / CLI boundaries | [0071](../adr/0071-engine-host-contract-boundary.md) | Accepted and implemented by issue #13: runtime depends on the neutral contract, native host implements it, plugin ABI is contract-only, keep-in-workspace repository decision |
| Manifest-driven Resource Control | [0065](../adr/0065-resource-control-vnext.md) | Proposed |
| Structured Tasks and Channels | [0066](../adr/0066-structured-tasks-v1.md) | Proposed |
| Table physical storage (T1/T2/T3), strict stdin/stderr/file/network resources | — | **Not decided**; do not implement by implication |
+4
View File
@@ -26,6 +26,7 @@ contract (rust:1.100-bookworm, python3-jsonschema, both shipped binaries):
analysis_consumer / observation_consumer / validate_protocols
stream==snapshot assertion (tools/ci/verify_observation_stream.py)
stale-Analysis rejection
dependency-direction gate (tools/ci/check_dependency_boundaries.py)
test (rust:1.100-bookworm, clippy/rustfmt, Node.js 22, MinGW, both binaries):
python3 tools/stdlib/bundle.py (verify the pinned Bundle)
@@ -35,6 +36,9 @@ test (rust:1.100-bookworm, clippy/rustfmt, Node.js 22, MinGW, both binaries):
cargo test --workspace --locked
docs_consistency / architecture_boundaries / stdlib_product
stdlib_product again with MARQDO_TEST_STDLIB_BUNDLE + MARQDO_TEST_BUNDLE_PIN
check_dependency_boundaries.py (Cargo-metadata responsibility graph)
check_engine_boundary.py (independent consumer build/run + CLI differential)
check_plugin_sdk.py (real third-party SDK plugin via the real CLI)
python3 -m unittest discover -s tools/ci -p "test_*.py"
rustup target add x86_64-pc-windows-gnu
cargo check --workspace --all-targets --target x86_64-pc-windows-gnu
+18
View File
@@ -25,6 +25,11 @@ Foreign wire v1, Provider manifest v2, lock v4 and markdown profile
## Recommended reading order
0. [Current architecture](../architecture/CURRENT.md) and
[ADR-0071](../adr/0071-engine-host-contract-boundary.md) — the Engine /
Host Contract / Native Host / CLI responsibility map and dependency rules.
Read this before touching a crate boundary; the historical plans are not
current requirements.
1. [quickstart.md](quickstart.md) — install the archive and run the first
project.
2. [libraries.md](libraries.md) — publish a pure `.mq.md` library and consume
@@ -47,6 +52,19 @@ contracts are the pages above and `spec/`).
Normative contracts live in [`../../spec/`](../../spec/); this directory is a
task-oriented map, not a second specification.
## Internal boundary changes
This page is for third-party consumers. If you change Marqdo CLI itself, the
internal boundary rules are in [ADR-0071](../adr/0071-engine-host-contract-boundary.md)
and [CURRENT.md](../architecture/CURRENT.md) §7. In short: the engine depends
only on `marqdo-host-contract`; the native host implements it; the plugin ABI
crate is a contract (no loader/worker); the CLI is the only assembly point.
Run `python3 tools/ci/check_dependency_boundaries.py`,
`python3 tools/ci/check_engine_boundary.py` and
`python3 tools/ci/check_plugin_sdk.py` with the Rust suits. Do not create an
empty candidate repository for a boundary; a split needs the evidence and a new
ADR.
## Baseline repository
The current implementation and release entry point is
@@ -0,0 +1,107 @@
# Evidence — issue #13 Engine / Host Contract boundary (candidate)
Date: 2026-11-26 (Asia/Shanghai)
Issue: <https://git.cflmy.cn/cflmy/marqdo-cli/issues/13>
Decision: [ADR-0071](../adr/0071-engine-host-contract-boundary.md)
Branch: `architecture/issue-13-engine-host-boundary`
Baseline: `master` at `4bbefc92449ee480c8a2c89b0308feb4cda8d0e7`
Candidate: the merge candidate built from this branch; the PR records the exact
source SHA. This file is not a release approval and does not reuse RC.4 evidence.
## Scope actually landed (M0–M3 core)
| Item | State |
|---|---|
| Neutral `marqdo-host-contract` crate (`Host`, `HostOp`, `ExecutionContext`, `ResourceRead`, `FrameId`, `ParameterSource`, `LoopTransfer`, `RuntimeObservation`) | **implemented** |
| `marqdo-runtime` depends on the contract, not `marqdo-host` | **implemented** (runtime test `marqdo-host` remains a dev-dependency only) |
| `marqdo-host` implements the contract; no reverse dependency on runtime/frontend/IR | **implemented** |
| Independent real consumer `tests/embedding` (own workspace + lock), Markdown→frontend→IR→runtime, bounded test host | **implemented and executed** |
| `marqdo-plugin-abi` reduced to the public contract (C ABI, wire, errors) | **implemented** |
| Loader/worker/manifest/artifact moved to `marqdo-host::plugin` | **implemented** |
| SDK consumes only the contract (no libloading/worker/host) | **implemented** |
| Real SDK plugin built and invoked by the real CLI; tampered digest rejected | **implemented and executed** |
| Dependency-direction gate from Cargo metadata + negative unit cases | **implemented** |
| Current architecture/doc entry, ADR, historical banners, status | **implemented** |
| New remote repository (`marqdo-cli-*`, engine/host) | **deliberately not created** — issue #13 §9.2 admission is not met; keep-in-workspace is recorded in ADR-0071/CURRENT.md §7 |
| Stdlib Bundle Phase B, SDK physical migration, regex/compression migration, foreign F-B | **not in this candidate**; separate issues/decisions, listed in `docs/STATUS.md` |
## Commands and results
All commands were run in this checkout with the repository-local Rust toolchain
(`rustc 1.100.0`, `cargo 1.100.0`) and `--offline` where the environment requires
the warm cache. The candidate source SHA is on the PR; do not copy these results
to a different commit.
| Gate | Command | Result |
|---|---|---|
| Formatting | `cargo fmt --all -- --check` | PASS |
| Clippy | `cargo clippy --workspace --all-targets --locked -- -D warnings` | PASS |
| Rust tests | `cargo test --workspace --locked --offline --no-fail-fast` | PASS — **636 passed / 0 failed / 2 ignored** across 74 test binaries (includes `docs_consistency`, `architecture_boundaries`, `stdlib_product`); baseline `4bbefc9` in a detached worktree is **633 passed / 0 failed / 2 ignored** (no regression; the candidate adds three architecture-boundary tests) |
| Architecture boundaries | `cargo test -p marqdo-cli --test architecture_boundaries --locked` | PASS (15) |
| Docs consistency | `cargo test -p marqdo-cli --test docs_consistency --locked` | PASS |
| Dependency gate | `python3 tools/ci/check_dependency_boundaries.py` | PASS |
| Dependency gate negative cases | `python3 -m unittest tools.ci.test_dependency_boundaries` / `python3 -m unittest discover -s tools/ci` | PASS (54 tool tests) |
| Engine independence and differential execution | `python3 tools/ci/check_engine_boundary.py` | PASS |
| Plugin SDK real consumption | `python3 tools/ci/check_plugin_sdk.py` | PASS |
| Existing product/conformance suites | included in workspace run; stdlib product suite additionally run | PASS |
Behavioral facts from the engine gate:
- the independent consumer returns `sum_to(10) = Int(55)` and a structural
`types(7)` map whose terminal Value Wire bytes equal a real CLI `call
--output json` on the same file;
- the consumer rejects real fuel exhaustion, stack-depth exceedance, expired
deadline, out-of-bounds `Memory` access, a host that grants no external effect
(`permission.denied`), and a host with no resource implementation
(`resource.unsupported`);
- `cargo tree -p marqdo-runtime -e normal,build` in the consumer graph has no
`marqdo-host`, sandbox, foreign or libloading/rustls dependency;
- `marqdo-plugin-sdk` normal tree contains only `marqdo-plugin-abi`,
`marqdo-value` and serialization primitives.
Behavioral facts from the SDK gate:
- `tests/sdk-plugin` builds with only `marqdo-plugin-sdk` as a path dependency;
- the real CLI loads it with `--trust-native-plugin` and
`--allow-plugin sdk.demo` and returns `Int 42`;
- a tampered `sha256` in `plugin.yaml` is rejected with an artifact/sha256
diagnostic.
## CI evidence (remote, same code SHA)
Woodpecker PR pipeline **#101** for commit
`9b4f0a08228e9932bf3b0a8c5cf80e0d04626ccb` finished **success** with every step
green: `clone`, `contract`, `test`, `minimum-rust`, `build`. The `build` step
builds the release binaries, packages the deterministic archive for
`$CI_COMMIT_SHA`, runs the from-archive smoke test and the frozen external
conformance suite, so C11/G05 get same-candidate CI evidence rather than an old
release claim. The first pipeline (#100) failed in one unrelated pre-existing
`provider_cli` test with `ETXTBSY` while executing a freshly copied binary; the
same tree passed on straight rerun (#101), so it is recorded as an environment
flake, not a candidate defect.
This evidence file was updated by a docs-only commit after that code SHA; code
and lock bytes are unchanged by it. The PR check list shows the final run.
## Not verified here (honest state)
| Item | State | Reason / owner |
|---|---|---|
| Minimum Rust 1.89 | **UNVERIFIED** locally | only Rust 1.100 is installed in this environment; the Woodpecker `minimum-rust` lane runs `cargo check --locked --workspace --all-targets` on `rust:1.89-bookworm` |
| Windows GNU cross-target compile | **PASS (cross-check only)** | `cargo check --workspace --all-targets --locked --target x86_64-pc-windows-gnu` finished successfully (pre-existing unrelated warnings); native Windows runtime and the GitHub/Woodpecker native lanes remain the actual platform gate |
| Windows/macOS native runtime | **UNVERIFIED** locally | no native runner here; existing GitHub/Woodpecker lanes remain the gate |
| `wasm32-unknown-unknown` Engine probe (E12) | **UNVERIFIED** | target std not installed and no network here; `cargo check -p marqdo-runtime --target wasm32-unknown-unknown` fails with `E0463: can't find crate for core/std`, i.e. a missing target toolchain rather than a forbidden native dependency. E01 is green, so no P0 violation is implied, but this is not a PASS |
| strict OS-isolation lane | **UNVERIFIED** | needs the disposable VM; `strict` remains fail-closed |
| Performance/RSS budget (G06) | **UNVERIFIED** | shared-node measurement is not valid evidence; no performance claim is made |
| Frozen external conformance / release archive (C11/G05) | **CI PASS at code SHA `9b4f0a0`** | Woodpecker pipeline #101 `build` step: release archive from that SHA, archive smoke, frozen external conformance, PASS. This is not a new release tag. |
| SDK physical repository, stdlib Phase B, regex/compression migration | **DEFERRED** | separate issues; see `docs/STATUS.md` |
## Boundary confirmation
- No new top-level CLI command, no `HostOp`/builtin/Value variant, no second
interpreter, no `legacy` feature, no compatibility re-export of removed
`marqdo_host::{Host, HostOp, ...}` paths.
- Public protocols and their revisions are unchanged. This evidence covers an
internal Rust boundary change, not a protocol migration.
- No remote repository was created or modified for this work beyond pushing the
candidate branch and PR; no empty candidate repository exists.
@@ -0,0 +1,84 @@
# Evidence — issue #15 independent `marqdo-plugin-sdk` repository
> **Superseded.** This snapshot records the (later reverted) ADR-0072 split.
> The SDK is back in the CLI workspace under
> [ADR-0073](../adr/0073-sdk-stays-in-cli-workspace.md); the remote repository
> was deleted. See `2026-11-26-issue-15-sdk-split-reverted.md`. Do not read this
> file as current architecture.
Date: 2026-11-26 (Asia/Shanghai)
Tracking issue: <https://git.cflmy.cn/cflmy/marqdo-cli/issues/15>
Decision: [ADR-0072](../adr/0072-sdk-independent-repository.md)
Parent: issue #13 / [ADR-0071](../adr/0071-engine-host-contract-boundary.md)
## Topology and identity
| Object | Exact identity |
|---|---|
| SDK repository | `cflmy/marqdo-plugin-sdk` (public), `main` at `b31187a` |
| CLI contract input | `marqdo-plugin-abi` from `https://git.cflmy.cn/cflmy/marqdo-cli.git` `rev = 2585915e16906dac75f8571bed02e7f6f868c6bc` (merge of PR #14) |
| CLI candidate | `architecture/sdk-independent-repository`; PR/CI SHA recorded by the PR |
| Frozen CLI acceptance binary | `marqdo` 3.0.0-rc.4 Linux x86_64 release archive, SHA-256 from the release `.sha256` asset |
| ABI | Plugin ABI 1.0 / Value Wire 1 / package + provider formats unchanged |
The SDK repository is its own Cargo workspace and lock. The CLI does not depend
on it, and the SDK does not depend on the CLI checkout, the native host, a
loader/worker, a sandbox or the CLI product.
## SDK repository verification (clean clone, independent of CLI checkout)
Commands run in a fresh `git clone https://git.cflmy.cn/cflmy/marqdo-plugin-sdk.git`
outside this repository:
| Gate | Command | Result |
|---|---|---|
| Locked build | `cargo build --locked` | PASS (contract fetched from the pinned public CLI git `rev`) |
| SDK tests | `cargo test --locked` | PASS (4 unit tests + 1 doc-test, 2 ignored doc examples) |
| Third-party fixture | `cargo build --locked --manifest-path tests/fixture/Cargo.toml` | PASS (built only from the SDK) |
| Frozen CLI invocation (S04/S07) | `python3 tools/check_with_frozen_cli.py --marqdo-bin frozen/marqdo` | PASS — real CLI returns `Int 42` |
| Tampered artifact (S05/S06) | same script, `sha256` replaced | PASS — rejected with artifact/sha256 diagnostic |
The frozen binary was the released 3.0.0-rc.4 archive, not a locally rebuilt CLI;
the plugin ABI is unchanged across the #13 decoupling, which is exactly the
cross-repository compatibility being tested.
SDK repository CI (`.woodpecker/main.yml`) repeats the workspace checks, the
fixture build and the frozen-CLI integration after downloading that released
archive. Enabling the Woodpecker project/webhook for the new repository is a
repository-administration step outside this change; the pipeline definition is
checked in and the same commands were executed manually above.
## CLI repository verification (this change)
| Gate | Command | Result |
|---|---|---|
| Workspace resolution | `cargo check --workspace --locked` | PASS; `marqdo-plugin-sdk` no longer appears in `Cargo.lock` |
| Formatting | `cargo fmt --all -- --check` | PASS |
| Clippy | `cargo clippy --workspace --all-targets --locked -- -D warnings` | PASS |
| Rust tests | `cargo test --workspace --locked --no-fail-fast` | PASS — 631 passed / 0 failed / 0 ignored (the removed SDK 4 unit + 1 doc test now run in the SDK repository; the two previously ignored SDK doc examples moved with them) |
| Architecture boundaries | `cargo test -p marqdo-cli --test architecture_boundaries --locked` | PASS — SDK absence/moved-repository assertion |
| Docs consistency | `cargo test -p marqdo-cli --test docs_consistency --locked` | PASS |
| Dependency direction | `python3 tools/ci/check_dependency_boundaries.py` | PASS — SDK no longer a workspace member; negative case added |
| Tools unit tests | `python3 -m unittest discover -s tools/ci -p "test_*.py"` | PASS |
| Engine differential | `python3 tools/ci/check_engine_boundary.py` | PASS (unchanged) |
Removed from the CLI workspace/repository in the same integration:
- `crates/marqdo-plugin-sdk/` (moved to the independent repository);
- `tests/sdk-plugin/` (fixture moved to `tests/fixture` in the SDK repository);
- `tools/ci/check_plugin_sdk.py` (its superset lives in the SDK repository and
uses a frozen CLI binary);
- workspace/lock entry, architecture/layer docs, CI lane entries and current
developer references.
## Not verified / follow-ups
- **Woodpecker activation** for the new public repository is administrative; the
pipeline definition is committed, but no remote pipeline run is claimed here.
- **Registry publication** of the contract crate is not introduced; the public
CLI git `rev` is the precise, fetchable input. A future published artifact
would be a new decision and would not change contract authority.
- Engine/Native Host remain in the CLI workspace under ADR-0071; this split does
not reopen that decision.
- No second ABI, wire encoder, loader or host copy exists in the SDK repository;
no compatibility/submodule path was added to the CLI repository.
@@ -0,0 +1,62 @@
# Evidence — issue #15 plugin SDK split reverted to the CLI workspace
Date: 2026-11-26 (Asia/Shanghai)
Tracking issue: <https://git.cflmy.cn/cflmy/marqdo-cli/issues/15>
Decision: [ADR-0073](../adr/0073-sdk-stays-in-cli-workspace.md) (supersedes
[ADR-0072](../adr/0072-sdk-independent-repository.md))
Parent: issue #13 / [ADR-0071](../adr/0071-engine-host-contract-boundary.md)
## Decision
Parent CLI contract merge: `2585915e16906dac75f8571bed02e7f6f868c6bc`.
Deleted split repository commits: `b31187a` / `c3134e4` (kept in Git history
of the former repository only; no source copy remains).
The plugin SDK stays in the CLI workspace as a contract-only crate. The public
repository `cflmy/marqdo-plugin-sdk` created by ADR-0072 was deleted; its source
was restored from CLI Git history. The pre-stable line prioritizes atomic
ABI/header/spec/SDK/loader changes in one workspace, lock and candidate SHA.
The logical ADR-0071 boundaries are unchanged.
## Actions executed
| Step | Result |
|---|---|
| Restore `crates/marqdo-plugin-sdk` from CLI history | Restored contract-only crate (`marqdo-plugin-abi` + serde/serde_json); no loader/host/worker dependency |
| Restore workspace member and lock | `cargo check --workspace --all-targets --locked` resolves the SDK in the workspace; `Cargo.lock` contains it again |
| Restore `tests/sdk-plugin` and `tools/ci/check_plugin_sdk.py` | Real fixture/gate back in the CLI; builds only against the public SDK and invokes via the real CLI |
| Restore architecture/dependency/docs references | `architecture_boundaries.rs`, `check_dependency_boundaries.py`, `docs_consistency` paths, README/AGENTS/spec/developer guides point at the in-repo crate again |
| Delete remote `cflmy/marqdo-plugin-sdk` | Authorized by the maintainer; the repository and its branches are gone, no mirror remains |
| No temporary branch | The revert is committed directly on `master` and pushed; old merged feature branches are deleted separately |
| Record superseded history | ADR-0072 and the old issue-#15 evidence carry Superseded banners; ADR-0073 is the current decision |
## Verification (local, Linux x86_64, Rust 1.100)
| Gate | Command | Result |
|---|---|---|
| Formatting | `cargo fmt --all -- --check` | PASS |
| Clippy | `cargo clippy --workspace --all-targets --locked -- -D warnings` | PASS |
| Rust tests | `cargo test --workspace --locked --offline --no-fail-fast` | PASS — **636 passed / 0 failed / 2 ignored** (same as the pre-split workspace) |
| Architecture boundaries | `cargo test -p marqdo-cli --test architecture_boundaries --locked` | PASS |
| Docs consistency | `cargo test -p marqdo-cli --test docs_consistency --locked` | PASS |
| Dependency direction | `python3 tools/ci/check_dependency_boundaries.py` | PASS — SDK back in the reviewed workspace allowlist with contract-only edges |
| SDK real consumption | `python3 tools/ci/check_plugin_sdk.py` | PASS — builds fixture with only the SDK; real CLI returns `Int 42`; tampered digest rejected |
| Engine differential | `python3 tools/ci/check_engine_boundary.py` | PASS |
| Tools unit tests | `python3 -m unittest discover -s tools/ci -p "test_*.py"` | PASS |
Remote CI on the code commit `98d256f`: Woodpecker push pipeline **#112**
success (contract/test/minimum-rust/build) and Gitea commit status `success`.
This evidence-only follow-up does not change code, lock or protocol bytes. No
split repository, mirror or submodule exists after the deletion.
## Current architecture facts
- `marqdo-plugin-abi` is still the pure public contract; loader/worker/manifest/
artifact remain in `marqdo-host::plugin` (ADR-0071).
- `marqdo-plugin-sdk` is a CLI workspace member with normal/build dependencies
only on the contract + serde; the CLI product is the only assembly point.
- Plugin authors get header, spec, SDK, examples and loader from one public CLI
repository/release; they compile their plugin, not the CLI.
- The CLI runtime does not depend on the SDK; external plugin loading remains
available (C ABI header + `--plugin`/`--trust-native-plugin`/`--allow-plugin`
+ worker transport).