Skip to content

Commit 8c490b0

Browse files
thebenternclaude
andcommitted
Merge branch 'master' into v2, and publish every erase image the manifest names
Backmerges master (b28b432..797c024): the Seeed Wio Tracker L2 svg, the OTAFIX bootloader factory-erase feature, two maintenance-UF2 manifest syncs and two deviceLinks syncs. DEVICE_HARDWARE is now 38936 B, byte-identical to Railway. The merge surfaced a blocking publish bug, fixed here. master added `erase.nrf52Bootloader` to data/maintenanceUf2.json as a deliberately additive sibling of `nrf52`/`rp2040`. Two hardcoded lists in the v2 pipeline did not know about it: - tools/build-static.ts named three .uf2 filenames literally, so meshtastic_factory_erase.uf2 was never emitted to R2. - tools/validate.ts collected erase entries from the `nrf52` and `rp2040` keys only, so the check whose stated contract is "a manifest naming a file we do not publish is a build failure" walked straight past it and reported OK. Net effect had this shipped: the Worker would serve a manifest naming a file, with its sha256, that returns 404 -- on the one flow that ends in an irreversible bootloader write. Confirmed live: the file is 200 on Railway and 404 on the Worker. Both call sites now resolve the list from the manifest through one shared helper, tools/eraseImages.ts, which walks the whole `erase` tree for anything carrying a fileName + sha256. The publisher and the validator read the same list from the same place, so a future additive key is picked up by both or by neither -- an allowlist of keys cannot fail closed against a schema designed to grow. Still an explicit per-file emit with a stated content-type, never a directory glob, so ATTRIBUTION.md stays unpublished. Also pins the new binary in tests/golden/binaries.sha256 (10 now): clients cache these by filename and pin them by digest, which is the property that file exists to protect. validate: OK (115 devices, 216 links, 35 softDevice variants, 4 erase images) build:static: 10 objects, 2.67 MB Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 parents f3254ac + 797c024 commit 8c490b0

11 files changed

Lines changed: 204 additions & 24 deletions

File tree

