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
fix(audit): a reader can only be owed where the decision is taken
esengineee0377dcf29e
diff --git a/tools/check-decision-inventory.mjs b/tools/check-decision-inventory.mjsindex 9bfd29cae..5a5778bf8 100644--- a/tools/check-decision-inventory.mjs+++ b/tools/check-decision-inventory.mjs@@ -71,17 +71,38 @@ for (const d of DECISIONS) {for (const s of SURFACES) {const surface = d[s];if (!surface) { problems.push(`${d.id} says nothing about its ${s} surface`); continue; }- if (!surface.has && !surface.owed) problems.push(`${d.id} → ${s} is absent with no reason`);- if (!surface.has) owed.push({ id: d.id, kind: d.kind, surface: s, why: surface.owed });+ if (!surface.has && !surface.owed && !surface.unavailable) {+ problems.push(`${d.id} → ${s} is absent with no reason`);+ }+ if (surface.has && (surface.owed || surface.unavailable)) {+ problems.push(`${d.id} → ${s} both claims a surface and explains its absence`);+ }+ // Two defects, counted apart: one is a reader nobody wrote, the other is a+ // fact this realm never produces. Only the first is a panel.+ if (!surface.has) {+ owed.push({+ id: d.id, surface: s, why: surface.owed ?? surface.unavailable,+ kind: surface.unavailable ? 'unavailable' : 'owed',+ });+ }}}/**- * The shapes worth naming apart, in the order they are worth fixing. `human >- * agent` is last because it breaks no principle — automation is not owed more+ * The shapes worth naming apart, in the order they are worth fixing.+ *+ * `realm prerequisite` comes first because it makes the others meaningless: a+ * surface can only owe a READER where the decision is actually taken.+ * residency.cellDemand read as "runtime > editor" for a whole pass while no+ * editor realm instantiated streaming at all — a panel built on that label would+ * have shown zeros for ever, and passed any gate that asked only whether a panel+ * existed.+ *+ * `human > agent` is last: it breaks no principle — automation is not owed more* than a person — and is still a surface that is not finished.*/const imbalance = (d) => {+ if (SURFACES.some((s) => d[s]?.unavailable)) return 'realm prerequisite';if (!d.runtime?.has) return 'decision > explanation';if (d.agent?.has && !d.editor?.has) return 'agent > human';if (!d.editor?.has) return 'runtime > editor';@@ -96,8 +117,12 @@ if (process.argv.includes('--list')) {const mark = (s) => (d[s]?.has ? ' ok ' : ' owed ');console.log(`${d.id.padEnd(width)} ${mark('runtime')}${mark('editor')}${mark('agent')} ${imbalance(d) ?? 'complete'}`);}- console.log(`\nowed (${owed.length}):`);- for (const o of owed) console.log(` ${o.id} → ${o.surface}: ${o.why}`);+ for (const kind of ['owed', 'unavailable']) {+ const rows = owed.filter((o) => o.kind === kind);+ if (!rows.length) continue;+ console.log(`\n${kind} (${rows.length}):`);+ for (const o of rows) console.log(` ${o.id} → ${o.surface}: ${o.why}`);+ }}if (skipped.length) {diff --git a/tools/lib/runtimeDecisions.mjs b/tools/lib/runtimeDecisions.mjsindex 9db4cc112..33dac1b66 100644--- a/tools/lib/runtimeDecisions.mjs+++ b/tools/lib/runtimeDecisions.mjs@@ -16,7 +16,9 @@* editor a person can see the choice and the reason, where they authored it* agent the automation surface answers the same question*- * runtime > editor the engine knows and nobody asks (worldResidencyReport)+ * runtime > editor the engine knows and nobody asks+ * realm prerequisite this realm never takes the decision, so there is no+ * reader to owe — a different defect from a missing one* agent > human automation can reach what a person cannot (spineVersion)* decision > explanation a real choice with nothing recording why (shadow atlas)*@@ -65,14 +67,14 @@ export const DECISIONS = [runtime: { has: true, cite: { path: 'sdk/src/residency/report.ts', probe: /prefetchHits/ } },editor: {has: false,- owed: 'not a missing reader — the editor never runs the thing. Streaming turns on only when '+ unavailable: 'the editor never runs the thing. Streaming turns on only when '+ 'runtimeLoader is handed a COOKED world manifest (`config.worlds`), which only exportGame '+ 'and the headless gameHost supply; neither the edit realm nor playHost passes one, so '+ 'worldResidencyReport answers EMPTY in both. A panel reading it would show zeros for ever, '+ 'and goldenProjects already records the split as deliberate ("the editor plays it whole"). '+ 'The debt is a decision about Play, not a panel',},- agent: { has: false, owed: 'same realm, same absence of a cooked world to report on' },+ agent: { has: false, unavailable: 'same realm, same absence of a cooked world to report on' },},{id: 'shadow.atlasAllocation',