Skip to content

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.

fix(gates): the evidence reader opens the whole project, and says what it opens

esenginebf82b86206b6
diff --git a/tools/check-golden.mjs b/tools/check-golden.mjs
index 500c6446a..262ac2b5c 100644
--- a/tools/check-golden.mjs
+++ b/tools/check-golden.mjs
@@ -16,7 +16,7 @@ import { existsSync, readFileSync, readdirSync } from 'node:fs';
import path from 'node:path';
import {
GOLDEN, CAPABILITIES, KNOWN_GAPS, EVIDENCE, TIERS, TARGETS,
- SHIPPED, CENSUS_FLOOR, shippedGround,
+ SHIPPED, CENSUS_FLOOR, shippedGround, EVIDENCE_FORMATS, NOT_EVIDENCE_FORMATS,
atTier, uncoveredCapabilities, nonGoldenExamples, projectDir, parityFor, interactFor,
} from './goldenProjects.mjs';
import { CRITERIA } from './releaseGate.mjs';
@@ -27,6 +27,8 @@ const fail = (msg) => problems.push(msg);
/** What a project is, as text: its sources plus the scene and prefab data it
* opens, since a capability can be exercised declaratively. */
const projectTextCache = new Map();
+/** Every extension the reader met, so it can be held to classifying them. */
+const seenFormats = new Set();
function projectText(id) {
if (projectTextCache.has(id)) return projectTextCache.get(id);
const parts = [];
@@ -37,8 +39,12 @@ function projectText(id) {
if (e.name === '.esengine' || e.name === 'node_modules' || e.name === 'dist') continue;
const p = path.join(dir, e.name);
if (e.isDirectory()) walk(p);
- else if (/\.(ts|esscene|esprefab|esproject|json)$/.test(e.name)) {
- try { parts.push(readFileSync(p, 'utf8')); } catch { /* unreadable */ }
+ else {
+ const ext = e.name.slice(e.name.lastIndexOf('.'));
+ seenFormats.add(ext);
+ if (EVIDENCE_FORMATS.includes(ext)) {
+ try { parts.push(readFileSync(p, 'utf8')); } catch { /* unreadable */ }
+ }
}
}
};
@@ -234,6 +240,19 @@ for (const [key, entry] of Object.entries(SHIPPED)) {
}
}
+// Every format a golden project holds is either evidence or declared not to be.
+// A reader that opens some of a project answers about all of it: root motion and
+// clip events were authored, verified on the packaged game, and read by nothing.
+for (const g of GOLDEN) projectText(g.id);
+for (const ext of [...seenFormats].sort()) {
+ if (EVIDENCE_FORMATS.includes(ext) || ext in NOT_EVIDENCE_FORMATS) continue;
+ fail(`golden projects hold "${ext}" files and the evidence reader classifies it as neither`
+ + ' read nor irrelevant — say which, or a capability authored in one reads as absent');
+}
+for (const ext of EVIDENCE_FORMATS) {
+ if (ext in NOT_EVIDENCE_FORMATS) fail(`"${ext}" is declared both evidence and not`);
+}
+
for (const c of uncoveredCapabilities()) {
fail(`nothing certifies "${c}" — add a project, or declare the gap in KNOWN_GAPS with a reason`);
}
@@ -266,6 +285,9 @@ console.log(
+ ' (release notes are the ground; nothing gates THEIR completeness)'
+ `, ${gaps} declared gap(s) — ok (${pairs})`,
);
+console.log(` evidence read from ${EVIDENCE_FORMATS.length} authored format(s);`
+ + ` ${Object.keys(NOT_EVIDENCE_FORMATS).length} more carry no claim;`
+ + ` ${seenFormats.size} met in the corpus, 0 unclassified`);
// Named, not counted. A number is a hole nobody reads; the whole bargain of
// declaring one is that it stays in front of the next person to run this.
for (const [c, why] of Object.entries(KNOWN_GAPS)) {
diff --git a/tools/goldenProjects.mjs b/tools/goldenProjects.mjs
index a2dd85805..9e7fd4471 100644
--- a/tools/goldenProjects.mjs
+++ b/tools/goldenProjects.mjs
@@ -42,6 +42,40 @@ export const DEFAULT_PARITY = 0.06;
*/
export const DEFAULT_RESPONDS = 0.15;
+/**
+ * The authored, textual formats a capability claim can be found in — what
+ * `projectText` opens. A reader that opens SOME of a project still answers about
+ * all of it, so a capability authored in an unread format reads as absent.
+ */
+export const EVIDENCE_FORMATS = [
+ '.ts', '.esproject', '.esscene', '.esprefab',
+ '.esanimator', '.estimeline', '.esanim',
+ '.esmaterial', '.esshader', '.esenv',
+ '.estileset', '.tmj', '.eslocale', '.esbt', '.inputmap',
+ '.json',
+];
+
+/**
+ * Every other extension a golden project may hold, and why it carries no claim.
+ * An extension in neither list fails: a format nobody classified is one the
+ * reader is silently not reading.
+ */
+export const NOT_EVIDENCE_FORMATS = {
+ '.meta': 'import settings for the file beside it; the asset is the claim, not its import row',
+ '.md': 'prose about the project, not the project',
+ '.mjs': 'the project\'s own tooling — engine-gaps ledgers and helpers',
+ '.gitignore': 'version control, not content',
+ '.png': 'a texture; what USES it is authored elsewhere',
+ '.ktx2': 'a compressed texture; same',
+ '.hdr': 'an environment map; the .esenv referencing it is the claim',
+ '.gltf': 'an imported model; the .esmesh and prefab it produced are the claim',
+ '.esmesh': 'the import result, not an authored file — regenerated from the .gltf',
+ '.atlas': 'a Spine atlas, written by Spine',
+ '.skel': 'a Spine skeleton, written by Spine',
+ '.mp4': 'video content',
+ '.wav': 'audio content',
+};
+
/**
* The release the shipped-feature census reaches back to. Older releases are out
* of its scope BY DECLARATION rather than by silence, and the gate says so.
@@ -203,9 +237,9 @@ export const EVIDENCE = {
ssao: /"type":\s*"ssao"/,
'navigation-3d': /\b(NavVolume|NavLink|NavAgent3D)\b/,
'root-motion': /\brootMotion\b/,
- // Events authored ON a clip. The runtime always read them; what shipped is a
- // format and an editor that can write them.
- 'animation-events': /"events"\s*:\s*\[/,
+ // The authored track, not any key called events: the runtime always read them,
+ // and what shipped is a format and an editor that can write them.
+ 'animation-events': /"type":\s*"customEvent"/,
// Nothing in a project's text can show it: the claim is that the first visible
// frame pays no compile, which only a run can settle. See NEEDS_RUN.
'shader-readiness': null,
@@ -241,11 +275,8 @@ export const EVIDENCE = {
* coverage — the same bargain check-project-settings strikes.
*/
export const KNOWN_GAPS = {
- // Shipped in 0.61 and carried by no project — the 3D stack's composition debt.
- // Work items, not dispensations: the staleness check below forces an entry out
- // the moment a project certifies it.
- 'root-motion': 'no golden project has a character moved by its animation; the 3D composition project owes it',
- 'animation-events': 'no golden project authors events on a clip and acts on them; the 3D composition project owes it',
+ // A work item, not a dispensation: the staleness check below forces the entry
+ // out the moment a project certifies it.
'shader-readiness': 'no golden project watches the frame something first appears on; needs a runBy a release criterion schedules',
// Present in the engine and shown by non-golden samples, but never carried
// through the chain by a project the release argues from.
@@ -348,7 +379,8 @@ export const GOLDEN = [
},
{
id: 'third-person-3d',
- certifies: ['third-person', 'level-of-detail', 'ssao', 'navigation-3d'],
+ certifies: ['third-person', 'level-of-detail', 'ssao', 'navigation-3d',
+ 'root-motion', 'animation-events'],
targets: ['web'],
tier: 'pr',
// The character walks on the key it declares. What it DOES on the way is