‎data/deviceLinks.json‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,28 @@
14821482
"Targets": [
14831483
"native"
14841484
]
1485+
},
1486+
{
1487+
"ShortCode": "ttc",
1488+
"Description": "Thing Things Conference 2026",
1489+
"Type": "Internal",
1490+
"Targets": []
1491+
},
1492+
{
1493+
"ShortCode": "mini-epaper-s3",
1494+
"Description": "Mini E-Paper S3 Kit",
1495+
"Type": "Vendor",
1496+
"Targets": [
1497+
"mini-epaper-s3"
1498+
]
1499+
},
1500+
{
1501+
"ShortCode": "tlora-c6",
1502+
"Description": "T-Lora C6",
1503+
"Type": "Vendor",
1504+
"Targets": [
1505+
"tlora-c6"
1506+
]
14851507
}
14861508
],
14871509
"Marketplaces": {

‎data/maintenanceUf2.json‎

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifestVersion": 1,
3-
"otafixReleaseTag": "0.9.2-OTAFIX2.3-BP1.5",
4-
"otafixBase": "https://github.com/meshtastic/Adafruit_nRF52_Bootloader_OTAFIX/releases/download/0.9.2-OTAFIX2.3-BP1.5",
3+
"otafixReleaseTag": "0.9.2-OTAFIX2.5",
4+
"otafixBase": "https://github.com/meshtastic/Adafruit_nRF52_Bootloader_OTAFIX/releases/download/0.9.2-OTAFIX2.5",
55
"erase": {
66
"nrf52": {
77
"6.1.1": {
@@ -15,6 +15,11 @@
1515
"expectedFirstTargetAddress": 159744
1616
}
1717
},
18+
"nrf52Bootloader": {
19+
"fileName": "meshtastic_factory_erase.uf2",
20+
"sha256": "6ef3146505c40079ee9e7e692448e40a793dad636f55d1545063299d28908f0d",
21+
"expectedFamilyId": 1296388936
22+
},
1823
"rp2040": {
1924
"fileName": "pico_erase.uf2",
2025
"sha256": "08aa7d561e8b8bf2f9b061b3506fb4d8f135e832efe0f3ae978241db2da0c853"
@@ -23,59 +28,79 @@
2328
"otafixByBoardId": {
2429
"HT-n5262": {
2530
"otafixBoardSlug": "heltec_t114",
26-
"sha256": "ae92d3577cb58dd9b43c9b61ffb9bfffda05b0eca4113a0ec42a37cd8be53b19"
31+
"sha256": "96a461dcf5eb3df81de26ed278632a949f777304878ddb445958dbbf0684702a"
32+
},
33+
"Heltec-T096-v1": {
34+
"otafixBoardSlug": "heltec_t096",
35+
"sha256": "e81ca347718ce0f3511fb909db793e090020e684f903ba35a4efe5aa2872356e"
36+
},
37+
"Heltec-T1": {
38+
"otafixBoardSlug": "heltec_t1",
39+
"sha256": "112fa1f748a6b6c33bbb1893378b432180c9afeb7ca608a23b7544bf364a6fb4"
2740
},
2841
"MinewSemi-MX25LE01": {
2942
"otafixBoardSlug": "minewsemi_mx25le01",
30-
"sha256": "e09564fd8dd03fc25d76dcb732a0214c79653da3b130240949b783254d3dfc1b"
43+
"sha256": "301937aaade9c548d40c4c25db7a7cd2356d694c27764ad295789e04128f4170"
3144
},
3245
"TRACKER L1": {
3346
"otafixBoardSlug": "wio_tracker_l1",
34-
"sha256": "70fbce0eda9d70d7bd8a4367057badf5ec310838bf3221370d45a56f04956b9e"
47+
"sha256": "4eb3c0aa307f6f69395817b49e2041ba063e7004333c3a702296f6724cdeae58"
48+
},
49+
"WisBlock-RAK3401-Board": {
50+
"otafixBoardSlug": "wiscore_rak3401",
51+
"sha256": "33d1d5f46ceda68e96d95ad358f9625eedc02fd9ebe67517e603a018ee1eac38"
3552
},
3653
"WisBlock-RAK4631-Board": {
3754
"otafixBoardSlug": "wiscore_rak4631_board",
38-
"sha256": "8741bc677a3c24f28422c5ffb80761de7d98a127a3b0191ba6585bf57ce9f305"
55+
"sha256": "20044aefae6f02e6b769d2018cdab827af359ca12aea5a93591e300574e8a7f4"
3956
},
4057
"WisMesh-Tag": {
4158
"otafixBoardSlug": "wismesh_tag",
42-
"sha256": "96d42e1990e17251e8c625e98a1551cac12c6e29111bc2e59ab7c9fe6dec8758"
59+
"sha256": "228545896fb2e16f4eaf0f70c672b7cd0ceab8448b51d24cd4f5a4b4515d6f52"
60+
},
61+
"muzi-Base-Board": {
62+
"otafixBoardSlug": "muzi_base",
63+
"sha256": "bee189b0c8aabacdd0033caac11cd1fb01445fe0d92912fb5e4bf5ba21ca7374"
64+
},
65+
"nRF52840-MeshTracker-X1": {
66+
"otafixBoardSlug": "mesh_tracker_x1",
67+
"sha256": "52764ebe629dae6d9085f6e6d85a8d5d2df7aeea8e47dca55c692fdb0fbcc4e8"
4368
},
4469
"nRF52840-SeeedSenseCAPSolarP1-v1": {
4570
"otafixBoardSlug": "sensecap_solar_p1",
46-
"sha256": "9b4bce48c1b4830617715c5619457bce6b21f3079803e35e13433de7701290f5"
71+
"sha256": "99bf90359cceadb6d93bafae4f8ed93865ed0f40c9f422399f78944d0a1a00c0"
4772
},
4873
"nRF52840-SeeedXiao-v1": {
4974
"otafixBoardSlug": "xiao_nrf52840_ble",
50-
"sha256": "ff8a0916e98cceb394fd66590bccc17f63612c11ff56b086ef88bd436c8df67f"
75+
"sha256": "678a68ef215461ab7f8fa840036e79fc0aa33433e8e5bb66bc20efa757c7c5c6"
5176
},
5277
"nRF52840-SeeedXiaoSense-v1": {
5378
"otafixBoardSlug": "xiao_nrf52840_ble_sense",
54-
"sha256": "fc233d83a1011419625fcb50b49084578460c25bbc0270374ca176757a3c40da"
79+
"sha256": "4a44832efe05ccc458bd9218934bed192aa4bd8a6f6aac5a2b45ec310c8e496d"
5580
},
5681
"nRF52840-T1000-E-v1": {
5782
"otafixBoardSlug": "t1000_e",
58-
"sha256": "5c065e11b8acd5b0cefa9295f98bca1512306cfa478856aa76a871124a904cc4"
83+
"sha256": "58e304325b0ad443ab91cd4d25f37197abde03f9b22fce449c903376222c6dfc"
5984
},
6085
"nRF52840-TEcho-v1": {
6186
"otafixBoardSlug": "lilygo_techo",
62-
"sha256": "2ddb36188ffe521c270bb2ce8441d742d0fe45325c57e4db6475bf63162a59b0"
87+
"sha256": "aea201b970862a53640d1aab367e2955224923ffbf9081a834bc73fedfc66853"
6388
},
6489
"nRF52840-ThinkNode-M3-v1": {
6590
"otafixBoardSlug": "thinknode_m3",
66-
"sha256": "bf90979f2f6adc96ef6ca09c280b2ab7e66cb8ce2654fc80da9b20407bfb8708"
91+
"sha256": "fe8104928ee53014a015345c814fc9fb77bda51c4f99414b823ea4631a78555c"
6792
},
6893
"nRF52840-ThinkNodeM1-v1": {
6994
"otafixBoardSlug": "thinknode_m1",
70-
"sha256": "aa0721b573c60e0b179274d5a5296bac7a8436faf339cfc03116ebe8a4375795"
95+
"sha256": "0173e78956cd4f3513d68e69fe51ae7182db2392e40121ddda7c9a44cc8af333"
7196
},
7297
"nRF52840-ThinkNodeM6-v1": {
7398
"otafixBoardSlug": "thinknode_m6",
74-
"sha256": "aaf94953a540a18f3e48f4cdec0c78290ad3c5f8740aea26fa3b3ce3632a8d4a"
99+
"sha256": "17525b78ac0f565f8f7942d8ccd4c4d614bd19ee0d82108d762e9bb811a533b5"
75100
},
76101
"nRF52840-promicro": {
77102
"otafixBoardSlug": "promicro_nrf52840",
78-
"sha256": "46ef3440f151d6f2606075bcd1aa83db25a660da7d25b988aeb47ef350c98794"
103+
"sha256": "c5b3af91554687ae3d2e62129f61a3656bcc6cfb2ab7d35f4ae7e18d979c0ae7"
79104
}
80105
},
81106
"otafixSupportedTargets": [
@@ -91,6 +116,10 @@
91116
"seeed_wio_tracker_L1",
92117
"seeed_wio_tracker_L1_eink",
93118
"seeed_solar_node",
94-
"seeed_xiao_nrf52840_kit"
119+
"seeed_xiao_nrf52840_kit",
120+
"seeed_mesh_tracker_X1",
121+
"muzi-base",
122+
"heltec-mesh-node-t096",
123+
"heltec-mesh-node-t1"
95124
]
96125
}

‎scripts/validate-maintenance-uf2.ts‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ interface EraseImageEntry {
2222
fileName: string;
2323
sha256: string;
2424
expectedFirstTargetAddress?: number;
25+
expectedFamilyId?: number;
2526
}
2627

2728
const manifest = JSON.parse(readFileSync(DATA_PATH, "utf8")) as {
@@ -30,6 +31,7 @@ const manifest = JSON.parse(readFileSync(DATA_PATH, "utf8")) as {
3031
otafixBase: string;
3132
erase: {
3233
nrf52: Record<string, EraseImageEntry>;
34+
nrf52Bootloader?: EraseImageEntry;
3335
rp2040: EraseImageEntry;
3436
};
3537
otafixByBoardId: Record<string, { otafixBoardSlug: string; sha256: string }>;
@@ -56,6 +58,52 @@ const checkSha256 = (sha256: string, where: string) => {
5658
}
5759
};
5860

61+
// --- bootloader-consumed erase image: one UF2 block whose family ID is the whole contract ---
62+
// The OTAFIX bootloader acts on this file by family ID alone (targetAddr is 0, so the clients'
63+
// first-target-address check does not apply); a wrong family here would make every device treat
64+
// it as an ordinary firmware block. Check the header the way the bootloader reads it.
65+
const UF2_BLOCK_SIZE = 512;
66+
const UF2_MAGIC0 = 0x0a324655;
67+
const UF2_MAGIC1 = 0x9e5d5157;
68+
const UF2_MAGIC_END = 0x0ab16f30;
69+
const UF2_FLAG_FAMILY_ID_PRESENT = 0x2000;
70+
71+
const checkUf2FamilyBlock = (
72+
bytes: Buffer,
73+
expectedFamilyId: number,
74+
where: string,
75+
) => {
76+
if (bytes.length !== UF2_BLOCK_SIZE) {
77+
fail(
78+
`${where}: expected exactly one ${UF2_BLOCK_SIZE}-byte UF2 block, got ${bytes.length} bytes`,
79+
);
80+
return;
81+
}
82+
const magic0 = bytes.readUInt32LE(0);
83+
const magic1 = bytes.readUInt32LE(4);
84+
const flags = bytes.readUInt32LE(8);
85+
const familyId = bytes.readUInt32LE(28);
86+
const magicEnd = bytes.readUInt32LE(508);
87+
if (magic0 !== UF2_MAGIC0 || magic1 !== UF2_MAGIC1) {
88+
fail(
89+
`${where}: bad UF2 start magic 0x${magic0.toString(16)}/0x${magic1.toString(16)}`,
90+
);
91+
}
92+
if (magicEnd !== UF2_MAGIC_END) {
93+
fail(`${where}: bad UF2 end magic 0x${magicEnd.toString(16)}`);
94+
}
95+
if ((flags & UF2_FLAG_FAMILY_ID_PRESENT) === 0) {
96+
fail(
97+
`${where}: UF2 flags 0x${flags.toString(16)} lack the family-ID-present bit`,
98+
);
99+
}
100+
if (familyId !== expectedFamilyId) {
101+
fail(
102+
`${where}: UF2 family ID 0x${familyId.toString(16)}, manifest expects 0x${expectedFamilyId.toString(16)}`,
103+
);
104+
}
105+
};
106+
59107
// --- erase images: fileName/sha256 shape, and the vendored bytes actually match ---
60108
const checkEraseEntry = (entry: EraseImageEntry, where: string) => {
61109
checkFileName(entry.fileName, where);
@@ -68,6 +116,9 @@ const checkEraseEntry = (entry: EraseImageEntry, where: string) => {
68116
`${where}: vendored ${entry.fileName} hashes to ${actual}, manifest says ${entry.sha256}`,
69117
);
70118
}
119+
if (entry.expectedFamilyId !== undefined) {
120+
checkUf2FamilyBlock(bytes, entry.expectedFamilyId, where);
121+
}
71122
} catch (err) {
72123
fail(
73124
`${where}: could not read static/maintenanceUf2/${entry.fileName}: ${(err as Error).message}`,
@@ -80,6 +131,10 @@ for (const [softDevice, entry] of Object.entries(manifest.erase.nrf52)) {
80131
checkEraseEntry(entry, `erase.nrf52["${softDevice}"]`);
81132
eraseImageCount++;
82133
}
134+
if (manifest.erase.nrf52Bootloader) {
135+
checkEraseEntry(manifest.erase.nrf52Bootloader, "erase.nrf52Bootloader");
136+
eraseImageCount++;
137+
}
83138
checkEraseEntry(manifest.erase.rp2040, "erase.rp2040");
84139
eraseImageCount++;
85140

‎src/lib/maintenanceUf2.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export interface EraseImageEntry {
2424
fileName: string;
2525
sha256: string;
2626
expectedFirstTargetAddress?: number;
27+
// Set only on nrf52Bootloader: the UF2 family ID the bootloader consumes itself. Its block
28+
// has targetAddr 0, so clients check this instead of expectedFirstTargetAddress.
29+
expectedFamilyId?: number;
2730
}
2831

2932
export interface OtafixAssetEntry {
@@ -44,6 +47,11 @@ export interface MaintenanceUf2Manifest {
4447
// all, so it correctly has no sub-key, unlike the old flat {s140_6_1_1, s140_7_3_0, rp2040}
4548
// shape that mixed a SoftDevice-variant axis with an architecture axis in one object.
4649
nrf52: Record<string, EraseImageEntry>; // keyed by SoftDeviceVariant.fromWire's input, e.g. "6.1.1"
50+
// One board-agnostic file the OTAFIX bootloader consumes itself (UF2 family 0x4D455348,
51+
// "MESH"), so it needs no SoftDevice sub-key. Clients gate it on the UF2 drive's INFO_UF2.TXT
52+
// carrying a "Factory-Erase:" line naming that family; an older bootloader has no such line
53+
// and silently ignores the file, so clients fall back to erase.nrf52 for it.
54+
nrf52Bootloader?: EraseImageEntry;
4755
rp2040: EraseImageEntry;
4856
};
4957
otafixByBoardId: Record<string, OtafixAssetEntry>;

‎src/lib/resource.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,7 @@ export const deviceHardwareList: DeviceHardware[] = [
13901390
supportLevel: 1,
13911391
displayName: "Seeed Wio Tracker L2 Pro",
13921392
tags: ["Seeed"],
1393+
images: ["seeed_wio_tracker_l2.svg"],
13931394
requiresDfu: true,
13941395
partitionScheme: "16MB",
13951396
},

‎static/maintenanceUf2/ATTRIBUTION.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@
55
(GPL-3.0-only), vendored here rather than fetched at runtime because that repo cuts no GitHub
66
releases. Digests are pinned in `../../data/maintenanceUf2.json` and re-verified by
77
`scripts/validate-maintenance-uf2.ts`.
8+
9+
`meshtastic_factory_erase.uf2` is `tools/meshtastic_factory_erase.uf2` from
10+
[meshtastic/Adafruit_nRF52_Bootloader_OTAFIX](https://github.com/meshtastic/Adafruit_nRF52_Bootloader_OTAFIX)
11+
(MIT) at commit
12+
[`c8ccd1d7419fda4c01c30c8a9bf144d30a424c46`](https://github.com/meshtastic/Adafruit_nRF52_Bootloader_OTAFIX/blob/c8ccd1d7419fda4c01c30c8a9bf144d30a424c46/tools/meshtastic_factory_erase.uf2),
13+
generated there by `tools/make_factory_erase_uf2.py` and shipped as the `meshtastic_factory_erase.uf2`
14+
asset of release [`0.9.2-OTAFIX2.4`](https://github.com/meshtastic/Adafruit_nRF52_Bootloader_OTAFIX/releases/tag/0.9.2-OTAFIX2.4)
15+
(same bytes, same digest). Same digest pinning and re-verification as above.
512 Bytes
Binary file not shown.

‎tests/golden/binaries.sha256‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ b3c4977c8a94ed864d62a55bc0fb2a9156b0ce7bade82089fbedd5f41d2f1449 static/eventFi
33
932b1adf0817b6721984d31f43f165ce39bc24bfd44162c6842ef267a7214da5 static/eventFirmware/dragoncon2026.png
44
07534af9b4b173369199de3c068897e8ef32016062b130b5e876a2a4dae0fe38 static/eventFirmware/fab26.png
55
f4946f1f791f26e04dbb1993977cbba29a09997e7ae783bc6d50aa4647e9ff19 static/eventFirmware/hamvention.png
6+
6ef3146505c40079ee9e7e692448e40a793dad636f55d1545063299d28908f0d static/maintenanceUf2/meshtastic_factory_erase.uf2
67
4b778a3def19854415db64cb51bfd29c15b11cc46006353dd518f62d09efe3fe static/maintenanceUf2/nrf_erase2.uf2
78
13941bedce009e61255c37b1524d11ca604e88c38e7588bb8b391e2998da468f static/maintenanceUf2/nrf_erase_sd7_3.uf2
89
08aa7d561e8b8bf2f9b061b3506fb4d8f135e832efe0f3ae978241db2da0c853 static/maintenanceUf2/pico_erase.uf2

‎tools/build-static.ts‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { createHash } from "node:crypto";
1212
import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
1313
import { dirname } from "node:path";
1414
import { sha256 } from "./canonical.js";
15+
import { collectEraseImages } from "./eraseImages.js";
1516

1617
export interface Entry {
1718
/** R2 object key. */
@@ -25,6 +26,8 @@ export interface Entry {
2526
readonly md5: string;
2627
}
2728

29+
const readJson = (p: string) => JSON.parse(readFileSync(p, "utf8"));
30+
2831
const OUT = "dist-static";
2932

3033
const ICONS = [
@@ -35,9 +38,17 @@ const ICONS = [
3538
"hamvention.png",
3639
];
3740

38-
// Every .uf2 the manifest can name. Kept as an explicit list and cross-checked by validate.ts
39-
// against data/maintenanceUf2.json, so a manifest entry can never point at an unpublished file.
40-
const UF2S = ["nrf_erase2.uf2", "nrf_erase_sd7_3.uf2", "pico_erase.uf2"];
41+
// Every .uf2 the manifest can name, read FROM the manifest via the same helper validate.ts uses.
42+
// It was a hardcoded list of three, with a comment asserting validate.ts cross-checked it; that
43+
// cross-check read only the `nrf52` and `rp2040` keys, so `erase.nrf52Bootloader` was published in
44+
// the manifest and never uploaded -- a 404 on the one flow ending in a bootloader write. Deriving
45+
// it makes that class of drift impossible rather than merely checked for.
46+
//
47+
// This is still an explicit per-file emit with a stated content-type, never a directory glob, so
48+
// ATTRIBUTION.md stays unpublished.
49+
const UF2S = collectEraseImages(readJson("data/maintenanceUf2.json").erase).map(
50+
(e) => e.fileName,
51+
);
4152

4253
const entries: Entry[] = [];
4354

‎tools/eraseImages.ts‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* The erase images named by data/maintenanceUf2.json, resolved from the manifest itself.
3+
*
4+
* This exists because the same list used to be written down twice -- an explicit `UF2S` array in
5+
* build-static.ts (what gets uploaded) and an explicit key list in validate.ts (what gets checked)
6+
* -- and the two silently disagreed the moment `erase.nrf52Bootloader` was added as an additive
7+
* sibling of `nrf52`/`rp2040`. The manifest named meshtastic_factory_erase.uf2 with its digest, no
8+
* upload ever emitted it, and the validator whose stated job is "a manifest naming a file we do
9+
* not publish is a build failure" walked straight past it, because an allowlist of keys cannot
10+
* fail closed against a schema designed to grow.
11+
*
12+
* Walking the tree for anything shaped like an entry means the publisher and the validator now
13+
* read the SAME list from the SAME place. A new erase key is picked up by both, or by neither.
14+
*/
15+
export interface EraseImage {
16+
readonly fileName: string;
17+
readonly sha256: string;
18+
}
19+
20+
const isEntry = (n: Record<string, unknown>): boolean =>
21+
typeof n.fileName === "string" && typeof n.sha256 === "string";
22+
23+
/**
24+
* Depth-first over `erase`, collecting every node carrying a fileName + sha256. Sorted by
25+
* fileName so the emitted R2 manifest is a pure function of the tree regardless of key order.
26+
*/
27+
export const collectEraseImages = (erase: unknown): EraseImage[] => {
28+
const out: EraseImage[] = [];
29+
const walk = (node: unknown): void => {
30+
if (!node || typeof node !== "object") return;
31+
const rec = node as Record<string, unknown>;
32+
if (isEntry(rec)) {
33+
out.push({
34+
fileName: rec.fileName as string,
35+
sha256: rec.sha256 as string,
36+
});
37+
return;
38+
}
39+
for (const child of Object.values(rec)) walk(child);
40+
};
41+
walk(erase);
42+
return out.sort((a, b) => (a.fileName < b.fileName ? -1 : 1));
43+
};

0 commit comments

Comments
 (0)