From 8af72620f12e2494a59830a23abb393768b610e9 Mon Sep 17 00:00:00 2001 From: cflmy Date: Fri, 20 Nov 2026 15:51:48 +0800 Subject: [PATCH] docs(release): record convergence evidence, RC, and support matrix WHY - The code fixes existed locally without same-SHA release material; the G0..G12 gate matrix, G-C VM evidence, RC artifact and explicit non-claims must be reviewable together. - The release-candidate workflow packaged no consumers and did not verify its own checksum in the clean-install directory. WHAT - Record the current Linux/VM evidence at f075c96 and keep remote CI/G-C as UNVERIFIED; overall decision DO NOT RELEASE. - Add G-C evidence (7/7 + positive CLI + 47-binary workspace run), RC report with gate matrix, clean-install and checksum result. - Update STATUS, COMPATIBILITY, CHANGELOG, README, tests/README, mapping spec and releasing procedure for the new condition/span/power/Tool behavior. - Harden release-candidate packaging: include tests/consumers, SOURCE_SHA, rustc -vV, verify the checksum before extraction, and run independent Analysis/Trace validation from the extracted archive. - Record the local convergence note in NEXT_RELEASE_CI_CONVERGENCE.md. TESTS - Local fmt/clippy/workspace PASS; G-C VM PASS at f075c96. - Linux RC: sha256 -c OK and clean-install smoke PASS. CI_URL - none: Gitee remote, no GitHub credentials. Windows/macOS and same-SHA G-C CI remain the blocking gates. BREAKING_CHANGE - none in this docs/workflow commit. SECURITY_SCOPE - strict remains fail-closed; no new capability or platform claim. G-C is local-VM evidence, not a CI-signed security URL. --- .github/workflows/ci.yml | 17 +- CHANGELOG.md | 33 + COMPATIBILITY.md | 61 +- README.md | 26 +- docs/NEXT_RELEASE_CI_CONVERGENCE.md | 525 ++++++++++++++ docs/STATUS.md | 172 ++--- .../evidence/2026-11-20-strict-gc-f075c96.log | 38 + docs/evidence/2026-11-20-strict-gc-f075c96.md | 114 +++ .../2026-11-20-workspace-tests-f075c96.log | 672 ++++++++++++++++++ .../RELEASE_CANDIDATE_0.1.0_f075c96.md | 141 ++++ docs/releasing.md | 24 +- docs/security-gate.md | 12 +- .../tool-samples/sample-knowledge/README.md | 1 + examples/tool-samples/sample-proof/README.md | 1 + examples/tool-samples/sample-view/README.md | 1 + spec/mapping.md | 11 +- tests/README.md | 21 +- 17 files changed, 1744 insertions(+), 126 deletions(-) create mode 100644 docs/NEXT_RELEASE_CI_CONVERGENCE.md create mode 100644 docs/evidence/2026-11-20-strict-gc-f075c96.log create mode 100644 docs/evidence/2026-11-20-strict-gc-f075c96.md create mode 100644 docs/evidence/2026-11-20-workspace-tests-f075c96.log create mode 100644 docs/evidence/RELEASE_CANDIDATE_0.1.0_f075c96.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bab42b7..7a86503 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,6 +168,10 @@ jobs: install -m 0755 target/release/marqdo "$stage/" cp LICENSE-MIT LICENSE-APACHE CHANGELOG.md COMPATIBILITY.md README.md "$stage/" cp -r spec examples "$stage/" + mkdir -p "$stage/tests" + cp -r tests/consumers "$stage/tests/" + printf 'source_sha=%s\nversion=%s\ntarget=%s\n' "$GITHUB_SHA" "$version" "${{ matrix.target }}" > "$stage/SOURCE_SHA" + rustc -vV > "$stage/rustc-vV.txt" tar -C dist -czf "dist/marqdo-${version}-${{ matrix.target }}.tar.gz" "$(basename "$stage")" cd dist if command -v sha256sum >/dev/null 2>&1; then @@ -181,12 +185,19 @@ jobs: run: | set -euo pipefail tmp="$(mktemp -d)" - tar -C "$tmp" -xzf dist/marqdo-*.tar.gz - cd "$tmp"/marqdo-* + cp dist/marqdo-*.tar.gz* "$tmp/" + cd "$tmp" + sha256sum -c marqdo-*.tar.gz.sha256 2>/dev/null || shasum -a 256 -c marqdo-*.tar.gz.sha256 + tar -xzf marqdo-*.tar.gz + cd marqdo-* ./marqdo --version ./marqdo --help >/dev/null - ./marqdo check examples/multi-module/index.mq.md + ./marqdo check examples/multi-module/index.mq.md --refs --emit analysis.json ./marqdo run examples/hello.mq.md + ./marqdo run examples/multi-module/index.mq.md --trace-file trace.json + python3 tests/consumers/analysis_consumer.py analysis.json + python3 tests/consumers/trace_consumer.py analysis.json trace.json + python3 tests/consumers/validate_protocols.py analysis.json trace.json examples/tool-unknown-name/tool.json - uses: actions/upload-artifact@v4 with: name: marqdo-${{ matrix.target }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 398cc1d..5a6960f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,18 @@ currently `0.1.0`; no release tag has been cut. Dates use ISO 8601. Linux security-gate evidence report (`docs/security-gate.md`). - `check_never_spawns_a_foreign_kernel`: proves static `check` does not spawn a declared Foreign provider, while `run` on the same document does. +- Power/control-flow corpus: 10 new AST goldens, 8 semantic goldens, 4 + compile-negative fixtures and 2 runtime-negative fixtures covering + right-associative `**`, unary-minus precedence, parentheses, float negative + exponents, Strong+CodeSpan payloads, branch/loop conditions, inert prose and + code fences, and source spans inside one/two-backtick code spans. +- Independent Tool Protocol v1 consumers `sample-view`, `sample-knowledge` and + `sample-proof` (analysis/trace readers) with install, dispatch and remove + tests; none is a hard-coded CLI command. +- Locked path-dependency content-tamper test: a changed dependency is rejected + without rewriting `marqdo.lock` or the materialized `.marqdo/env`. +- G-C lane honours `CARGO_TARGET_DIR`, so a run from a clean `git archive` with + an external target directory uses the binary it just built. ### Changed @@ -41,6 +53,12 @@ currently `0.1.0`; no release tag has been cut. Dates use ISO 8601. reporting an opaque mismatch. - Worker plugin fixtures use the platform dynamic-library name and compiler flags. +- List-item condition paragraphs now accept only inert description; an + executable `Strong`/`Emph` there is a hard `markdown.invalid_construct` + error instead of being silently swallowed. Condition expression spans are + mapped from the literal bytes inside the code-span backticks. +- Linux strict `inspect --platform` remains a snapshot, not a promise. A run + that loses namespace/resources between probe and launch must fail closed. ### Fixed @@ -48,6 +66,17 @@ currently `0.1.0`; no release tag has been cut. Dates use ISO 8601. goldens (reproduced with a fresh `core.autocrlf=true` clone). - macOS CI plugin failure caused by assuming a Linux `.so` and Linux-only manifest target. +- macOS/Windows `E0433`: platform detection now uses `#[cfg]` functions + instead of `cfg!` around `linux::probe()`, so the Linux module is not + referenced on other targets. +- Linux strict probe→launch race: the CLI contract and the sandbox seam now + require a non-zero, diagnosed, fail-closed refusal when the real supervisor + launch fails after a successful probe. +- Parallel security tests shared process-id scratch paths and deleted each + other's project; every case now has a unique path and the helper is compiled + once. +- Condition parse diagnostics pointed at the backtick instead of the missing + operand; the payload map now excludes delimiters. ### Security @@ -59,6 +88,10 @@ currently `0.1.0`; no release tag has been cut. Dates use ISO 8601. sandbox starts. Strict L2 inheritance is future work. - Capability brokers and worker processes remain cooperative authorization/crash isolation, not an OS sandbox. +- The G-C lane was re-run at `f075c96` from a clean `git archive` in a + disposable Ubuntu 26.04 VM as ordinary user `dev`: 7/7 adversarial tests, + positive CLI contract and forged-marker rejection PASS. This is still a local + VM result, not a self-hosted GitHub security-lane URL. ## Baseline `0.1.0` (before this stabilization slice) diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index 056b805..d12a22e 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -1,7 +1,8 @@ # Compatibility and support matrix -Snapshot: workspace version **0.1.0**, no release tag cut. This file records -what was actually verified and separates it from what is only implemented. +Snapshot: workspace version **0.1.0**, code/security SHA **`f075c96`**, no +release tag cut. This file records what was actually verified and separates it +from what is only implemented. ## Public protocol versions @@ -24,33 +25,48 @@ portable/tested locally but the native platform lane has not run here; | Feature | Ubuntu Linux x86_64 | macOS arm64 | Windows x86_64 | |---|---|---|---| -| Markdown profile / AST goldens | PASS | UNVERIFIED (CRLF fix) | UNVERIFIED (CRLF fix) | -| Rust interpreter / semantics | PASS | UNVERIFIED | UNVERIFIED | +| Markdown profile / AST goldens (160) | PASS | UNVERIFIED (cfg fix + CRLF fix) | UNVERIFIED (cfg fix + CRLF fix) | +| Rust interpreter / semantics (44) | PASS | UNVERIFIED | UNVERIFIED | | `run` / `call` / `check` / `inspect` / `fmt` | PASS | UNVERIFIED | UNVERIFIED | -| lock v3 path/Git graph + sync | PASS | UNVERIFIED | UNVERIFIED | -| Analysis v2 / Trace v2 + consumers | PASS | UNVERIFIED | UNVERIFIED | -| Tool Protocol v1 | PASS | UNVERIFIED | UNVERIFIED | -| Native ABI (`plugin inspect`, trusted call) | PASS (C fixture) | UNVERIFIED (host-native fixture) | UNSUPPORTED in CI lane (no `cc`) | -| Worker ABI + `fs.read` bridge | PASS (Unix) | UNVERIFIED | UNSUPPORTED (tests are Unix-gated) | +| lock v3 path/Git graph + sync + tamper | PASS | UNVERIFIED | UNVERIFIED | +| Analysis v2 / Trace v2 + Python consumers | PASS | UNVERIFIED | UNVERIFIED | +| Tool Protocol v1 + 3 independent consumers | PASS | UNVERIFIED | UNVERIFIED | +| Native ABI (`plugin inspect`, trusted call) | PASS (C fixture) | UNVERIFIED (host-native fixture) | **UNSUPPORTED** | +| Worker ABI + `fs.read` bridge | PASS (Unix) | UNVERIFIED | **UNSUPPORTED** (Unix-gated) | | Foreign Python/Node | PASS (system `python3`/`node`) | UNVERIFIED | UNVERIFIED | | Foreign pinned environment binding | PASS | UNVERIFIED | UNVERIFIED | -| `strict` OS isolation | PASS when runtime probe passes (VM-verified); no CI URL yet | FAIL-CLOSED | FAIL-CLOSED | +| `strict` Linux L1 (pure Marqdo + Math) | PASS, probe-gated, 7/7 VM lane | **FAIL-CLOSED** | **FAIL-CLOSED** | +| `strict` L2 (Worker/Foreign/native) | **UNSUPPORTED** (flags refused) | **UNSUPPORTED** | **UNSUPPORTED** | -The Ubuntu column is from this development host (Ubuntu 26.04 container). It is -**not** a GitHub Actions result: this checkout has no GitHub remote or CI +The Ubuntu column is from this development host (Ubuntu 26.04 container) and a +disposable Ubuntu 26.04 QEMU/TCG VM for the security lane. It is **not** a +GitHub Actions result: this checkout has a Gitee remote and no GitHub credentials. A fresh local clone with `core.autocrlf=true` was used to reproduce the Windows checkout byte behavior. +## Strict L1 scope (ADR-0021) + +- Enabled only when the runtime Bubblewrap probe succeeds. Probe failure or a + probe→launch race exits non-zero with a diagnostic and **never** falls back + to `project`. +- Inside the sandbox: user/mount/PID/net/UTS/IPC namespaces, no-new-privs, + empty capabilities, read-only `/project`, private `/proc`/`/dev`/`/tmp`, + rlimits and wall-clock/output supervision; the child verifies `PID 1`, + `NoNewPrivs`, `CapEff=0`, a non-initial uid map and no non-loopback network. +- Refused before launch: `--allow-read`, `--allow-write`, `--allow-foreign`, + `--allow-plugin`, `--plugin`, `--trust-native-plugin`, `--kernel`, + `--trace-file`. +- Strict L2 (letting Worker/Foreign/native plugin run inside the sandbox) is + not implemented and must not be inferred from L1 passing. + ## Minimum environment - Rust 1.82+ (verified with 1.100.0). - Linux/macOS: a C compiler for Native ABI fixtures; Python/Node only for - Foreign kernels. + Foreign kernels; `git` for Git dependencies. - `strict` additionally requires Bubblewrap and a kernel/environment that - permits user, mount, PID and network namespaces. It is enabled only when the - runtime probe passes; the current development container fails that probe, so - strict is refused there. See [`docs/security-gate.md`](docs/security-gate.md) - and ADR-0021. + permits user, mount, PID and network namespaces. See + [`docs/security-gate.md`](docs/security-gate.md) and ADR-0021. ## Explicitly unsupported in this candidate @@ -60,4 +76,13 @@ reproduce the Windows checkout byte behavior. - Automatic uv/npm/venv provisioning; only an explicitly provisioned, pinned directory is verified (and must contain a regular-file executable). - Registry/package publishing, JIT, Knowledge/Proof/View built-ins, - sessions, and general-purpose CAS. + sessions, and general-purpose CAS. The three `sample-*` tools are test + fixtures for the generic Tool protocol, not product features. +- Windows/macOS release archives from this host; the GitHub release job may + build macOS but has not run for the convergence SHA. + +## Release decision + +**DO NOT RELEASE.** G1/G2/G3 (native CI) and G9 (self-hosted security-lane CI +URL) have no real remote PASS for this SHA. See +[`docs/evidence/RELEASE_CANDIDATE_0.1.0_f075c96.md`](docs/evidence/RELEASE_CANDIDATE_0.1.0_f075c96.md). diff --git a/README.md b/README.md index 6c352cc..a3bdd29 100644 --- a/README.md +++ b/README.md @@ -15,16 +15,19 @@ plugin ABI v2 are not claimed to work here. > **Status: stabilization candidate, not released.** The language, lock v3, > Analysis v2, Trace v2, Tool v1, Plugin ABI v1 (native + worker) and pinned > Foreign providers are implemented and covered by tests on Linux. The -> Windows AST and macOS plugin CI failures are fixed in source, but the native -> Windows/macOS lanes have not been re-run from this checkout. **`strict` OS -> isolation is available on Linux only when the runtime Bubblewrap probe -> passes**; it was verified against the full escape/resource matrix in a -> disposable Ubuntu VM (ADR-0021). macOS/Windows fail closed, strict L2 -> (Worker/Foreign) is not implemented, and the broker/worker are not a -> sandbox. See +> macOS/Windows `E0433` platform-cfg failure and the Linux strict +> probe→launch race are fixed in source at `f075c96`, but the native +> Windows/macOS and GitHub Linux lanes have not been re-run from this +> checkout. **`strict` OS isolation is available on Linux only when the +> runtime Bubblewrap probe passes**; it was verified against the full +> escape/resource matrix in a disposable Ubuntu 26.04 VM at `f075c96` +> (ADR-0021). macOS/Windows fail closed, strict L2 (Worker/Foreign) is not +> implemented, and the broker/worker are not a sandbox. The release decision +> is **DO NOT RELEASE** until the remote gates have same-SHA URLs. See > [`docs/STATUS.md`](docs/STATUS.md), [`COMPATIBILITY.md`](COMPATIBILITY.md) -> and [`docs/security-gate.md`](docs/security-gate.md). The single next-phase -> plan is [`docs/STABLE_RELEASE_IMPLEMENTATION.md`](docs/STABLE_RELEASE_IMPLEMENTATION.md). +> and [`docs/security-gate.md`](docs/security-gate.md). The single current CI +> convergence plan is +> [`docs/NEXT_RELEASE_CI_CONVERGENCE.md`](docs/NEXT_RELEASE_CI_CONVERGENCE.md). ## Build @@ -78,8 +81,9 @@ executes anything. ## What works (implemented and tested) * **P0 contracts** — frozen Markdown profile, AST → program mapping, strict - expression grammar, evaluation semantics; 150 AST goldens and 48 negative - compile-error fixtures (`tests/`). + expression grammar, evaluation semantics; 160 AST goldens, 44 semantic + goldens, 52 compile-error fixtures and 12 runtime-error fixtures + (`tests/`). * **P1 interpreter** — native Rust tree-walk interpreter: values, scopes, functions, static parameter inference, assignments, branches, loops, returns, recursion, structured errors, fuel/stack/output budgets. diff --git a/docs/NEXT_RELEASE_CI_CONVERGENCE.md b/docs/NEXT_RELEASE_CI_CONVERGENCE.md new file mode 100644 index 0000000..21b7024 --- /dev/null +++ b/docs/NEXT_RELEASE_CI_CONVERGENCE.md @@ -0,0 +1,525 @@ +# Marqdo CLI:CI 收敛、语言边界回归与稳定发行实施规范 + +> **文档性质:** 可直接入库的执行规范 / Release Convergence Plan。供未阅读任何历史聊天的维护者、贡献者与 DeepSeek Harness 使用。 +> +> **仓库:** `https://github.com/cflmy/marqdo-cli`;开发者的本地 Git 远端可能是 Gitee,不应混淆远端提交、GitHub 镜像与真实 CI 状态。 +> +> **事实基线:** 2026-11-20,GitHub `master` `c9f01aa8fb127a2dcc125103ef794832984774ad`。最新公开 CI:[run 44692692318](https://github.com/cflmy/marqdo-cli/actions/runs/44692692318)。工作区当前版本 `0.1.0`;检索时 GitHub Releases 为空。**这不是已发布稳定版。** +> +> **实施原则:** 以仓库的 `spec/` 和已接受 ADR 为语义权威,以真实 CI/本地运行日志为实现证据。此文档只定义剩余收尾工作和验收顺序,不重开已解决的架构议题,不授予自动发布权限。后续每次变更先更新 `docs/STATUS.md` 事实基线。若阅读时 HEAD 已变化,重新取得该 SHA 的 CI 证据,并在本规范记录差异,不能机械照搬旧故障。 + +> **执行更新(2026-11-20,本地收敛):** 远程 `master` 仍为 `c9f01aa8`,本机新增收敛提交 `d05f36f` → `f075c96`,但**未推送**(本检出只有 Gitee 远端且无 GitHub 凭据)。`f075c96` 上:Linux 本地 `fmt`/`clippy`/`cargo test --workspace --locked` PASS;专用 Ubuntu 26.04 VM 普通用户 `dev` 从 `git archive` 重跑 G-C lane **7/7 + 正向 CLI PASS**(见 `docs/evidence/2026-11-20-strict-gc-f075c96.md`);Linux RC 已打包并通过外部干净安装与 checksum 校验。Windows/macOS 与同 SHA 的 GitHub CI、G-C 自托管 CI URL 仍为 **UNVERIFIED**,因此总体决定仍是 **DO NOT RELEASE**。下一动作是把 `f075c96` 或仅补文档的后继提交推送到 GitHub 并重跑全平台 CI 与安全 lane。 + +--- + +## 0. 一页决策摘要 + +目前 **不是重新开发 Marqdo CLI** 的阶段。Rust 语言实现、Markdown profile、表达式解析、lock v3、Analysis v2、Trace v2、Tool v1、Foreign 固定环境、Linux strict L1 已有实现;Linux strict L1 曾在普通用户运行的专用 Ubuntu VM 完成 **7/7** 安全测试,但其证据对应提交 `b6fc182`,**尚无同一发布 SHA 的远程安全 CI URL**。 + +最新 `c9f01aa8` 的 GitHub CI 状态: + +| CI job | 观察到的结果 | 具体证据 | 发布影响 | +|---|---|---|---| +| `fmt + clippy + test (Linux x86_64)` | **FAIL** | `strict_mode_enforces_isolation_or_refuses_closed`: Bubblewrap 启动返回 `Resource temporarily unavailable`,其余已执行的 17 项 CLI 集成测试通过 | **阻断 G-B** | +| `runtime contract (macos-latest)` | **FAIL** | `marqdo-sandbox/src/lib.rs:115` 对 `linux::probe()` 的非 Linux 引用导致 `E0433` | **阻断 macOS 运行契约** | +| `runtime contract (windows-latest)` | **FAIL** | 同样 `E0433` | **阻断 Windows 运行契约** | +| `schema instance validation + consumers` | **PASS** | 真实 Analysis/Trace 实例、Tool manifest 的 Schema 验证及消费者通过 | 公共协议该 job 有有效证据 | +| `release candidate artifact` | **SKIPPED** | 上游 CI 不通过;且该 job 仅按 tag/手动触发运行 | 尚无合格发行产物证据 | +| Linux strict G-C 独立安全 lane | **无同 SHA 的 CI 记录** | 本地 VM 7/7 的历史证据在 `docs/evidence/2026-11-20-strict-gc.md` | 若发行宣称 Linux strict L1,**必须补同 SHA 安全 CI** | + +**不要将“CI 通过 1/4”解释为“功能完成 25%”。** 四个工作流 job 是离散的质量门禁,不是均匀的功能权重;代码已经较完整,但当前可发布判定为 **DO NOT RELEASE**。也不要猜测“几天内发版”;只有逐项 PASS 才能发布。 + +### 0.1 实施范围与拒绝范围 + +本轮必须:修复三平台 CI,补充 Markdown–表达式跨层金样与语义测试,证明核心现有包/协议/Tool/ABI/Foreign 的支持范围,补充独立扩展消费者,完成发行候选与安全证据,更新文档和版本。 + +本轮不应引入:新的顶层命令、第二套 Markdown 解析器、改写 `**` / `` `...` `` 的正式职责、知识编译器、Lean 证明器、View 网页、自动 uv/npm 生态管理、通用容器平台、JIT、公共包注册表。除非**现有承诺的稳定路径存在阻断级缺陷**,否则这些是独立项目或后续版本工作。 + +## 1. 项目架构及必须保持的边界 + +### 1.1 目标与计算路径 + +Marqdo 是独立 Rust 实现的 Markdown 原生语言,**不是**把 Markdown 翻译成 Python 运行。程序计算过程是: + +```text +.mq.md UTF-8 source + │ + ▼ +marqdo-markdown:固定 Comrak/CommonMark/GFM/Math profile(唯一 Markdown 解析) + │ Canonical MdNode + byte Span + ▼ +marqdo-frontend:Heading 作用域/导入/参数推断/Markdown AST→IR + │ 条件头、分支、循环、调用、引用、源码位置 + ▼ +marqdo-ir + marqdo-expression:可执行 AST/强类型表达式语法 + │ + ▼ +marqdo-runtime:Rust 原生树遍历执行 + 数值/控制流 + │ + ▼ +marqdo-host / marqdo-sandbox:能力授权、预算、可选外部 Kernel/ABI + │ + └── 通过 marqdo CLI 输出结果、诊断和受控 Trace +``` + +扩展架构保持正交: + +```text +marqdo tool install <通用第三方 Tool bundle> + │ + └── marqdo <工具名> ... 由外部进程承担,不在核心硬编码工具名单 + +公共消费协议:Analysis v2 / Trace v2(由 check/run 产生,Tool 可按需消费) +运行时扩展:Plugin ABI v1(独立于外部 CLI Tool) +Foreign:显式 Kernel Provider 与已固定环境(独立于 Tool 和 ABI) +``` + +**不准**为了测试方便把第三方工具、数学扩展或安全子系统直接塞进解释器的 `match` 链;**不准**将 Markdown 解析换成基于正则的近似语法;**不准**让 `check` 执行副作用。 + +### 1.2 规范、状态与历史的权威顺序 + +- `spec/markdown-profile.md`、`spec/mapping.md`、`spec/expression.ebnf`、`spec/evaluation.md`:语言语义。 +- `spec/package-format.md`、`spec/analysis-v2.md`、`spec/trace-v2.md`、`spec/tool-v1.md`、`spec/plugin-abi.md`、`spec/foreign.md`、`spec/security.md`:工程契约。 +- ADR-0016~0021:lock v3、Worker/Host、Foreign 环境绑定、Linux strict L1 的有效决策。 +- `AGENTS.md`、`docs/STABLE_RELEASE_IMPLEMENTATION.md`、`docs/contributor-guide.md`:既有开发和稳定化规程;**本文细化其当前 CI 收尾工作,不推翻其范围约束**。 +- `docs/STATUS.md`、`COMPATIBILITY.md`、`docs/security-gate.md`:必须逐 SHA 更新事实证据。旧状态、旧本地日志、旧 CI 不能自动转成新 SHA 的 PASS。 + +### 1.3 版本与安全概念 + +- **G-A**:核心运行与语义可用(开发阶段)。 +- **G-B / Core Stable**:承诺的语言/工程功能在所有支持平台的 CI 通过;契约、工具与发行产物可复现。 +- **G-C / Linux strict L1**:独立安全 lane 在普通用户、真实 OS namespace 环境中通过逃逸矩阵,并记录同一 SHA 的 CI URL。L1 仅含纯 Marqdo、console 和原生 Math;Foreign、Worker、Native ABI 等 **L2 仍不支持**,必须拒绝。 +- 稳定版本号可以仍为预 1.0 版本;“stable”指受支持功能通过公布的验收门槛,**不等于**所有未来设想均已完成。 + +## 2. 当前失败的精确根因与首轮修复 + +### P0-1:Windows / macOS 的 `E0433` 条件编译错误 + +**已观察到:** 现有 `crates/marqdo-sandbox/src/lib.rs` 中的 `linux` 模块由 `#[cfg(target_os = "linux")]` 条件编译,但 `PlatformCapabilities::detect()` 使用: + +```rust +let strict = if cfg!(target_os = "linux") { + match linux::probe() { /* ... */ } +} else { /* ... */ }; +``` + +`cfg!(...)` 产生布尔常量,**不移除代码分支的类型检查**。macOS/Windows 仍需解析 `linux::probe()`,因而报 `E0433`。这是确定的源代码缺陷,而不是 CI 环境错误。 + +**最小正确修复:** 把平台专用操作分配给带 `#[cfg]` 的实现函数/模块: + +```rust +#[cfg(target_os = "linux")] +fn detect_strict() -> StrictIsolation { + match linux::probe() { + Ok(mechanism) => StrictIsolation::Available { mechanism }, + Err(reason) => StrictIsolation::Unavailable { reason }, + } +} + +#[cfg(not(target_os = "linux"))] +fn detect_strict() -> StrictIsolation { + StrictIsolation::Unavailable { + reason: format!("no verified strict OS adapter for {}", std::env::consts::OS), + } +} +``` + +然后 `PlatformCapabilities::detect()` 只调用 `detect_strict()`。这段是**示意修改**,开发者必须依仓库现有 API 实际实现,并消除非 Linux 专属的 `libc` 依赖警告。不要将 `mod linux;` 变成无条件导入,那会使 Linux 特有依赖污染其他平台。 + +**必须添加的验证:** + +1. Ubuntu 本地 `cargo fmt --all -- --check && cargo clippy --workspace --all-targets -- -D warnings && cargo test --workspace`。 +2. Windows/macOS **真实本机 CI** `cargo test --workspace`,不能仅 `cargo check`。 +3. 在非 Linux 上 `marqdo inspect --platform --json` 报 `strict=unavailable`;`marqdo run ... --mode strict` 必须拒绝,未产生程序副作用。 +4. 再次运行 plugin host-target fixture;确认先前的 `.dylib`/CRLF 问题没有在恢复编译后重新显现。 + +**完成定义:** 两平台的 `E0433` 消失;各自完整测试 job 绿灯;严格模式仍 fail-closed;没有更改公开语义。 + +### P0-2:Linux CI 的 strict probe 与运行时 `EAGAIN` + +**已观察到:** `crates/cli/tests/integration_cli.rs::strict_mode_enforces_isolation_or_refuses_closed` 首先通过 `inspect --platform` 判断 strict 是否 available;如果 available,它就要求另一进程 `run --mode strict` 必须退出 0。最新 CI stderr: + +```text +bwrap: Creating new namespace failed: Resource temporarily unavailable +``` + +因此日志支持的是**运行时受到瞬时或配额类环境限制**,尚不能证明具体是 `user.max_user_namespaces`、用户进程限制、宿主工作负载、Runner 策略中的哪一项;更不能断言 Linux strict L1 安全边界失效。 + +当前 `crates/marqdo-sandbox/src/linux.rs` `probe()` 会运行 Bubblewrap 烟测;`run()` 内部又调用 `probe()`,之后才真正启动带资源限制和项目挂载的监督进程。探测成功不代表后续启动一定成功,两次启动之间的系统资源与权限可改变;这属于典型 TOCTOU / 资源可用性问题。 + +**不允许的“修复”:** 删除测试、在 strict 失败时降级为 project、把 `EAGAIN` 误标为成功执行、在普通 CI 下断言所有 Linux 主机支持 strict、用 sudo/root 运行测试代替普通用户验证。 + +**推荐分离两项不同契约:** + +1. **普通 CI:安全失败契约。** 在任意 CI 机器上都能运行。若本次实际隔离启动成功,则程序输出必须正确;若由于真实系统资源或权限不足启动失败,则必须退出非零、给出明确诊断、**项目代码从未在不受限环境执行**,不得隐式降级。`inspect` 仅是当时环境快照,不能拿它当“今后一定成功”的永久承诺。 +2. **专用 G-C 设备:正向安全契约。** `MARQDO_REQUIRE_STRICT_SECURITY=1`、普通用户、可重建的 Ubuntu VM/self-hosted runner。此处 **不允许 skip/允许拒绝**;必须成功完成 run/call 和全部 7 项对抗测试,否则 G-C FAIL。 + +**实现建议:** + +- 在受控测试中注入可预测的 `probe succeeds → launch returns EAGAIN` 情况(通过隔离的 adapter abstraction/test seam,而非改写全局 PATH 造成工具替换风险),断言 `LaunchFailed/StrictUnavailable` 被诊断且没有无沙箱执行。 +- 取消普通 CI 的“第一次 probe 为 available,第二次执行就必须成功”的不可靠断言;仍要验证成功路径和失败路径,而不是简单忽略失败。 +- 如果要减少多次 probe,只在确保**实际启动**使用同等/更强参数且执行时失败仍 fail-closed 的前提下实施;不要用纯文件存在或 bwrap `--version` 代替真实 probe。 +- 记录 `EAGAIN` 时使用的 uid、namespace/sysctl、RLIMIT、bwrap 版本和进程负载作为诊断信息;不得将这类失败归结为不存在的语义错误。 +- bounded retry 只能作为可选可靠性工程,不能吞没最终错误、不能绕过安全约束;默认先保证 fail-closed。 +- 将错误码和机器可读错误分类稳定化(安全不可用、启动失败、超时/资源耗尽),不要把下游 bwrap stderr 当作任意调用成功。 + +**完成定义:** 普通 Linux CI 与受控 G-C 安全 lane 同时成立;在宿主不可用时 100% fail-closed;在专用 VM 中 7/7 且 run/call 正常。保存当前目标 SHA 的两条 URL。 + +### P0-3:修复后必须重新确认 CI,不得“预判绿灯” + +当前 macOS/Windows 在编译阶段中止,所以不能据此声称以前的 native plugin、AST CRLF、Tool、Foreign 以及跨模块测试全部通过。恢复编译后有可能暴露后续错误。 + +具体动作: + +- 从同一 SHA 打开完整 CI run,逐 job 导出失败步骤、`thread ... panicked`、错误分类和目标平台。 +- 不要只看 GitHub Workflow 总结;对每个失败 job 下载原始日志。 +- 不论上一条失败多简单,修复后必须以**新的 HEAD CI** 为依据重新评估所有平台。 +- 不对 macOS/Windows 的 Unix-only ABI/Worker 测试作“通过”宣称;它们若没有运行,应在 `COMPATIBILITY.md` 明确 UNSUPPORTED,而不是掩饰为 PASS。 + +## 3. Markdown 与乘方:从疑虑收缩为正式回归测试 + +### 3.1 已确定的语义,不得擅自改变 + +Markdown 源码经过冻结 Comrak profile。`##` 定义函数;普通函数段落中的 `Strong` 是可执行语句;`Emph` 是返回表达式;有序列表是分支,无序列表是循环;列表项第一段的**首个 CodeSpan** 是条件表达式;后续普通文字可解释目的;BlockQuote 是显式调用。完整计算表达式由独立 Marqdo 表达式解析器解释。 + +**用户本地实测**已经说明:适当空格使 Markdown 按预期生成 AST,乘方可以正确运行。故这一轮**不应以“修复乘方”为由重新设计强/斜体语法**。Markdown 标记本身具有分隔符词法规则:紧凑写法造成不同 AST 属于需要准确文档化的语言边界,而不是一律归咎解释器。 + +```markdown +## main + +**n = 2** + +**`n = n ** 2`** + +> print(n) +``` + +以上是建议的、对 `**` 乘方运算最稳妥的可读写法:外围 Strong 定义执行语句,内部 CodeSpan 避免 Markdown 把计算运算符看作强调分隔符。对于本机已经验证能形成正确 AST 的空格写法,也应以 AST 金样记录,不应禁止。 + +**正式判断标准:** `marqdo inspect --ast` 的 Comrak AST 是否对应规范结构;其后 `check`/`run` 是否按该结构执行。不得为“猜测用户想写什么”而增加原始 Markdown 正则修复器,也不得因源码像表达式就跳过 Markdown AST。 + +### 3.2 乘方在各层的当前证据 + +- `marqdo-expression/src/lexer.rs`:`TokenKind::StarStar`。 +- `marqdo-expression/src/parser.rs`:`parse_power()`;测试 `power_is_right_associative_and_binds_tighter_than_unary_minus`。 +- `marqdo-runtime/src/value_ops.rs`:`BinaryOp::Pow`;整数精确幂、负整数指数类型错误、指数最大 100000、估算结果位数上限 1000000;浮点由 `powf()` 处理。 +- Runtime 层测试 `text_concatenation_and_power` 覆盖 `2 ** 10 = 1024` 与负指数拒绝。 +- 当前 36 组 `tests/conformance/semantics/` 的 `.mq.md` 金样未单独测试 **Marqdo 原生** `**`;`36-foreign-call-python.mq.md` 的 `r ** 2` 属于 Python Foreign,不等价于 Marqdo 乘方。 + +### 3.3 新增的正向语义 fixtures(至少) + +遵循 `crates/cli/tests/conformance_semantics.rs` 已有的 `.mq.md` + `.expected.json` 机制。不要用 `UPDATE_SEMANTICS_GOLDENS=1` 把错误期望直接覆盖;先手工计算期望。 + +| 编号建议 | 源码表达 | 预期 | 证明什么 | +|---|---|---|---| +| 37 | `*` + CodeSpan(`2 ** 3 ** 2`) + `*` | `Int 512` | Markdown→右结合解析→求值 | +| 38 | `*` + CodeSpan(`-2 ** 2`) + `*` | `Int -4` | 一元负号优先级 | +| 39 | `*` + CodeSpan(`(-2) ** 2`) + `*` | `Int 4` | 括号与优先级 | +| 40 | `*` + CodeSpan(`2.0 ** -1`) + `*` | `Float 0.5` | 浮点负指数 | +| 41 | `**` + CodeSpan(`n = 2 ** 3`) + `**`,然后返回 `n` | `Int 8` | Strong + CodeSpan 嵌套路径 | +| 42 | 有序列表条件 `` `n ** 2 == 4` `` + 叙述 + 引用调用 | 只调用真分支 | 条件 Markdown / 段落 / 控制流 | +| 43 | 无序列表条件 `` `n ** 2 < limit` `` + 叙述 + 递增 | 预期迭代和返回 | 循环、条件重新求值、乘方 | + +例如,给 42 建立下述源文件;相应 expected 的 `stdout` 应为 `乘方正确\n`,返回值应为 `Unit`,实际 JSON 具体类型按已存在 wire-v1 金样约定构造: + +```markdown +## main + +**n = 2** + +1. `n ** 2 == 4`,正确分支的自然语言说明。 + + > print("乘方正确") + +2. `n ** 2 != 4`,另一分支的说明。 + + > print("乘方错误") +``` + +对 41: + +```markdown +## main + +**`n = 2 ** 3`** + +*n* +``` + +### 3.4 必须新增的负向/边界测试 + +| 输入或场景 | 必须验证的行为 | 测试层 | +|---|---|---| +| `2 ** -1`,纯 Int | 类型错误;不是神奇地得到 `0.5` | Runtime error fixture | +| `2 ** 100001` | `resource.exhausted`(当前指数限额) | Runtime error fixture | +| `2 **` | 解析器诊断非法表达式,正确源码 span | 负向 fixture | +| 列表头 `` `n ** 2 ==` `` | 条件表达式语法错误,定位到原 Markdown 源码中缺失操作数的位置 | Frontend / CLI error | +| 多反引号 CodeSpan 包含 `**` | 仍能正确映射完整表达式与字节 Span | AST + frontend | +| `**n=n**2**` 等缺少空格的 Markdown 边界 | 固定 Comrak 真实 AST,不推断用户意图,不自动更正 | AST golden + 文档例子 | +| `**n = n ** 2**`(有空格) | 在实际 profile 中确认 AST,再据此固定接受/拒绝结果 | AST + CLI | +| 普通叙述段落出现 `` `n ** 2` `` | 不执行计算、不被作为分支条件 | 结构/副作用性质测试 | +| 代码围栏中出现 `**` | 保持惰性,不会触发运算 | AST + inert fixture | +| 纯说明段落的修改 | 可执行 IR/实际结果不变 | property test | +| 强行嵌套 Markdown 强调导致非法 payload | 给出诊断,不静默换另一计算规则 | negative test | + +**条件头被吞掉的可执行节点:** 当前 `map.rs::condition_of()` 使用 `&item.children[1..]` 形成分支体,首段里第一个 CodeSpan 后若出现 `Strong` / `Emph`,这些可执行标记可能被整体忽略。建议在原有“首个 CodeSpan + 说明文本”语法上增加一个严格检查:首段剩余结构仅允许惰性叙述(按已冻结 profile 判定),保留其原始 AST 与 SourceSpan;若出现其他可执行角色,报 `markdown.invalid_construct`,不能无声丢弃。先补复现 fixture,再制定必要的精确规则;**无需更换 CodeSpan 条件头的正式语法**。 + +**CodeSpan 源码位置:** `condition_of()` 当前使用 `PayloadSegments::single(&literal, condition_node.span)`,须回归验证反引号是否计入字节跨度;若诊断偏移,修正 span 映射而不是改 Markdown AST。要求单/双反引号、中文前缀、换行和多字节 UTF-8 的准确来源测试。 + +### 3.5 正确的测试组织与执行命令 + +```bash +cargo test -p marqdo-expression power_is_right_associative_and_binds_tighter_than_unary_minus +cargo test -p marqdo-runtime text_concatenation_and_power +cargo test -p marqdo-cli --test conformance_ast +cargo test -p marqdo-cli --test conformance_semantics +cargo test -p marqdo-cli --test negative +cargo test -p marqdo-cli --test properties +``` + +逐个检查 `*.expected.json` 的类型标签、stdout、退出码和诊断分类;新增 AST goldens 先独立检查真实树,再写语义期望,不允许一键刷新旧金样掩盖回归。CI 应直接运行上述测试(或被 `cargo test --workspace` 包含),并在单独的 job step 报告 fixture 覆盖,使 Markdown 语义边界成为可发现的门禁。 + +## 4. 第二轮:核心生态、协议与跨平台验证(不能以 Linux 绿灯替代) + +### P1-1:lock v3、环境与可复现性 + +既有 `marqdo.lock v3`、传递包实例图、Git cache、`sync --locked` 和环境原子物化需要继续验证,**不需要重写包管理器**。 + +- `cargo test -p marqdo-cli --test package_env`;增加/核实传递依赖固定、多版本别名、路径/Git 内容篡改、锁文件缺失/过时、`run`/`check` 不下载不改锁、原子安装失败可回滚。 +- Windows 与 macOS 的实际原生测试必须覆盖承诺支持的路径与 Git 功能;Unix-only 设计要作为 UNSUPPORTED 写清。 +- 校验包内容哈希策略对无关构建目录与特殊文件的一致处理,不能因 checkout 位置变化造成无端哈希漂移。 + +### P1-2:Analysis v2 / Trace v2 + +- 运行 `cargo test -p marqdo-cli --test analysis_trace`,及 `tests/consumers/validate_protocols.py`、`analysis_consumer.py`、`trace_consumer.py` 的真实实例验证。 +- 验证跨项目移动后的逻辑身份、资源定位、SourceSpan、跨模块追踪、Trace 与 Analysis 字节摘要绑定、错误/截断/过期证明;不得把缺少某字段的 JSON 视为 Schema 检查成功。 +- 新增乘方/控制流 fixture 后,证明 Analysis 的语义投影一致,Trace 只记录实际命中分支;阅读工具不执行源码。 + +### P1-3:通用 Tool Protocol v1 的独立消费者 + +目前已实现未知名字 `benchmark` 的 Tool fixture,尚缺用于验证三类真实消费者的独立样例。新增**三个小型、彼此独立、可跨平台运行**的模拟 Tool:`sample-view`、`sample-knowledge`、`sample-proof`。名字仅是测试 fixture,不是 CLI 硬编码白名单,也不是在本仓库实现实际 View/Knowledge/Proof。 + +各消费者从公共 `Analysis v2` 或 `Trace v2` 中读取极小字段、产生确定输出;按 Tool v1 manifest 安装、调用和卸载。至少验证: + +- 安装 `marqdo tool install ` 后 `marqdo <自定义名称>` 正确分发;Tool 不在 CLI 源码内特殊注册。 +- 传递原样 argv/cwd/stdin/stdout/stderr 与子进程退出码;打断、卸载、恶意 bundle 路径与 whole-bundle digest 篡改严格拒绝。 +- Analysis/Trace 兼容版本不匹配时在调用前给出清晰诊断。 +- CI 使用临时 `MARQDO_TOOL_HOME`;不触碰个人工具目录,不借由用户 PATH 自动运行未注册程序。 + +### P1-4:ABI/Worker/Foreign 的真实支持矩阵 + +- Linux/macOS Native ABI:使用各自主机目标构建 C fixture;成功调用、多导出、ABI mismatch、损坏 bundle、Worker 超时/崩溃。 +- Windows:如当前没有承诺 Windows Native/Worker,明确 UNSUPPORTED;不得通过“测试跳过”声称可用。仍应验证 Windows 的语言/Tool/包/分析契约。 +- Host Broker:只宣称已有明确实现的 `fs.read` 等能力;其他 `fs.write`、`net.request` 等返回 `capability.unavailable` 不算正常功能支持。 +- Foreign:验证真正启动的可执行文件来自已 pin 的环境,环境内容 digest 与版本漂移检查,非法 wire、stdout/stderr 限额、超时;未实现 uv/npm/venv 自动生成,应在支持矩阵写清,**不作为稳定基础 CLI 的必需特性**。 +- `check` 不执行 Foreign、Plugin 或用户程序;恶意输入下也必须保持静态。 + +## 5. G-C 专用安全验证与准入 + +### 5.1 已完成的事实与不可推断部分 + +ADR-0021 已实现 Bubblewrap supervisor,Linux strict L1 在专用 Ubuntu 26.04 VM、普通用户 `dev` 下通过 7 个对抗测试,包括身份/权限、主机读写、网络、进程与资源。日志位于 `docs/evidence/2026-11-20-strict-gc.log`,对应执行的代码提交为 `b6fc182`。 + +**不能据此推断:** 任意 Ubuntu 都支持 strict;所有 Linux 版本均通过;macOS/Windows 已具备 strict;Worker/Foreign/Native 插件能在 strict 中运行;已经获得 G-C 远程 CI 认证。 + +### 5.2 同 SHA 的安全 CI + +- `.github/workflows/security-linux.yml` 已设定 `[self-hosted, linux, marqdo-security]`,必须由**专用、可销毁 VM** 执行。 +- runner 主机需实际支持非 root Bubblewrap user/mount/PID/net namespace、正确 AppArmor profile;不可通过全局关闭保护或 sudo 模拟非特权用户。 +- `MARQDO_REQUIRE_STRICT_SECURITY=1`:runner 缺机制、跳过测试、7 项中任一失败均视为 FAIL。 +- 记录完整 run URL、被测 SHA、VM image/kernel、bwrap 版本、uid、源码与 artifact 摘要、7/7 结果;只有同 SHA 证据可作为正式发行审核依据。 +- 严格证明“源码从未在降级模式运行”;启动/挂载/namespace 失败时退出非零并且没有副作用。 +- L2(Worker/Foreign)明确拒绝;不应为赶发版扩展 strict 范围,除非另立 ADR 与攻击测试。 + +### 5.3 可选发行范围决策 + +**方案 A(推荐):** 发行声称 Linux strict L1,前提是同 SHA 专用安全 CI PASS。该方案最符合当前 `STATUS.md` 的发布门槛。 + +**方案 B(仅当项目负责人明确改变发行范围):** 发布仅 G-B 的普通 CLI,正式关闭/不宣称 strict L1,文档、功能开关、支持矩阵和测试必须一致,确保用户不会误以为安全运行已认证。不能一边保留可用的 L1 声明一边省略 G-C 证据。 + +## 6. 发行产物与工作流纠偏 + +当前 `release-candidate` job 依赖 Linux、macOS、Windows 核心 CI;在前置失败时被 skip 合理。它只对 release tag 或 `workflow_dispatch` 执行;`docs/releasing.md` 要求源代码与 CI 的 SHA 一致、干净环境安装、checksum、spec/examples、许可证、兼容矩阵与回滚说明。 + +### 6.1 发版前的工作流检查 + +- 修复 P0-1、P0-2 并触发**同一 SHA** 的全平台 CI,所有 jobs 必须 PASS。 +- 单独跑 G-C 真实 VM(若宣称 Linux strict L1);记录 URL 与环境。 +- 校验 Release job 输出的 OS/arch/target 与 `rustc -vV` 一致,不可以把实际 host 二进制错误标注成 `aarch64-apple-darwin`。Windows 未配置发行包就不要宣称提供 Windows 发行资产。 +- Windows/macOS/Linux 原生 smoke(当前支持的功能)必须发生在提取后的干净目录中,不能只在源代码树里 `cargo run`。 +- `git describe --tags`、`Cargo.toml` 版本、二进制 `--version`、归档名、`CHANGELOG.md`、compatibility、Release Notes 保持一致;拒绝不同 SHA 的证据拼接。 +- 发布前先在 RC 上执行 `sha256sum -c`(macOS 对应 `shasum -a 256`),再安装、运行、通过 Python consumers 验证 Analysis/Trace。 +- 发版 tag/release 是不可逆的对外动作,需项目负责人显式批准;Harness 只可预备 RC 和证据,不能因完成文档而自行发 tag。 + +### 6.2 CI 环境可靠性要求 + +- 固定必要工具版本/lock,所有主机对同份 `.mq.md` 拥有一致字节行为(`.gitattributes` 与 CRLF 金样)。 +- 影响平台的改动强制在受支持的平台编译和完整测试;仅 Ubuntu 本地通过不能合并发布。 +- 对 GitHub-hosted runner 资源不稳定场景采取安全失败检测,不能把所有 `strict` 失败一概当可用;对应专用安全 lane 必须跑真成功路径。 +- 避免把工具链安装、网络下载、外部 Python/Node 可用性放进与语言语义直接耦合的金样,从而避免无关环境波动把语言回归误判。 + +## 7. 严格的发布门禁清单(唯一签署表) + +每项只允许 `PASS(证据URL/日志/SHA)`、`FAIL(原因)`、`UNVERIFIED(待执行)`、`EXPLICITLY UNSUPPORTED(范围说明)`。**核心必需项不允许标成 UNSUPPORTED;可选能力明确不发布时才可以。** + +| 门禁 | 当前 c9f01aa8 | 证据/下一动作 | +|---|---|---| +| G0 同 SHA、版本与变更集明确 | PASS(基线记录) | SHA c9f01aa8;0.1.0;无 release | +| G1 Linux fmt/clippy/workspace/smoke | FAIL | strict CI false assumption/EAGAIN | +| G2 Windows workspace + portable smoke | FAIL | cfg! 下 linux::probe E0433 | +| G3 macOS workspace + portable smoke | FAIL | 同 E0433 | +| G4 公共 Schema + 消费者 | PASS(当前 job) | 当前 GitHub CI schema job | +| G5 Markdown AST/乘方新增语义回归 | UNVERIFIED / 待新增 | 第 3 章 test matrix | +| G6 全套负向/源位置/惰性属性测试 | UNVERIFIED(同 SHA 完整 job 未绿) | 现有 `negative`/`properties` 加新增条件头测试 | +| G7 lock v3 与包环境受支持平台 | UNVERIFIED(跨平台未完成) | `package_env`、Git / lock 反例 | +| G8 Tool、ABI、Worker、Foreign 受支持矩阵 | PARTIAL | 新消费者 fixture,macOS Native 实测;Windows 明确范围 | +| G9 Linux strict L1 安全真实测试 | VM PASS(旧 SHA),同 SHA CI UNVERIFIED | self-hosted security lane | +| G10 RC 构建/校验和/跨平台干净安装 | UNVERIFIED | release-candidate job 尚未执行 | +| G11 文档与版本/许可证/兼容矩阵 | PARTIAL | `STATUS.md` 落后最新 CI,需修订 | +| G12 负责人批准 tag + Release | NOT STARTED | 前面门禁 PASS 后审批 | + +**当前总体发布状态:`DO NOT RELEASE`。** 不给虚假的百分比;以余下硬门禁的通过证据量化进度。建议每次提交后在 `STATUS.md` 维护上述表,至少填 commit SHA、各 CI URL 和失败测试。 + +### 7.1 关闭条件:最短可衡量路径 + +- **第一个工作包完成:** G1~G3 全绿(解决旧 CI 三处失败);不再存在 E0433 / 环境依赖的错误断言。 +- **第二个工作包完成:** G5/G6 全绿(乘方、Strong/CodeSpan、列表叙述、负向边界、源 Span);语言语义不需重新设计。 +- **第三个工作包完成:** G7/G8 全绿或清楚地标为非承诺子能力;独立 Tool 消费无硬编码。 +- **第四个工作包完成:** G9 由专用 VM 自托管 CI 在同 SHA PASS,或经负责人明确决定仅发行 G-B 并真正关闭 G-C 声明。 +- **第五个工作包完成:** G10/G11 PASS、Release Candidate 清洁安装,再经批准完成 G12。 + +## 8. 分阶段执行与 PR 编排(供 Harness 持续推进) + +| PR/工作包 | 优先级 | 改动范围 | 先写失败测试 | 所需 CI | Done 定义 | +|---|---|---|---|---|---| +| `RC-01 cross-platform cfg` | P0 | `marqdo-sandbox` 平台检测与依赖 cfg | 非 Linux compile + strict refusal | Linux/Windows/macOS | 编译、测试、拒绝契约绿 | +| `RC-02 strict CI robustness` | P0 | `linux.rs`、`integration_cli.rs`、安全适配层 seam | probe-success/launch-EAGAIN | 普通 Linux + VM | 两种环境均有正确契约 | +| `RC-03 Markdown power fixtures` | P0/P1 | AST/conformance/negative/property/spec 示例 | 新乘方 goldens、错误 spans | 全平台 workspace tests | 结果与语法精确一致 | +| `RC-04 consumers & platform coverage` | P1 | Tool fixture、包/ABI/Foreign CI | 独立名称+恶意 bundle+ABI | Linux/macOS/Windows 支持矩阵 | 无硬编码,边界清楚 | +| `RC-05 G-C security CI` | P1(若宣称 L1 则必需) | self-hosted VM lane 与证据绑定 | 真逃逸负例,不允许 skip | 安全 runner | 同 SHA 7/7 PASS | +| `RC-06 artifact and release` | 发布门槛 | 版本、文档、工作流、checksums | 干净安装的 smoke | 全平台/安全/RC | 可签署发行记录 | + +**PR 原则:** 每 PR 对应一个可以独立关闭的错误类,绝不把跨平台修复、控制流语义重定义、外部产品开发打包成大重构;在新 CI 上出现额外故障则新增最小复现并纳入同类工作包。每个 PR 的提交信息至少包含:`WHY / WHAT / TESTS / CI_URL / BREAKING_CHANGE / SECURITY_SCOPE`。 + +## 9. Ubuntu 开发工作流与 DeepSeek Harness 权限 + +日常执行以普通用户进行: + +```bash +pwd +git status --short --branch +git remote -v +git rev-parse HEAD +git fetch --all --prune +rustc -vV +cargo fmt --all -- --check +cargo clippy --workspace --all-targets -- -D warnings +cargo test --workspace --locked +cargo build --release --locked -p marqdo-cli +``` + +**重要:** 本地 `origin` 可能是 Gitee,而 GitHub 才运行 CI。Push 到 Gitee 的输出只是 Gitee 更新证据,不能证明 GitHub 镜像/Actions 已经检出了同一 SHA。先对比 GitHub `master` SHA,再读取 Actions 结果,不能把两个远端混为一谈。 + +可在专用、可销毁 Ubuntu VM 中给予 Harness 有审计的 sudo,安装测试依赖与配置隔离环境;但**实际 G-C 安全用例必须以普通用户运行**。若当前机器不能创建 namespace,则开发普通语言/CI 工作包可继续,G-C 转到已验证 VM,不能通过关闭 AppArmor 全局规则来凑成功。 + +日常建议按以下顺序: + +```bash +# 快速复现核心行为 +cargo test -p marqdo-cli --test integration_cli +cargo test -p marqdo-cli --test conformance_ast +cargo test -p marqdo-cli --test conformance_semantics +cargo test -p marqdo-cli --test negative +cargo test -p marqdo-cli --test analysis_trace +cargo test -p marqdo-cli --test tool_protocol +cargo test -p marqdo-cli --test package_env + +# 安全专用测试:仅在能实际提供 OS namespace 的 VM 中强制执行 +MARQDO_REQUIRE_STRICT_SECURITY=1 ./tests/security/run-lane.sh +``` + +每修完一个问题应先本地跑最小用例,再跑 workspace,再等待远端支持平台 CI;只有被 CI 验证的 SHA 才能进入下一门禁。不要跳过失败测试,也不要把 `cargo check` 的通过当作 `cargo test` 的通过。 + +## 10. 发行验收报告模板 + +在仓库中维护 `docs/evidence/RELEASE_CANDIDATE__.md`(文件名在创建时替换),填入下面模板,并将 CI 链接明确绑定 SHA: + +```text +Marqdo CLI release candidate +Source SHA: +Workspace version: +Intended release target/platforms: +Linux fmt/clippy/workspace/smoke URL / PASS?: +Windows native runtime tests URL / PASS?: +macOS native runtime tests URL / PASS?: +Schema + independent consumers URL / PASS?: +Markdown/power AST, semantic, negative fixture results: +Package/Tool/ABI/Foreign supported-matrix results: +Linux strict L1 claimed? (yes/no): +If yes, G-C self-hosted security URL + 7/7 evidence SHA: +Unsupported optional features: +Release archive names, targets, SHA-256: +Clean-install smoke (external directory) outcome: +Changelog / COMPATIBILITY / STATUS links and version: +Known limitations and rollback approach: +Gate summary G0..G12: +FINAL DECISION: RELEASE / DO NOT RELEASE +Approved by / time: +``` + +必须通过:`G1~G8`、`G10`、`G11`,以及如果承诺 strict L1 则 `G9`;`G12` 是最后的人工批准。报告附全部原始日志或 URL。不得将未运行的 Windows/Worker/Foreign 自动环境功能写成已通过。 + +## 11. 可直接发送给 DeepSeek Harness 的完整任务指令 + +> 下面是执行指令,不是已完成工作的声明。用户允许在专用 Ubuntu 开发 VM 中按需 sudo,不代表允许绕过独立安全验证或未经许可发布 tag。 + +```text +你现在负责 cflmy/marqdo-cli 的稳定版发版收尾。工作以 +`docs/NEXT_RELEASE_CI_CONVERGENCE.md` 为唯一当前 CI 收敛计划; +语言规范以 spec/、已接受 ADR、AGENTS.md 为准。 + +先获取最新的本地 HEAD、Gitee 和 GitHub master SHA、最近一次 GitHub CI。 +若仓库已有新提交,必须重新定位失败,不许盲目修复文档中基线 SHA 的旧故障。 + +目标不是扩写 CLI,而是在不改变冻结语言语义的前提下完成: +(1) Windows/macOS 的 Linux-only cfg 编译修复; +(2) Ubuntu 普通 CI 下 strict probe 与实际启动竞态/资源不足的 fail-closed + 契约,并在独立安全 VM 保证严格隔离正向执行与 7/7 攻击矩阵; +(3) 增加完整 Markdown AST、乘方、分支/循环条件、源 Span、惰性与 + 错误边界的黄金测试和端到端语义测试,不擅自改 CodeSpan 条件语法; +(4) 验证 lock v3、Analysis/Trace、完全通用的 Tool、ABI/Worker/Foreign + 的支持矩阵和独立消费者; +(5) 完成全平台 CI、同 SHA 的 G-C 证据、Release Candidate 干净安装、 + checksums、COMPATIBILITY、STATUS、CHANGELOG 与发版审批材料。 + +开发纪律: +- 修复前先写最小失败复现,修复后运行其正反测试与 workspace tests。 +- 不删除/跳过失败测试;不改金样来掩盖未知变化;不降级安全模式。 +- 不写死官方 Tool 名称,不引入第二解释器,不扩大顶层命令数。 +- 对于未承诺的 Windows ABI、strict L2、uv/npm 自动生成环境, + 明确 UNSUPPORTED,不为了“全部完成”强行加入 CLI。 +- 在专用 VM 内可为环境配置使用 sudo;G-C 执行者必须是普通用户。 +- 每个 PR 提供源 SHA、问题根因、代码位置、运行测试、GitHub CI URL、 + 对平台和安全承诺的影响。任何 CI 失败均视为门禁未通过。 +- 最新仓库若出现额外阻断,增补最小再现测试及 STATUS 事实,继续 + 将问题关闭到 release gate PASS;不要反复只提交开发计划。 +- 版本 tag / 正式 Release 需要项目负责人明确审批,不可自动发布。 + +最终交付:G0..G12 门禁矩阵、完整运行日志/CI 链接、可信安全范围、 +可安装和验证 checksum 的 RC 产物、完整变更说明、可复现发行流程。 +如果任一必要门禁没有真实 PASS,明确给出 DO NOT RELEASE 和下一步动作。 +``` + +--- + +## 12. 外部事实与代码审查索引 + +- 最新审查提交:`https://github.com/cflmy/marqdo-cli/commit/c9f01aa8fb127a2dcc125103ef794832984774ad` +- 最新 CI:`https://github.com/cflmy/marqdo-cli/actions/runs/44692692318` +- 工作区状态:`docs/STATUS.md`、`COMPATIBILITY.md` +- 安全机制与证据:`docs/adr/0021-linux-strict-isolation.md`、`docs/security-gate.md`、`docs/evidence/2026-11-20-strict-gc.md` +- CLI 测试:`crates/cli/tests/integration_cli.rs`、`conformance_ast.rs`、`conformance_semantics.rs`、`negative.rs`、`properties.rs` +- Markdown/表达式:`crates/marqdo-markdown/src/profile.rs`、`crates/marqdo-frontend/src/map.rs`、`crates/marqdo-expression/src/parser.rs`、`crates/marqdo-runtime/src/value_ops.rs` +- 发行流程:`.github/workflows/ci.yml`、`.github/workflows/security-linux.yml`、`docs/releasing.md` + +**证据边界说明:** 这里的 GitHub CI 结论来自该次真实 Actions 运行与原始任务日志;本文件编写期间没有在作者环境重新运行 Cargo/OS 隔离测试,也没有修改 GitHub 仓库。新增代码与测试为实施要求,不应被读成已完成。后续维护者必须将所有 `UNVERIFIED` 转为含原始来源的结果,才能签署稳定版本。 diff --git a/docs/STATUS.md b/docs/STATUS.md index 17b22a9..0812ab6 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -1,7 +1,8 @@ # Marqdo Implementation Status Snapshot: **2026-11-20**, workspace version `0.1.0`, no release tag. -Authoritative task plan: [`STABLE_RELEASE_IMPLEMENTATION.md`](STABLE_RELEASE_IMPLEMENTATION.md). +Authoritative CI convergence plan: +[`NEXT_RELEASE_CI_CONVERGENCE.md`](NEXT_RELEASE_CI_CONVERGENCE.md). Support matrix: [`../COMPATIBILITY.md`](../COMPATIBILITY.md). This file records what was actually executed on the current tree. "Implemented" @@ -10,130 +11,133 @@ commands were run and where. The historical M0.5 snapshot is preserved at [`history/STATUS-M0.5-snapshot.md`](history/STATUS-M0.5-snapshot.md) and must not be read as current status. -## 1. CI baseline and current evidence +## 1. Remote baseline and current evidence -The last known public GitHub CI at baseline `e966b76` (run -[44680378977](https://github.com/cflmy/marqdo-cli/actions/runs/44680378977)) -was **not green**: +GitHub `master` is still `c9f01aa8fb127a2dcc125103ef794832984774ad`; the latest +public CI is run +[44692692318](https://github.com/cflmy/marqdo-cli/actions/runs/44692692318) +and is **red**: -- Linux `fmt + clippy + workspace tests + smoke`: PASS. -- Schema instance validation + Python consumers: PASS. -- macOS `cargo test --workspace`: FAIL — - `plugin_inspect_and_explicit_trusted_invocation` used a Linux `.so` and a - Linux-target manifest. -- Windows `cargo test --workspace`: FAIL — AST golden bytes were CRLF after - checkout while the parser emits LF, producing "0 line(s) differ". +- Linux `fmt + clippy + test`: FAIL — + `strict_mode_enforces_isolation_or_refuses_closed` hit + `bwrap: Creating new namespace failed: Resource temporarily unavailable`. +- macOS / Windows `cargo test --workspace`: FAIL — `E0433` on + `linux::probe()` under `cfg!`. +- Schema instance validation + consumers: PASS. +- Release candidate artifact: SKIPPED (upstream failure; tag/dispatch only). -This checkout has a Gitee remote only and no GitHub Actions credentials. **No -new remote CI URL can be produced from this host.** The local gate below is -real evidence for this machine, not a substitute for the native Windows/macOS -lanes. +This checkout has a Gitee remote and **no GitHub credentials**. No new remote +CI URL can be produced from this host. The evidence below is local/VM evidence +for the convergence commit, not a substitute for the native GitHub lanes. -### Local gate after the stabilization commits +Convergence code/security SHA: **`f075c967f24d885ac42c1e99329bee3498154598`** +(the following docs commit only adds this report and release material; code is +byte-identical). -All commands were run from the repository root with Rust 1.100.0: +### Local static and test gate (Ubuntu 26.04, Rust 1.100.0) ```text cargo fmt --all -- --check PASS cargo clippy --workspace --all-targets -- -D warnings PASS -cargo test --workspace PASS -cargo test -p marqdo-cli --test conformance_ast PASS (4 tests) -cargo test -p marqdo-cli --test integration_cli PASS (23 tests) -cargo test -p marqdo-cli --test plugin_worker PASS (4 tests) -cargo test -p marqdo-foreign --test provider PASS (8 tests) -cargo test --workspace PASS (47 binaries, - 360 tests, 0 failed) +cargo test --workspace --locked PASS + (47 test binaries, 0 failed; includes 7/7 Linux security tests) ``` -Linux G-C security lane (disposable Ubuntu 26.04 VM, ordinary user `dev`): +### G-C security lane (disposable Ubuntu 26.04 VM, ordinary user `dev`) + +Source: `git archive f075c96` extracted in the VM (not the dev container). +Host: QEMU/TCG, kernel `7.0.0-43-generic`, `systemd-detect-virt --container` += `none`, bubblewrap 0.11.1 with `bwrap-userns-restrict`, uid 1000. ```text -crates/marqdo-sandbox/tests/security_linux.rs PASS (7/7) -tests/security/run-lane.sh PASS +./tests/security/run-lane.sh + adversarial helper matrix: 7 passed, 0 failed, 0 ignored + positive CLI contract: PASS + external-execution surfaces refused: PASS + forged active marker rejected: PASS + G-C security lane: PASS +cargo test --workspace --locked (same archive): 47 ok, 0 failed ``` -The committed code SHA for this evidence is `b6fc182`; the VM lane was re-run -from a `git archive` of that commit. See -[`evidence/2026-11-20-strict-gc.md`](evidence/2026-11-20-strict-gc.md). - -Windows checkout reproduction: a fresh local clone with -`git -c core.autocrlf=true clone ...` kept goldens at LF, preserved the CRLF -byte fixture, and passed all four `conformance_ast` tests. The previous -behavior was reproduced by converting one golden to CRLF: the new diagnostic -reports the first differing byte and "the only difference is line endings". - -macOS reproduction is **not possible on this host**; the fix removes the Linux -assumption by generating the manifest from the host triple and building -`solver.dylib` with `-dynamiclib`. It remains UNVERIFIED until the macOS lane -runs. +Logs: [`evidence/2026-11-20-strict-gc-f075c96.md`](evidence/2026-11-20-strict-gc-f075c96.md). +This is still a **local VM lane**, not a self-hosted GitHub Actions security URL. ## 2. Work package status | # | Work package | State | Evidence | |---|---|---|---| -| 0 | Windows AST line endings | **Fixed locally, Windows CI UNVERIFIED** | `.gitattributes`, byte diagnostics, CRLF structure test, autocrlf clone PASS | -| 1 | macOS native plugin fixtures | **Fixed locally, macOS CI UNVERIFIED** | host-target manifest + dylib flags, foreign-target/tamper/ABI tests PASS | -| 2 | Status/docs reconcile | **Done** | this file, `COMPATIBILITY.md`, `CHANGELOG.md`, `docs/releasing.md`, `docs/security-gate.md` | -| 3 | Package lock v3 reproducibility | **Implemented; targeted audit pending** | ADR-0016, `cargo test -p marqdo-cli --test package_env` PASS | -| 4 | Analysis/Trace/Tool protocol | **Implemented; consumers PASS locally** | schemas + `tests/consumers/*.py`, `analysis_trace`/`tool_protocol` PASS; `check_never_spawns_a_foreign_kernel` PASS | -| 5 | Foreign pinned environment | **Done (ADR-0020)** | provider tests PASS; env binds interpreter; version drift rejected | -| 6 | ABI session/broker hardening | **Partial** | `fs.read` bridge + budgets + handle tests PASS; Windows ABI unsupported; broader services still `capability.unavailable` | -| 7 | Linux strict probe | **Done** | runtime Bubblewrap probe; unavailable host reports the real reason | -| 8 | Linux strict pure (L1) | **DONE (VM-verified)** | ADR-0021; 7/7 adversarial tests + CLI matrix PASS in disposable Ubuntu VM | -| 9 | Linux strict extensions (L2) | **NOT IMPLEMENTED** | strict rejects Worker/Foreign/native ABI; future ADR needed | -| 10 | Native platform matrix | **Partial** | Linux PASS; macOS/Windows source fixes, remote lanes absent | -| 11 | Independent ecosystem consumers | **Partial** | Analysis/Trace Python consumers PASS; three Tool fixtures not added | -| 12 | RC/docs/artifacts | **Candidate build only** | release docs, checksummed artifact, clean-install smoke; NOT released | +| 0 | Windows AST line endings | Fixed locally; **Windows CI UNVERIFIED** | `.gitattributes`, CRLF fixture | +| 1 | macOS native plugin fixtures | Fixed locally; **macOS CI UNVERIFIED** | host-target manifest + dylib flags | +| 2 | Cross-platform strict `cfg` | **Fixed locally; native CI UNVERIFIED** | `#[cfg]` dispatch + non-Linux regression test | +| 3 | Strict probe→launch race | **Fixed locally; GitHub Linux CI UNVERIFIED** | fail-closed CLI contract + probe-OK/launch-EAGAIN seam test | +| 4 | Parallel security matrix isolation | **Fixed** | unique paths + helper `OnceLock`; 7/7 in parallel workspace run | +| 5 | Markdown/power/control-flow corpus | **Done locally** | 160 AST, 44 semantic, 52 compile-negative, 12 runtime-negative fixtures | +| 6 | Condition header + source spans | **Fixed** | executable tails rejected; literal-inside-backtick mapping tests | +| 7 | Independent Tool consumers | **Done locally** | `sample-view`/`sample-knowledge`/`sample-proof` E2E test | +| 8 | lock v3 reproducibility | **Implemented; tamper test added** | `package_env` PASS | +| 9 | Analysis/Trace/Tool/ABI/Foreign | **Implemented; supported-matrix bounded** | protocol tests, plugin/worker/foreign tests | +| 10 | Linux strict L1 | **VM PASS at f075c96; no CI URL** | 7/7 + positive CLI | +| 11 | Linux strict L2 | **NOT IMPLEMENTED / UNSUPPORTED** | strict rejects Worker/Foreign/native ABI | +| 12 | Windows Native/Worker ABI | **UNSUPPORTED** | no Windows ABI artifact/claim | +| 13 | RC artifact | **Linux candidate only; no release** | clean-install + checksums; macOS not built here | +| 14 | Release approval | **NOT STARTED** | requires owner approval | ## 3. Verified capabilities -- Frozen Markdown profile `marqdo.md.v1` with 150 AST goldens and explicit +- Frozen Markdown profile `marqdo.md.v1` with 160 AST goldens and explicit CRLF byte semantics. -- Native Rust interpreter with 36 semantic goldens, 48 compile-error fixtures, +- Native Rust interpreter with 44 semantic goldens, 52 compile-error fixtures, and runtime error source attribution. +- Native `**` power is pinned end-to-end: right associativity, unary-minus + precedence, parentheses, float negative exponents, branch/loop conditions, + Strong+CodeSpan payloads, and inert prose/code fences. - lock v3 full transitive package-instance graph, verified Git cache, strict `sync --locked`, atomic `.marqdo/env` materialization; `run`/`check` never - fetch or rewrite the lock. + fetch or rewrite the lock. Locked path content tamper is rejected without + rewriting the lock or environment. - Analysis v2 (logical identity, resources, byte digest) and Trace v2 (module ownership, bounds, truncation, stale detection) with independent Python consumers and JSON Schema validation. -- Tool Protocol v1 with arbitrary command names, SemVer/protocol negotiation, - whole-bundle digest verification, atomic install/remove. +- Tool Protocol v1 with arbitrary command names (no CLI hard-coding), + SemVer/protocol negotiation, whole-bundle digest verification, atomic + install/remove, and three independent Analysis/Trace consumers. - Plugin ABI v1: native + worker transports, capability broker executing `fs.read` through `ProjectFs`, per-invocation budgets, host-owned handle identity, crash/timeout isolation. Not an OS sandbox. - Foreign kernels: one-shot Python/Node, typed wire, timeout/output caps, - provider and environment digests, and (ADR-0020) environment-bound provider - with interpreter-version verification. + provider/environment digests, environment-bound provider, interpreter + version verification. +- Linux strict L1: Bubblewrap namespace supervisor, runtime probe, fail-closed + launch, child self-verification, 7/7 adversarial matrix. ## 4. Open blockers and limits -1. **No remote CI evidence for this commit.** The repository remote is Gitee; - no GitHub workflow was executed. Windows/macOS fixes are UNVERIFIED there. -2. **G-C is VM-verified but not CI-signed.** Strict L1 passes the full - adversarial matrix in a disposable Ubuntu 26.04 VM (ADR-0021, - [`security-gate.md`](security-gate.md)), and is enabled only when the - runtime Bubblewrap probe succeeds. No remote security-lane URL exists yet, - and strict L2 (Worker/Foreign) is not implemented. -3. Windows Native/Worker ABI is explicitly unsupported (no `cc` toolchain in - the lane); it is not counted as a pass. +1. **No remote CI evidence for the convergence SHA.** Windows/macOS fixes and + the Linux EAGAIN contract are UNVERIFIED on GitHub. G1/G2/G3 remain FAIL + until a real run exists. +2. **G-C is VM-verified but not CI-signed.** No self-hosted security-lane URL + for f075c96 exists. +3. Windows Native/Worker ABI is explicitly UNSUPPORTED (no Windows `cc` + fixture lane, Unix-gated worker tests). 4. `fs.write`, `net.request`, `process`, `clock`, `random` are not executed broker services; unsupported requests must return `capability.unavailable`. 5. uv/npm/venv provisioning is not implemented. Only a pre-provisioned, digest-pinned directory with a regular-file executable is supported. -6. Three independent Tool consumers (`sample-view`/`knowledge`/`proof`) are - not yet added; only the portable `benchmark` fixture and Analysis/Trace - Python consumers exist. -7. No release tag/binary publication. A candidate archive and checksums are - produced locally; the release decision is **DO NOT RELEASE** until the - native CI matrix and a security-lane CI URL exist. +6. No Windows/macOS RC archive exists from this host. The release-candidate + workflow can build macOS on GitHub, but it has not run for this SHA. +7. No release tag/binary publication. The release decision is **DO NOT + RELEASE** until the native CI matrix and a security-lane CI URL exist. ## 5. Evidence files - [`evidence/2026-11-20-local-gate.md`](evidence/2026-11-20-local-gate.md) — - exact local commands, Windows autocrlf reproduction and clean-install smoke. -- [`security-gate.md`](security-gate.md) — the full G-C VM evidence, escape - matrix and strict L1/L2 limits. + earlier local gate and Windows autocrlf reproduction. +- [`evidence/2026-11-20-strict-gc-f075c96.md`](evidence/2026-11-20-strict-gc-f075c96.md) + — current VM lane, environment, full log and workspace test log. +- [`evidence/RELEASE_CANDIDATE_0.1.0_f075c96.md`](evidence/RELEASE_CANDIDATE_0.1.0_f075c96.md) + — G0..G12 matrix and RC decision. +- [`security-gate.md`](security-gate.md) — mechanism, attack matrix and strict + L1/L2 limits. ## 6. Reproduce @@ -142,7 +146,7 @@ export PATH="$HOME/.cargo/bin:$PATH" # On hosts with a read-only $HOME, point CARGO_HOME at a writable directory. cargo fmt --all -- --check cargo clippy --workspace --all-targets -- -D warnings -cargo test --workspace +cargo test --workspace --locked cargo build --release --locked -p marqdo-cli ``` @@ -154,3 +158,9 @@ Consumer evidence: python3 tests/consumers/analysis_consumer.py /tmp/a.json python3 tests/consumers/trace_consumer.py /tmp/a.json /tmp/t.json ``` + +G-C (ordinary user, disposable VM only): + +```bash +MARQDO_REQUIRE_STRICT_SECURITY=1 ./tests/security/run-lane.sh +``` diff --git a/docs/evidence/2026-11-20-strict-gc-f075c96.log b/docs/evidence/2026-11-20-strict-gc-f075c96.log new file mode 100644 index 0000000..86d5d71 --- /dev/null +++ b/docs/evidence/2026-11-20-strict-gc-f075c96.log @@ -0,0 +1,38 @@ +Warning: Permanently added '[127.0.0.1]:2222' (ED25519) to the list of known hosts. +== adversarial helper matrix == + Compiling marqdo-sandbox v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-sandbox) + Finished `test` profile [unoptimized + debuginfo] target(s) in 9.71s + Running tests/security_linux.rs (/home/dev/marqdo-src/target/debug/build/marqdo-sandbox/73fdd38fdea71ea2/out/security_linux-73fdd38fdea71ea2) + +running 7 tests +test strict_child_cannot_escape_via_proc_or_privileges ... ok +test strict_child_cannot_reach_the_network ... ok +test strict_child_cannot_read_host_files_but_reads_the_project ... ok +test strict_child_cannot_write_outside_or_into_the_project ... ok +test strict_child_identity_is_unprivileged_and_namespaced ... ok +test strict_supervisor_enforces_fd_and_process_limits ... ok +test strict_supervisor_enforces_memory_cpu_and_output_limits ... ok + +test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.12s + +== build CLI == + Compiling marqdo-span v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-span) + Compiling marqdo-sandbox v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-sandbox) + Compiling marqdo-package v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-package) + Compiling marqdo-value v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-value) + Compiling marqdo-expression v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-expression) + Compiling marqdo-plugin-abi v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-plugin-abi) + Compiling marqdo-math v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-math) + Compiling marqdo-foreign v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-foreign) + Compiling marqdo-ir v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-ir) + Compiling marqdo-host v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-host) + Compiling marqdo-markdown v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-markdown) + Compiling marqdo-runtime v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-runtime) + Compiling marqdo-frontend v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-frontend) + Compiling marqdo-cli v0.1.0 (/home/dev/marqdo-f075c96/crates/cli) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 49s +strict mechanism: bubblewrap 0.11.1 (user/mount/PID/net/UTS/IPC namespaces + no-new-privs + rlimits) +== positive CLI contract == +== external-execution surfaces are refused == +== forged active marker is rejected == +G-C security lane: PASS diff --git a/docs/evidence/2026-11-20-strict-gc-f075c96.md b/docs/evidence/2026-11-20-strict-gc-f075c96.md new file mode 100644 index 0000000..a66bad4 --- /dev/null +++ b/docs/evidence/2026-11-20-strict-gc-f075c96.md @@ -0,0 +1,114 @@ +# G-C strict-isolation evidence — source archive `f075c96` (2026-11-20) + +Source SHA: **`f075c967f24d885ac42c1e99329bee3498154598`** +Source archive: `git archive --format=tar.gz --prefix=marqdo-f075c96/ f075c96` +SHA-256 `dc5df444ef6c4f4c073005f355c95bc765c0e4a8c593799e14c22ae10e0520e3`. + +Status: **G-C local VM lane PASS**, run as ordinary user `dev` (uid 1000) in a +disposable Ubuntu 26.04 QEMU/TCG VM. **No self-hosted GitHub Actions security +URL exists for this SHA**, so this is not yet a CI-signed G-C. + +Full logs: +[`2026-11-20-strict-gc-f075c96.log`](2026-11-20-strict-gc-f075c96.log), +[`2026-11-20-workspace-tests-f075c96.log`](2026-11-20-workspace-tests-f075c96.log). + +## Environment + +```text +id: uid=1000(dev) gid=1000(dev) groups=1000(dev),27(sudo) +uname: Linux marqdo-security 7.0.0-43-generic #43-Ubuntu SMP ... x86_64 +virt: systemd-detect-virt --container -> none (QEMU/TCG guest) +bwrap: bubblewrap 0.11.1 (bwrap-userns-restrict) +cc: cc (Ubuntu 15.2.0-16ubuntu1) 15.2.0 +node: v22.22.1 +python: Python 3.14.4 +rustc: rustc 1.100.0 (0ef1bc386 2026-11-09) +uid_map: 0 0 4294967295 +cgroup2: rw,nosuid,nodev,noexec,relatime,nsdelegate,... +``` + +The lane was extracted from `git archive`, not run from the development +container. `CARGO_TARGET_DIR` pointed at the cached VM target directory; the +lane was fixed to honour that variable rather than hard-coding `target/debug`. + +## Lane command + +```bash +cd ~/marqdo-f075c96 +export PATH=$HOME/.cargo/bin:$PATH +export CARGO_TARGET_DIR=$HOME/marqdo-src/target +MARQDO_REQUIRE_STRICT_SECURITY=1 ./tests/security/run-lane.sh +``` + +## Result + +```text +== adversarial helper matrix == +running 7 tests +test strict_child_cannot_escape_via_proc_or_privileges ... ok +test strict_child_cannot_reach_the_network ... ok +test strict_child_cannot_read_host_files_but_reads_the_project ... ok +test strict_child_cannot_write_outside_or_into_the_project ... ok +test strict_child_identity_is_unprivileged_and_namespaced ... ok +test strict_supervisor_enforces_fd_and_process_limits ... ok +test strict_supervisor_enforces_memory_cpu_and_output_limits ... ok +test result: ok. 7 passed; 0 failed; 0 ignored + +strict mechanism: bubblewrap 0.11.1 (user/mount/PID/net/UTS/IPC namespaces + no-new-privs + rlimits) +== positive CLI contract == +== external-execution surfaces are refused == +== forged active marker is rejected == +G-C security lane: PASS +``` + +The same archive ran `cargo test --workspace --locked`: **47 test binaries, +0 failed**, including the seven security cases in parallel (the parallel +scratch-path collision is fixed in this SHA). + +## Case-level observations + +| Attack/surface | Observed inside sandbox | +|---|---| +| identity | `uid=1000`, `pid=1`, `NoNewPrivs: 1`, `CapEff: 0` | +| `/etc/shadow`, `/root`, `$HOME` | `DENIED` | +| `/project/allowed.txt` | `OK` | +| write outside project / into `/project` | `DENIED`; no host file created | +| write `/tmp` | allowed in private tmpfs, host unaffected | +| `/proc/1/root/etc/shadow` | `DENIED` | +| inherited fds above stdio | none | +| `setuid(0)`, `mount`, nested `unshare` | `DENIED` | +| IPv4 connect / raw socket | `DENIED` | +| fd loop | `EMFILE` <= 64 | +| fork loop | bounded below 200 | +| 768 MiB allocation | denied/killed by 512 MiB `RLIMIT_AS` | +| infinite CPU loop | stopped by wall-clock/CPU budget | +| 4 MiB stdout | stopped at the 64 KiB output limit | + +## CLI behavior in the VM + +```text +run examples/hello.mq.md --mode strict -> 你好,Marqdo (exit 0) +call examples/factorial.mq.md 数学.阶乘 --arg n=5 --mode strict -> 120 +run examples/multi-module/index.mq.md --mode strict -> exit 0 +run --mode strict --json -> success: true +run --mode strict --allow-foreign -> exit 2 +run --mode strict --allow-read/--allow-write -> exit 2 +run --mode strict --trust-native-plugin --plugin ... -> exit 2 +run --mode strict --kernel ... -> exit 2 +run --mode strict --trace-file ... -> exit 2 +MARQDO_STRICT_ACTIVE=1 run --mode strict -> exit 1 (not PID 1) +``` + +## Residual risks and non-claims + +* Strict L2 (Worker/Foreign/native ABI inheriting the sandbox) is not + implemented; those flags are rejected. Native ABI is never allowed in strict. +* rlimits are used instead of cgroup-v2 accounting; no cgroup enforcement is + claimed. +* Filesystem TOCTOU is reduced by read-only mounts but not formally proven + against a racing host user. +* Network is denied by the network namespace, not a seccomp syscall allowlist. +* **A remote self-hosted security-lane CI run is still required** before a + release may call G-C CI-verified. `.github/workflows/security-linux.yml` + defines that lane; `MARQDO_REQUIRE_STRICT_SECURITY=1` makes a missing + mechanism fail instead of skip. diff --git a/docs/evidence/2026-11-20-workspace-tests-f075c96.log b/docs/evidence/2026-11-20-workspace-tests-f075c96.log new file mode 100644 index 0000000..8d14702 --- /dev/null +++ b/docs/evidence/2026-11-20-workspace-tests-f075c96.log @@ -0,0 +1,672 @@ +Warning: Permanently added '[127.0.0.1]:2222' (ED25519) to the list of known hosts. + Compiling marqdo-plugin-sdk v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-plugin-sdk) + Compiling marqdo-runtime v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-runtime) + Compiling marqdo-foreign v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-foreign) + Compiling marqdo-cli v0.1.0 (/home/dev/marqdo-f075c96/crates/cli) + Compiling marqdo-package v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-package) + Compiling marqdo-host v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-host) + Compiling marqdo-frontend v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-frontend) + Compiling marqdo-markdown v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-markdown) + Compiling marqdo-ir v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-ir) + Compiling marqdo-sandbox v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-sandbox) + Compiling marqdo-math v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-math) + Compiling marqdo-plugin-abi v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-plugin-abi) + Compiling marqdo-value v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-value) + Compiling marqdo-expression v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-expression) + Compiling marqdo-span v0.1.0 (/home/dev/marqdo-f075c96/crates/marqdo-span) + Finished `test` profile [unoptimized + debuginfo] target(s) in 2m 35s + Running unittests src/main.rs (/home/dev/marqdo-src/target/debug/build/marqdo-cli/44db2e5fd6960968/out/marqdo-44db2e5fd6960968) + +running 2 tests +test args::tests::rejects_non_constant_and_malformed_arguments ... ok +test args::tests::parses_typed_arguments ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s + + Running tests/analysis_trace.rs (/home/dev/marqdo-src/target/debug/build/marqdo-cli/8805c2b5d230266a/out/analysis_trace-8805c2b5d230266a) + +running 6 tests +test failed_check_removes_stale_analysis ... ok +test analysis_v2_projects_addressable_formula_and_code_resources ... ok +test analysis_v2_identity_is_location_independent ... ok +test trace_v2_budget_truncates_long_loops_without_failing_the_run ... ok +test trace_records_calls_effects_and_status_without_secrets ... ok +test analysis_is_deterministic_and_has_stable_semantic_nodes ... ok + +test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.69s + + Running tests/conformance_ast.rs (/home/dev/marqdo-src/target/debug/build/marqdo-cli/4a86832a684510a9/out/conformance_ast-4a86832a684510a9) + +running 4 tests +test byte_diff_helpers_distinguish_line_endings_from_semantics ... ok +test ast_goldens_use_canonical_lf_bytes ... ok +test crlf_fixture_is_preserved_as_bytes ... ok +test ast_goldens_match_the_frozen_profile ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.56s + + Running tests/conformance_semantics.rs (/home/dev/marqdo-src/target/debug/build/marqdo-cli/775a9ac61fe4e563/out/conformance_semantics-775a9ac61fe4e563) + +running 1 test +test semantic_goldens_match_end_to_end_execution ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 4.21s + + Running tests/examples_r6.rs (/home/dev/marqdo-src/target/debug/build/marqdo-cli/c12f7ae83e17dbbf/out/examples_r6-c12f7ae83e17dbbf) + +running 4 tests +test public_schemas_are_valid_json_and_versioned ... ok +test unknown_tool_name_installs_and_dispatches ... ok +test multi_version_packages_run_without_an_implicit_override ... ok +test external_kernel_provider_runs_without_core_changes ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.98s + + Running tests/integration_cli.rs (/home/dev/marqdo-src/target/debug/build/marqdo-cli/1987735ce297336b/out/integration_cli-1987735ce297336b) + +running 20 tests +test condition_parse_diagnostic_points_inside_the_code_span ... ok +test check_exit_codes_and_diagnostics ... ok +test fmt_normalises_line_endings_and_trailing_newlines ... ok +test check_never_spawns_a_foreign_kernel ... ok +test inspect_outputs_ast_units_signatures_ir_and_refs ... ok +test init_creates_a_runnable_project ... ok +test call_executes_examples_with_typed_arguments ... ok +test lock_and_sync_locked_detect_dependency_tampering ... ok +test platform_reports_strict_capability_truthfully ... ok +test multi_module_imports_and_cycles ... ok +test plugin_foreign_target_is_rejected_without_loading ... ok +test examples_run_end_to_end_including_foreign_when_available ... ok +test power_branch_loop_and_inert_code_end_to_end ... ok +test run_json_embeds_program_stdout ... ok +test run_refuses_documents_with_compile_errors ... ok +test runtime_error_in_imported_module_reports_that_module ... ok +test plugin_artifact_tampering_is_rejected_before_load ... ok +test strict_mode_enforces_isolation_or_refuses_closed ... ok +test plugin_abi_major_mismatch_is_rejected_before_execution ... ok +test plugin_inspect_and_explicit_trusted_invocation ... ok + +test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.65s + + Running tests/negative.rs (/home/dev/marqdo-src/target/debug/build/marqdo-cli/c746e5e201607331/out/negative-c746e5e201607331) + +running 3 tests +test warning_goldens ... ok +test compile_time_negative_goldens ... ok +test runtime_negative_goldens ... ok + +test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.23s + + Running tests/package_env.rs (/home/dev/marqdo-src/target/debug/build/marqdo-cli/ffe0eb54eae24ed0/out/package_env-ffe0eb54eae24ed0) + +running 8 tests +test check_does_not_fetch_a_missing_git_revision ... ok +test deleted_lock_edge_fails_check_and_run ... ok +test run_and_check_require_a_lock_when_dependencies_exist ... ok +test lock_records_transitive_closure_and_sync_materializes_it ... ok +test sync_is_strict_and_never_rewrites_the_lock ... ok +test tampered_path_dependency_content_is_rejected_by_locked_sync ... ok +test transitive_path_dependency_resolves_from_its_own_manifest ... ok +test pinned_git_dependency_locks_syncs_and_runs ... ok + +test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.04s + + Running tests/plugin_worker.rs (/home/dev/marqdo-src/target/debug/build/marqdo-cli/d45a194c30207bdf/out/plugin_worker-d45a194c30207bdf) + +running 4 tests +test worker_capability_request_budget_stops_a_runaway_plugin ... ok +test worker_transport_runs_without_in_process_trust ... ok +test worker_capability_bridge_reads_granted_file_and_denies_without_grant ... ok +test worker_crash_is_isolated_from_the_host ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.10s + + Running tests/properties.rs (/home/dev/marqdo-src/target/debug/build/marqdo-cli/90e4a82e1e9db60d/out/properties-90e4a82e1e9db60d) + +running 2 tests +test narration_removal_preserves_execution ... ok +test pure_prose_edits_do_not_change_executable_ir ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.64s + + Running tests/tool_protocol.rs (/home/dev/marqdo-src/target/debug/build/marqdo-cli/53f82706fffb0ee3/out/tool_protocol-53f82706fffb0ee3) + +running 7 tests +test a_root_record_json_in_the_source_package_is_rejected ... ok +test invalid_manifests_and_path_escapes_are_rejected ... ok +test tampered_binary_and_path_hijack_are_not_executed ... ok +test install_dispatch_list_remove_without_core_knowledge_of_the_name ... ok +test protocol_negotiation_accepts_declared_versions_and_rejects_disjoint_ones ... ok +test tampering_any_bundle_file_or_adding_an_unlisted_file_is_rejected ... ok +test independent_sample_tools_consume_public_analysis_and_trace ... ok + +test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 26.54s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-expression/0c43a9e46f8c64a9/out/marqdo_expression-0c43a9e46f8c64a9) + +running 50 tests +test ast::tests::spanless_variants_return_the_empty_span ... ok +test lexer::tests::bad_text_lexing_reports_errors ... ok +test ast::tests::span_accessor_covers_structural_nodes ... ok +test ast::tests::span_serde_round_trips_inside_ast ... ok +test lexer::tests::comments_are_not_supported ... ok +test lexer::tests::text_escapes_decode ... ok +test lexer::tests::number_lexing_rejects_invalid_forms ... ok +test lexer::tests::tokenizes_keywords_separately_from_identifiers ... ok +test lexer::tests::token_remembers_multibyte_spans ... ok +test lexer::tests::tokenizes_operators_and_punctuation ... ok +test lexer::tests::unicode_whitespace_is_skipped ... ok +test parser::tests::assignment_statements_parse ... ok +test parser::tests::additive_and_multiplicative_precedence ... ok +test parser::tests::boolean_and_none_literals_parse ... ok +test parser::tests::calls_parse_positional_and_named_arguments ... ok +test parser::tests::comments_are_not_supported ... ok +test parser::tests::comparisons_are_non_associative ... ok +test parser::tests::call_argument_errors_are_rejected ... ok +test parser::tests::comparisons_bind_looser_than_arithmetic ... ok +test parser::tests::error_spans_point_at_the_offending_token ... ok +test parser::tests::expression_statements_parse ... ok +test parser::tests::expressions_reject_assignment_syntax ... ok +test parser::tests::float_literals_cover_the_grammar ... ok +test parser::tests::integer_literals_are_arbitrary_precision ... ok +test parser::tests::invalid_float_literals_are_rejected ... ok +test parser::tests::invalid_text_literals_are_rejected ... ok +test parser::tests::invalid_statements_are_rejected ... ok +test parser::tests::list_literal_errors_are_rejected ... ok +test ast::tests::ast_types_serde_round_trip ... ok +test parser::tests::list_literals_parse ... ok +test parser::tests::member_and_index_access_chain ... ok +test parser::tests::logical_operators_chain_left_associatively ... ok +test parser::tests::member_and_index_errors_are_rejected ... ok +test parser::tests::parse_arguments_matches_call_argument_semantics ... ok +test parser::tests::parse_arguments_parses_a_leading_argument_list ... ok +test parser::tests::parse_arguments_rejects_invalid_lists ... ok +test parser::tests::power_is_right_associative_and_binds_tighter_than_unary_minus ... ok +test parser::tests::record_literal_errors_are_rejected ... ok +test parser::tests::reserved_keywords_cannot_be_identifiers ... ok +test parser::tests::spans_are_byte_offsets_into_the_payload ... ok +test parser::tests::record_literals_parse ... ok +test parser::tests::text_literals_decode_escapes ... ok +test parser::tests::unary_operators_stack ... ok +test tests::ast_types_are_reachable_from_the_crate_root ... ok +test parser::tests::unicode_identifiers_are_accepted ... ok +test tests::empty_payloads_are_errors ... ok +test tests::parse_error_displays_code_and_span_and_implements_error ... ok +test tests::public_api_parses_expression_and_statement ... ok +test parser::tests::adversarial_inputs_never_panic ... ok +test parser::tests::nesting_depth_limit_is_enforced ... ok + +test result: ok. 50 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.20s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-foreign/5ae4cf14f713cad7/out/marqdo_foreign-5ae4cf14f713cad7) + +running 2 tests +test tests::languages_are_normalized ... ok +test tests::request_envelope_is_versioned ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s + + Running tests/kernels.rs (/home/dev/marqdo-src/target/debug/build/marqdo-foreign/f8c333b5425a20ed/out/kernels-f8c333b5425a20ed) + +running 22 tests +test call_rejects_non_json_stdout ... ok +test call_rejects_stdout_noise ... ok +test call_decodes_a_python_wire_value ... ok +test call_reports_timeout_as_an_error ... ok +test call_rejects_unknown_wire_types ... ok +test error_messages_are_human_readable ... ok +test child_environment_only_keeps_path ... ok +test detect_finds_python_and_node_versions ... ok +test kernel_that_ignores_stdin_does_not_hang ... ok +test non_zero_exit_is_failed_and_keeps_stderr ... ok +test non_zero_exit_is_preserved_by_call ... ok +test oversized_output_is_an_error ... ok +test node_commonjs_syntax_is_supported ... ok +test oversized_stderr_is_an_error ... ok +test relative_writes_happen_in_a_fresh_cleaned_directory ... ok +test node_run_success_captures_stdout ... ok +test call_decodes_a_node_wire_value ... ok +test run_success_captures_stdout ... ok +test unknown_language_is_unavailable ... ok +test timeout_kills_the_kernel ... ok +test stdin_envelope_carries_the_input ... ok +test stdin_envelope_sends_null_for_missing_input ... ok + +test result: ok. 22 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.11s + + Running tests/provider.rs (/home/dev/marqdo-src/target/debug/build/marqdo-foreign/789d5b736522dbbd/out/provider-789d5b736522dbbd) + +running 8 tests +test builtin_provider_cannot_be_bound_to_an_environment ... ok +test duplicate_language_labels_and_wire_versions_are_rejected ... ok +test external_provider_timeout_is_enforced ... ok +test pinned_environment_binds_the_provider_and_is_verified_before_execution ... ok +test provider_outside_pinned_environment_is_rejected ... ok +test external_provider_is_registered_without_core_changes ... ok +test declared_interpreter_version_must_match_the_resolved_program ... ok +test provider_digest_is_verified_at_registration_and_execution ... ok + +test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.23s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-frontend/9ee456f4c9890a8d/out/marqdo_frontend-9ee456f4c9890a8d) + +running 35 tests +test analyze::tests::invalid_list_header_is_a_hard_error ... ok +test analyze::tests::invalid_strong_payload_is_a_hard_error ... ok +test analyze::tests::maps_countdown_loop ... ok +test calls::tests::builtin_arity_is_checked ... ok +test analyze::tests::maps_recursive_factorial ... ok +test calls::tests::inferred_signature_requires_named_arguments ... ok +test calls::tests::explicit_signature_allows_positional_and_checks_arity ... ok +test calls::tests::unknown_function_is_an_error ... ok +test calls::tests::declared_plugin_export_is_checked_statically ... ok +test infer::tests::explicit_signature_reports_unknown_reads ... ok +test infer::tests::infers_free_reads ... ok +test infer::tests::loop_counter_is_parameter ... ok +test infer::tests::unconditional_entry_assignment_is_local ... ok +test analyze::tests::prose_changes_do_not_change_ir ... ok +test infer::tests::partial_branch_assignment_is_ambiguous ... ok +test payload::extra_span_tests::double_backtick_code_span_maps_inside_both_delimiters ... ok +test payload::extra_span_tests::condition_description_rejects_executable_roles ... ok +test payload::extra_span_tests::condition_literal_span_excludes_backticks_for_one_and_two_ticks ... ok +test payload::extra_span_tests::condition_description_allows_inert_inline_content ... ok +test payload::extra_span_tests::utf8_prefix_and_multiline_payload_map_to_original_bytes ... ok +test payload::tests::payload_and_spans_are_preserved ... ok +test payload::tests::span_maps_across_text_and_code_segments ... ok +test payload::tests::nested_markup_is_a_hard_error ... ok +test signature::tests::parses_untyped_and_empty ... ok +test signature::tests::parses_typed_signature_with_default ... ok +test signature::tests::split_respects_nesting_and_strings ... ok +test signature::tests::rejects_duplicates_and_bad_defaults ... ok +test resources::tests::content_hash_is_stable ... ok +test resources::tests::formulas_and_code_are_attributed_to_functions ... ok +test units::tests::duplicate_function_names_are_errors ... ok +test units::tests::empty_heading_is_an_error ... ok +test units::tests::builds_function_ranges ... ok +test units::tests::executable_outside_function_warns_but_does_not_execute ... ok +test units::tests::root_level_function_without_namespace ... ok +test units::tests::same_name_in_different_namespaces_is_allowed ... ok + +test result: ok. 35 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.28s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-host/8baaeabbbfb903b3/out/marqdo_host-8baaeabbbfb903b3) + +running 10 tests +test budget::tests::output_and_stack_limits ... ok +test budget::tests::fuel_is_bounded ... ok +test capability::tests::defaults_deny_external_io ... ok +test capability::tests::explicit_grants_are_glob_scoped ... ok +test fs::tests::rejects_traversal_and_absolute_paths ... ok +test fs::tests::reads_and_writes_inside_root ... ok +test capability::tests::broker_enforces_core_grants_and_vendor_policy ... ok +test capability::execute_tests::broker_executes_fs_read_and_reports_unavailable_for_other_capabilities ... ok +test handles::tests::forged_cross_owner_and_expired_handles_are_rejected ... ok +test handles::tests::handles_inside_untrusted_values_are_detected ... ok + +test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s + + Running tests/capability_broker.rs (/home/dev/marqdo-src/target/debug/build/marqdo-host/2c4ec063e83a0665/out/capability_broker-2c4ec063e83a0665) + +running 1 test +test granted_fs_read_returns_real_bytes_and_denial_is_audited ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.06s + + Running tests/plugin_exports.rs (/home/dev/marqdo-src/target/debug/build/marqdo-host/23f86a8716dc2ffd/out/plugin_exports-23f86a8716dc2ffd) + +running 1 test +test every_export_is_registered_by_complete_name_and_conflicts_are_atomic ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.76s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-ir/0a42156cdf4add17/out/marqdo_ir-0a42156cdf4add17) + +running 7 tests +test builtins::tests::lookup_aliases ... ok +test builtins::tests::arity_validation ... ok +test tests::ir_serializes_for_inspect ... ok +test callable::tests::builtins_are_registered_with_aliases ... ok +test callable::tests::external_names_must_be_unique_and_not_shadow_builtins ... ok +test tests::module_lookup_helpers ... ok +test tests::stmt_keeps_spans ... ok + +test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-markdown/bdef3a0717e05139/out/marqdo_markdown-bdef3a0717e05139) + +running 16 tests +test frontmatter::tests::empty_frontmatter_is_null ... ok +test frontmatter::tests::invalid_yaml_is_reported_not_panicked ... ok +test frontmatter::tests::import_shapes_are_validated ... ok +test frontmatter::tests::parses_import_mapping ... ok +test profile::tests::bom_is_tolerated_and_spans_shift ... ok +test profile::tests::profile_options_are_frozen ... ok +test profile::tests::setext_headings_are_heading_nodes ... ok +test profile::tests::math_nodes_are_native_and_inert ... ok +test profile::tests::parse_maps_core_constructs ... ok +test profile::tests::spans_are_byte_offsets_into_original_source ... ok +test profile::tests::crlf_and_lf_sources_keep_structure_and_byte_spans ... ok +test text::tests::payload_accepts_text_and_code ... ok +test text::tests::payload_rejects_nested_markup ... ok +test text::tests::plain_text_uses_alt_and_label ... ok +test text::tests::normalize_collapses_whitespace_and_nfc ... ok +test profile::tests::tables_and_task_lists_are_supported ... ok + +test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.15s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-math/1b48f3246f930605/out/marqdo_math-1b48f3246f930605) + +running 21 tests +test error::tests::constructors_use_stable_kinds ... ok +test error::tests::display_includes_kind_and_position ... ok +test ast::tests::decimal_and_fraction_rendering_is_deterministic ... ok +test ast::tests::variables_are_collected_without_constants ... ok +test ast::tests::rendering_round_trips_through_parse ... ok +test parse::tests::frac_and_sqrt_become_dedicated_nodes ... ok +test parse::tests::empty_and_malformed_input_is_a_parse_error ... ok +test parse::tests::implicit_multiplication_joins_adjacent_factors ... ok +test parse::tests::left_and_right_parentheses_are_accepted ... ok +test parse::tests::more_than_one_equals_is_a_parse_error ... ok +test parse::tests::excessive_node_count_is_rejected ... ok +test parse::tests::power_is_right_associative ... ok +test parse::tests::precedence_matches_standard_arithmetic ... ok +test parse::tests::single_equals_is_an_equation ... ok +test parse::tests::unary_minus_binds_looser_than_power ... ok +test parse::tests::unknown_characters_are_structured ... ok +test parse::tests::unsupported_commands_are_structured ... ok +test parse::tests::deep_nesting_is_rejected_without_stack_overflow ... ok +test tests::public_api_round_trip ... ok +test parse::tests::numeric_literal_bounds_are_enforced ... ok +test parse::tests::very_long_chain_is_rejected_without_stack_overflow ... ok + +test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.26s + + Running tests/kernel.rs (/home/dev/marqdo-src/target/debug/build/marqdo-math/015a83300848687b/out/kernel-015a83300848687b) + +running 37 tests +test division_by_zero_is_a_structured_error ... ok +test constants_and_their_ambiguity_rules ... ok +test division_stays_exact_when_it_reduces_to_an_integer ... ok +test decimal_literals_are_exact_rationals ... ok +test dot_and_times_are_multiplication_operators ... ok +test error_display_includes_kind_and_position ... ok +test exponent_must_be_an_integer ... ok +test equation_solving_requires_exactly_one_affine_occurrence ... ok +test f_equals_m_a_solved_for_a ... ok +test f_equals_m_a_solved_for_f ... ok +test f_equals_m_a_solved_for_m ... ok +test exact_big_integer_arithmetic ... ok +test float_bindings_are_exact_numeric_values ... ok +test frac_is_exact_division ... ok +test huge_exponents_are_bounded_not_hung ... ok +test hostile_inputs_never_panic ... ok +test large_exact_results_are_returned_as_integers ... ok +test left_right_parentheses_and_nesting ... ok +test negative_integer_exponents_are_exact_reciprocals ... ok +test malformed_latex_is_a_parse_error_with_position ... ok +test linear_equation_solving_both_directions ... ok +test non_numeric_bindings_are_type_errors ... ok +test perfect_and_non_perfect_square_roots ... ok +test pi_r_squared_area ... ok +test scientific_notation_and_adjacent_numbers_are_rejected ... ok +test precedence_and_parentheses ... ok +test solve_target_on_the_left_of_a_product ... ok +test substitute_rejects_unsupported_binding_types ... ok +test substitute_leaves_unbound_variables_symbolic ... ok +test substitute_replaces_bindings_deterministically ... ok +test target_errors_are_structured ... ok +test substitution_with_float_and_negative_bindings_reparses ... ok +test undefined_variables_are_reported ... ok +test unicode_identifiers ... ok +test unsupported_constructs_are_structured ... ok +test long_operator_chains_within_the_node_budget_still_evaluate ... ok +test oversized_formulas_are_rejected_with_a_structured_error ... ok + +test result: ok. 37 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.52s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-package/3349516ee391f20b/out/marqdo_package-3349516ee391f20b) + +running 19 tests +test fileset::tests::excludes_git_and_marqdo_directories ... ok +test fileset::tests::materialization_rejects_a_wrong_expected_digest ... ok +test fileset::tests::digest_encoding_is_unambiguous ... ok +test fileset::tests::materialization_uses_the_same_selection_and_digest ... ok +test fileset::tests::rejects_symlinks ... ok +test fileset::tests::target_directory_is_package_content ... ok +test tests::discovers_project_root ... ok +test tests::git_dependency_requires_rev ... ok +test fileset::tests::rejects_special_files ... ok +test tests::package_resolution_is_stable_across_path_moves ... ok +test tests::lockfile_serialization_is_stable_and_sorted ... ok +test tests::lock_graph_records_transitive_path_closure ... ok +test tests::missing_locked_edge_fails_closed ... ok +test tests::rejects_absolute_dependency_paths ... ok +test tests::root_manifest_edit_invalidates_the_lock ... ok +test tests::parses_manifest_and_validates_sources ... ok +test tests::v1_and_v2_locks_are_rejected_with_a_relock_hint ... ok +test tests::sync_materializes_a_content_checked_environment ... ok +test tests::pinned_git_dependency_resolves_and_reuses_cache ... ok + +test result: ok. 19 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.55s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-plugin-abi/90fd8b9216ff8955/out/marqdo_plugin_abi-90fd8b9216ff8955) + +running 27 tests +test abi::tests::layout_matches_c_header_on_64_bit ... ok +test abi::tests::negotiation_accepts_same_major_and_clamps_minor ... ok +test abi::tests::negotiation_rejects_other_majors ... ok +test artifact::tests::hex_validation_is_strict ... ok +test abi::tests::metadata_rejects_empty_and_invalid ... ok +test abi::tests::metadata_wire_roundtrip ... ok +test artifact::tests::host_triple_is_parseable_and_matches_word_size ... ok +test artifact::tests::target_triple_parsing_and_word_size ... ok +test error::tests::optional_fields_are_omitted ... ok +test manifest::tests::abi_requirement_caret_semantics ... ok +test artifact::tests::sha256_matches_known_vector ... ok +test error::tests::error_is_serializable_roundtrip ... ok +test manifest::tests::malformed_yaml_is_rejected ... ok +test manifest::tests::duplicate_and_reserved_exports_are_rejected ... ok +test manifest::tests::valid_manifest_parses_and_validates ... ok +test manifest::tests::artifact_resolution_requires_exact_host_target ... ok +test manifest::tests::invalid_fields_are_rejected ... ok +test wire::tests::request_rejects_wrong_version_or_kind ... ok +test manifest::tests::vendor_capabilities_are_validated_but_not_granted ... ok +test wire::tests::response_rejects_ambiguous_payloads_and_accepts_unit ... ok +test wire::tests::response_success_and_error_roundtrip ... ok +test worker::tests::frame_roundtrip_and_clean_eof ... ok +test worker::tests::oversized_and_zero_length_frames_are_rejected ... ok +test worker::tests::partial_header_is_an_error_not_eof ... ok +test worker::tests::truncated_payload_is_rejected ... ok +test wire::tests::request_roundtrip_preserves_type_tags ... ok +test wire::tests::oversized_wire_is_rejected_before_json_parsing ... ok + +test result: ok. 27 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.20s + + Running tests/loader_unix.rs (/home/dev/marqdo-src/target/debug/build/marqdo-plugin-abi/795cd8c1c3c5ea31/out/loader_unix-795cd8c1c3c5ea31) + +running 8 tests +test malformed_manifest_is_rejected ... ok +test example_manifest_parses_and_validates ... ok +test artifact_target_must_match_host ... ok +test missing_artifact_file_fails_resolution ... ok +test missing_entry_symbol_fails_load ... ok +test sha256_mismatch_fails_verification ... ok +test wrong_abi_major_fails_load ... ok +test c_plugin_roundtrips_wire_request ... ok + +test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.80s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-plugin-sdk/a8c1ea2d42f1442c/out/marqdo_plugin_sdk-a8c1ea2d42f1442c) + +running 4 tests +test tests::initialization_rejects_bad_host_major ... ok +test tests::handler_error_is_written_as_error_envelope ... ok +test tests::registered_export_roundtrips_wire_request ... ok +test tests::macro_exports_and_registers ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-runtime/7e824000026d5c21/out/marqdo_runtime-7e824000026d5c21) + +running 6 tests +test value_ops::tests::division_by_zero_is_an_error ... ok +test value_ops::tests::floor_division_and_modulo_signs ... ok +test value_ops::tests::division_always_yields_float ... ok +test value_ops::tests::integer_arithmetic_is_exact ... ok +test value_ops::tests::mixed_comparisons_are_exact ... ok +test value_ops::tests::text_concatenation_and_power ... ok + +test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s + + Running tests/interpreter.rs (/home/dev/marqdo-src/target/debug/build/marqdo-runtime/c19d767cfe9ce07e/out/interpreter-c19d767cfe9ce07e) + +running 10 tests +test explicit_signature_supports_positional_arguments ... ok +test fuel_budget_is_enforced ... ok +test builtins_for_conversions_and_length ... ok +test ambiguous_ref_resource_is_an_error ... ok +test non_bool_condition_is_a_runtime_error ... ok +test function_reference_can_be_called ... ok +test loop_prints_and_returns_unit_for_fallthrough ... ok +test recursion_branch_and_return ... ok +test recursion_depth_is_bounded ... ok +test return_inside_loop_propagates ... ok + +test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.69s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-sandbox/bb72be089115133e/out/marqdo_sandbox-bb72be089115133e) + +running 4 tests +test tests::mode_names_round_trip ... ok +test linux::tests::launch_failure_never_falls_back_to_unrestricted_execution ... ok +test tests::strict_refuses_when_isolation_is_unavailable ... ok +test linux::tests::probe_success_then_launch_eagain_is_fail_closed ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s + + Running tests/security_linux.rs (/home/dev/marqdo-src/target/debug/build/marqdo-sandbox/0bce0bec1aee4fec/out/security_linux-0bce0bec1aee4fec) + +running 7 tests +test strict_child_cannot_read_host_files_but_reads_the_project ... ok +test strict_child_cannot_write_outside_or_into_the_project ... ok +test strict_child_cannot_reach_the_network ... ok +test strict_child_cannot_escape_via_proc_or_privileges ... ok +test strict_child_identity_is_unprivileged_and_namespaced ... ok +test strict_supervisor_enforces_fd_and_process_limits ... ok +test strict_supervisor_enforces_memory_cpu_and_output_limits ... ok + +test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.18s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-span/320ae70514012226/out/marqdo_span-320ae70514012226) + +running 2 tests +test tests::span_merge_and_shift ... ok +test tests::line_index_maps_multibyte_text ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s + + Running unittests src/lib.rs (/home/dev/marqdo-src/target/debug/build/marqdo-value/997168d51ecaf867/out/marqdo_value-997168d51ecaf867) + +running 10 tests +test value::tests::big_integers_are_arbitrary_precision ... ok +test error::tests::frames_are_rendered_as_related_diagnostics ... ok +test value::tests::unit_and_none_are_distinct ... ok +test diagnostic::tests::diagnostic_json_shape_is_stable ... ok +test value::tests::display_is_stable ... ok +test value::tests::float_to_bigint_requires_integral_value ... ok +test wire::tests::big_integers_keep_all_digits ... ok +test wire::tests::special_floats_are_tagged ... ok +test wire::tests::scalar_roundtrip ... ok +test wire::tests::untrusted_wire_is_validated ... ok + +test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s + + Doc-tests marqdo_expression + +running 2 tests +test crates/marqdo-expression/src/lib.rs - (line 64) ... ok +test crates/marqdo-expression/src/lib.rs - (line 11) ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.08s + + Doc-tests marqdo_foreign + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests marqdo_frontend + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests marqdo_host + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests marqdo_ir + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests marqdo_markdown + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests marqdo_math + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests marqdo_package + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests marqdo_plugin_abi + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests marqdo_plugin_sdk + +running 3 tests +test crates/marqdo-plugin-sdk/src/lib.rs - mq_plugin_entry (line 68) ... ignored +test crates/marqdo-plugin-sdk/src/wire.rs - wire (line 7) ... ignored +test crates/marqdo-plugin-sdk/src/lib.rs - (line 8) ... ok + +test result: ok. 1 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 1.28s + + Doc-tests marqdo_runtime + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests marqdo_sandbox + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests marqdo_span + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests marqdo_value + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/docs/evidence/RELEASE_CANDIDATE_0.1.0_f075c96.md b/docs/evidence/RELEASE_CANDIDATE_0.1.0_f075c96.md new file mode 100644 index 0000000..eec53f4 --- /dev/null +++ b/docs/evidence/RELEASE_CANDIDATE_0.1.0_f075c96.md @@ -0,0 +1,141 @@ +# Marqdo CLI release candidate — 0.1.0 / `f075c96` + +```text +Source SHA: f075c967f24d885ac42c1e99329bee3498154598 +Workspace version: 0.1.0 +Intended release target: Linux x86_64 (local RC); macOS/Windows UNVERIFIED +GitHub master: c9f01aa8fb127a2dcc125103ef794832984774ad (unchanged) +Latest public CI: https://github.com/cflmy/marqdo-cli/actions/runs/44692692318 (FAILED) +``` + +This report records the convergence work and the honest release gate. The +checkout used for this run has a Gitee remote and no GitHub credentials, so no +new remote CI URL can be produced here. The code is ready for a CI run; the +release decision is **DO NOT RELEASE** until the hard gates below have remote +PASS evidence. + +## 1. What changed at this SHA + +- macOS/Windows `E0433`: strict detection now dispatches through `#[cfg]` + functions, so `linux::probe()` is not type-checked on non-Linux targets. + A non-Linux regression test asserts `strict=unavailable` and fail-closed + refusal. +- Linux strict probe→launch race: `inspect --platform` is a snapshot, not a + promise. The CLI test now accepts only success with correct output or a + non-zero, diagnosed, fail-closed refusal with no project stdout. A sandbox + seam test injects `probe OK → spawn EAGAIN` and proves `LaunchFailed`, + never unrestricted execution. +- Parallel security matrix: unique per-test project/outside paths and a + once-compiled helper, so `cargo test --workspace` can run the 7 adversarial + cases in parallel. +- Condition headers: executable `Strong`/`Emph` in the description remainder + are a hard `markdown.invalid_construct` error; condition expression spans are + mapped from the literal bytes inside the backticks. +- Power/control-flow corpus: 10 AST, 8 semantic, 4 compile-negative and 2 + runtime-negative fixtures; CLI E2E branch/loop/inert tests. +- Generic Tool protocol: independent `sample-view`, `sample-knowledge` and + `sample-proof` Analysis/Trace consumers, installed and dispatched by name + with no CLI hard-coding. +- Locked path-dependency tamper test; G-C lane honours `CARGO_TARGET_DIR`. + +## 2. Local static and test evidence + +Ubuntu 26.04 development container, Rust 1.100.0: + +```text +cargo fmt --all -- --check PASS +cargo clippy --workspace --all-targets -- -D warnings PASS +cargo test --workspace --locked PASS +cargo build --release --locked -p marqdo-cli PASS +``` + +G-C VM, source archive `f075c96`, ordinary user `dev` (uid 1000): + +```text +MARQDO_REQUIRE_STRICT_SECURITY=1 ./tests/security/run-lane.sh + adversarial 7/7 PASS + positive CLI contract PASS + external surfaces refused PASS + forged marker rejected PASS + G-C security lane: PASS +cargo test --workspace --locked (same archive) PASS (47 binaries, 0 failed) +``` + +See [`2026-11-20-strict-gc-f075c96.md`](2026-11-20-strict-gc-f075c96.md). + +## 3. Release candidate artifact + +```text +archive: marqdo-0.1.0-x86_64-unknown-linux-gnu.tar.gz +sha256: 4e1020735bd7f5bd590b5472e48ed431b1365641b8ac6574254dd963be8cc285 +contents: marqdo binary, MIT/Apache licenses, CHANGELOG, COMPATIBILITY, + README, spec/, examples/, tests/consumers/, selected docs, + SOURCE_SHA, rustc -vV +``` + +Clean-install smoke from an extracted external directory: + +```text +sha256sum -c marqdo-0.1.0-x86_64-unknown-linux-gnu.tar.gz.sha256 -> OK +./marqdo --version -> marqdo 0.1.0 +./marqdo --help -> ok +./marqdo run examples/hello.mq.md -> 你好,Marqdo +./marqdo check examples/multi-module/index.mq.md --refs --emit ... -> ok +analysis_consumer.py -> functions=2 +trace_consumer.py -> events=7 +validate_protocols.py -> validated analysis/trace/tool +``` + +No Windows or macOS archive was produced from this host. The `release-candidate` +GitHub job can build macOS, but it has not run for this SHA. + +## 4. Gate matrix + +| Gate | Status at f075c96 | Evidence / next action | +|---|---|---| +| G0 same SHA, version, changelog | **PASS (local)** | source archive `f075c96`; version 0.1.0; changelog updated; remote master still `c9f01aa` | +| G1 Linux CI fmt/clippy/workspace/smoke | **FAIL — no remote same-SHA run** | local PASS; push to GitHub and let `CI` run | +| G2 Windows workspace + portable smoke | **FAIL — no remote native run** | cfg fix is local; needs Windows CI | +| G3 macOS workspace + portable smoke | **FAIL — no remote native run** | cfg fix is local; needs macOS CI | +| G4 public Schema + consumers | **UNVERIFIED at same SHA** | local schema/consumer PASS; remote job last passed at `c9f01aa` | +| G5 Markdown AST/power new semantics | **PASS (local)** | 160 AST + 44 semantic fixtures; CLI E2E | +| G6 negative/source-span/inert tests | **PASS (local)** | 52 compile-negative, 12 runtime-negative, span unit/CLI tests | +| G7 lock v3 + package environments | **PASS (local Linux)** | package_env, Git/path tamper, locked sync; Windows/macOS UNVERIFIED | +| G8 Tool/ABI/Worker/Foreign matrix | **PASS (local Linux, bounded)** | generic Tool + 3 consumers; native/worker/foreign tests; Windows ABI UNSUPPORTED | +| G9 Linux strict L1 G-C | **PASS (local VM); CI UNVERIFIED** | 7/7 + CLI; needs self-hosted security-lane URL | +| G10 RC build/checksum/clean install | **PASS (Linux only)** | artifact + sha256 + external clean-install smoke | +| G11 docs/version/license/compatibility | **PASS** | STATUS, COMPATIBILITY, CHANGELOG, security evidence | +| G12 owner approval + tag/Release | **NOT STARTED** | requires explicit project-owner approval | + +## 5. Decision + +**DO NOT RELEASE.** + +Reason: G1/G2/G3 have no real GitHub PASS at this SHA, G4 is not re-proven at +this SHA, and G9 has no self-hosted security-lane URL. Local VM and container +evidence cannot be substituted for those lanes. + +## 6. Next actions (in order) + +1. Push `f075c96` or its docs-complete successor to GitHub `master` and wait + for all `CI` jobs (Linux, macOS, Windows, schema/consumers) to pass. +2. Register the disposable security VM as a self-hosted runner with labels + `[self-hosted, linux, marqdo-security]`, then run + `.github/workflows/security-linux.yml` at the same SHA. Record the URL and + 7/7 result. +3. Run the `release candidate artifact` job at the same SHA; download and + verify the Linux/macOS archives and checksums in a clean directory. +4. Only after G1–G11 have same-SHA URLs, ask the project owner for explicit + approval, then create the version tag and publish the release. + +## 7. Known limitations / rollback + +- Linux strict L1 only; strict L2 (Worker/Foreign/native) is refused. +- Windows Native/Worker ABI is unsupported. +- macOS/Windows strict is fail-closed, not implemented. +- Foreign requires a pre-provisioned, digest-pinned environment; no uv/npm/venv + auto-provisioning. +- The RC has no signed provenance/SLSA attestation yet; checksums are the only + integrity artifact. +- Rollback is to keep the previous stable release (none has been published) and + withdraw the candidate tag/artifact; no data migration is involved. diff --git a/docs/releasing.md b/docs/releasing.md index 0122cf2..c143e18 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -6,9 +6,9 @@ required CI matrix on the exact commit. ## 1. Preconditions -- All applicable G-B gates in - [`STABLE_RELEASE_IMPLEMENTATION.md`](STABLE_RELEASE_IMPLEMENTATION.md) §16.1 - are PASS with a CI URL for the same SHA. +- All applicable gates in + [`NEXT_RELEASE_CI_CONVERGENCE.md`](NEXT_RELEASE_CI_CONVERGENCE.md) §7 are + PASS with a CI URL for the same SHA. - G-C is either PASS with a security-lane URL, or the release explicitly says strict isolation is unavailable. Never claim G-C from local root/sudo runs. - `git status --porcelain` is clean apart from intended release files. @@ -27,7 +27,8 @@ cargo build --release --locked -p marqdo-cli ## 3. Artifact creation The artifact is a tarball containing the binary, license, README, changelog, -compatibility matrix and specs. Build it from the repository root: +compatibility matrix, specs, examples and the public protocol consumers. Build +it from the repository root: ```bash version="$(cargo metadata --no-deps --format-version 1 \ @@ -38,7 +39,9 @@ rm -rf "$stage" mkdir -p "$stage" install -m 0755 target/release/marqdo "$stage/" cp LICENSE* CHANGELOG.md COMPATIBILITY.md README.md "$stage/" -cp -r spec "$stage/" +cp -r spec examples "$stage/" +mkdir -p "$stage/tests" +cp -r tests/consumers "$stage/tests/" tar -C dist -czf "dist/marqdo-${version}-${target}.tar.gz" "$(basename "$stage")" sha256sum "dist/marqdo-${version}-${target}.tar.gz" \ | tee "dist/marqdo-${version}-${target}.tar.gz.sha256" @@ -62,8 +65,10 @@ cd "$tmp"/marqdo-* ./marqdo call examples/factorial.mq.md 阶乘 --arg n=5 ./marqdo check examples/multi-module/index.mq.md --refs --emit analysis.json ./marqdo run examples/multi-module/index.mq.md --trace-file trace.json -python3 /path/to/tests/consumers/analysis_consumer.py analysis.json -python3 /path/to/tests/consumers/trace_consumer.py analysis.json trace.json +python3 tests/consumers/analysis_consumer.py analysis.json +python3 tests/consumers/trace_consumer.py analysis.json trace.json +python3 tests/consumers/validate_protocols.py analysis.json trace.json \ + examples/tool-unknown-name/tool.json ``` Also verify the SHA-256 file before extraction: @@ -87,6 +92,11 @@ git push origin "v${version}" Do not force-push, do not tag a red commit, and do not upload macOS/Windows binaries unless those platform lanes actually passed. +The current `0.1.0` candidate at `f075c96` is **not** releasable: it has local +Linux/VM evidence and a checksummed Linux RC, but no same-SHA GitHub CI or +self-hosted G-C URL. See +[`evidence/RELEASE_CANDIDATE_0.1.0_f075c96.md`](evidence/RELEASE_CANDIDATE_0.1.0_f075c96.md). + ## 6. Rollback - If an asset fails verification: delete the release asset and keep the tag diff --git a/docs/security-gate.md b/docs/security-gate.md index 38b4a46..01503c7 100644 --- a/docs/security-gate.md +++ b/docs/security-gate.md @@ -1,7 +1,11 @@ # Linux strict-isolation security gate (G-C) — evidence Status: **PASSED in a disposable Ubuntu VM; Linux strict is enabled only when -the runtime probe succeeds.** Code commit: `b6fc182`. No remote security-lane CI URL exists yet. +the runtime probe succeeds.** Current convergence evidence is for source +archive `f075c96` (see +[`evidence/2026-11-20-strict-gc-f075c96.md`](evidence/2026-11-20-strict-gc-f075c96.md)); +the earlier `b6fc182` run is retained below as history. **No remote +self-hosted security-lane CI URL exists yet.** Snapshot: workspace `0.1.0`, 2026-11-20. See ADR-0021. This report separates three things that are often conflated: @@ -70,6 +74,12 @@ The helper is `tests/security/escape_helper.c`, launched through the **same** lane is `tests/security/run-lane.sh` and the test is `crates/marqdo-sandbox/tests/security_linux.rs`. +At `f075c96` the same lane was re-run from a clean `git archive` in the +disposable VM as `dev` uid 1000: 7/7 adversarial tests, positive CLI contract, +external-surface refusals, and forged-marker rejection all PASS. The command +now honours `CARGO_TARGET_DIR`; the parallel workspace run also passes all +seven security tests. + ```text 7/7 tests PASS: strict_child_identity_is_unprivileged_and_namespaced diff --git a/examples/tool-samples/sample-knowledge/README.md b/examples/tool-samples/sample-knowledge/README.md index 8f38303..906fdea 100644 --- a/examples/tool-samples/sample-knowledge/README.md +++ b/examples/tool-samples/sample-knowledge/README.md @@ -8,6 +8,7 @@ product. Build and install (any OS with a Rust toolchain): ```sh +mkdir -p /tmp/marqdo-tool-sample-knowledge/bin rustc --edition 2021 examples/tool-samples/sample-knowledge/src/main.rs \ -o /tmp/marqdo-tool-sample-knowledge/bin/sample-knowledge cp examples/tool-samples/sample-knowledge/tool.json /tmp/marqdo-tool-sample-knowledge/ diff --git a/examples/tool-samples/sample-proof/README.md b/examples/tool-samples/sample-proof/README.md index 1132f36..797632f 100644 --- a/examples/tool-samples/sample-proof/README.md +++ b/examples/tool-samples/sample-proof/README.md @@ -8,6 +8,7 @@ product. Build and install (any OS with a Rust toolchain): ```sh +mkdir -p /tmp/marqdo-tool-sample-proof/bin rustc --edition 2021 examples/tool-samples/sample-proof/src/main.rs \ -o /tmp/marqdo-tool-sample-proof/bin/sample-proof cp examples/tool-samples/sample-proof/tool.json /tmp/marqdo-tool-sample-proof/ diff --git a/examples/tool-samples/sample-view/README.md b/examples/tool-samples/sample-view/README.md index d3c46bf..0723c81 100644 --- a/examples/tool-samples/sample-view/README.md +++ b/examples/tool-samples/sample-view/README.md @@ -8,6 +8,7 @@ product. Build and install (any OS with a Rust toolchain): ```sh +mkdir -p /tmp/marqdo-tool-sample-view/bin rustc --edition 2021 examples/tool-samples/sample-view/src/main.rs \ -o /tmp/marqdo-tool-sample-view/bin/sample-view cp examples/tool-samples/sample-view/tool.json /tmp/marqdo-tool-sample-view/ diff --git a/spec/mapping.md b/spec/mapping.md index 2acf792..00b553d 100644 --- a/spec/mapping.md +++ b/spec/mapping.md @@ -113,7 +113,14 @@ Each item must: 2. have a `paragraph` as its **first** block; 3. have an inline `code` node as the **first inline node** of that paragraph; its literal is the condition expression; -4. any remaining inline content in that first paragraph is prose. +4. any remaining inline content in that first paragraph is **inert prose** + (`text`, inline `code`, links, images, math, HTML, strikethrough and line + breaks). An executable `Strong`/`Emph` there is a hard + `markdown.invalid_construct` error, not silently ignored description. + +The condition literal is mapped from the bytes **inside** the code-span +backticks. Delimiters are part of the Code node's source span, but condition +expression spans and parse diagnostics point at the literal. The item's remaining blocks form the branch body. Items are tested in AST order; the first condition evaluating to `true` is executed once. No match @@ -235,6 +242,8 @@ The following are compile errors with source spans, never prose fallbacks: * nested `strong`/`emph`/link inside an executable payload; * ordered list item whose first inline node is not a code span condition; * bullet list item without a condition header; +* executable `Strong`/`Emph` in the description remainder of a condition + paragraph (it would otherwise be swallowed); * non-`Bool` condition (detected statically when the type is known, else at runtime as `runtime.type`); * block quote that is not exactly one complete call; diff --git a/tests/README.md b/tests/README.md index 0316df4..73506f7 100644 --- a/tests/README.md +++ b/tests/README.md @@ -14,12 +14,12 @@ no test commits, copies or rewrites files outside a throw-away temp directory. ```text tests/ ├── conformance/ -│ ├── ast/ 150 × *.mq.md + sibling *.ast.json goldens -│ └── semantics/ 36 × *.mq.md + sibling *.expected.json goldens +│ ├── ast/ 160 × *.mq.md + sibling *.ast.json goldens +│ └── semantics/ 44 × *.mq.md + sibling *.expected.json goldens ├── negative/ -│ ├── *.mq.md 48 × compile-time hard-error fixtures + *.expected.json +│ ├── *.mq.md 52 × compile-time hard-error fixtures + *.expected.json │ ├── warnings/ 6 × inert-executable warning fixtures + *.expected.json -│ └── runtime/ 10 × runtime-error fixtures + *.expected.json +│ └── runtime/ 12 × runtime-error fixtures + *.expected.json └── README.md this file ``` @@ -56,6 +56,19 @@ cargo test -p marqdo-cli --test properties cargo test -p marqdo-cli --test integration_cli ``` +The power/control-flow slice is pinned by: + +* AST fixtures 151–160: code-span vs tight/spaced `**`, multi-backtick spans, + inert prose/code fences, branch/loop headers and math blocks; +* semantic fixtures 37–44: right-associative power, unary-minus precedence, + parentheses, float negative exponents, Strong+CodeSpan assignment, branch, + loop and inert prose; +* negative fixtures 49–52: missing power/condition operands and executable + nodes swallowed by a condition paragraph; +* runtime negatives 11–12: negative integer exponent and exponent budget; +* `crates/marqdo-frontend/src/payload.rs` span tests and + `crates/cli/tests/integration_cli.rs` CLI span/E2E assertions. + Fixture discovery is directory-based and sorted by file name, so the order is deterministic on every platform. The AST and semantic suites fail loudly if the corpus shrinks below 100 / 25 fixtures, and the negative suite fails below 30