release(3.0.0-beta.1): product version migration, beta gates, archive tooling and developer docs
ci/woodpecker/push/main Pipeline was successful
ci/woodpecker/manual/performance Pipeline was successful
Linux strict security lane (G-C) / strict isolation escape matrix (push) Canceled after 0s
CI / fmt + clippy + test (Linux x86_64) (push) Canceled after 0s
CI / schema instance validation + consumers (push) Canceled after 0s
CI / runtime contract (macos-latest) (push) Canceled after 0s
CI / runtime contract (windows-latest) (push) Canceled after 0s
CI / release evidence manifest (push) Canceled after 0s
CI / release candidate artifact (macos-latest) (push) Canceled after 0s
CI / release candidate artifact (ubuntu-latest) (push) Canceled after 0s

REL-01: workspace/CLI/Analysis product version 3.0.0-beta.1 with updated
Cargo.lock; project.marqdo is enforced against the running core with
package.marqdo_range_invalid/package.marqdo_incompatible fail-closed
diagnostics; Tool SemVer prerelease negotiation tests; init template and
examples use the beta range. Verify init derives the project name from the
target directory instead of falling back to 'example'.

REL-02: beta support matrix is Linux x86_64 only; macOS/Windows are explicitly
experimental/unclaimed; strict policy and G4 Beta-only WARN are documented for
the release evidence.

REL-03: deterministic release packaging (tools/release/package.py) ships the
CLI and provider worker together with SOURCE_SHA, RELEASE_INFO.json,
known-limitations, specs, developer docs, examples incl. built plugin/provider
artifacts and consumers; tools/release/smoke.py cold-install tests the archive.

REL-04: docs/developers entry pages; corrected and self-contained third-party
integration handbook; stale Proposed/native-only/informational spec claims
fixed; release/status/compatibility/changelog/releasing docs updated.

REL-05: release_evidence.py gains an explicit beta profile
(BETA_RELEASE_CANDIDATE) distinct from the stable profile; Woodpecker build
step now packages and smoke-tests the archive on every pipeline.

Adds a runnable Resource Provider v2 example and corrects check --emit to
Analysis v2.
This commit is contained in:
cflmy committed 2026-11-22 02:31:32 +08:00
1 parent 56189b176c
commit 2c7c4f31e7
55 files changed
+3136 -453

No files matched your search

