feat(web): W-G13 default to Go libweb in CLI, gold, and release

Switch ext add / gold / release builds to scripts/build-web-plugin.sh,
drop the Rust archive from the Cargo workspace, and resolve libweb from
plugins/web/build (and target copies) without MARQDO_WEB_PLUGIN.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-10 20:18:41 +08:00
1 parent 7fab85b389
commit c4a726397d
11 files changed
+222 -1614

No files matched your search

+20 -2
View File
@@ -20,15 +20,26 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Go (web plugin)
uses: actions/setup-go@v5
with:
go-version: "1.23.x"
- name: Install Node (VS Code extension)
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install MinGW for cgo (web.dll)
run: choco install mingw -y
- name: Build release CLI + official plugins
shell: bash
run: |
export PATH="/c/ProgramData/mingw64/mingw64/bin:/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin:$PATH"
cargo build --release
cargo build --release -p marqdo_plugin_web -p marqdo_plugin_agent -p marqdo_plugin_quantum -p marqdo_plugin_linalg
cargo build --release -p marqdo_plugin_agent -p marqdo_plugin_quantum -p marqdo_plugin_linalg
bash ./scripts/build-web-plugin.sh
- name: Checkout extension sources (branch vscode-extension only)
run: git fetch origin vscode-extension && git checkout origin/vscode-extension -- vscode-extension
@@ -153,8 +164,15 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Go (web plugin)
uses: actions/setup-go@v5
with:
go-version: "1.23.x"
- name: Build official plugins (release)
run: cargo build --release -p marqdo_plugin_web -p marqdo_plugin_agent -p marqdo_plugin_quantum -p marqdo_plugin_linalg
run: |
cargo build --release -p marqdo_plugin_agent -p marqdo_plugin_quantum -p marqdo_plugin_linalg
bash ./scripts/build-web-plugin.sh
- name: Package native zip
run: |
Generated
+29 -1384
View File
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -57,11 +57,12 @@ chrono = { version = "0.4", default-features = false, features = ["alloc", "std"
members = [
"plugins/demo",
"plugins/agent",
"plugins/web-rust-archive",
"plugins/quantum",
"plugins/linalg",
"crates/marqdo-wasm",
]
# Official web plugin is Go (`plugins/web/`); Rust sources kept as
# `plugins/web-rust-archive/` for reference (not a workspace member).
resolver = "2"
[dev-dependencies]
+4 -2
View File
@@ -35,9 +35,11 @@ and get both L1 `.mq.md` **and** the matching native plugin (`.dll` / `.so`) **w
### Resolution order (`add` with native crate)
1. Local artifact (`MARQDO_*_PLUGIN`, `target/{debug,release}`, beside `marqdo`, `MARQDO_EXT_SOURCE/native`, …)
1. Local artifact (`MARQDO_*_PLUGIN`, `plugins/web/build` for **web**, `target/{debug,release}`, beside `marqdo`, `MARQDO_EXT_SOURCE/native`, …)
2. **Download** `marqdo-{VER}-native-{target}.zip` from the GitHub Release for this CLI version → cache under `~/.marqdo/cache/`
3. If Rust/`cargo` is available → `cargo build -p marqdo_plugin_*` (developers)
3. Local rebuild fallback:
- **web** → `./scripts/build-web-plugin.sh` (Go c-shared `libweb`; requires Go 1.22+ / cgo)
- other plugins → `cargo build -p marqdo_plugin_*` when Rust/`cargo` is available
4. Else fail with a clear message pointing at the Release assets
L1 sources:
+12 -10
View File
@@ -347,7 +347,7 @@ plugins/web/ # Go module(替换原 Rust crate)
scripts/build-web-plugin.sh # go build -buildmode=c-shared -o …/libweb.so
```
原 Rust 源码:迁移期可暂存 `plugins/web-rust-archive/` 或 git 历史保留;**默认构建不再 `cargo build -p marqdo_plugin_web`**。
原 Rust 源码:`plugins/web-rust-archive/`(**已移出 Cargo workspace**;参考用,默认不构建)。
### 9.2 产物与解析
@@ -367,7 +367,9 @@ scripts/build-web-plugin.sh # go build -buildmode=c-shared -o …/libweb.so
| 组件 | 变更 |
|------|------|
| 根 `Cargo.toml` workspace | 移除 `plugins/web` Rust member |
| `tests/gold.rs` | `cargo build -p marqdo_plugin_web` → 调用 `scripts/build-web-plugin.sh` |
| `tests/gold.rs` | `ensure_web_plugin_built()` → `scripts/build-web-plugin.sh` |
| Release 脚本 | Go:`scripts/build-web-plugin.sh`;其它插件仍 `cargo build -p …` |
| `marqdo ext add web` | 构建回退:有 Go 则 `go build`;Release 仍下发预编译 native zip |
| Release 脚本 | 增加 Go 交叉/本机编译 `libweb` 打包步骤 |
| [ext-cli.md](ext-cli.md) / [ext-abi.md](ext-abi.md) | 注明 web 插件实现语言为 Go |
@@ -398,7 +400,7 @@ scripts/build-web-plugin.sh # go build -buildmode=c-shared -o …/libweb.so
| **W-G10** | proxy + invoke + nested plugin | ✅ `web-proxy-invoke` / hosting live |
| **W-G11** | 定制 C2–C4 shell/layout/style/nav | ✅ `web-c2`–`c4` |
| **W-G12** | G 增强 WS rooms + Redis session/pubsub + API key 原语 | ✅ 单测 + `web-g12-api-key-smoke` |
| **W-G13** | 默认切换 Go `libweb`;归档 Rust;更新发版与 ext CLI | 全量 `tests/ext/web-*` 绿 |
| **W-G13** | 默认切换 Go `libweb`;归档 Rust;更新发版与 ext CLI | ✅ 离线 `tests/ext/web-*`(有 `# main`)全绿;`ext add`/`gold`/`release` 走 `scripts/build-web-plugin.sh`;Rust 移出 workspace |
| **W-G14** | anlian Marqdo 重写主路径(可分仓或 `examples/anlian-mq/`) | §8 矩阵主路径可演示 |
每波次:**先补 Go 实现 → 跑对应 gold → 再进入下一波**。禁止跨波次留下「注册了但返回 stub 错误」的 ABI(除 W-G0 明确的未实现探测)。
@@ -433,14 +435,14 @@ scripts/build-web-plugin.sh # go build -buildmode=c-shared -o …/libweb.so
实现推进时同步:
- [ ] 本文状态行随波次更新
- [ ] [ext-abi.md](ext-abi.md) Demo/Web 节:实现语言 Go
- [ ] [ext-cli.md](ext-cli.md):构建回退含 `go build`
- [ ] [ext-web.md](ext-web.md):链到本文;C5 落实说明
- [x] 本文状态行随波次更新
- [x] [ext-abi.md](ext-abi.md) Demo/Web 节:实现语言 Go
- [x] [ext-cli.md](ext-cli.md):构建回退含 `go build` / `scripts/build-web-plugin.sh`
- [x] [ext-web.md](ext-web.md):链到本文;C5 落实说明
- [ ] [web-asgi-servers-and-marqdo.md](web-asgi-servers-and-marqdo.md):axum → Go `net/http`
- [ ] [doc/README.md](../README.md) 索引行
- [ ] ADR:`doc/adr/0004-web-plugin-go.md`(Accepted)
- [ ] `plugins/web/README.md` 开发者构建说明
- [ ] [doc/README.md](../README.md) 索引行(若尚未链到本文)
- [x] ADR:`doc/adr/0004-web-plugin-go.md`(Accepted)
- [x] `plugins/web/README.md` 开发者构建说明
---
+1 -1
View File
@@ -541,7 +541,7 @@ submit → action=insert → db.insert;action=update → db.update
|----|----|------|
| Marqdo 核心 | 表→Value、类/方法、import | 不识别 web 路径语法 |
| `ext/web/*.mq.md` | 作者 API、中英面、委托插件 | 不直接 `host_*` |
| `plugins/web` | 路径解析辅助、装配结果、listen、SQL、渲染 | 不要求作者写袋 |
| `plugins/web` | **Go** `libweb`(HTTP / SQL / HTML 壳;见 [ext-web-go-rewrite.md](ext-web-go-rewrite.md)) | 不要求作者写袋 |
**实现要点(评审通过后再做):**
+9
View File
@@ -0,0 +1,9 @@
# web-rust-archive
Former Rust/axum implementation of the Marqdo web plugin (`marqdo_plugin_web`).
**Status (W-G13):** archived reference only. The official plugin is Go under
[`plugins/web/`](../web/). This crate is **not** a Cargo workspace member and is
not built by CI or `marqdo ext add web`.
Do not evolve features here — see [ext-web-go-rewrite.md](../../doc/design/ext-web-go-rewrite.md) C5 / ADR 0004.
+9 -5
View File
@@ -2,22 +2,26 @@
施工图:[doc/design/ext-web-go-rewrite.md](../../doc/design/ext-web-go-rewrite.md) · ADR:[0004](../../doc/adr/0004-web-plugin-go.md)
**Default native web plugin (W-G13).** `plugin.native_path name=web` resolves `plugins/web/build/libweb.so` (and copies under `target/{debug,release}/`).
## Build
```bash
./scripts/build-web-plugin.sh
# → plugins/web/build/libweb.so (also copied to target/debug|release)
export MARQDO_WEB_PLUGIN=$PWD/plugins/web/build/libweb.so
# → plugins/web/build/libweb.so
# → also copied to target/debug|release/libweb.so
```
Requires **Go 1.22+** with cgo (`CGO_ENABLED=1`) and a C toolchain.
Override path: `export MARQDO_WEB_PLUGIN=$PWD/plugins/web/build/libweb.so`
## Layout
| Path | Role |
|------|------|
| `plugin.go` | `//export` ABI entry + registration |
| `abi/marqdo_abi.h` | C contract (from `include/`) |
| `plugin.go` / `abi_*.go` | `//export` ABI entry + registration |
| `abi/marqdo_abi_cgo.h` | C contract for cgo |
| `internal/*` | page / db / http / ws / … |
迁移期 Rust 参考实现:`plugins/web-rust-archive/`(勿再演进)。
Rust reference (not built by default): `plugins/web-rust-archive/`.
+11 -6
View File
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# Build Marqdo web plugin (Go → C shared library).
# Output: plugins/web/build/libweb.so (Linux) / libweb.dylib / web.dll
# Canonical output: plugins/web/build/libweb.so (Linux) / libweb.dylib / web.dll
# Also copies into target/{debug,release}/ for ext CLI and release packaging.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT/plugins/web"
@@ -17,8 +18,12 @@ case "$(uname -s)" in
esac
echo "building $OUT (go $(go version | awk '{print $3}'))…"
CGO_ENABLED=1 go build -buildmode=c-shared -o "$OUT" .
# Do NOT copy over target/{debug,release}/libweb.so — rust archive crate still
# builds there during migration. Canonical Go artifact is plugins/web/build/.
echo "ok: $ROOT/plugins/web/$OUT"
echo "hint: export MARQDO_WEB_PLUGIN=$ROOT/plugins/web/$OUT"
echo " (or use plugins/web/build before ~/.marqdo/ext/native in resolution)"
ABS="$ROOT/plugins/web/$OUT"
BASE="$(basename "$OUT")"
for dir in "$ROOT/target/debug" "$ROOT/target/release"; do
mkdir -p "$dir"
cp -f "$ABS" "$dir/$BASE"
done
echo "ok: $ABS"
echo "also: $ROOT/target/debug/$BASE $ROOT/target/release/$BASE"
echo "hint: plugin.native_path name=web resolves these; override with MARQDO_WEB_PLUGIN=$ABS"
+72 -5
View File
@@ -32,7 +32,7 @@ pub const CATALOG: &[ExtPackage] = &[
},
ExtPackage {
id: "web",
description: "Dynamic website toolkit (ext/web) — page/db/bind/admin",
description: "Dynamic website toolkit (ext/web) — Go libweb (page/db/bind/admin)",
mq_files: &["web/web.mq.md", "web/网页.mq.md"],
native_crate: Some("marqdo_plugin_web"),
},
@@ -274,11 +274,73 @@ fn find_native_plugin(short: &str) -> Result<PathBuf> {
}
}
bail!(
"cannot find native plugin `{name}` (run `cargo build -p marqdo_plugin_{short}`, or set {env_key})"
"cannot find native plugin `{name}` (for `web`: `./scripts/build-web-plugin.sh`; \
else `cargo build -p marqdo_plugin_{short}`; or set {env_key})"
)
}
/// Locate a built native plugin: local artifact → GitHub Release prebuild → optional cargo build.
/// Walk from cwd (and common anchors) to find the Marqdo repo root that contains
/// `scripts/build-web-plugin.sh`.
fn find_web_plugin_build_script() -> Option<PathBuf> {
let mut starts = Vec::new();
if let Ok(cwd) = env::current_dir() {
starts.push(cwd);
}
if let Ok(exe) = env::current_exe() {
if let Some(dir) = exe.parent() {
starts.push(dir.to_path_buf());
}
}
for start in starts {
let mut dir = start;
for _ in 0..8 {
let script = dir.join("scripts").join("build-web-plugin.sh");
if script.is_file() {
return Some(script);
}
if !dir.pop() {
break;
}
}
}
None
}
fn build_go_web_plugin() -> Result<PathBuf> {
let script = find_web_plugin_build_script().ok_or_else(|| {
anyhow::anyhow!(
"cannot locate scripts/build-web-plugin.sh (run from the Marqdo repo, \
or set {} to a built libweb path)",
native_env_var("web")
)
})?;
let root = script
.parent()
.and_then(|p| p.parent())
.ok_or_else(|| anyhow::anyhow!("invalid build-web-plugin.sh path"))?;
println!("native plugin for `web` not found; building Go libweb via scripts/build-web-plugin.sh…");
let status = std::process::Command::new("bash")
.arg(&script)
.current_dir(root)
.status()
.with_context(|| format!("spawn {}", script.display()))?;
if !status.success() {
bail!(
"scripts/build-web-plugin.sh failed (status {status}); \
install Go 1.22+ with cgo, or set {} to a built libweb path",
native_env_var("web")
);
}
find_native_plugin("web").with_context(|| {
format!(
"built Go libweb but still cannot find {}; set {} to the .so/.dll path",
native_lib_filename("web"),
native_env_var("web")
)
})
}
/// Locate a built native plugin: local artifact → GitHub Release prebuild → optional build.
fn ensure_native_plugin(crate_name: &str) -> Result<PathBuf> {
let short = native_short_name(crate_name);
if let Ok(p) = find_native_plugin(short) {
@@ -296,6 +358,11 @@ fn ensure_native_plugin(crate_name: &str) -> Result<PathBuf> {
}
}
// Official web plugin is Go (W-G13); do not cargo-build the Rust archive.
if short == "web" {
return build_go_web_plugin();
}
#[cfg(feature = "net-host")]
let have_cargo = crate::ext_fetch::cargo_available();
#[cfg(not(feature = "net-host"))]
@@ -434,10 +501,10 @@ pub fn remove_ext(id: &str) -> Result<()> {
}
/// Resolve installed native plugin path for `name` (`agent`, `web`, …).
/// Also falls back to cargo `target/{debug,release}` artifacts for local runs.
/// Also falls back to cargo `target/{debug,release}` and Go `plugins/web/build`.
///
/// `MARQDO_*_PLUGIN` env overrides installed `~/.marqdo/ext` so developers can
/// point at a freshly built Go `libweb.so` during the web rewrite.
/// point at a freshly built plugin path.
pub fn installed_native_path(name: &str) -> Option<PathBuf> {
let short = native_short_name(name);
if !matches!(short, "agent" | "web" | "quantum" | "linalg") {
+53 -198
View File
@@ -37,6 +37,26 @@ fn assert_out(path: &str, expect: &str) {
assert_eq!(stdout.trim_end(), expect.trim_end(), "{path}");
}
/// Build Go `plugins/web/build/libweb.so` once per test process (W-G13).
fn ensure_web_plugin_built() {
use std::sync::Once;
static ONCE: Once = Once::new();
ONCE.call_once(|| {
let root = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let script = root.join("scripts").join("build-web-plugin.sh");
let status = Command::new("bash")
.arg(&script)
.current_dir(&root)
.status()
.expect("run scripts/build-web-plugin.sh");
assert!(
status.success(),
"failed to build Go libweb via scripts/build-web-plugin.sh"
);
});
}
/// Assert failure with `path:line:col:` prefix and message substring (both backends).
fn assert_err(path: &str, line_col: &str, substr: &str) {
for backend in ["tree", "bytecode"] {
@@ -1513,12 +1533,7 @@ fn ext_cli_add_agent() {
#[test]
fn ext_cli_add_web() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
let tmp = tempfile_dir("marqdo-ext-web");
let src = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("ext");
@@ -1550,12 +1565,7 @@ fn ext_cli_add_web() {
#[test]
fn ext_web_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-smoke.mq.md",
"render-ok
@@ -1573,12 +1583,7 @@ fn ext_web_entrydir_smoke() {
// not the process cwd (host_query("entry_dir")). We run from the repo
// root while the script lives in tests/ext, so the sqlite file must
// land under tests/ext/entrydir-fixtures/data/ and NOT repo-root/.
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
let script = "tests/ext/web-entrydir-smoke.mq.md";
let fixture_data = std::path::Path::new("tests/ext/entrydir-fixtures/data");
@@ -1615,12 +1620,7 @@ fn ext_web_entrydir_smoke() {
#[test]
fn ext_web_form_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-form-smoke.mq.md",
"validate-ok
@@ -1632,12 +1632,7 @@ render-ok",
#[test]
fn ext_web_admin_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-admin-smoke.mq.md",
"schema-ok
@@ -1653,12 +1648,7 @@ errors-echoed-ok",
#[test]
fn ext_web_net_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-net-smoke.mq.md",
"session-new-ok
@@ -1681,12 +1671,7 @@ ws-connect-error-ok",
#[test]
fn ext_web_route_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-route-smoke.mq.md",
"about-ok
@@ -1697,12 +1682,7 @@ render-ok",
#[test]
fn ext_web_form_embed_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-form-embed-smoke.mq.md",
"form-id-ok
@@ -1712,12 +1692,7 @@ render-ok",
#[test]
fn ext_web_form_slot_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-form-slot-smoke.mq.md",
"target-ok
@@ -1727,12 +1702,7 @@ slot-ok",
#[test]
fn ext_web_part_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-part-smoke.mq.md",
"route-stamp-ok
@@ -1743,12 +1713,7 @@ route-part-ok",
#[test]
fn ext_web_select_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-select-smoke.mq.md",
"map-where-ok
@@ -1759,12 +1724,7 @@ all-ok",
#[test]
fn ext_web_zh_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-zh-smoke.mq.md",
"render-ok
@@ -1776,12 +1736,7 @@ route-ok",
#[test]
fn ext_web_static_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-static-smoke.mq.md",
"dir-ok
@@ -1792,12 +1747,7 @@ custom-ok",
#[test]
fn ext_web_assets_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-assets-smoke.mq.md",
"images-ok
@@ -1812,12 +1762,7 @@ make-head-ok",
#[test]
fn ext_web_assets_live() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
let script = "tests/ext/web-assets-live-server.mq.md";
let bin = env!("CARGO_BIN_EXE_marqdo");
@@ -1888,12 +1833,7 @@ fn ext_web_assets_live() {
#[test]
fn ext_web_middleware_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-middleware-smoke.mq.md",
"cors-origin-ok
@@ -1916,12 +1856,7 @@ json-post-ok",
fn ext_web_middleware_live() {
// Boots a real HTTP server and verifies CORS / security headers /
// gzip / JSON API / body limit over the wire.
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
let script = "tests/ext/web-middleware-live-server.mq.md";
let bin = env!("CARGO_BIN_EXE_marqdo");
@@ -2054,12 +1989,7 @@ fn ext_web_middleware_live() {
#[test]
fn ext_web_proxy_invoke_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-proxy-invoke-smoke.mq.md",
"proxy-table-ok
@@ -2074,12 +2004,7 @@ invoke-method-ok",
#[test]
fn ext_web_hosting_live() {
// Mock upstream SSE on 18142 + Marqdo web proxy/invoke on 18141.
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
use std::io::{Read, Write};
use std::net::TcpListener;
@@ -2194,12 +2119,7 @@ fn ext_web_hosting_live() {
#[test]
fn ext_web_db_cross_module_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out("tests/ext/web-db-cross-module-smoke.mq.md", "cross-db-ok");
}
@@ -2220,12 +2140,7 @@ mcp-fn-ok",
#[test]
fn ext_web_security_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-security-smoke.mq.md",
"hash-ok
@@ -2236,12 +2151,7 @@ auth-bad-reject-ok",
#[test]
fn ext_web_content_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-content-smoke.mq.md",
"meta-ok
@@ -2253,12 +2163,7 @@ rss-ok",
#[test]
fn ext_web_drivers_smoke() {
// W4 drivers: memory cache, file storage, postgres/s3 URL shape (offline).
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
let root = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("tests/ext/web-fixtures/data/drivers-blobs");
@@ -2277,12 +2182,7 @@ s3-open-ok",
#[test]
fn ext_web_upload_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
let root = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("tests/ext/web-fixtures/data/upload-blobs");
@@ -2301,12 +2201,7 @@ form-file-ok",
#[test]
fn ext_web_upload_live() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
let root = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("tests/ext/web-fixtures/data/upload-live-blobs");
@@ -2450,12 +2345,7 @@ fn ext_web_upload_live() {
#[test]
fn ext_web_db_w6_smoke() {
// W6: versioned migrate, FTS5 search, published filter + comments table.
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
let db = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("tests/ext/web-fixtures/data/w6-smoke.db");
@@ -2475,12 +2365,7 @@ fts-row-ok",
#[test]
fn ext_web_ws_broadcast_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-ws-broadcast-smoke.mq.md",
"ws-broadcast-route-ok
@@ -2490,12 +2375,7 @@ access-log-ok",
#[test]
fn ext_web_w7_finish_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-w7-finish-smoke.mq.md",
"unique-ok
@@ -2509,12 +2389,7 @@ error-page-ok",
#[test]
fn ext_web_w7_live() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
let script = "tests/ext/web-w7-live-server.mq.md";
let bin = env!("CARGO_BIN_EXE_marqdo");
@@ -2625,12 +2500,7 @@ fn ext_web_w7_live() {
#[test]
fn ext_web_p3_smoke() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
assert_out(
"tests/ext/web-p3-smoke.mq.md",
"audit-insert-ok
@@ -2644,12 +2514,7 @@ gallery-ok",
#[test]
fn ext_web_p3_live() {
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
let script = "tests/ext/web-p3-live-server.mq.md";
let bin = env!("CARGO_BIN_EXE_marqdo");
@@ -2743,12 +2608,7 @@ fn ext_web_ws_broadcast_live() {
use futures_util::{SinkExt, StreamExt};
use tokio_tungstenite::tungstenite::Message;
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
let script = "tests/ext/web-ws-broadcast-live-server.mq.md";
let bin = env!("CARGO_BIN_EXE_marqdo");
@@ -2847,12 +2707,7 @@ fn ext_web_ws_broadcast_live() {
fn ext_web_db_w2_smoke() {
// W2 data layer: transactions, connection pooling, pagination, query
// expressiveness (IN/BETWEEN/OR), and row counting.
let status = Command::new("cargo")
.args(["build", "-p", "marqdo_plugin_web"])
.current_dir(env!("CARGO_MANIFEST_DIR"))
.status()
.expect("build web plugin");
assert!(status.success(), "failed to build marqdo_plugin_web");
ensure_web_plugin_built();
let db = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("tests/ext/web-fixtures/data/w2-smoke.db");