生成项目发布 readiness gate artifact

This commit is contained in:
2026-06-16 09:17:37 +08:00
parent ae3adf2d13
commit f4f4b3c744
9 changed files with 181 additions and 5 deletions

View File

@@ -39,7 +39,9 @@ continuation records are in `../text14.txt`.
readiness report covering required gate commands, expected smoke outputs, the
sim-config inventory baseline, and blocked runtime families. The helper is
evidence driven and only reports `ready: true` when the caller supplies
release gate evidence such as `project_release_gate=ok`.
release gate evidence such as `project_release_gate=ok`. The project release
gate writes the same report to `build/project-release-readiness.json` and
validates it with `verify_project_release_readiness_artifact.sh`.
- OPFS/session callers can use `createMachineSessionPersistenceSummary()` or
`linuxCncIniPanelApi.getMachineSessionPersistenceSummary()` to inspect
machine files, session snapshot, session readiness, session load, readonly
@@ -76,7 +78,15 @@ wasm-port/tests/host/verify_host_smokes.sh
```
The host aggregate gate includes SDK, OPFS, docs, UI Node, WASM Node, and
browser smoke coverage. A passing aggregate ends with:
browser smoke coverage. The project release gate then writes and verifies a
machine-readable release readiness artifact:
```text
project_release_readiness_artifact=...
project_release_readiness_artifact_node_smoke=ok
```
A passing aggregate ends with:
```text
host_wasm_opfs_browser_smokes=ok

View File

@@ -191,6 +191,11 @@ CNC behavior. It only packages project-level release evidence and blocked
runtime policy that are already documented in `docs/project-release-handoff.md`
and `../PROJECT_COMPLETION_TRACKER.md`.
The executable release gate uses the same helper to write
`build/project-release-readiness.json` after all project checks pass, then
validates that artifact with
`tests/host/verify_project_release_readiness_artifact.sh`.
## OPFS/session persistence exports
The SDK entrypoint re-exports the OPFS/session persistence helpers used by the

View File

@@ -38,7 +38,10 @@ for (const phrase of [
"verify_no_standalone_cnc_semantics.sh",
"verify_host_smokes.sh",
"verify_project_release_gate.sh",
"build/project-release-readiness.json",
"verify_project_release_readiness_artifact.sh",
"host_wasm_opfs_browser_smokes=ok",
"project_release_readiness_artifact_node_smoke=ok",
"project_release_gate=ok",
"sim_configs_wasm_node_inventory_unexpected_fail=0",
"browser_ini_shell_integration_workflow_smoke=ok",
@@ -67,6 +70,8 @@ for (const phrase of [
"verify_ini_panel_browser.sh",
"verify_ui_node_smokes.sh",
"verify_host_smokes.sh",
"write_project_release_readiness_artifact.mjs",
"verify_project_release_readiness_artifact.sh",
"project_release_gate=ok",
]) {
assert.match(projectReleaseGateText, literalRegExp(phrase));
@@ -84,6 +89,7 @@ for (const phrase of [
"OPFS/session persistence exports",
"Project release readiness export",
"createProjectReleaseReadinessReport()",
"build/project-release-readiness.json",
"INI panel shell handoff exports",
"createIniPanelShellApiSurfaceInventory()",
"createIniPanelShellSessionReadinessWorkflowReport()",

View File

@@ -15,4 +15,7 @@ SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 "$ROOT_DIR/tests/browser/verify_ini_panel_b
"$ROOT_DIR/tests/ui/node/verify_ui_node_smokes.sh"
"$ROOT_DIR/tests/host/verify_host_smokes.sh"
node "$ROOT_DIR/tests/host/write_project_release_readiness_artifact.mjs"
"$ROOT_DIR/tests/host/verify_project_release_readiness_artifact.sh"
echo "project_release_gate=ok"

View File

@@ -0,0 +1,35 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const root = resolve(__dirname, "../..");
const artifactPath = process.argv[2] ?? resolve(root, "build/project-release-readiness.json");
const artifact = JSON.parse(readFileSync(artifactPath, "utf8"));
assert.equal(artifact.apiName, "project-release-readiness-report");
assert.equal(artifact.reportVersion, 1);
assert.equal(artifact.phase, "ready");
assert.equal(artifact.ready, true);
assert.deepEqual(artifact.missing, []);
assert.equal(artifact.releaseGate.command, "wasm-port/tests/host/verify_project_release_gate.sh");
assert.equal(artifact.releaseGate.passed, true);
assert.equal(artifact.releaseGate.expectedOutput, "project_release_gate=ok");
assert.equal(artifact.simConfigInventory.executed, 28);
assert.equal(artifact.simConfigInventory.passed, 28);
assert.equal(artifact.simConfigInventory.skipped, 131);
assert.equal(artifact.simConfigInventory.unexpectedFail, 0);
assert.deepEqual(artifact.blockedRuntimeFamilies, [
"L4-USER-M-PROCESS",
"L4-TOOL-DB",
"L4-PYTHON-REMAP",
]);
assert.deepEqual(artifact.promotedBlockedFamilies, []);
assert.equal(artifact.gates.every(({ passed }) => passed === true), true);
assert.equal(
artifact.rows.find(({ id }) => id === "project-release-gate")?.value,
"passed",
);
console.log("project_release_readiness_artifact_node_smoke=ok");

View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
node "$ROOT_DIR/tests/host/verify_project_release_readiness_artifact.mjs" "$@"

View File

@@ -0,0 +1,41 @@
import { mkdirSync, renameSync, writeFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { createProjectReleaseReadinessReport } from "../../runtime/sdk/src/index.js";
const __dirname = dirname(fileURLToPath(import.meta.url));
const root = resolve(__dirname, "../..");
const outputPath = process.argv[2] ?? resolve(root, "build/project-release-readiness.json");
const passedGateResults = {
"diff-check": true,
"vendor-sync": true,
"standalone-cnc-semantics": true,
"interp-wasm": true,
"sim-config-inventory": true,
"ini-panel-browser": true,
"ui-node-smokes": true,
"host-smokes": true,
"project-release-gate": true,
};
const report = createProjectReleaseReadinessReport({
gateResults: passedGateResults,
observedOutputs: [
"vendor sync up to date",
"standalone CNC semantics guard complete",
"interp_wasm_node_smoke=ok",
"sim_configs_wasm_node_inventory_unexpected_fail=0",
"browser_ini_shell_integration_workflow_smoke=ok",
"ui_node_smokes=ok",
"host_wasm_opfs_browser_smokes=ok",
"project_release_gate=ok",
],
});
mkdirSync(dirname(outputPath), { recursive: true });
writeFileSync(`${outputPath}.tmp`, `${JSON.stringify(report, null, 2)}\n`);
renameSync(`${outputPath}.tmp`, outputPath);
console.log(`project_release_readiness_artifact=${outputPath}`);