From 0f8fd26cca3ea8b80b7e3c4cb7207a35b9fb5abe Mon Sep 17 00:00:00 2001 From: Waozi Date: Mon, 26 Oct 2026 00:36:07 -0300 Subject: [PATCH] Open Arcade as a launcher under one megabyte A collection that does not pack the Apps controller opens with Breeze's own reviewed controller, also on the preparation worker, and its covers arrive as one separate art download published with its games. Pins the Apps host with both and the shared-code toolchain, and Kryon's browser missing-file fix. The 2.1.49 notes name the smaller Arcade and its plain covers. --- CHANGELOG.md | 7 +++++++ scripts/node_app_games.py | 9 ++++++++- src/apps/node_app_open.zi | 4 +++- src/apps/node_app_tree.zi | 10 +++++++++- tests/node_app_games_test.py | 14 ++++++++++++++ ziran.lock | 32 ++++++++++++++++---------------- 6 files changed, 57 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6158855a..f1a84eeba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.49] - 2026-10-25 + +- Download Arcade in under one megabyte; its games and their covers arrive separately. +- Arcade’s covers show only the game art; the download dialog shows the size. +- Install game editors with their required games and review the complete download size. +- Reuse Shovey’s downloaded artwork and sounds in its editor. + ## [2.1.48] - 2026-10-25 - Arcade uses large rounded game covers in the same dark library on every device. diff --git a/scripts/node_app_games.py b/scripts/node_app_games.py index cedf3c1b6..10fe22f25 100644 --- a/scripts/node_app_games.py +++ b/scripts/node_app_games.py @@ -20,7 +20,8 @@ def required_games(bundle): catalog = assets.get('assets/apps/catalog.json') if catalog is None: return set() - children = json.loads(catalog)['children'] + catalog = json.loads(catalog) + children = catalog['children'] if len(children) > GAME_LIMIT: raise ValueError('collection has too many games') names = set() @@ -31,6 +32,12 @@ def required_games(bundle): if not re.fullmatch(r'[0-9a-f]{64}', digest): raise ValueError('invalid game digest in catalog') names.add(digest + '.zx') + # The library art a collection does not pack downloads like a game. + art = catalog.get('art') + if art is not None and 'assets/apps/art.zx' not in assets: + if not re.fullmatch(r'[0-9a-f]{64}', art.get('sha256', '')): + raise ValueError('invalid art digest in catalog') + names.add(art['sha256'] + '.zx') return names diff --git a/src/apps/node_app_open.zi b/src/apps/node_app_open.zi index 5b1b938c3..ca95de32a 100644 --- a/src/apps/node_app_open.zi +++ b/src/apps/node_app_open.zi @@ -199,8 +199,10 @@ NodeOpenPump :: (activate: bool) -> bool { return true } if node_open_preparation == null { + // A collection without its own controller prepares with Breeze's. node_open_preparation = AppPrepare(node_open_work.bytes, - TextUntilNul(node_open_work.digest[:]), PackageID(NodeAppIndex(node_open_slot))) + TextUntilNul(node_open_work.digest[:]), PackageID(NodeAppIndex(node_open_slot)), + APP_PREPARATION_BYTE_LIMIT, null, NodeTreeController(null).data) if node_open_preparation == null { NodeOpenFail() } diff --git a/src/apps/node_app_tree.zi b/src/apps/node_app_tree.zi index 0ba7660d7..8ec97ee11 100644 --- a/src/apps/node_app_tree.zi +++ b/src/apps/node_app_tree.zi @@ -452,6 +452,14 @@ NodeTreeEffect :: (context: *void, account: string, locator: *AppLocator, return true } +// Breeze's own reviewed Apps controller, for a collection such as Arcade +// that does not pack one. The Apps host accepts it only by its digest. +NodeTreeController :: (context: *void) -> HostedAsset { + unused context + bytes := AssetRead("apps.zx") + return HostedAsset.{.found = bytes.found, .data = bytes.data} +} + // verified is the digest the package manager just checked these bytes // against, or empty to hash them here; either way the Apps host does not // hash the whole bundle again. @@ -480,7 +488,7 @@ NodeTreeStart :: (runner: *NodeAppRunner, bytes: string, verified: string, platform := AppPlatform.{.context = cast(*void)runner, .allows = NodeTreeAllows, .call = NodeTreeCall, .widgets = NodeTreeWidgets, .save = NodeTreeSave, .state = NodeTreeState, .effect = NodeTreeEffect, .bundle = NodeChildBundle, - .download = NodeChildDownload, .fetch = NodeChildFetch} + .download = NodeChildDownload, .fetch = NodeChildFetch, .controller = NodeTreeController} ready := false if preparation != null { ready = AppHostStartPrepared(host, preparation, TextUntilNul(authority[:]), PackageID(NodeAppIndex(slot)), diff --git a/tests/node_app_games_test.py b/tests/node_app_games_test.py index 893bf596f..394d7de06 100644 --- a/tests/node_app_games_test.py +++ b/tests/node_app_games_test.py @@ -54,6 +54,20 @@ class GameArchiveTests(unittest.TestCase): self.bundle.write_bytes(fixture_bundle({})) self.assertEqual(required_games(self.bundle), set()) + def test_unpacked_art_downloads_like_a_game(self): + art = b'ZX\0\0library art' + name = sha256(art).hexdigest() + '.zx' + catalog = {'children': [self.child], 'art': {'sha256': name[:-3], 'bytes': len(art)}} + self.bundle.write_bytes(fixture_bundle({'assets/apps/catalog.json': json.dumps(catalog).encode()})) + self.assertEqual(required_games(self.bundle), {self.name, name}) + self.archive_games([(self.name, self.game), (name, art)]) + stage_games(self.bundle, self.archive, self.output) + self.assertEqual(sorted(path.name for path in self.output.iterdir()), sorted([self.name, name])) + catalog['art']['sha256'] = 'not a digest' + self.bundle.write_bytes(fixture_bundle({'assets/apps/catalog.json': json.dumps(catalog).encode()})) + with self.assertRaisesRegex(ValueError, 'invalid art digest'): + required_games(self.bundle) + def test_exact_download_is_staged_without_stale_games(self): self.output.mkdir() (self.output / 'old.zx').write_bytes(b'old') diff --git a/ziran.lock b/ziran.lock index 9d095b545..62c993914 100644 --- a/ziran.lock +++ b/ziran.lock @@ -1,6 +1,14 @@ { "format": 1, "packages": [ + { + "commit": "af0f938dcdc301257fee19b7fd62cd0d5b9ed76d", + "dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "p668d6e1e4a4cf2bb"}, + "id": "pd8bc546029ba54a6", + "name": "Apps", + "ref": "master", + "url": "https://github.com/waozixyz/apps.git" + }, { "commit": "b31299434c785d0f2bd82f36b5bfd2fd36ba1216", "dependencies": {}, @@ -20,7 +28,7 @@ }, { "commit": "1cb9df183089a77c8a16448a556186f30b261a98", - "dependencies": {"kryon": "p2d318e48a4d2aa44"}, + "dependencies": {"kryon": "p668d6e1e4a4cf2bb"}, "id": "p1b13dda539ed2a39", "name": "Kss", "ref": "master", @@ -28,16 +36,16 @@ }, { "commit": "bad2caaa84ef3eae61e40c99bf572d2b060d0ca2", - "dependencies": {"kryon": "p2d318e48a4d2aa44"}, + "dependencies": {"kryon": "p668d6e1e4a4cf2bb"}, "id": "p20eb23d3e6db3711", "name": "Game2D", "ref": "master", "url": "https://github.com/kryonlabs/game2d.git" }, { - "commit": "92ca1fd68ced43969df57632720060ee9666da16", + "commit": "b20836cf38d0e70247439c882b70d951efdff11c", "dependencies": {"raylib": "p5a77c9c35110e925"}, - "id": "p2d318e48a4d2aa44", + "id": "p668d6e1e4a4cf2bb", "name": "kryon", "ref": "master", "url": "https://github.com/kryonlabs/kryon.git" @@ -96,7 +104,7 @@ }, { "commit": "3f888653b6b97010163d824c4cc72476be3214f3", - "dependencies": {"kryon": "p2d318e48a4d2aa44"}, + "dependencies": {"kryon": "p668d6e1e4a4cf2bb"}, "id": "pab5377a2950368a2", "name": "plot", "ref": "master", @@ -127,14 +135,6 @@ "ref": "master", "url": "https://github.com/kryonlabs/mingcute.git" }, - { - "commit": "489788be514c4c5d8cf7a68945b4208da767a3ba", - "dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "p2d318e48a4d2aa44"}, - "id": "pe47c1aa8cd7bc05e", - "name": "Apps", - "ref": "master", - "url": "https://github.com/waozixyz/apps.git" - }, { "commit": "58626f682afbc2e3467e8c2e5b37f7f29d89ed99", "dependencies": {}, @@ -146,7 +146,7 @@ }, { "commit": "e05dbce942cdc40e9ae4878018966a88b2b76b9f", - "dependencies": {"daochi_client": "p750b89a9c1c4b56b", "kryon": "p2d318e48a4d2aa44", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"}, + "dependencies": {"daochi_client": "p750b89a9c1c4b56b", "kryon": "p668d6e1e4a4cf2bb", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"}, "id": "pf12aee7fe9383c11", "name": "Entity", "ref": "master", @@ -154,11 +154,11 @@ } ], "root": { - "dependencies": {"apps": "pe47c1aa8cd7bc05e", "crypto": "pc23fbf455e97614d", "curl": "pd4bcd11b7d623073", "daochi_client": "p750b89a9c1c4b56b", "entity": "pf12aee7fe9383c11", "game2d": "p20eb23d3e6db3711", "kryon": "p2d318e48a4d2aa44", "kss": "p1b13dda539ed2a39", "liboqs": "p4b0a50b49959e674", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "practices": "pa020981edfd0b927", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "sqlite": "peaa43c4b7ef72edf"}, + "dependencies": {"apps": "pd8bc546029ba54a6", "crypto": "pc23fbf455e97614d", "curl": "pd4bcd11b7d623073", "daochi_client": "p750b89a9c1c4b56b", "entity": "pf12aee7fe9383c11", "game2d": "p20eb23d3e6db3711", "kryon": "p668d6e1e4a4cf2bb", "kss": "p1b13dda539ed2a39", "liboqs": "p4b0a50b49959e674", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "practices": "pa020981edfd0b927", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "sqlite": "peaa43c4b7ef72edf"}, "name": "Inbe" }, "toolchain": { - "commit": "2eafe31e2a0d0c30bb24c3ae70995c76de38f7ba", + "commit": "5efa24f818485cf265bdd5c066a4e2150175ac0e", "ref": "master", "url": "https://github.com/ziranlang/ziran.git" }