Require complete same-SHA evidence for Linux RC and stable releases

This commit is contained in:
cflmy committed 2026-11-22 22:10:34 +08:00
1 parent 6e9b5af88d
commit e4c4a852d0
3 files changed
+138 -111

No files matched your search

+30 -5
View File
@@ -4,12 +4,16 @@ 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 and fixed-node performance PASS.
* **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 +68,24 @@ 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%.
Shared-host or unapproved measurements do not satisfy the RC gate.
- 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
@@ -172,8 +194,11 @@ 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, replace the profile with `--profile rc --require-release`,
stable` and additionally require Windows/macOS PASS and a strict PASS. declare both excluded platforms, and supply PASS for all six Linux and contract gates. 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 +214,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 fixed-node comparison, or the documented exception for beta;
* 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.
+39 -49
View File
@@ -5,16 +5,11 @@ 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 all require PASS in both profiles. The historical beta profile
`COMPATIBILITY.md` (Linux x86_64 for `3.0.0-beta.1`). `windows`/`macos` must retains its scoped exceptions, including a documented performance WARN.
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). Gate spec: `name=STATE:tested_sha:run_url` (url may contain colons).
@@ -29,7 +24,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 +35,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 +45,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"},
@@ -109,7 +104,7 @@ def build_manifest(target_sha: str, gates: list[str], profile: str = "stable") -
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
parsed = {} parsed = {}
@@ -120,11 +115,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,25 +127,15 @@ 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()
return { return {
"schema": SCHEMA, "schema": SCHEMA,
@@ -175,6 +160,11 @@ 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(
"--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)
@@ -187,7 +177,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__":
+69 -57
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,79 @@ 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:
manifest = release_evidence.build_manifest( for original in self.rc_gates():
SHA, name, details = original.split("=", 1)
[ state = details.split(":", 1)[0]
gate("linux", "FAIL"), for replacement, reason in [
gate("windows", "PASS"), ([], "missing gate"),
gate("macos", "PASS"), ([gate(name, state, OTHER)], "!= target_sha"),
gate("strict_vm", "PASS"), ([gate(name, state, url="")], "missing evidence reference"),
gate("performance", "PASS"), ([gate(name, "FAIL")], "FAIL"),
], ([gate(name, "UNVERIFIED")], "UNVERIFIED"),
) ]:
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE") with self.subTest(gate=name, reason=reason):
inputs = [spec for spec in self.rc_gates() if spec != original]
manifest = release_evidence.build_manifest(
SHA, inputs + replacement, profile="rc"
)
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:
manifest = release_evidence.build_manifest( for name, state in [
SHA, ("strict_vm", "UNSUPPORTED"),
[ ("performance", "WARN"),
gate("linux", "PASS"), ("windows", "PASS"),
gate("windows", "PASS"), ("macos", "PASS"),
gate("macos", "PASS"), ]:
gate("strict_vm", "PASS"), with self.subTest(gate=name, state=state):
gate("performance", "UNVERIFIED"), inputs = [spec for spec in self.rc_gates() if not spec.startswith(f"{name}=")]
], manifest = release_evidence.build_manifest(
) SHA, inputs + [gate(name, state)], profile="rc"
)
self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE")
self.assertTrue(manifest["reasons"][0].startswith(f"{name}:"))
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.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 +131,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,
[ [