7 Commits
Author SHA1 Message Date
cflmy f7a5a7b016 Allow a documented shared-node performance exception for a named RC
ci/woodpecker/push/main Pipeline was successful
ci/woodpecker/pr/main Pipeline was successful
ci/woodpecker/manual/performance Pipeline was successful
2026-11-22 22:19:08 +08:00
cflmy 22b7757420 Compare fixed-node performance without promoting shared CI timings
ci/woodpecker/pr/main Pipeline is pending
ci/woodpecker/push/main Pipeline was canceled
2026-11-22 22:14:07 +08:00
cflmy dd69919b48 Document RC protocol scope, strict support and beta migration 2026-11-22 22:13:14 +08:00
cflmy 1390f0081b Reuse the frozen Linux archive for release smoke and artifact delivery 2026-11-22 22:11:34 +08:00
cflmy e4c4a852d0 Require complete same-SHA evidence for Linux RC and stable releases 2026-11-22 22:10:34 +08:00
cflmy 6e9b5af88d Prepare 3.0.0-rc.1 and verify the locked Rust minimum 2026-11-22 22:08:04 +08:00
cflmy b702b31c76 Merge pull request 'RFC-GPL-0004: enforce core boundaries and frozen external conformance' (#5) from rfc-gpl-0004 into master
ci/woodpecker/push/main Pipeline was successful
2026-11-22 20:48:11 +08:00
27 changed files with 457 additions and 312 deletions

No files matched your search

+28 -69
View File
@@ -185,7 +185,7 @@ jobs:
frozen-extensions: frozen-extensions:
name: frozen Linux archive and external extensions name: frozen Linux archive and external extensions
runs-on: ubuntu-latest runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@@ -200,6 +200,7 @@ jobs:
version="$(cargo metadata --no-deps --format-version 1 --offline \ version="$(cargo metadata --no-deps --format-version 1 --offline \
| python3 -c 'import json,sys; print(next(p["version"] for p in json.load(sys.stdin)["packages"] if p["name"]=="marqdo-cli"))')" | python3 -c 'import json,sys; print(next(p["version"] for p in json.load(sys.stdin)["packages"] if p["name"]=="marqdo-cli"))')"
python3 tools/release/package.py --source-sha "$GITHUB_SHA" --version "$version" python3 tools/release/package.py --source-sha "$GITHUB_SHA" --version "$version"
python3 tools/release/smoke.py --archive dist/marqdo-*.tar.gz
tools/ci/run_frozen_extensions.sh dist/marqdo-*.tar.gz "$GITHUB_SHA" dist/frozen-extension-evidence.json tools/ci/run_frozen_extensions.sh dist/marqdo-*.tar.gz "$GITHUB_SHA" dist/frozen-extension-evidence.json
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
@@ -207,6 +208,13 @@ jobs:
path: dist/frozen-extension-evidence.json path: dist/frozen-extension-evidence.json
if-no-files-found: error if-no-files-found: error
- uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
with:
name: frozen-linux-archive-${{ github.sha }}
path: dist/marqdo-*.tar.gz*
if-no-files-found: error
release-evidence: release-evidence:
name: release evidence manifest name: release evidence manifest
needs: [test, schema, cross-platform, frozen-extensions] needs: [test, schema, cross-platform, frozen-extensions]
@@ -222,7 +230,6 @@ jobs:
LINUX_RESULT: ${{ needs.test.result }} LINUX_RESULT: ${{ needs.test.result }}
SCHEMA_RESULT: ${{ needs.schema.result }} SCHEMA_RESULT: ${{ needs.schema.result }}
EXTENSIONS_RESULT: ${{ needs.frozen-extensions.result }} EXTENSIONS_RESULT: ${{ needs.frozen-extensions.result }}
PORTABLE_RESULT: ${{ needs.cross-platform.result }}
run: | run: |
set -euo pipefail set -euo pipefail
state() { state() {
@@ -233,11 +240,18 @@ jobs:
esac esac
} }
linux="$(state "$LINUX_RESULT")" linux="$(state "$LINUX_RESULT")"
portable="$(state "$PORTABLE_RESULT")"
if [ "$(state "$SCHEMA_RESULT")" != "PASS" ] || [ "$(state "$EXTENSIONS_RESULT")" != "PASS" ]; then if [ "$(state "$SCHEMA_RESULT")" != "PASS" ] || [ "$(state "$EXTENSIONS_RESULT")" != "PASS" ]; then
linux="FAIL" linux="FAIL"
fi fi
python3 tools/ci/release_evidence.py --target-sha "$TARGET_SHA" --out "docs/evidence/ci/$TARGET_SHA/manifest.json" --gate "linux=$linux:$TARGET_SHA:$RUN_URL" --gate "windows=$portable:$TARGET_SHA:$RUN_URL" --gate "macos=$portable:$TARGET_SHA:$RUN_URL" --gate "strict_vm=UNVERIFIED::${{ github.server_url }}/${{ github.repository }}/actions/workflows/security-linux.yml" --gate "performance=UNVERIFIED::" python3 tools/ci/release_evidence.py --profile rc --target-sha "$TARGET_SHA" \
--out "docs/evidence/ci/$TARGET_SHA/manifest.json" \
--gate "linux=$linux:$TARGET_SHA:$RUN_URL" \
--gate "windows=UNSUPPORTED:$TARGET_SHA:linux-only-rc-scope" \
--gate "macos=UNSUPPORTED:$TARGET_SHA:linux-only-rc-scope" \
--gate "extension=$(state "$EXTENSIONS_RESULT"):$TARGET_SHA:$RUN_URL" \
--gate "strict_vm=UNVERIFIED::$RUN_URL" \
--gate "performance=UNVERIFIED::$RUN_URL"
- name: Validate external-extension evidence when committed - name: Validate external-extension evidence when committed
shell: bash shell: bash
env: env:
@@ -249,7 +263,7 @@ jobs:
python3 tools/ci/verify_extension_contracts.py --validate "$manifest" python3 tools/ci/verify_extension_contracts.py --validate "$manifest"
else else
echo "UNVERIFIED: no external-extension manifest for $TARGET_SHA." echo "UNVERIFIED: no external-extension manifest for $TARGET_SHA."
echo "Release requires tools/ci/verify_extension_contracts.py on the tagged SHA (docs/releasing.md §7)." echo "Release requires tools/ci/verify_extension_contracts.py on the tagged SHA (docs/releasing.md §8)."
fi fi
- name: Upload release manifest - name: Upload release manifest
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
@@ -259,72 +273,17 @@ jobs:
if-no-files-found: error if-no-files-found: error
release-candidate: release-candidate:
name: release candidate artifact (${{ matrix.os }}) name: archive-only Linux candidate smoke
needs: [test, schema, cross-platform, frozen-extensions] needs: [test, schema, cross-platform, frozen-extensions]
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
strategy: runs-on: ubuntu-24.04
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build release binaries
run: |
cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker
test -x target/release/marqdo-provider-worker
- name: Package and checksum
shell: bash
run: |
set -euo pipefail
version="$(cargo metadata --no-deps --format-version 1 | python3 -c 'import json,sys; print(json.load(sys.stdin)["packages"][0]["version"])')"
stage="dist/marqdo-${version}-${{ matrix.target }}"
mkdir -p "$stage"
install -m 0755 target/release/marqdo "$stage/"
# The provider worker is required for provider.json v2 and must be a
# sibling of the marqdo executable (no PATH fallback).
install -m 0755 target/release/marqdo-provider-worker "$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
sha256sum "marqdo-${version}-${{ matrix.target }}.tar.gz" > "marqdo-${version}-${{ matrix.target }}.tar.gz.sha256"
else
shasum -a 256 "marqdo-${version}-${{ matrix.target }}.tar.gz" > "marqdo-${version}-${{ matrix.target }}.tar.gz.sha256"
fi
cat "marqdo-${version}-${{ matrix.target }}.tar.gz.sha256"
- name: Clean-install smoke
shell: bash
run: |
set -euo pipefail
tmp="$(mktemp -d)"
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
test -x ./marqdo-provider-worker
./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: with:
name: marqdo-${{ matrix.target }} persist-credentials: false
path: dist/marqdo-*.tar.gz* - uses: actions/download-artifact@v4
if-no-files-found: error with:
name: frozen-linux-archive-${{ github.sha }}
path: dist
- name: Cold install the checked archive
run: bash tools/release/cold-install.sh dist/marqdo-*.tar.gz "$GITHUB_SHA"
+8 -1
View File
@@ -32,9 +32,16 @@ steps:
- rustup target add x86_64-pc-windows-gnu - rustup target add x86_64-pc-windows-gnu
- cargo check --workspace --all-targets --target x86_64-pc-windows-gnu - cargo check --workspace --all-targets --target x86_64-pc-windows-gnu
minimum-rust:
image: rust:1.89-bookworm
commands:
- apt-get update
- apt-get install -y --no-install-recommends build-essential ca-certificates
- cargo check --locked --workspace --all-targets
build: build:
image: rust:1.100-bookworm image: rust:1.100-bookworm
depends_on: [test] depends_on: [test, minimum-rust]
commands: commands:
- apt-get update - apt-get update
- apt-get install -y --no-install-recommends ca-certificates git openssl python3 build-essential - apt-get install -y --no-install-recommends ca-certificates git openssl python3 build-essential
+19 -11
View File
@@ -1,11 +1,5 @@
# G4 fixed performance node. # Manual performance comparison on the shared Woodpecker runner.
# # Shared-node measurements may support an explicitly approved RC WARN.
# Manual only: this workflow never runs on push or pull_request and therefore
# never executes untrusted PR code on the designated performance agent. The
# repository currently has one Woodpecker agent (agent_id 1), so it is the
# fixed node; the CPU affinity and hardware/toolchain manifest are recorded in
# every report. Do not compare its timings with another machine or with
# QEMU/TCG.
when: when:
event: [manual] event: [manual]
branch: [master] branch: [master]
@@ -15,18 +9,29 @@ steps:
image: rust:1.100-bookworm image: rust:1.100-bookworm
commands: commands:
- apt-get update - apt-get update
- apt-get install -y --no-install-recommends python3 util-linux ca-certificates - apt-get install -y --no-install-recommends python3 util-linux ca-certificates git build-essential
- cargo build --release --locked -p marqdo-cli - cargo build --release --locked -p marqdo-cli
- | - |
set -eu set -eu
baseline_sha=2c7c4f31e7a388d3fcfa717a77067e696ed13854
git fetch --no-tags origin refs/tags/v3.0.0-beta.1
test "$(git rev-parse 'FETCH_HEAD^{commit}')" = "$baseline_sha"
perf_dir="$(mktemp -d)"
git worktree add --detach "$perf_dir/beta" "$baseline_sha"
trap 'git worktree remove --force "$perf_dir/beta"; rm -rf "$perf_dir"' EXIT
(cd "$perf_dir/beta" && cargo build --release --locked -p marqdo-cli)
allowed="$(awk '/^Cpus_allowed_list:/ {print $2}' /proc/self/status)" allowed="$(awk '/^Cpus_allowed_list:/ {print $2}' /proc/self/status)"
cpu_list="${MARQDO_PERF_CPU_LIST:-$(printf '%s' "$allowed" | cut -d, -f1 | cut -d- -f1)}" cpu_list="${MARQDO_PERF_CPU_LIST:-$(printf '%s' "$allowed" | cut -d, -f1 | cut -d- -f1)}"
echo "G4_NODE host=$(uname -n) kernel=$(uname -r) arch=$(uname -m) allowed_cpus=$allowed pin=$cpu_list" echo "G4_NODE host=$(uname -n) kernel=$(uname -r) arch=$(uname -m) allowed_cpus=$allowed pin=$cpu_list"
echo "G4_CPU $(awk -F: '/model name/ {print $2; exit}' /proc/cpuinfo | xargs)" echo "G4_CPU $(awk -F: '/model name/ {print $2; exit}' /proc/cpuinfo | xargs)"
echo "G4_GOVERNOR $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null || echo unavailable)" echo "G4_GOVERNOR $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null || echo unavailable)"
(cd "$perf_dir/beta" && python3 tools/perf/runner.py --no-build \
--warmups 5 --samples 20 --platform-id woodpecker-agent-1 \
--cpu-list "$cpu_list" --out "$perf_dir/beta.json" > /dev/null)
python3 tools/perf/runner.py --no-build --warmups 5 --samples 20 \ python3 tools/perf/runner.py --no-build --warmups 5 --samples 20 \
--approved-node --platform-id woodpecker-agent-1 \ --platform-id woodpecker-agent-1 --cpu-list "$cpu_list" \
--cpu-list "$cpu_list" --out perf.json --baseline "$perf_dir/beta.json" --out perf.json > /dev/null
python3 - <<'PY' python3 - <<'PY'
import json import json
@@ -47,6 +52,9 @@ steps:
f"rss={workload.get('max_rss_kb_median')}" f"rss={workload.get('max_rss_kb_median')}"
) )
PY PY
echo "G4_BASELINE_REPORT_BEGIN"
cat "$perf_dir/beta.json"
echo "G4_BASELINE_REPORT_END"
echo "G4_REPORT_BEGIN" echo "G4_REPORT_BEGIN"
cat perf.json cat perf.json
echo "G4_REPORT_END" echo "G4_REPORT_END"
+6 -1
View File
@@ -10,7 +10,12 @@ Foreign wire v1, Provider manifest v2, lock v4) and independent package
versions (including the bundled stdlib `0.1.0`) are versioned separately and versions (including the bundled stdlib `0.1.0`) are versioned separately and
do not follow the product version. Dates use ISO 8601. do not follow the product version. Dates use ISO 8601.
## Unreleased (post `3.0.0-beta.1`) ## 3.0.0-rc.1 (candidate)
- The Rust workspace, CLI version output and protocol producers report
`3.0.0-rc.1`. The locked workspace requires Rust 1.89.
- The candidate targets Linux x86_64 with glibc. See
[release gates](docs/releasing.md) for the evidence required for publication.
### Core/extension boundary — RFC-EXT-0003 (issue #3) ### Core/extension boundary — RFC-EXT-0003 (issue #3)
+7 -2
View File
@@ -8,6 +8,11 @@ this beta. Executed status and same-SHA evidence are in
[`docs/STATUS.md`](docs/STATUS.md), and SHA-bound external evidence is under [`docs/STATUS.md`](docs/STATUS.md), and SHA-bound external evidence is under
[`docs/evidence/extension/`](docs/evidence/extension/README.md). [`docs/evidence/extension/`](docs/evidence/extension/README.md).
The `3.0.0-rc.1` candidate targets Linux x86_64 on glibc 2.39 and
includes the post-beta changes below. See the
[RC acceptance procedure](docs/releasing.md). The platform evidence table
records the beta and subsequent development verification.
## Language source syntax (breaking change) ## Language source syntax (breaking change)
**The `.mq.md` source language is a breaking change.** The current contract is **The `.mq.md` source language is a breaking change.** The current contract is
@@ -46,7 +51,7 @@ Consequences for compatibility:
## Post-`3.0.0-beta.1` boundary changes (RFC-EXT-0003) ## Post-`3.0.0-beta.1` boundary changes (RFC-EXT-0003)
These land after the beta tag and **before any next beta/stable tag**; they are These landed after the beta tag and **are included in the `3.0.0-rc.1` candidate**; they are
intentional beta-line incompatibilities. Frozen decisions: ADR-0060..0063; executed intentional beta-line incompatibilities. Frozen decisions: ADR-0060..0063; executed
evidence: [`docs/evidence/2026-11-22-rfc-ext-0003-core-hardcoding.md`](docs/evidence/2026-11-22-rfc-ext-0003-core-hardcoding.md). evidence: [`docs/evidence/2026-11-22-rfc-ext-0003-core-hardcoding.md`](docs/evidence/2026-11-22-rfc-ext-0003-core-hardcoding.md).
@@ -65,7 +70,7 @@ evidence: [`docs/evidence/2026-11-22-rfc-ext-0003-core-hardcoding.md`](docs/evid
| Surface | Version | Compatibility rule | | Surface | Version | Compatibility rule |
|---|---|---| |---|---|---|
| Markdown profile | `marqdo.md.v1` | Frozen parser/options. The RFC-LANG-0002 mapping rewrite keeps this profile; the source-language break is tracked above, not by a new profile id. | | Markdown profile | `marqdo.md.v1` | Frozen parser/options. The RFC-LANG-0002 mapping rewrite keeps this profile; the source-language break is tracked above, not by a new profile id. |
| Language / CLI | `3.0.0-beta.1` (prerelease) | SemVer prerelease: breaking changes inside the 3.0 beta line are allowed and announced in the changelog. The `.mq.md` source language changed incompatibly (RFC-LANG-0002); there is no old-syntax execution path or downgrade. CLI flags may change with a changelog note; `strict` refusal is contractual. | | Language / CLI | `3.0.0-rc.1` (candidate) | SemVer prerelease: breaking changes inside the 3.0 beta line are allowed and announced in the changelog. The `.mq.md` source language changed incompatibly (RFC-LANG-0002); there is no old-syntax execution path or downgrade. CLI flags may change with a changelog note; `strict` refusal is contractual. |
| `marqdo.lock` | v4 | v3 is rejected with an explicit `marqdo lock` migration error; v1/v2 are rejected with a relock instruction; `run`/`call`/`check` never rewrite or fetch the lock. `extensions:` records manifest/artifact identity (integrity, not publisher auth). | | `marqdo.lock` | v4 | v3 is rejected with an explicit `marqdo lock` migration error; v1/v2 are rejected with a relock instruction; `run`/`call`/`check` never rewrite or fetch the lock. `extensions:` records manifest/artifact identity (integrity, not publisher auth). |
| Analysis | v2 | Consumers reject unknown majors; incompatible field changes require v3. | | Analysis | v2 | Consumers reject unknown majors; incompatible field changes require v3. |
| Trace | v2 | Binds to the exact Analysis bytes; unknown majors rejected. | | Trace | v2 | Binds to the exact Analysis bytes; unknown majors rejected. |
Generated
+15 -15
View File
@@ -412,7 +412,7 @@ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
[[package]] [[package]]
name = "marqdo-cli" name = "marqdo-cli"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"clap", "clap",
"hex", "hex",
@@ -438,7 +438,7 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-expression" name = "marqdo-expression"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"marqdo-span", "marqdo-span",
"num-bigint", "num-bigint",
@@ -449,7 +449,7 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-foreign" name = "marqdo-foreign"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"hex", "hex",
"libc", "libc",
@@ -465,7 +465,7 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-frontend" name = "marqdo-frontend"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"marqdo-expression", "marqdo-expression",
"marqdo-ir", "marqdo-ir",
@@ -480,7 +480,7 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-host" name = "marqdo-host"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"flate2", "flate2",
"getrandom 0.4.3", "getrandom 0.4.3",
@@ -504,7 +504,7 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-ir" name = "marqdo-ir"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"marqdo-expression", "marqdo-expression",
"marqdo-span", "marqdo-span",
@@ -514,7 +514,7 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-markdown" name = "marqdo-markdown"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"comrak", "comrak",
"marqdo-span", "marqdo-span",
@@ -525,7 +525,7 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-package" name = "marqdo-package"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"hex", "hex",
"semver", "semver",
@@ -539,7 +539,7 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-plugin-abi" name = "marqdo-plugin-abi"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"hex", "hex",
"libloading", "libloading",
@@ -554,7 +554,7 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-plugin-sdk" name = "marqdo-plugin-sdk"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"marqdo-plugin-abi", "marqdo-plugin-abi",
"serde", "serde",
@@ -563,7 +563,7 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-provider-worker" name = "marqdo-provider-worker"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"libloading", "libloading",
"marqdo-host", "marqdo-host",
@@ -575,7 +575,7 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-runtime" name = "marqdo-runtime"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"marqdo-expression", "marqdo-expression",
"marqdo-frontend", "marqdo-frontend",
@@ -594,7 +594,7 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-sandbox" name = "marqdo-sandbox"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"libc", "libc",
"serde", "serde",
@@ -602,14 +602,14 @@ dependencies = [
[[package]] [[package]]
name = "marqdo-span" name = "marqdo-span"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"serde", "serde",
] ]
[[package]] [[package]]
name = "marqdo-value" name = "marqdo-value"
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
dependencies = [ dependencies = [
"marqdo-span", "marqdo-span",
"num-bigint", "num-bigint",
+2 -2
View File
@@ -19,9 +19,9 @@ members = [
] ]
[workspace.package] [workspace.package]
version = "3.0.0-beta.1" version = "3.0.0-rc.1"
edition = "2021" edition = "2021"
rust-version = "1.82" rust-version = "1.89"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
repository = "https://github.com/cflmy/marqdo-cli" repository = "https://github.com/cflmy/marqdo-cli"
authors = ["Marqdo contributors"] authors = ["Marqdo contributors"]
+3 -3
View File
@@ -10,7 +10,7 @@ The official implementation is a Rust workspace; Python/Node are optional
foreign kernels, never the compiler target. foreign kernels, never the compiler target.
This repository is the new, independent Marqdo toolchain, now at product This repository is the new, independent Marqdo toolchain, now at product
version **`3.0.0-beta.1`**. It is **not** a compatibility rewrite of version **`3.0.0-rc.1`** in this checkout. It is **not** a compatibility rewrite of
`cflmy/marqdo`; the old syntax, package format and plugin ABI v2 are not `cflmy/marqdo`; the old syntax, package format and plugin ABI v2 are not
claimed to work here. See [docs/developers/](docs/developers/README.md) for the claimed to work here. See [docs/developers/](docs/developers/README.md) for the
third-party entry point and `docs/MARQDO_3_0_PRERELEASE_PLAN.md` for the beta third-party entry point and `docs/MARQDO_3_0_PRERELEASE_PLAN.md` for the beta
@@ -27,7 +27,7 @@ release policy.
> [`docs/STATUS.md`](docs/STATUS.md) and > [`docs/STATUS.md`](docs/STATUS.md) and
> [`docs/migration/README.md`](docs/migration/README.md). > [`docs/migration/README.md`](docs/migration/README.md).
> **Status: `3.0.0-beta.1` prerelease** — > **Published baseline: `3.0.0-beta.1` prerelease** —
> [release](https://git.cflmy.cn/cflmy/marqdo-cli/releases/tag/v3.0.0-beta.1), > [release](https://git.cflmy.cn/cflmy/marqdo-cli/releases/tag/v3.0.0-beta.1),
> source `2c7c4f31e7a388d3fcfa717a77067e696ed13854`. The public beta target is **Linux x86_64 (glibc)**; macOS and Windows are experimental and not claimed, and the > source `2c7c4f31e7a388d3fcfa717a77067e696ed13854`. The public beta target is **Linux x86_64 (glibc)**; macOS and Windows are experimental and not claimed, and the
> C ABI plugin/provider paths are Linux-only in this beta. The language > C ABI plugin/provider paths are Linux-only in this beta. The language
@@ -53,7 +53,7 @@ mirror is not used as the authoritative lane for this beta.
## Build ## Build
Requires Rust 1.82+. Requires Rust 1.89 or newer for the locked workspace.
```bash ```bash
cargo build -p marqdo-cli cargo build -p marqdo-cli
+22 -15
View File
@@ -436,30 +436,37 @@ fn tampered_path_dependency_content_is_rejected_by_locked_sync() {
} }
#[test] #[test]
fn incompatible_project_marqdo_range_fails_closed_before_program_load() { fn project_marqdo_range_applies_to_the_running_core() {
let dir = TempDir::new("runtime-range"); let dir = TempDir::new("runtime-range");
let root = dir.path(); let root = dir.path();
let core = env!("CARGO_PKG_VERSION");
write(&root.join("index.mq.md"), "## @exec main\n\n`return 1`\n");
for (range, compatible) in [
(">=3.0.0-beta.1,<4.0.0".to_string(), true),
(format!("={core}"), true),
(">=3.0.0,<4.0.0".to_string(), !core.contains('-')),
(">=0.1,<1".to_string(), false),
] {
write( write(
&root.join("marqdo.yaml"), &root.join("marqdo.yaml"),
"project:\n name: stale\n version: 0.1.0\n marqdo: \">=0.1,<1\"\n", &format!("project:\n name: runtime-range\n version: 0.1.0\n marqdo: \"{range}\"\n"),
);
write(&root.join("index.mq.md"), "## @exec main\n\n`return 1`\n");
for command in [["check", "index.mq.md"], ["run", "index.mq.md"]] {
let output = cli(root, &command);
assert!(
!output.status.success(),
"{} must fail closed: {}",
command[0],
String::from_utf8_lossy(&output.stderr)
); );
for command in ["check", "run"] {
let output = cli(root, &[command, "index.mq.md"]);
let stderr = String::from_utf8_lossy(&output.stderr); let stderr = String::from_utf8_lossy(&output.stderr);
assert!( assert_eq!(
stderr.contains("package.marqdo_incompatible"), output.status.success(),
"unexpected stderr: {stderr}" compatible,
"{command}: {range} on {core}: {stderr}"
); );
if !compatible {
assert!(stderr.contains("package.marqdo_incompatible"), "{stderr}");
assert!( assert!(
stderr.contains(env!("CARGO_PKG_VERSION")), stderr.contains(core),
"diagnostic must name the running core: {stderr}" "diagnostic must name the running core: {stderr}"
); );
} }
}
}
} }
+17 -13
View File
@@ -451,35 +451,39 @@ fn a_root_record_json_in_the_source_package_is_rejected() {
} }
#[test] #[test]
fn beta_core_requires_an_explicit_prerelease_compatible_range() { fn prerelease_core_requires_an_explicit_prerelease_compatible_range() {
let dir = TempDir::new("prerelease-range"); let dir = TempDir::new("prerelease-range");
let home = dir.path().join("home"); let home = dir.path().join("home");
let core = env!("CARGO_PKG_VERSION"); let core = env!("CARGO_PKG_VERSION");
// The shipped example range opt-in must install on this real core. for (range, compatible) in [
(">=3.0.0-beta.1,<4.0.0".to_string(), true),
(format!("={core}"), true),
(">=3.0.0,<4.0.0".to_string(), !core.contains('-')),
(">=0.1,<1".to_string(), false),
] {
let manifest = write_tool(dir.path(), "prerelease", "#!/bin/sh\nexit 0\n"); let manifest = write_tool(dir.path(), "prerelease", "#!/bin/sh\nexit 0\n");
let install = cli(&home, &["tool", "install", manifest.to_str().unwrap()]);
assert_eq!(install.status.code(), Some(0), "{}", stderr(&install));
if core.contains('-') {
// SemVer: a stable-only requirement must not silently accept a
// prerelease core. The operator has to opt in with a prerelease range.
let manifest = write_tool(dir.path(), "stableonly", "#!/bin/sh\nexit 0\n");
let text = std::fs::read_to_string(&manifest) let text = std::fs::read_to_string(&manifest)
.unwrap() .unwrap()
.replace(">=3.0.0-beta.1,<4.0.0", ">=3.0.0,<4.0.0"); .replace(">=3.0.0-beta.1,<4.0.0", &range);
std::fs::write(&manifest, text).unwrap(); std::fs::write(&manifest, text).unwrap();
let output = cli(&home, &["tool", "install", manifest.to_str().unwrap()]); let output = cli(&home, &["tool", "install", manifest.to_str().unwrap()]);
assert_eq!( assert_eq!(
output.status.code(), output.status.success(),
Some(1), compatible,
"a stable-only range must reject prerelease core {core}: {}", "{range} on {core}: {}",
stderr(&output) stderr(&output)
); );
if compatible {
assert!(cli(&home, &["tool", "remove", "prerelease"])
.status
.success());
} else {
assert!( assert!(
stderr(&output).contains("requires marqdo"), stderr(&output).contains("requires marqdo"),
"{}", "{}",
stderr(&output) stderr(&output)
); );
} }
}
} }
+1 -1
View File
@@ -620,7 +620,7 @@ fn validate_handler_name(name: &str) -> Result<(), PluginError> {
pub struct Capabilities { pub struct Capabilities {
/// Write to program standard output (`打印`). /// Write to program standard output (`打印`).
pub console: bool, pub console: bool,
/// Use the native math kernel. /// Grant ceiling for the `math.compute` plugin capability.
pub math: bool, pub math: bool,
/// Readable project-relative path patterns. /// Readable project-relative path patterns.
pub fs_read: Vec<String>, pub fs_read: Vec<String>,
+8
View File
@@ -24,6 +24,14 @@ command, log or source path is a defect, not a state. Historical snapshots
[`history/`](history/README.md) and [`evidence/`](evidence/) and must not be read [`history/`](history/README.md) and [`evidence/`](evidence/) and must not be read
as current status. as current status.
## RC candidate
The workspace reports `3.0.0-rc.1` and declares Rust 1.89 as its locked
minimum. Linux x86_64 on glibc 2.39 is the candidate platform. The
[release procedure](releasing.md) requires a green manifest bound to the
candidate SHA before publication. The release record below refers to the
published beta.
## 0. Beta release record — `3.0.0-beta.1` ## 0. Beta release record — `3.0.0-beta.1`
### 0.1 Product, version axes and scope ### 0.1 Product, version axes and scope
+1 -1
View File
@@ -6,7 +6,7 @@ Rust structures, `marqdo-ir` internals, `inspect --ir`, relative paths into the
core checkout, or host memory layout. Adding a new domain function must not core checkout, or host memory layout. Adding a new domain function must not
require a core commit. require a core commit.
Product version for these docs: **`3.0.0-beta.1`** (Linux x86_64 beta). Product version for these docs: **`3.0.0-rc.1`** (Linux x86_64 candidate).
Protocol versions are independent: Analysis v2, Trace v2, Execution Events v1, Protocol versions are independent: Analysis v2, Trace v2, Execution Events v1,
Tool v1, Plugin ABI v1, Foreign wire v1, Provider manifest v2, lock v4, Tool v1, Plugin ABI v1, Foreign wire v1, Provider manifest v2, lock v4,
markdown profile `marqdo.md.v1`. markdown profile `marqdo.md.v1`.
+11 -18
View File
@@ -6,9 +6,9 @@ This page summarizes the public support policy. The authoritative matrix is
## Version axes (do not conflate) ## Version axes (do not conflate)
| Axis | `3.0.0-beta.1` value | Change rule | | Axis | `3.0.0-rc.1` value | Change rule |
|---|---|---| |---|---|---|
| Product / CLI | `3.0.0-beta.1` | SemVer prerelease; breaking changes inside the 3.0 beta line are allowed and appear in `CHANGELOG.md`. | | Product / CLI | `3.0.0-rc.1` | SemVer prerelease. See `CHANGELOG.md` for changes from the beta. |
| Analysis | v2 | New major for incompatible changes; consumers reject unknown majors. | | Analysis | v2 | New major for incompatible changes; consumers reject unknown majors. |
| Trace | v2 | New major for incompatible changes; binds to exact Analysis bytes. | | Trace | v2 | New major for incompatible changes; binds to exact Analysis bytes. |
| Execution Events | v1 | One-line NDJSON stream; new major for incompatible required-field/ordering/redaction changes. Consumers reject unknown majors. | | Execution Events | v1 | One-line NDJSON stream; new major for incompatible required-field/ordering/redaction changes. Consumers reject unknown majors. |
@@ -22,14 +22,14 @@ This page summarizes the public support policy. The authoritative matrix is
| Plugin/tool/example packages | their own | Independent SemVer. | | Plugin/tool/example packages | their own | Independent SemVer. |
`project.marqdo` and a tool's `compatibility.marqdo` are **enforced product `project.marqdo` and a tool's `compatibility.marqdo` are **enforced product
ranges**. Beta cores require a prerelease range such as ranges**. Prerelease cores require a prerelease range such as
`>=3.0.0-beta.1,<4.0.0`; `>=3.0.0,<4.0.0` does not match a beta core. `>=3.0.0-beta.1,<4.0.0`; `>=3.0.0,<4.0.0` does not match the RC.
## Platform support (`3.0.0-beta.1`) ## Candidate platform scope
| Platform | Release status | Notes | | Platform | Release status | Notes |
|---|---|---| |---|---|---|
| Linux x86_64 (glibc) | **Supported** | Only release archive: CLI + provider worker, same target triple. | | Linux x86_64 (glibc 2.39 baseline) | **RC target** | Only release archive: CLI + provider worker, same target triple. |
| Linux aarch64 | Not built | No artifact; source may build. | | Linux aarch64 | Not built | No artifact; source may build. |
| macOS arm64/x86_64 | Experimental, not claimed | Core may run; no macOS provider worker, no plugin ABI claim, no archive. | | macOS arm64/x86_64 | Experimental, not claimed | Core may run; no macOS provider worker, no plugin ABI claim, no archive. |
| Windows x86_64 | Experimental, not claimed | Compile gate only; C ABI/plugin/provider/worker not claimed/fail-closed. | | Windows x86_64 | Experimental, not claimed | Compile gate only; C ABI/plugin/provider/worker not claimed/fail-closed. |
@@ -42,7 +42,7 @@ grant, values are off by default, and `--mode strict` currently refuses
## Language compatibility ## Language compatibility
`3.0.0-beta.1` implements RFC-LANG-0002 only. Pre-RFC `.mq.md` source `3.0.0-rc.1` implements RFC-LANG-0002 only. Pre-RFC `.mq.md` source
(Strong-execute / Emph-return / ordered-list branch / bullet-list loop / (Strong-execute / Emph-return / ordered-list branch / bullet-list loop /
block-quote call / first code-span signature) is **not executable**; there is no block-quote call / first code-span signature) is **not executable**; there is no
`--legacy`, syntax switch or downgrade path. Migration is a rewrite task `--legacy`, syntax switch or downgrade path. Migration is a rewrite task
@@ -52,15 +52,8 @@ The earlier `cflmy/marqdo` product line is a different architecture; its source
syntax, package format and plugin ABI v2 are not compatible and no hidden syntax, package format and plugin ABI v2 are not compatible and no hidden
compatibility layer is provided. compatibility layer is provided.
## Beta policy ## RC policy
- Beta may break behavior with a changelog note; protocols are versioned - See [release gates](../releasing.md) for the Linux RC acceptance procedure.
separately and only change with a new major. - [Known limitations](release-limits.md) ship with the archive.
- No LTS is announced. LTS is a later, evidence-based decision (see the - Every archive records its checksum, source SHA and toolchain.
prerelease plan §3.2/§5), not a calendar promise.
- Known non-security gaps are listed in [release-limits.md](release-limits.md)
and in the release notes; unsupported requests must fail closed.
- G4 performance is a Beta-only `WARN` on the fixed Woodpecker agent for this
release; it is not a general performance guarantee.
- Every archive is checksummed and records its source SHA and toolchain.
Checksums prove integrity only, not publisher identity.
+5 -5
View File
@@ -1,15 +1,15 @@
# Quickstart: install and run # Quickstart: install and run
Product: `3.0.0-beta.1` (Linux x86_64 beta). Install a **release archive**, not Product: `3.0.0-rc.1` (Linux x86_64 candidate). Install a **release archive**, not
a source checkout, when you only consume Marqdo. a source checkout, when you only consume Marqdo.
## 1. Install the archive ## 1. Install the archive
```bash ```bash
sha256sum -c marqdo-3.0.0-beta.1-x86_64-unknown-linux-gnu.tar.gz.sha256 sha256sum -c marqdo-3.0.0-rc.1-x86_64-unknown-linux-gnu.tar.gz.sha256
tar -xzf marqdo-3.0.0-beta.1-x86_64-unknown-linux-gnu.tar.gz tar -xzf marqdo-3.0.0-rc.1-x86_64-unknown-linux-gnu.tar.gz
cd marqdo-3.0.0-beta.1-x86_64-unknown-linux-gnu cd marqdo-3.0.0-rc.1-x86_64-unknown-linux-gnu
./marqdo --version # marqdo 3.0.0-beta.1 ./marqdo --version # marqdo 3.0.0-rc.1
./marqdo --help ./marqdo --help
``` ```
+20 -18
View File
@@ -1,14 +1,14 @@
# Marqdo 3.0.0-beta.1 — known limitations # Marqdo 3.0.0-rc.1 — known limitations
This file ships in the release archive as `KNOWN_LIMITATIONS.md`. It is part of This file ships in the release archive as `KNOWN_LIMITATIONS.md`. It is part of
the release record: the beta support claim is exactly what is written here. the release record: it defines the platform and feature scope for the release candidate.
Items marked **unsupported** must fail closed, not be silently emulated. Items marked **unsupported** must fail closed, not be silently emulated.
## Platform support ## Platform support
| Platform | Beta status | Notes | | Platform | RC scope | Notes |
|---|---|---| |---|---|---|
| Linux x86_64 (glibc) | **Supported release platform** | The archived `marqdo` and `marqdo-provider-worker` binaries target `x86_64-unknown-linux-gnu` and are the only binaries this release claims. | | Linux x86_64 (glibc 2.39 baseline) | **Supported release platform** | The archived `marqdo` and `marqdo-provider-worker` binaries target `x86_64-unknown-linux-gnu` and are the only binaries this release claims. |
| Linux aarch64 | Not built | No release artifact; source may build. | | Linux aarch64 | Not built | No release artifact; source may build. |
| macOS (arm64/x86_64) | Experimental, not claimed | Core CLI may work, but no macOS provider worker, no native plugin ABI claim and no macOS release artifact. | | macOS (arm64/x86_64) | Experimental, not claimed | Core CLI may work, but no macOS provider worker, no native plugin ABI claim and no macOS release artifact. |
| Windows x86_64 | Experimental, not claimed | Core CLI may compile/run; the plugin/provider C ABI and provider worker are not claimed. | | Windows x86_64 | Experimental, not claimed | Core CLI may compile/run; the plugin/provider C ABI and provider worker are not claimed. |
@@ -19,14 +19,13 @@ user and is not a security boundary against hostile code.
## `strict` isolation ## `strict` isolation
`strict` is Linux-only and probe-gated. The beta release claims it only when the `strict` is Linux-only and probe-gated. The RC release requires same-SHA
same-SHA G3 evidence recorded in `docs/evidence/` is present; otherwise this file G3 evidence from a non-root disposable VM. The CLI fails closed when the
and the release notes must say **strict: unsupported** and the runtime must fail runtime probe is unavailable.
closed (no project code executes).
Even when available: Even when available:
* strict L1 covers the pure language plus native Math; * strict L1 covers the interpreter, console and read-only bundled stdlib;
* strict L2 (Worker/Foreign/Provider inside strict) is **unsupported** and every * strict L2 (Worker/Foreign/Provider inside strict) is **unsupported** and every
such flag is refused with exit 2; such flag is refused with exit 2;
* rlimits are used for resource limits, not cgroup-v2 accounting; * rlimits are used for resource limits, not cgroup-v2 accounting;
@@ -58,18 +57,14 @@ Even when available:
## Compatibility and versioning ## Compatibility and versioning
* `3.0.0-beta.1` is a **prerelease**, not stable and not LTS. Breaking changes * `3.0.0-rc.1` is a **prerelease**. The changelog lists changes from the beta.
inside the 3.0 beta series are allowed and announced in the changelog.
* The product version is independent of protocol versions: Analysis v2, Trace * The product version is independent of protocol versions: Analysis v2, Trace
v2, Execution Events v1, Tool v1, Plugin ABI v1, Foreign wire v1, Provider v2, Execution Events v1, Tool v1, Plugin ABI v1, Foreign wire v1, Provider
manifest v2 and lock v4 keep their own major numbers. Do not infer them from manifest v2 and lock v4 keep their own major numbers.
`3.0.0-beta.1`. Execution Events v1 is a post-beta addition and is not in the
tagged beta archive.
* The official bundled stdlib keeps its independent package version `0.1.0`. * The official bundled stdlib keeps its independent package version `0.1.0`.
A plugin `.mq.md` package version such as `0.1.0` is also independent. A plugin `.mq.md` package version such as `0.1.0` is also independent.
* `project.marqdo` in `marqdo.yaml` is enforced in this release. SemVer * `project.marqdo` in `marqdo.yaml` is enforced in this release. SemVer
prerelease rules apply: `>=3.0.0,<4.0.0` does **not** accept a beta core; prerelease rules apply: `>=3.0.0,<4.0.0` does **not** accept a prerelease core. Packages and Tools can use a prerelease range such as
beta users must declare a prerelease range such as
`>=3.0.0-beta.1,<4.0.0`. `>=3.0.0-beta.1,<4.0.0`.
* Old `cflmy/marqdo` source syntax, package format and plugin ABI v2 are not * Old `cflmy/marqdo` source syntax, package format and plugin ABI v2 are not
compatible. There is no `--legacy` or downgrade path; migration is a separate compatible. There is no `--legacy` or downgrade path; migration is a separate
@@ -82,7 +77,7 @@ Archives are accompanied by SHA256 checksums and `RELEASE_INFO.json`
integrity only; they are **not** a publisher signature. A digest obtained from integrity only; they are **not** a publisher signature. A digest obtained from
an untrusted Git URL does not make the code trustworthy. an untrusted Git URL does not make the code trustworthy.
## Execution Events v1 (post-beta addition) ## Execution Events v1
* Implemented: live stdout/stderr chunks, lifecycle/terminal events, call * Implemented: live stdout/stderr chunks, lifecycle/terminal events, call
instance ids, branch/loop/effect events, explicit bounded value observation. instance ids, branch/loop/effect events, explicit bounded value observation.
@@ -92,7 +87,7 @@ an untrusted Git URL does not make the code trustworthy.
* `--mode strict` currently rejects `--event-stream` explicitly; there is no * `--mode strict` currently rejects `--event-stream` explicitly; there is no
silent fallback to `project`. silent fallback to `project`.
* The live lane is tested on Linux x86_64; macOS/Windows are unverified for * The live lane is tested on Linux x86_64; macOS/Windows are unverified for
this option like the rest of the beta CLI. this option for this candidate.
* In-process native plugins are rejected in event mode * In-process native plugins are rejected in event mode
(`ext.event_stream_unsupported_native_plugin`) because they share the process (`ext.event_stream_unsupported_native_plugin`) because they share the process
and can write the protocol fd directly; worker plugins remain usable. and can write the protocol fd directly; worker plugins remain usable.
@@ -106,3 +101,10 @@ environment creation, a distributed package registry, JIT execution, built-in
Knowledge/Proof/View commands, a mature async/concurrency model, and platform Knowledge/Proof/View commands, a mature async/concurrency model, and platform
installers. The planned direction is external Tool repositories consuming the installers. The planned direction is external Tool repositories consuming the
public protocols, not new core commands. public protocols, not new core commands.
## Beta migration
The former core `math.*` calls fail static validation with `symbol.unknown`.
Use a pure `.mq.md` library or an explicitly selected ABI backend. See
[the math library migration](libraries.md).
Task/Channel and Resource Control are outside this RC's protocol scope.
+1 -1
View File
@@ -20,7 +20,7 @@ marqdo-view/
examples/ examples/
``` ```
`tool.json` for the `3.0.0-beta.1` product line: `tool.json` for the `3.0.0-rc.1` candidate:
```json ```json
{ {
+40 -17
View File
@@ -4,12 +4,17 @@ This document is the release-candidate procedure. It does **not** grant
permission to tag or publish: a tag requires the gates below to be green on the permission to tag or publish: a tag requires the gates below to be green on the
exact commit and an explicit maintainer sign-off recorded in the release notes. exact commit and an explicit maintainer sign-off recorded in the release notes.
Two profiles are deliberately separate (see Three profiles apply (see
[`MARQDO_3_0_PRERELEASE_PLAN.md`](MARQDO_3_0_PRERELEASE_PLAN.md) §3): [`MARQDO_3_0_PRERELEASE_PLAN.md`](MARQDO_3_0_PRERELEASE_PLAN.md) §3):
* **beta** — a prerelease (`-beta.N`) on the platform(s) the project can really * **beta** — a prerelease (`-beta.N`) on the platform(s) the project can really
test and fix. Known non-security gaps are allowed only when explicitly test and fix. Known non-security gaps are allowed only when explicitly
recorded. `3.0.0-beta.1` claims **Linux x86_64 (glibc)** only. recorded. `3.0.0-beta.1` claims **Linux x86_64 (glibc)** only.
* **rc** — `-rc.N`. The current target is Linux x86_64 (glibc).
Record Windows and macOS as UNSUPPORTED for this scope. Require same-SHA
Linux CI, frozen extensions, clean install, version compatibility, strict
VM PASS. Performance requires fixed-node PASS or the specific shared-node
exception documented below.
* **stable** — `3.0.0`/LTS. Not covered by beta exceptions; see * **stable** — `3.0.0`/LTS. Not covered by beta exceptions; see
[`STABLE_RELEASE_IMPLEMENTATION.md`](STABLE_RELEASE_IMPLEMENTATION.md) [`STABLE_RELEASE_IMPLEMENTATION.md`](STABLE_RELEASE_IMPLEMENTATION.md)
(historical roadmap input) and the public support matrix. (historical roadmap input) and the public support matrix.
@@ -64,6 +69,29 @@ JIT and built-in Knowledge/Proof/View are **not** beta gates; they are listed as
unsupported/experimental in unsupported/experimental in
[`developers/release-limits.md`](developers/release-limits.md). [`developers/release-limits.md`](developers/release-limits.md).
### Linux RC preconditions
Use the frozen-SHA build and archive checks above. Additionally:
- Strict L1 requires a same-SHA PASS on a disposable VM as a non-root user.
Record the strict evidence and verify the archived binary on that guest.
- Measure the packaged CLI on a dedicated fixed node with 5 warmups and
20 samples or more for each of the nine workloads. Compare against a
correctness-verified baseline on the same node, CPU affinity, governor,
kernel and toolchain. Record investigation and resolution for any p50
increase of at least 15% or median peak RSS increase of at least 20%.
A dedicated node is the default. For a prerelease approved by the
maintainer to use a shared node, take at least three paired beta/RC runs
under the same measured conditions and keep all reports. Verify all nine
workloads and investigate threshold breaches or unstable samples before
accepting a `WARN`. Record the approval, runner environment and limits in
the release notes. This exception applies to the named RC only.
- Version compatibility covers the locked Rust minimum, CLI and Analysis
product identity, Tool/project prerelease ranges, and beta migration.
- Use Ubuntu 24.04 (glibc 2.39) for the independent archive-only runtime
check. Task/Channel, Resource Control and native macOS/Windows remain
outside this candidate's support scope.
## 2. Build and local gate ## 2. Build and local gate
```bash ```bash
@@ -136,18 +164,7 @@ The cold-install gate must run in a container that receives **only the archive
bytes** — no source directory, no `/build`, no Cargo — and extracts them itself: bytes** — no source directory, no `/build`, no Cargo — and extracts them itself:
```bash ```bash
docker run --rm -v "$PWD/dist:/dist:ro" ubuntu:24.04 sh -c ' bash tools/release/cold-install.sh dist/marqdo-*.tar.gz "$(git rev-parse HEAD)"
set -eu
mkdir -p /opt/marqdo
tar -xzf /dist/marqdo-<version>-x86_64-unknown-linux-gnu.tar.gz -C /opt/marqdo
cd /opt/marqdo/marqdo-<version>-x86_64-unknown-linux-gnu
./marqdo --version
./marqdo --help >/dev/null
./marqdo run examples/hello.mq.md
./marqdo check examples/multi-module/index.mq.md --emit /tmp/analysis.json
./marqdo call examples/math-library-demo.mq.md main
./marqdo call examples/factorial.mq.md 阶乘 --arg n=5
'
``` ```
Run this on the same Linux x86_64 glibc baseline as the release support Run this on the same Linux x86_64 glibc baseline as the release support
@@ -172,8 +189,14 @@ python3 tools/ci/release_evidence.py --profile beta --target-sha "$sha" \
`BETA_RELEASE_CANDIDATE` is the only acceptable decision for a beta tag. A `BETA_RELEASE_CANDIDATE` is the only acceptable decision for a beta tag. A
missing, skipped, failed or SHA-mismatched gate is `DO_NOT_RELEASE`; never missing, skipped, failed or SHA-mismatched gate is `DO_NOT_RELEASE`; never
hand-edit a manifest to PASS. Stable releases use the default `--profile hand-edit a manifest to PASS. For a Linux RC, use
stable` and additionally require Windows/macOS PASS and a strict PASS. `--profile rc --require-release` and declare both excluded platforms. If
the shared-node exception applies, pass
`--rc-shared-performance-approval <release-notes-reference>` and supply
`performance=WARN:<candidate-sha>:<comparison-evidence>`. Use the generated
`RC_RELEASE_CANDIDATE` decision before running the tagging commands.
Stable releases use `--profile stable --require-release` and require native
Windows and macOS PASS in addition to the Linux and contract gates.
## 6. Tagging and publication (owner approval required) ## 6. Tagging and publication (owner approval required)
@@ -189,10 +212,10 @@ git push origin "v${version}"
Then create the Gitea release for the tag with `prerelease: true`, attach the Then create the Gitea release for the tag with `prerelease: true`, attach the
tarball and its `.sha256`, and include the release notes. The notes must state: tarball and its `.sha256`, and include the release notes. The notes must state:
* beta / non-LTS status and the Linux x86_64-only support claim; * prerelease status, support lifetime and the Linux x86_64 platform scope;
* the breaking RFC-LANG-0002 language change and no legacy path; * the breaking RFC-LANG-0002 language change and no legacy path;
* the strict policy (same-SHA evidence, or `strict: unsupported` fail-closed); * the strict policy (same-SHA evidence, or `strict: unsupported` fail-closed);
* the G4 Beta-only WARN environment and limits when applicable; * the G4 result and its comparison, including any approved shared-node exception;
* independently versioned protocols and stdlib/package versions; * independently versioned protocols and stdlib/package versions;
* the checksum-integrity-not-signature caveat and the known-limitations file; * the checksum-integrity-not-signature caveat and the known-limitations file;
* the exact source SHA and links to the evidence manifest. * the exact source SHA and links to the evidence manifest.
+4 -6
View File
@@ -1,7 +1,6 @@
# Marqdo Security Model (implemented status) # Marqdo Security Model (implemented status)
Status: **describes the `3.0.0-beta.1` implementation, including honest gaps.** This is Status: describes enforcement in the `3.0.0-rc.1` candidate.
not a security audit; it documents what the code actually enforces.
Normative implementation: Normative implementation:
@@ -14,7 +13,7 @@ Normative implementation:
| Project-rooted filesystem | `crates/marqdo-host/src/fs.rs` | | Project-rooted filesystem | `crates/marqdo-host/src/fs.rs` |
| Budgets | `crates/marqdo-host/src/budget.rs` | | Budgets | `crates/marqdo-host/src/budget.rs` |
| Effect tracing | `crates/marqdo-host/src/trace.rs` | | Effect tracing | `crates/marqdo-host/src/trace.rs` |
| Math/foreign adapters | `crates/marqdo-host/src/kernels.rs` | | Foreign adapter | `crates/marqdo-host/src/kernels.rs` |
| Foreign child processes | `crates/marqdo-foreign/src/lib.rs` | | Foreign child processes | `crates/marqdo-foreign/src/lib.rs` |
| Plugin loading / in-process plugin calls | `crates/marqdo-host/src/host.rs` (`load_plugin`, `op_plugin_invoke`), `crates/marqdo-plugin-abi/src/loader.rs` | | Plugin loading / in-process plugin calls | `crates/marqdo-host/src/host.rs` (`load_plugin`, `op_plugin_invoke`), `crates/marqdo-plugin-abi/src/loader.rs` |
| CLI flags and capability construction | `crates/cli/src/main.rs`, `crates/cli/src/commands.rs` | | CLI flags and capability construction | `crates/cli/src/main.rs`, `crates/cli/src/commands.rs` |
@@ -29,7 +28,7 @@ Normative implementation:
|---|---|---| |---|---|---|
| `pure` | No external I/O; memory computation and budgets only. | **Enforced.** `Capabilities::pure()` = `console`, `math` only; every FS/foreign/plugin grant flag makes the CLI exit 2 with "pure mode prohibits external I/O grants". | | `pure` | No external I/O; memory computation and budgets only. | **Enforced.** `Capabilities::pure()` = `console`, `math` only; every FS/foreign/plugin grant flag makes the CLI exit 2 with "pure mode prohibits external I/O grants". |
| `project` | Operator-approved project resources under `CapabilityHost` + bounded resources. | **Enforced for the implemented operations.** Defaults equal `pure`; `--allow-read`, `--allow-write`, `--allow-net`, `--allow-env`, `--allow-process`, `--allow-random`, `--allow-foreign`, `--allow-plugin` add grants. `resource.open` supports stdin read, separate stdout/stderr write, granted project-file read/write (ADR-0025/0026/0040), granted in-process provider kinds (ADR-0033) and granted TCP/UDP/listener/TLS streams, including DNS names after an exact host grant (ADR-0034/0047/0048); process/device remain unsupported. Sandboxing is cooperative (in-process checks), not OS isolation; in-process providers are trusted, not sandboxed. | | `project` | Operator-approved project resources under `CapabilityHost` + bounded resources. | **Enforced for the implemented operations.** Defaults equal `pure`; `--allow-read`, `--allow-write`, `--allow-net`, `--allow-env`, `--allow-process`, `--allow-random`, `--allow-foreign`, `--allow-plugin` add grants. `resource.open` supports stdin read, separate stdout/stderr write, granted project-file read/write (ADR-0025/0026/0040), granted in-process provider kinds (ADR-0033) and granted TCP/UDP/listener/TLS streams, including DNS names after an exact host grant (ADR-0034/0047/0048); process/device remain unsupported. Sandboxing is cooperative (in-process checks), not OS isolation; in-process providers are trusted, not sandboxed. |
| `strict` | Untrusted documents under real OS isolation. | **Linux: enforced when the runtime probe passes (ADR-0021).** `resource.open` is **refused** in strict except for the existing `stdio/stdout` console channel (console grant); stdin/stderr, file/TCP/provider/process resources remain refused until a provider passes the isolation lane (CM-A11, ADR-0030/0034/0040). `PlatformCapabilities::detect()` runs a real Bubblewrap smoke test; success reports `Available { mechanism }`, failure reports `Unavailable { reason }`. Strict L1 supports the interpreter, console, native Math and the read-only bundled stdlib (published at `/run/marqdo-stdlib` for the Compat-C print chain); `--allow-read/--allow-write/--allow-net/--allow-env/--allow-process/--allow-random/--allow-foreign/--allow-plugin/--plugin/--trust-native-plugin/--kernel/--trace-file` are rejected with exit 2. macOS/Windows and Linux hosts without the mechanisms remain `Unavailable`; there is **no fallback** to an unrestricted process. | | `strict` | Untrusted documents under real OS isolation. | **Linux: enforced when the runtime probe passes (ADR-0021).** `resource.open` is **refused** in strict except for the existing `stdio/stdout` console channel (console grant); stdin/stderr, file/TCP/provider/process resources remain refused until a provider passes the isolation lane (CM-A11, ADR-0030/0034/0040). `PlatformCapabilities::detect()` runs a real Bubblewrap smoke test; success reports `Available { mechanism }`, failure reports `Unavailable { reason }`. Strict L1 supports the interpreter, console and the read-only bundled stdlib (published at `/run/marqdo-stdlib` for the Compat-C print chain); `--allow-read/--allow-write/--allow-net/--allow-env/--allow-process/--allow-random/--allow-foreign/--allow-plugin/--plugin/--trust-native-plugin/--kernel/--trace-file` are rejected with exit 2. macOS/Windows and Linux hosts without the mechanisms remain `Unavailable`; there is **no fallback** to an unrestricted process. |
`marqdo inspect <file> --platform` prints the detection report, for example: `marqdo inspect <file> --platform` prints the detection report, for example:
@@ -92,7 +91,7 @@ set for one run:
| Field | Default (`pure`/`project`) | Used by | | Field | Default (`pure`/`project`) | Used by |
|---|---|---| |---|---|---|
| `console: bool` | `true` | `resource.open("stdio","stdin",["read"])`, `resource.open("stdio","stdout"/"stderr",["write"])` and the stdlib console chain; a missing grant is `permission.denied` and stdout/stderr are also bounded by the output budget | | `console: bool` | `true` | `resource.open("stdio","stdin",["read"])`, `resource.open("stdio","stdout"/"stderr",["write"])` and the stdlib console chain; a missing grant is `permission.denied` and stdout/stderr are also bounded by the output budget |
| `math: bool` | `true` | `math.*` host ops | | `math: bool` | `true` | Grant ceiling for the `math.compute` plugin capability, subject to package, policy and installed handler checks |
| `fs_read: Vec<String>` | empty | `fs.read` and project `resource.open("file", path, ["read"])` | | `fs_read: Vec<String>` | empty | `fs.read` and project `resource.open("file", path, ["read"])` |
| `fs_write: Vec<String>` | empty | `fs.write` and project `resource.open("file", path, ["write"])` | | `fs_write: Vec<String>` | empty | `fs.write` and project `resource.open("file", path, ["write"])` |
| `net_hosts: Vec<String>` | empty | exact host/IP grants for `resource.open("tcp"|"udp"|"tcp-listener"|"tls", "host:port", ...)`; DNS is resolved only after the host grant; TLS still validates certificates; `--allow-net <HOST>` adds a grant (ADR-0034/0047/0048) | | `net_hosts: Vec<String>` | empty | exact host/IP grants for `resource.open("tcp"|"udp"|"tcp-listener"|"tls", "host:port", ...)`; DNS is resolved only after the host grant; TLS still validates certificates; `--allow-net <HOST>` adds a grant (ADR-0034/0047/0048) |
@@ -171,7 +170,6 @@ before reading. Full symlink/race hardening is an open P4 item.
* `resource.request("random.bytes")` → `capabilities.check_random` before * `resource.request("random.bytes")` → `capabilities.check_random` before
`getrandom::fill`; `getrandom::fill`;
* `fs.write` → `check_write` then `ProjectFs::write`; * `fs.write` → `check_write` then `ProjectFs::write`;
* math ops → `capabilities.math` (in `crates/marqdo-host/src/kernels.rs`);
* foreign ops → `capabilities.check_foreign` (requires `foreign && process`); * foreign ops → `capabilities.check_foreign` (requires `foreign && process`);
* plugin invoke → the **complete export name** must be registered, then * plugin invoke → the **complete export name** must be registered, then
`capabilities.check_plugin(package)` on **every call**; loading also checks `capabilities.check_plugin(package)` on **every call**; loading also checks
+1 -1
View File
@@ -1,6 +1,6 @@
# Marqdo CLI Tool Protocol v1 — 通用外部工具协议 # Marqdo CLI Tool Protocol v1 — 通用外部工具协议
> 状态:**Implemented / frozen protocol v1**(产品 `3.0.0-beta.1`)。核心根命令同样优先;任何官方/第三方工具一视同仁;该协议**不是** C ABI 插件协议。安装、校验、分发与协议协商均已实现并由 `crates/cli/tests/tool_protocol.rs` 覆盖。 > 状态:**Implemented / frozen protocol v1**(独立于产品版本)。核心根命令同样优先;任何官方/第三方工具一视同仁;该协议**不是** C ABI 插件协议。安装、校验、分发与协议协商均已实现并由 `crates/cli/tests/tool_protocol.rs` 覆盖。
## 1. 范围与不变量 ## 1. 范围与不变量
+61 -51
View File
@@ -5,16 +5,12 @@ Schema: `marqdo.release-gates.v1`. A missing, skipped, timed-out, failed or
SHA-mismatched gate is never PASS. The tool only records supplied facts; it SHA-mismatched gate is never PASS. The tool only records supplied facts; it
does not query CI and cannot turn an UNVERIFIED gate into a release. does not query CI and cannot turn an UNVERIFIED gate into a release.
Two profiles exist and both are explicit in the output: The `rc` profile requires every gate on the target SHA. For a Linux-only RC,
Windows and macOS must be explicitly UNSUPPORTED; the stable profile requires
* `stable` — every required platform gate must PASS on the target SHA. both to PASS. Strict VM, extension, clean install, version compatibility and
* `beta` — the supported platform set is the one declared in performance require PASS. RC can record a shared-node performance WARN only
`COMPATIBILITY.md` (Linux x86_64 for `3.0.0-beta.1`). `windows`/`macos` must with an explicit maintainer approval reference. The historical beta profile
be explicitly `UNSUPPORTED` (not silently omitted). `strict_vm` may be PASS retains its own scoped exceptions.
with same-SHA disposable-VM evidence, or `UNSUPPORTED` when the tested policy
is an explicit fail-closed refusal; `extension`, `clean_install` and
`version_compat` must PASS. `performance` may be `WARN` only in beta and is
recorded with its reason.
Gate spec: `name=STATE:tested_sha:run_url` (url may contain colons). Gate spec: `name=STATE:tested_sha:run_url` (url may contain colons).
@@ -29,7 +25,7 @@ Usage:
--gate windows=UNSUPPORTED:$SHA:supported-platforms-exclude \ --gate windows=UNSUPPORTED:$SHA:supported-platforms-exclude \
--gate macos=UNSUPPORTED:$SHA:supported-platforms-exclude \ --gate macos=UNSUPPORTED:$SHA:supported-platforms-exclude \
--gate performance=WARN:$SHA:docs/evidence/... \ --gate performance=WARN:$SHA:docs/evidence/... \
--out/docs/evidence/ci/$SHA/manifest.json --out docs/evidence/ci/$SHA/manifest.json
""" """
import argparse import argparse
@@ -40,22 +36,6 @@ import sys
from pathlib import Path from pathlib import Path
SCHEMA = "marqdo.release-gates.v1" SCHEMA = "marqdo.release-gates.v1"
PROFILES = {
"stable": {
"required": ("linux", "windows", "macos", "strict_vm"),
"optional": ("performance",),
"windows_macos_unsupported_allowed": False,
"strict_unsupported_allowed": False,
"decision": "RELEASE_CANDIDATE",
},
"beta": {
"required": ("linux", "strict_vm", "extension", "clean_install", "version_compat"),
"optional": ("windows", "macos", "performance"),
"windows_macos_unsupported_allowed": True,
"strict_unsupported_allowed": True,
"decision": "BETA_RELEASE_CANDIDATE",
},
}
GATES = ( GATES = (
"linux", "linux",
"windows", "windows",
@@ -66,6 +46,22 @@ GATES = (
"version_compat", "version_compat",
"performance", "performance",
) )
RC_PLATFORM_STATES = {"windows": {"UNSUPPORTED"}, "macos": {"UNSUPPORTED"}}
BETA_OPTIONAL = ("windows", "macos", "performance")
PROFILES = {
"stable": ("RELEASE_CANDIDATE", {}, ()),
"rc": ("RC_RELEASE_CANDIDATE", RC_PLATFORM_STATES, ()),
"beta": (
"BETA_RELEASE_CANDIDATE",
{
"windows": {"PASS", "UNSUPPORTED"},
"macos": {"PASS", "UNSUPPORTED"},
"strict_vm": {"PASS", "UNSUPPORTED"},
"performance": {"PASS", "WARN"},
},
BETA_OPTIONAL,
),
}
STATES = { STATES = {
"linux": {"PASS", "FAIL", "UNVERIFIED"}, "linux": {"PASS", "FAIL", "UNVERIFIED"},
"windows": {"PASS", "FAIL", "UNVERIFIED", "UNSUPPORTED"}, "windows": {"PASS", "FAIL", "UNVERIFIED", "UNSUPPORTED"},
@@ -105,13 +101,23 @@ def parse_gate(text: str) -> tuple[str, dict]:
return name, {"state": state, "tested_sha": tested_sha, "run_url": run_url} return name, {"state": state, "tested_sha": tested_sha, "run_url": run_url}
def build_manifest(target_sha: str, gates: list[str], profile: str = "stable") -> dict: def build_manifest(
target_sha: str,
gates: list[str],
profile: str = "stable",
rc_shared_performance_approval: str = "",
) -> dict:
if not SHA_RE.fullmatch(target_sha): if not SHA_RE.fullmatch(target_sha):
raise ValueError(f"target SHA must be 40 lowercase hex characters: {target_sha!r}") raise ValueError(f"target SHA must be 40 lowercase hex characters: {target_sha!r}")
try: try:
rules = PROFILES[profile] release_decision, accepted_states, optional = PROFILES[profile]
except KeyError: except KeyError:
raise ValueError(f"unknown profile {profile!r}; expected {sorted(PROFILES)}") from None raise ValueError(f"unknown profile {profile!r}; expected {sorted(PROFILES)}") from None
approval = rc_shared_performance_approval.strip()
if approval and profile != "rc":
raise ValueError("shared-node approval is supported only by the rc profile")
if approval:
accepted_states = {**accepted_states, "performance": {"PASS", "WARN"}}
parsed = {} parsed = {}
for spec in gates: for spec in gates:
name, gate = parse_gate(spec) name, gate = parse_gate(spec)
@@ -120,11 +126,11 @@ def build_manifest(target_sha: str, gates: list[str], profile: str = "stable") -
parsed[name] = gate parsed[name] = gate
reasons = [] reasons = []
for name in rules["required"] + rules["optional"]: for name in GATES:
gate = parsed.get(name) gate = parsed.get(name)
if gate is None: if gate is None:
parsed[name] = {"state": "UNVERIFIED", "tested_sha": "", "run_url": ""} parsed[name] = {"state": "UNVERIFIED", "tested_sha": "", "run_url": ""}
if name in rules["required"]: if name not in optional:
reasons.append(f"{name}: missing gate") reasons.append(f"{name}: missing gate")
continue continue
if gate["tested_sha"] != target_sha: if gate["tested_sha"] != target_sha:
@@ -132,26 +138,18 @@ def build_manifest(target_sha: str, gates: list[str], profile: str = "stable") -
f"{name}: tested_sha {gate['tested_sha'] or '(missing)'} != target_sha {target_sha}" f"{name}: tested_sha {gate['tested_sha'] or '(missing)'} != target_sha {target_sha}"
) )
continue continue
if gate["state"] == "FAIL": allowed = accepted_states.get(name, {"PASS"})
reasons.append(f"{name}: FAIL") if gate["state"] not in allowed:
elif gate["state"] == "UNVERIFIED": reasons.append(
reasons.append(f"{name}: UNVERIFIED") f"{name}: {gate['state']} is not accepted; expected {' or '.join(sorted(allowed))}"
elif gate["state"] == "UNSUPPORTED": )
allowed = False elif not gate["run_url"].strip():
if name in {"windows", "macos"}: reasons.append(f"{name}: missing evidence reference")
allowed = rules["windows_macos_unsupported_allowed"]
elif name == "strict_vm":
allowed = rules["strict_unsupported_allowed"]
if not allowed:
reasons.append(f"{name}: UNSUPPORTED is not allowed in the {profile} profile")
elif name == "performance":
if gate["state"] not in {"PASS", "WARN"}:
reasons.append(f"{name}: {gate['state']} is not PASS/WARN")
elif gate["state"] != "PASS":
reasons.append(f"{name}: {gate['state']} is not PASS")
decision = rules["decision"] if not reasons else "DO_NOT_RELEASE" decision = release_decision if not reasons else "DO_NOT_RELEASE"
recorded = utc_now() recorded = utc_now()
if approval and parsed["performance"]["state"] == "WARN":
parsed["performance"]["rc_shared_node_approval"] = approval
return { return {
"schema": SCHEMA, "schema": SCHEMA,
"profile": profile, "profile": profile,
@@ -175,9 +173,21 @@ def main(argv: list[str]) -> int:
parser.add_argument("--profile", choices=sorted(PROFILES), default="stable") parser.add_argument("--profile", choices=sorted(PROFILES), default="stable")
parser.add_argument("--gate", action="append", default=[]) parser.add_argument("--gate", action="append", default=[])
parser.add_argument("--out", default="") parser.add_argument("--out", default="")
parser.add_argument(
"--rc-shared-performance-approval",
default="",
help="maintainer approval reference for the measured shared-node RC performance WARN",
)
parser.add_argument(
"--require-release",
action="store_true",
help="exit 1 when the recorded decision blocks publication",
)
args = parser.parse_args(argv) args = parser.parse_args(argv)
try: try:
manifest = build_manifest(args.target_sha, args.gate, args.profile) manifest = build_manifest(
args.target_sha, args.gate, args.profile, args.rc_shared_performance_approval
)
except ValueError as error: except ValueError as error:
print(f"error: {error}", file=sys.stderr) print(f"error: {error}", file=sys.stderr)
return 2 return 2
@@ -187,7 +197,7 @@ def main(argv: list[str]) -> int:
out.parent.mkdir(parents=True, exist_ok=True) out.parent.mkdir(parents=True, exist_ok=True)
out.write_text(text) out.write_text(text)
sys.stdout.write(text) sys.stdout.write(text)
return 0 return int(args.require_release and manifest["release_decision"] == "DO_NOT_RELEASE")
if __name__ == "__main__": if __name__ == "__main__":
+86 -52
View File
@@ -1,5 +1,8 @@
import importlib.util import importlib.util
import io
import json
import unittest import unittest
from contextlib import redirect_stdout
from pathlib import Path from pathlib import Path
MODULE = Path(__file__).with_name("release_evidence.py") MODULE = Path(__file__).with_name("release_evidence.py")
@@ -18,70 +21,101 @@ def gate(name: str, state: str, sha: str = SHA, url: str = "https://example.test
class ReleaseEvidenceTests(unittest.TestCase): class ReleaseEvidenceTests(unittest.TestCase):
def test_all_required_pass_is_candidate(self) -> None: def test_all_required_pass_is_candidate(self) -> None:
manifest = release_evidence.build_manifest( manifest = release_evidence.build_manifest(
SHA, SHA, [gate(name, "PASS") for name in release_evidence.GATES]
[
gate("linux", "PASS"),
gate("windows", "PASS"),
gate("macos", "PASS"),
gate("strict_vm", "PASS"),
gate("performance", "WARN"),
],
) )
self.assertEqual(manifest["release_decision"], "RELEASE_CANDIDATE") self.assertEqual(manifest["release_decision"], "RELEASE_CANDIDATE")
self.assertEqual(manifest["reasons"], []) self.assertEqual(manifest["reasons"], [])
def test_missing_strict_vm_is_not_release(self) -> None: def test_complete_linux_rc_is_candidate(self) -> None:
manifest = release_evidence.build_manifest( manifest = release_evidence.build_manifest(SHA, self.rc_gates(), profile="rc")
SHA, self.assertEqual(manifest["release_decision"], "RC_RELEASE_CANDIDATE")
[ self.assertEqual(manifest["reasons"], [])
gate("linux", "PASS"),
gate("windows", "PASS"),
gate("macos", "PASS"),
gate("performance", "PASS"),
],
)
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
self.assertTrue(any("strict_vm" in reason for reason in manifest["reasons"]))
def test_sha_mismatch_is_not_release(self) -> None: @staticmethod
manifest = release_evidence.build_manifest( def rc_gates() -> list[str]:
SHA, return [
[ gate(name, "UNSUPPORTED" if name in {"windows", "macos"} else "PASS")
gate("linux", "PASS"), for name in release_evidence.GATES
gate("windows", "PASS", OTHER), ]
gate("macos", "PASS"),
gate("strict_vm", "PASS"),
gate("performance", "PASS"),
],
)
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
self.assertTrue(any("windows" in reason for reason in manifest["reasons"]))
def test_failure_is_not_release(self) -> None: def test_rc_requires_same_sha_evidence_for_every_gate(self) -> None:
for original in self.rc_gates():
name, details = original.split("=", 1)
state = details.split(":", 1)[0]
for replacement, reason in [
([], "missing gate"),
([gate(name, state, OTHER)], "!= target_sha"),
([gate(name, state, url="")], "missing evidence reference"),
([gate(name, "FAIL")], "FAIL"),
([gate(name, "UNVERIFIED")], "UNVERIFIED"),
]:
with self.subTest(gate=name, reason=reason):
inputs = [spec for spec in self.rc_gates() if spec != original]
manifest = release_evidence.build_manifest( manifest = release_evidence.build_manifest(
SHA, SHA, inputs + replacement, profile="rc"
[
gate("linux", "FAIL"),
gate("windows", "PASS"),
gate("macos", "PASS"),
gate("strict_vm", "PASS"),
gate("performance", "PASS"),
],
) )
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE") self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
self.assertEqual(len(manifest["reasons"]), 1)
self.assertIn(reason, manifest["reasons"][0])
def test_unverified_performance_is_not_release(self) -> None: def test_rc_rejects_beta_exceptions_and_platform_scope_changes(self) -> None:
for name, state in [
("strict_vm", "UNSUPPORTED"),
("performance", "WARN"),
("windows", "PASS"),
("macos", "PASS"),
]:
with self.subTest(gate=name, state=state):
inputs = [spec for spec in self.rc_gates() if not spec.startswith(f"{name}=")]
manifest = release_evidence.build_manifest( manifest = release_evidence.build_manifest(
SHA, SHA, inputs + [gate(name, state)], profile="rc"
[
gate("linux", "PASS"),
gate("windows", "PASS"),
gate("macos", "PASS"),
gate("strict_vm", "PASS"),
gate("performance", "UNVERIFIED"),
],
) )
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE") self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
self.assertTrue(manifest["reasons"][0].startswith(f"{name}:"))
def test_rc_shared_performance_requires_explicit_approval_and_evidence(self) -> None:
approval = "release notes: maintainer approved the shared node for this RC"
inputs = [spec for spec in self.rc_gates() if not spec.startswith("performance=")]
inputs.append(gate("performance", "WARN"))
manifest = release_evidence.build_manifest(SHA, inputs, "rc", approval)
self.assertEqual(manifest["release_decision"], "RC_RELEASE_CANDIDATE")
self.assertEqual(manifest["gates"]["performance"]["rc_shared_node_approval"], approval)
manifest = release_evidence.build_manifest(
SHA, inputs[:-1] + [gate("performance", "WARN", OTHER)], "rc", approval
)
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
manifest = release_evidence.build_manifest(
SHA, inputs[:-1] + [gate("performance", "WARN", url="")], "rc", approval
)
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
manifest = release_evidence.build_manifest(
SHA, inputs[:-1] + [gate("performance", "FAIL")], "rc", approval
)
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
with self.assertRaises(ValueError):
release_evidence.build_manifest(SHA, inputs, "stable", approval)
def test_stable_requires_extension_install_version_and_performance(self) -> None:
names = ("extension", "clean_install", "version_compat", "performance")
for name in names:
with self.subTest(gate=name):
inputs = [gate(key, "PASS") for key in release_evidence.GATES if key != name]
manifest = release_evidence.build_manifest(SHA, inputs)
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
self.assertEqual(manifest["reasons"], [f"{name}: missing gate"])
inputs = [gate(key, "WARN" if key == "performance" else "PASS") for key in release_evidence.GATES]
manifest = release_evidence.build_manifest(SHA, inputs)
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
self.assertIn("performance: WARN", manifest["reasons"][0])
def test_require_release_returns_failure_and_preserves_manifest(self) -> None:
output = io.StringIO()
with redirect_stdout(output):
status = release_evidence.main(
["--target-sha", SHA, "--profile", "rc", "--require-release"]
)
self.assertEqual(status, 1)
self.assertEqual(json.loads(output.getvalue())["release_decision"], "DO_NOT_RELEASE")
def test_beta_profile_accepts_declared_linux_scope_with_warn_performance(self) -> None: def test_beta_profile_accepts_declared_linux_scope_with_warn_performance(self) -> None:
manifest = release_evidence.build_manifest( manifest = release_evidence.build_manifest(
@@ -119,7 +153,7 @@ class ReleaseEvidenceTests(unittest.TestCase):
) )
self.assertEqual(manifest["release_decision"], "BETA_RELEASE_CANDIDATE") self.assertEqual(manifest["release_decision"], "BETA_RELEASE_CANDIDATE")
def test_beta_profile_requires_explicit_platform_and_extension_gates(self) -> None: def test_beta_profile_requires_extension_but_retains_optional_platforms(self) -> None:
manifest = release_evidence.build_manifest( manifest = release_evidence.build_manifest(
SHA, SHA,
[ [
+20 -6
View File
@@ -10,12 +10,15 @@ workload whose wire output did not match the committed expected digest.
`Cargo.lock` digest, `rustc -vV`, source SHA and profile. `Cargo.lock` digest, `rustc -vV`, source SHA and profile.
* Correctness comes first: every warmup run is parsed and hashed. A mismatch * Correctness comes first: every warmup run is parsed and hashed. A mismatch
is `CORRECTNESS_FAIL`; its faster wall time is never reported. is `CORRECTNESS_FAIL`; its faster wall time is never reported.
* Release evidence needs at least 5 warmups and 20 samples per workload with * Approved-node release evidence needs at least 5 warmups and 20 samples per
`--approved-node` on a dedicated, stable performance node. Shorter runs are workload on a dedicated, stable node. A maintainer-approved shared-node
`SMOKE` and must not be cited as a release gate. RC comparison needs the same sample counts in at least three paired runs.
* Do not compare timings across different `platform_id`s, CPU models, kernels, Shared-node reports stay `SMOKE` and are eligible only for the RC
toolchains or load conditions. `--baseline` refuses a different `WARN` exception described in [releasing.md](../../docs/releasing.md).
`platform_id`/profile. * `--baseline` checks platform ID, build profile, CPU model, kernel,
governor, CPU affinity and toolchain. For an approved-node comparison
it also requires an approved, correctness-verified MEASURED baseline.
Record competing load and investigate differences before sign-off.
* Avoid TCG/QEMU for final performance numbers; use native or KVM with fixed * Avoid TCG/QEMU for final performance numbers; use native or KVM with fixed
CPU affinity (`--cpu-list`) and an administrator-approved governor. CPU affinity (`--cpu-list`) and an administrator-approved governor.
* The suggested investigation thresholds are p50 +15% and peak RSS +20%; they * The suggested investigation thresholds are p50 +15% and peak RSS +20%; they
@@ -43,3 +46,14 @@ source. Running `--record-expected` rewrites them: inspect the diff and commit
it only when the output change is the intended one. it only when the output change is the intended one.
`bench.py` remains only as a compatibility shim. `bench.py` remains only as a compatibility shim.
## RC comparison
On the designated node, run the beta benchmark from a checkout
pinned to `v3.0.0-beta.1` and the candidate benchmark from the frozen
candidate checkout. Use the same toolchain, CPU list and platform ID in both
commands. Pass the extracted, verified candidate CLI via `--no-build --binary`
and add `--baseline /path/to/beta.json` to the candidate command. Keep both
reports and confirm all nine comparisons are present and correctness-verified.
The shared Woodpecker manual workflow can reproduce the comparison and
produces SMOKE reports.
+14 -1
View File
@@ -339,6 +339,18 @@ def compare_baseline(report: dict, baseline: dict) -> list[dict]:
) )
if baseline.get("binary", {}).get("profile") != report.get("binary", {}).get("profile"): if baseline.get("binary", {}).get("profile") != report.get("binary", {}).get("profile"):
raise SystemExit("baseline profile differs") raise SystemExit("baseline profile differs")
for field in ("kernel", "machine", "cpu_model", "governor", "cpu_list"):
if baseline["environment"].get(field) != report["environment"].get(field):
raise SystemExit(f"baseline environment.{field} differs")
for field in ("rustc", "cargo"):
if baseline["binary"].get(field) != report["binary"].get(field):
raise SystemExit(f"baseline binary.{field} differs")
if report["environment_approved"] and (
not baseline.get("environment_approved")
or baseline.get("status") != "MEASURED"
or baseline.get("correctness") != "VERIFIED"
):
raise SystemExit("approved-node comparison requires an approved, verified MEASURED baseline")
previous = {item["name"]: item for item in baseline.get("workloads", [])} previous = {item["name"]: item for item in baseline.get("workloads", [])}
comparisons = [] comparisons = []
for current in report["workloads"]: for current in report["workloads"]:
@@ -415,6 +427,7 @@ def main(argv: list[str]) -> int:
order_seed = hashlib.sha256(source_sha.encode()).hexdigest()[:16] order_seed = hashlib.sha256(source_sha.encode()).hexdigest()[:16]
order = list(workloads) order = list(workloads)
random.Random(order_seed).shuffle(order) random.Random(order_seed).shuffle(order)
start_load = loadavg()
results = [] results = []
for workload in order: for workload in order:
result = run_workload( result = run_workload(
@@ -461,7 +474,7 @@ def main(argv: list[str]) -> int:
"machine": platform.machine(), "machine": platform.machine(),
"cpu_model": cpu_model(), "cpu_model": cpu_model(),
"governor": governor(), "governor": governor(),
"loadavg_start": loadavg(), "loadavg_start": start_load,
"cpu_list": args.cpu_list or "unbound", "cpu_list": args.cpu_list or "unbound",
"python": platform.python_version(), "python": platform.python_version(),
}, },
+50
View File
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
# Exercise only the shipped Linux archive on the supported glibc baseline.
set -euo pipefail
if [[ $# != 2 || ! $2 =~ ^[a-f0-9]{40}$ ]]; then
echo "usage: $0 <archive.tar.gz> <source-sha>" >&2
exit 2
fi
archive="$(realpath "$1")"
source_sha="$2"
name="$(basename "$archive")"
if [[ ! $name =~ ^marqdo-(.+)-x86_64-unknown-linux-gnu\.tar\.gz$ ]]; then
echo "unexpected archive name: $name" >&2
exit 2
fi
version="${BASH_REMATCH[1]}"
(
cd "$(dirname "$archive")"
sha256sum --check --status "$name.sha256"
)
docker run --rm --network none --user 65534:65534 \
--mount "type=bind,source=$archive,target=/archive.tar.gz,readonly" \
ubuntu:24.04 sh -eu -c '
test "$(getconf GNU_LIBC_VERSION)" = "glibc 2.39"
if command -v cargo; then
echo "unexpected Cargo binary in the runtime container" >&2
exit 1
fi
mkdir /tmp/marqdo
tar -xzf /archive.tar.gz -C /tmp/marqdo
cd "/tmp/marqdo/marqdo-$1-x86_64-unknown-linux-gnu"
test "$(cat SOURCE_SHA)" = "$2"
test "$(./marqdo --version)" = "marqdo $1"
./marqdo --help >/dev/null
test -x ./marqdo-provider-worker
./marqdo run examples/hello.mq.md | grep -F "你好,Marqdo"
./marqdo check examples/multi-module/index.mq.md --emit /tmp/analysis.json
./marqdo call examples/math-library-demo.mq.md main
test "$(./marqdo call examples/factorial.mq.md 阶乘 --arg n=5)" = 120
./marqdo run tests/consumers/fixtures/execution-events/basic.mq.md \
--event-stream jsonl >/tmp/events.jsonl
tail -n 1 /tmp/events.jsonl | grep -Eq "\"kind\"[[:space:]]*:[[:space:]]*\"run.completed\""
mv stdlib stdlib.hidden
if ./marqdo run examples/hello.mq.md >/tmp/missing-stdlib.log 2>&1; then
echo "run succeeded without the shipped stdlib" >&2
exit 1
fi
grep -E "stdlib|symbol\.unknown|打印" /tmp/missing-stdlib.log
' sh "$version" "$source_sha"
+2 -1
View File
@@ -16,7 +16,7 @@ Usage (from the repository root, after
python3 tools/release/package.py \ python3 tools/release/package.py \
--source-sha "$(git rev-parse HEAD)" \ --source-sha "$(git rev-parse HEAD)" \
--version 3.0.0-beta.1 --version 3.0.0-rc.1
""" """
from __future__ import annotations from __future__ import annotations
@@ -266,6 +266,7 @@ def stage(stage_dir: Path, version: str, source_sha: str, target: str) -> dict:
"protocols": { "protocols": {
"analysis": 2, "analysis": 2,
"trace": 2, "trace": 2,
"execution_events": 1,
"tool": 1, "tool": 1,
"plugin_abi": "1.x", "plugin_abi": "1.x",
"foreign_wire": 1, "foreign_wire": 1,
+5 -1
View File
@@ -9,7 +9,7 @@ Provider v2 worker (positive, unauthorized and missing-helper fail-closed), and
strict mode when the host genuinely supports it. strict mode when the host genuinely supports it.
Usage: Usage:
python3 tools/release/smoke.py --archive dist/marqdo-3.0.0-beta.1-x86_64-unknown-linux-gnu.tar.gz python3 tools/release/smoke.py --archive dist/marqdo-3.0.0-rc.1-x86_64-unknown-linux-gnu.tar.gz
""" """
from __future__ import annotations from __future__ import annotations
@@ -302,6 +302,10 @@ def main(argv: list[str]) -> int:
] ]
if not events or events[0].get("kind") != "stream.opened": if not events or events[0].get("kind") != "stream.opened":
fail("Execution Events stream does not start with stream.opened") fail("Execution Events stream does not start with stream.opened")
if events[0].get("payload", {}).get("producer", {}).get("version") != version:
fail("Execution Events producer.version does not match the product version")
if events[0].get("schema_version") != info["protocols"].get("execution_events"):
fail("Execution Events schema_version does not match RELEASE_INFO.json")
if events[-1].get("kind") != "run.completed": if events[-1].get("kind") != "run.completed":
fail("Execution Events stream has no successful terminal event") fail("Execution Events stream has no successful terminal event")
validate_events = subprocess.run( validate_events = subprocess.run(