This commit is contained in:
parent
1a13b9d58c
commit
c6479d6811
1 changed files with 6 additions and 8 deletions
|
|
@ -71,9 +71,7 @@ const events = (schedule.events as Array<Record<string, unknown>>).map((ev) => (
|
||||||
function placeholderPng(id: string): Uint8Array {
|
function placeholderPng(id: string): Uint8Array {
|
||||||
// 1x1 PNG-ish deterministic payload; hash/size budgets are what matter here.
|
// 1x1 PNG-ish deterministic payload; hash/size budgets are what matter here.
|
||||||
const marker = new TextEncoder().encode(`lumen-placeholder:${id}`);
|
const marker = new TextEncoder().encode(`lumen-placeholder:${id}`);
|
||||||
const pngHeader = new Uint8Array([
|
const pngHeader = new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, ...marker]);
|
||||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, ...marker,
|
|
||||||
]);
|
|
||||||
return pngHeader;
|
return pngHeader;
|
||||||
}
|
}
|
||||||
const mapLevelIds = (
|
const mapLevelIds = (
|
||||||
|
|
@ -207,7 +205,10 @@ const pkg = built.pkg;
|
||||||
const totalBytes =
|
const totalBytes =
|
||||||
[...pkg.files.values()].reduce((s, f) => s + f.bytes, 0) +
|
[...pkg.files.values()].reduce((s, f) => s + f.bytes, 0) +
|
||||||
pkg.assets.reduce((s, a) => s + a.bytes, 0);
|
pkg.assets.reduce((s, a) => s + a.bytes, 0);
|
||||||
log("validate/build/hash", `ok — ${pkg.files.size} sections + ${pkg.assets.length} assets, ${String(totalBytes)} bytes (budget ≤40MB: ${totalBytes <= 40 * 1024 * 1024 ? "PASS" : "FAIL"})`);
|
log(
|
||||||
|
"validate/build/hash",
|
||||||
|
`ok — ${pkg.files.size} sections + ${pkg.assets.length} assets, ${String(totalBytes)} bytes (budget ≤40MB: ${totalBytes <= 40 * 1024 * 1024 ? "PASS" : "FAIL"})`,
|
||||||
|
);
|
||||||
if (pkg.floorBytes > 16 * 1024) die(`emergency floor ${String(pkg.floorBytes)} > 16KB`);
|
if (pkg.floorBytes > 16 * 1024) die(`emergency floor ${String(pkg.floorBytes)} > 16KB`);
|
||||||
log("floor", `emergency floor compiled: ${String(pkg.floorBytes)} bytes (≤16KB)`);
|
log("floor", `emergency floor compiled: ${String(pkg.floorBytes)} bytes (≤16KB)`);
|
||||||
if (!pkg.signature) die("expected signature with test key");
|
if (!pkg.signature) die("expected signature with test key");
|
||||||
|
|
@ -228,10 +229,7 @@ writeFileSync(join(pkgDir, "signature.json"), JSON.stringify(pkg.signature, null
|
||||||
// can re-verify offline. Production trust pins the key inside the app shell
|
// can re-verify offline. Production trust pins the key inside the app shell
|
||||||
// (Stage 7 verifier) — never rely on a key published alongside the data.
|
// (Stage 7 verifier) — never rely on a key published alongside the data.
|
||||||
writeFileSync(join(pkgDir, "publicKey.pem"), kp.publicKeyPem);
|
writeFileSync(join(pkgDir, "publicKey.pem"), kp.publicKeyPem);
|
||||||
writeFileSync(
|
writeFileSync(join(pkgDir, "emergency-floor.json"), JSON.stringify(pkg.emergencyFloor, null, 2));
|
||||||
join(pkgDir, "emergency-floor.json"),
|
|
||||||
JSON.stringify(pkg.emergencyFloor, null, 2),
|
|
||||||
);
|
|
||||||
// Mutable pointer — last write, so immutable files always exist before flip.
|
// Mutable pointer — last write, so immutable files always exist before flip.
|
||||||
writeFileSync(join(outDir, "latest.json"), JSON.stringify(pkg.latest, null, 2));
|
writeFileSync(join(outDir, "latest.json"), JSON.stringify(pkg.latest, null, 2));
|
||||||
log("upload", `wrote immutable tree under ${pkgDir}/ + latest.json flip`);
|
log("upload", `wrote immutable tree under ${pkgDir}/ + latest.json flip`);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue