A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
feat(ci): the 0.48 exit criteria, as something a machine holds together
esengine2b61e78fb00d
diff --git a/package.json b/package.jsonindex 7f59e32fa..c44113b9a 100644--- a/package.json+++ b/package.json@@ -17,13 +17,14 @@"emsdk:setup": "node build-tools/toolchain/setup-emsdk.js","asset-meta": "node tools/asset-meta.js","migrate-asset-refs": "node tools/migrate-asset-refs.js",- "verify": "pnpm --filter ./sdk exec tsc --noEmit && pnpm --filter @estella/editor exec tsc --noEmit && node tools/api-surface.mjs --check && node tools/check-cycles.mjs && node tools/check-layers.mjs && node tools/check-project-settings.mjs && node tools/check-workflows.mjs && node tools/check-tool-calls.mjs && node tools/check-inspector-door.mjs && node tools/check-dirty-source.mjs && node tools/check-path-sandbox.mjs && node tools/check-key-codes.mjs && node tools/check-comment-style.mjs && node tools/check-cpp-tests.mjs && node tools/check-release-metadata.mjs && node tools/check-golden.mjs && node tools/check-minigame-host.mjs && node tools/component-reference.mjs --check",+ "verify": "pnpm --filter ./sdk exec tsc --noEmit && pnpm --filter @estella/editor exec tsc --noEmit && node tools/api-surface.mjs --check && node tools/check-cycles.mjs && node tools/check-layers.mjs && node tools/check-project-settings.mjs && node tools/check-workflows.mjs && node tools/check-tool-calls.mjs && node tools/check-inspector-door.mjs && node tools/check-dirty-source.mjs && node tools/check-path-sandbox.mjs && node tools/check-key-codes.mjs && node tools/check-comment-style.mjs && node tools/check-cpp-tests.mjs && node tools/check-release-metadata.mjs && node tools/check-golden.mjs && node tools/check-minigame-host.mjs && node tools/check-release-gate.mjs && node tools/component-reference.mjs --check","perf": "node tools/perf-guard.mjs --check","scale": "node tools/perf-budget.mjs","stress-project": "node tools/stress-project.mjs","prepare": "git config core.hooksPath .githooks || true","soak": "pnpm --filter ./sdk exec vitest run tests/soak",- "torture": "pnpm --filter ./sdk exec vitest run tests/torture"+ "torture": "pnpm --filter ./sdk exec vitest run tests/torture",+ "gate": "node tools/check-release-gate.mjs --report"},"dependencies": {"chalk": "^5.3.0",diff --git a/tools/check-release-gate.mjs b/tools/check-release-gate.mjsnew file mode 100644index 000000000..b324aaa32--- /dev/null+++ b/tools/check-release-gate.mjs@@ -0,0 +1,66 @@+// SPDX-License-Identifier: Apache-2.0+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team+/**+ * @file check-release-gate — every exit criterion still has something answering it.+ *+ * The failure this exists for is quiet: a verifier gets renamed or dropped, the+ * criterion it settled stays on the list, and the release ships against a rule+ * nothing was checking. Holding the two together is the only way the list means+ * anything a month after it was written.+ *+ * node tools/check-release-gate.mjs # hold the list together+ * node tools/check-release-gate.mjs --report # print it, to run or to paste+ */+import { existsSync } from 'node:fs';+import path from 'node:path';+import { fileURLToPath } from 'node:url';+import { RELEASE, CRITERIA } from './releaseGate.mjs';++const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const problems = [];+const fail = (m) => problems.push(m);++const seen = new Set();+for (const c of CRITERIA) {+ if (!c.id) { fail('a criterion has no id'); continue; }+ if (seen.has(c.id)) fail(`"${c.id}" is listed twice`);+ seen.add(c.id);++ if (!c.says?.trim()) fail(`"${c.id}" does not say what it requires`);+ if (!c.answeredBy && !c.manual) {+ fail(`"${c.id}" has neither a command nor a named owner — it is a wish, not a criterion`);+ }+ if (c.answeredBy && c.manual) fail(`"${c.id}" is both automated and manual — pick one`);+ if (c.manual !== undefined && !(typeof c.manual === 'string' && c.manual.trim())) {+ fail(`"${c.id}" is manual without saying who does it and why a machine cannot`);+ }+ // The point of `needs`: a verifier that is deleted or renamed fails HERE,+ // loudly, rather than at whatever moment somebody trusts the list next.+ if (c.answeredBy && !c.needs?.length) fail(`"${c.id}" names a command but no file it lives in`);+ for (const rel of c.needs ?? []) {+ if (!existsSync(path.join(ROOT, rel))) fail(`"${c.id}" needs ${rel}, which is not there`);+ }+}++if (problems.length) {+ console.error(`check-release-gate: the ${RELEASE} exit criteria do not hold together.\n`);+ for (const p of problems) console.error(` ${p}`);+ process.exit(1);+}++if (process.argv.includes('--report')) {+ const auto = CRITERIA.filter((c) => c.answeredBy);+ const manual = CRITERIA.filter((c) => c.manual);+ console.log(`# ${RELEASE} exit criteria\n`);+ console.log(`## Run (${auto.length})\n`);+ for (const c of auto) console.log(`- [ ] **${c.id}** — ${c.says}\n \`${c.answeredBy}\``);+ console.log(`\n## By hand (${manual.length})\n`);+ for (const c of manual) console.log(`- [ ] **${c.id}** — ${c.says}\n ${c.manual}`);+ process.exit(0);+}++const auto = CRITERIA.filter((c) => c.answeredBy).length;+console.log(+ `check-release-gate: ${CRITERIA.length} ${RELEASE} criteria — ${auto} have a command,`+ + ` ${CRITERIA.length - auto} are owned by a person — ok`,+);diff --git a/tools/releaseGate.mjs b/tools/releaseGate.mjsnew file mode 100644index 000000000..e762c1266--- /dev/null+++ b/tools/releaseGate.mjs@@ -0,0 +1,112 @@+// SPDX-License-Identifier: Apache-2.0+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team+/**+ * @file releaseGate.mjs — what 0.48 has to be able to say, and what says it.+ *+ * "Do not open 0.49 until these hold" is only a rule if the list is somewhere a+ * machine reads. Written down anywhere else it decays the usual way: a criterion+ * loses the check that answered it and nobody notices, because nothing was ever+ * holding the two together.+ *+ * So each criterion names the command that settles it. A criterion no command+ * answers is allowed — as `manual`, with who does it and why a machine cannot —+ * and check-release-gate refuses the third case, a criterion with neither.+ *+ * This says the criteria are OWNED. Whether they PASS is what running them says.+ */++export const RELEASE = '0.48';++/**+ * `answeredBy` is a shell command run from the repo root; `needs` are the files+ * it lives in, so deleting a verifier fails the gate rather than the release.+ */+export const CRITERIA = [+ {+ id: 'golden-packages',+ says: 'every golden project packages and launches on every target it declares',+ answeredBy: 'node tools/verify-golden.mjs --tier release',+ needs: ['tools/verify-golden.mjs', 'tools/goldenProjects.mjs'],+ },+ {+ id: 'package-matches-editor',+ says: 'a packaged game shows what the editor showed',+ answeredBy: 'node tools/verify-golden.mjs --tier release',+ needs: ['tools/frameCompare.mjs'],+ },+ {+ id: 'package-answers-input',+ says: 'a packaged game visibly answers the input its project declares',+ answeredBy: 'node tools/verify-golden.mjs --tier release',+ needs: ['desktop/scripts/inputScript.mjs'],+ },+ {+ id: 'launch-smoke-every-platform',+ says: 'every shipping platform launches a package and draws',+ answeredBy: 'node tools/verify-golden.mjs --tier release'+ + ' && node tools/verify-desktop-render.mjs --tier pr'+ + ' && node tools/verify-native-boot.mjs --platform android --examples all',+ needs: [+ 'desktop/scripts/launch-export.mjs',+ 'desktop/scripts/launch-minigame.mjs',+ 'tools/verify-desktop-render.mjs',+ 'tools/verify-native-boot.mjs',+ ],+ },+ {+ id: 'old-projects-open',+ says: 'projects released by older versions still open, with nothing dropped',+ answeredBy: 'node tools/verify-legacy.mjs --tier release',+ needs: ['tools/verify-legacy.mjs'],+ },+ {+ id: 'play-stop-conserves',+ says: 'Play/Stop 100 times returns every conserved counter to baseline, GL objects included',+ // The check defaults to 12 cycles for a PR; the criterion is 100, so the+ // command that answers it is the one that asks for 100.+ answeredBy: 'cd desktop && SOAK_CYCLES=100 node scripts/editor-checks/run.mjs soak',+ needs: ['desktop/scripts/editor-checks/soak.mjs', 'desktop/scripts/lib/censusJudge.mjs'],+ },+ {+ id: 'scene-churn-flat',+ says: 'opening and closing scenes shows no upward trend in GPU resources',+ answeredBy: 'cd desktop && SOAK_CYCLES=40 node scripts/editor-checks/run.mjs scene-churn',+ needs: ['desktop/scripts/editor-checks/scene-churn.mjs'],+ },+ {+ id: 'headless-soak',+ says: 'entity and prefab churn holds its bounded resources flat',+ answeredBy: 'pnpm run soak',+ needs: ['sdk/tests/soak/churn.test.ts', 'sdk/tests/soak/dist-probes.test.ts'],+ },+ {+ id: 'lifecycle-torture',+ says: 'asset and scene lifecycles survive interleaved load/unload/reload',+ answeredBy: 'pnpm run torture',+ needs: ['sdk/tests/torture/asset-lifecycle.test.ts', 'sdk/tests/torture/scene-lifecycle.test.ts'],+ },+ {+ id: 'performance-ceilings',+ says: 'no benchmark regresses past its recorded ceiling',+ answeredBy: 'pnpm run perf && pnpm run scale',+ needs: ['tools/perf-guard.mjs', 'tools/perf-budget.mjs'],+ },+ {+ id: 'static-gates',+ says: 'every declared contract still holds (api surface, layers, corpus, host shim…)',+ answeredBy: 'pnpm run verify',+ needs: ['tools/check-golden.mjs', 'tools/check-minigame-host.mjs'],+ },+ {+ id: 'diagnostics-from-a-release-build',+ says: 'a shipped build can export a diagnostic bundle',+ // No runner: it needs an installed, signed application, which is the one+ // artifact CI produces and cannot then run as a user would.+ manual: 'release captain, on the downloaded build: Help → Export Diagnostics',+ },+ {+ id: 'no-p0-packaging-bugs',+ says: 'no open P0 against packaging or launch',+ manual: 'release captain, over the tracker — a count of issues is not a thing to compute here',+ },+];