+84 -18
View File
@@ -1,13 +1,35 @@
#!/usr/bin/env python3
"""Aggregate per-gate CI evidence into a SHA-bound release manifest.
Schema: marqdo.release-gates.v1. A missing, skipped, timed-out, failed or
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
does not query CI and cannot turn an UNVERIFIED gate into a release.
Two profiles exist and both are explicit in the output:
* `stable` — every required platform gate must PASS on the target SHA.
* `beta` — the supported platform set is the one declared in
`COMPATIBILITY.md` (Linux x86_64 for `3.0.0-beta.1`). `windows`/`macos` must
be explicitly `UNSUPPORTED` (not silently omitted). `strict_vm` may be PASS
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).
Required gates: linux, windows, macos, strict_vm; performance must be PASS or
WARN. Any other gate name is rejected so a typo cannot silently disappear.
Usage:
python3 tools/ci/release_evidence.py --target-sha "$SHA" --profile beta \
--gate linux=PASS:$SHA:https://ci.cflmy.cn/... \
--gate strict_vm=PASS:$SHA:docs/evidence/... \
--gate extension=PASS:$SHA:docs/evidence/extension/$SHA/manifest.json \
--gate clean_install=PASS:$SHA:docs/evidence/... \
--gate version_compat=PASS:$SHA:cargo-test \
--gate windows=UNSUPPORTED:$SHA:supported-platforms-exclude \
--gate macos=UNSUPPORTED:$SHA:supported-platforms-exclude \
--gate performance=WARN:$SHA:docs/evidence/... \
--out/docs/evidence/ci/$SHA/manifest.json
"""
import argparse
@@ -18,13 +40,40 @@ import sys
from pathlib import Path
SCHEMA = "marqdo.release-gates.v1"
REQUIRED = ("linux", "windows", "macos", "strict_vm")
OPTIONAL = ("performance",)
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 = (
"linux",
"windows",
"macos",
"strict_vm",
"extension",
"clean_install",
"version_compat",
"performance",
)
STATES = {
"linux": {"PASS", "FAIL", "UNVERIFIED"},
"windows": {"PASS", "FAIL", "UNVERIFIED"},
"macos": {"PASS", "FAIL", "UNVERIFIED"},
"strict_vm": {"PASS", "FAIL", "UNVERIFIED"},
"windows": {"PASS", "FAIL", "UNVERIFIED", "UNSUPPORTED"},
"macos": {"PASS", "FAIL", "UNVERIFIED", "UNSUPPORTED"},
"strict_vm": {"PASS", "FAIL", "UNVERIFIED", "UNSUPPORTED"},
"extension": {"PASS", "FAIL", "UNVERIFIED"},
"clean_install": {"PASS", "FAIL", "UNVERIFIED"},
"version_compat": {"PASS", "FAIL", "UNVERIFIED"},
"performance": {"PASS", "WARN", "FAIL", "UNVERIFIED"},
}
SHA_RE = re.compile(r"^[0-9a-f]{40}$")
@@ -48,7 +97,7 @@ def parse_gate(text: str) -> tuple[str, dict]:
raise ValueError(f"gate must be name=STATE:sha:url, got {text!r}")
state, tested_sha, run_url = parts
if name not in STATES:
raise ValueError(f"unknown gate {name!r}; expected {list(STATES)}")
raise ValueError(f"unknown gate {name!r}; expected {list(GATES)}")
if state not in STATES[name]:
raise ValueError(f"invalid state {state!r} for gate {name!r}")
if tested_sha and not SHA_RE.fullmatch(tested_sha):
@@ -56,9 +105,13 @@ def parse_gate(text: str) -> tuple[str, dict]:
return name, {"state": state, "tested_sha": tested_sha, "run_url": run_url}
def build_manifest(target_sha: str, gates: list[str]) -> dict:
def build_manifest(target_sha: str, gates: list[str], profile: str = "stable") -> dict:
if not SHA_RE.fullmatch(target_sha):
raise ValueError(f"target SHA must be 40 lowercase hex characters: {target_sha!r}")
try:
rules = PROFILES[profile]
except KeyError:
raise ValueError(f"unknown profile {profile!r}; expected {sorted(PROFILES)}") from None
parsed = {}
for spec in gates:
name, gate = parse_gate(spec)
@@ -67,29 +120,41 @@ def build_manifest(target_sha: str, gates: list[str]) -> dict:
parsed[name] = gate
reasons = []
for name in REQUIRED + OPTIONAL:
for name in rules["required"] + rules["optional"]:
gate = parsed.get(name)
if gate is None:
parsed[name] = {"state": "UNVERIFIED", "tested_sha": "", "run_url": ""}
reasons.append(f"{name}: missing gate")
if name in rules["required"]:
reasons.append(f"{name}: missing gate")
continue
if gate["tested_sha"] != target_sha:
reasons.append(
f"{name}: tested_sha {gate['tested_sha'] or '(missing)'} != target_sha {target_sha}"
)
elif gate["state"] == "FAIL":
continue
if gate["state"] == "FAIL":
reasons.append(f"{name}: FAIL")
elif gate["state"] == "UNVERIFIED":
reasons.append(f"{name}: UNVERIFIED")
elif name in REQUIRED and gate["state"] != "PASS":
elif gate["state"] == "UNSUPPORTED":
allowed = False
if name in {"windows", "macos"}:
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")
elif name == "performance" and gate["state"] not in {"PASS", "WARN"}:
reasons.append(f"performance: {gate['state']} is not PASS/WARN")
decision = "RELEASE_CANDIDATE" if not reasons else "DO_NOT_RELEASE"
decision = rules["decision"] if not reasons else "DO_NOT_RELEASE"
recorded = utc_now()
return {
"schema": SCHEMA,
"profile": profile,
"target_sha": target_sha,
"recorded_utc": recorded,
"gates": {
@@ -107,11 +172,12 @@ def build_manifest(target_sha: str, gates: list[str]) -> dict:
def main(argv: list[str]) -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--target-sha", required=True)
parser.add_argument("--profile", choices=sorted(PROFILES), default="stable")
parser.add_argument("--gate", action="append", default=[])
parser.add_argument("--out", default="")
args = parser.parse_args(argv)
try:
manifest = build_manifest(args.target_sha, args.gate)
manifest = build_manifest(args.target_sha, args.gate, args.profile)
except ValueError as error:
print(f"error: {error}", file=sys.stderr)
return 2
+90
View File
@@ -83,6 +83,96 @@ class ReleaseEvidenceTests(unittest.TestCase):
)
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
def test_beta_profile_accepts_declared_linux_scope_with_warn_performance(self) -> None:
manifest = release_evidence.build_manifest(
SHA,
[
gate("linux", "PASS"),
gate("strict_vm", "PASS"),
gate("extension", "PASS"),
gate("clean_install", "PASS"),
gate("version_compat", "PASS"),
gate("windows", "UNSUPPORTED", url="linux-only-support-matrix"),
gate("macos", "UNSUPPORTED", url="linux-only-support-matrix"),
gate("performance", "WARN"),
],
profile="beta",
)
self.assertEqual(manifest["release_decision"], "BETA_RELEASE_CANDIDATE")
self.assertEqual(manifest["profile"], "beta")
self.assertEqual(manifest["reasons"], [])
def test_beta_profile_allows_tested_fail_closed_strict_policy(self) -> None:
manifest = release_evidence.build_manifest(
SHA,
[
gate("linux", "PASS"),
gate("strict_vm", "UNSUPPORTED", url="strict.fail_closed_test"),
gate("extension", "PASS"),
gate("clean_install", "PASS"),
gate("version_compat", "PASS"),
gate("windows", "UNSUPPORTED"),
gate("macos", "UNSUPPORTED"),
gate("performance", "WARN"),
],
profile="beta",
)
self.assertEqual(manifest["release_decision"], "BETA_RELEASE_CANDIDATE")
def test_beta_profile_requires_explicit_platform_and_extension_gates(self) -> None:
manifest = release_evidence.build_manifest(
SHA,
[
gate("linux", "PASS"),
gate("strict_vm", "PASS"),
gate("clean_install", "PASS"),
gate("version_compat", "PASS"),
gate("performance", "WARN"),
],
profile="beta",
)
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
joined = " ".join(manifest["reasons"])
self.assertIn("extension: missing gate", joined)
self.assertNotIn("windows: missing gate", joined)
def test_beta_profile_rejects_wrong_sha_and_unverified_gates(self) -> None:
manifest = release_evidence.build_manifest(
SHA,
[
gate("linux", "PASS", OTHER),
gate("strict_vm", "PASS"),
gate("extension", "UNVERIFIED"),
gate("clean_install", "PASS"),
gate("version_compat", "PASS"),
gate("windows", "UNSUPPORTED"),
gate("macos", "UNSUPPORTED"),
gate("performance", "PASS"),
],
profile="beta",
)
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
joined = " ".join(manifest["reasons"])
self.assertIn("linux", joined)
self.assertIn("extension", joined)
def test_stable_profile_rejects_beta_unsupported_states(self) -> None:
manifest = release_evidence.build_manifest(
SHA,
[
gate("linux", "PASS"),
gate("windows", "UNSUPPORTED"),
gate("macos", "UNSUPPORTED"),
gate("strict_vm", "UNSUPPORTED"),
gate("performance", "WARN"),
],
)
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
def test_unknown_profile_is_rejected(self) -> None:
with self.assertRaises(ValueError):
release_evidence.build_manifest(SHA, [], profile="lts")
def test_unknown_gate_and_bad_sha_are_rejected(self) -> None:
with self.assertRaises(ValueError):
release_evidence.build_manifest(SHA, [gate("solaris", "PASS")])