Archive the Rust web plugin and add a Go c-shared skeleton with ABI v2 bridge, build script, design doc/ADR, and smoke test so multi-language plugins and full web parity can proceed wave by wave. Co-authored-by: Cursor <cursoragent@cursor.com>
1.5 KiB
1.5 KiB
ADR 0004:网络拓展库原生实现改为 Go
| Status | Accepted |
| Date | 2026-09-10 |
| Related | ext-web-go-rewrite.md · ext-abi.md · 0001-implementation-language.md |
Context
- Marqdo 宿主/解释器仍为 Rust(ADR 0001 不变)。
- 官方插件契约是稳定 C ABI(
include/marqdo_abi.h),不绑定 Rust ABI。 plugins/web(Rust/axum)已具备 W0–W8 等能力,但迭代成本高;且需验证多语言插件生态。- 产品目标:网络拓展库支撑完整网页制备,并以暗恋见君(外接 PostgreSQL + Redis)验收;应用层前后端均为 Marqdo 脚本。
Decision
- 重写
plugins/web为 Go 共享库(-buildmode=c-shared),产物名仍为libweb.so/web.dll/libweb.dylib。 - ABI 全量兼容(函数名、参数、语义);
ext/web作者面默认不动。 - 施工图:ext-web-go-rewrite.md。禁止在旧 Rust 插件上继续打补丁演进(ext-web C5)。
- 其它官方插件(agent / quantum / linalg)暂不强制改语言;Go web 作为多语言样板。
Consequences
- 构建与发版需安装 Go;CI/
marqdo ext add web增加go build回退。 - 根 Cargo workspace 不再包含
plugins/webRust crate(切换完成后)。 - cgo/共享库生命周期与
shutdown需严格测试。 - 金样例
tests/ext/web-*为门禁。