Compare commits

..
Author SHA1 Message Date
waozi 6e58768825 Save Arcade's unfinished reminder and pin work 2026-11-02 11:12:09 -03:00
94 changed files with 855 additions and 2470 deletions

No files matched your search

-49
View File
@@ -1,49 +0,0 @@
name: Export locked games
description: Prepare game-owned exports, downloading Wurm's compiled release unchanged.
runs:
using: composite
steps:
- id: games
shell: bash
working-directory: waozixyz/arcade
run: |
python3 - <<'PY' >> "$GITHUB_OUTPUT"
import json
lock = json.load(open('ziran.lock'))
for name in ('shovey', 'wurm', 'choano'):
identifier = lock['root']['dependencies'][name]
print(name + '=' + next(p['commit'] for p in lock['packages'] if p['id'] == identifier))
PY
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: waozixyz/shovey
ref: ${{ steps.games.outputs.shovey }}
path: waozixyz/shovey
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: waozixyz/wurm
ref: ${{ steps.games.outputs.wurm }}
path: waozixyz/wurm
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: waozixyz/choano
ref: ${{ steps.games.outputs.choano }}
path: waozixyz/choano
- shell: bash
working-directory: waozixyz/arcade
run: |
python3 - <<'PY'
from pathlib import Path
for name in ('shovey', 'choano'):
(Path('..') / name / 'ziran.local.toml').write_text('[overrides]\nziran = "../../ziranlang/ziran"\n')
Path('ziran.local.toml').write_text('[overrides]\nziran = "../../ziranlang/ziran"\nshovey = "../shovey"\nwurm = "../wurm"\nchoano = "../choano"\n')
PY
(cd ../shovey && make levels landscape && python3 scripts/player.py collection --web)
(cd ../choano && make portable)
- name: Download the pinned Wurm portable release
shell: bash
working-directory: waozixyz/arcade
env:
GH_TOKEN: ${{ github.token }}
WURM_COMMIT: ${{ steps.games.outputs.wurm }}
run: python3 scripts/fetch-wurm-export.py --source ../wurm --commit "$WURM_COMMIT"
+1 -2
View File
@@ -119,12 +119,11 @@ jobs:
# The game is generated in its own checkout at the locked release.
printf '[overrides]\nshovey = "../shovey"\nziran = "../../ziranlang/ziran"\n' > ziran.local.toml
../../ziranlang/ziran/build/bin/ziran fetch
- name: Export games in their owning repositories
uses: ./waozixyz/arcade/.github/actions/game-exports
- name: Build the APK
env:
EDITION: ${{ matrix.edition }}
run: |
make -C ../shovey levels landscape
if [ "$EDITION" = direct ]; then make android; else make "android-$EDITION"; fi
- name: Keep Google libraries out of the normal and F-Droid APK
if: matrix.edition != 'gplay'
+2 -5
View File
@@ -36,7 +36,6 @@ jobs:
run: |
python3 tests/game_updates_test.py
python3 tests/catalog_versions_test.py
python3 tests/wurm_export_test.py
- name: Find newer game releases
id: updates
env:
@@ -63,7 +62,7 @@ jobs:
- name: Install build dependencies
if: steps.updates.outputs.changed == 'true'
working-directory: .
run: sh ziranlang/ziran/scripts/ci_packages.sh build-essential python3-pil python3-numpy python3-cryptography
run: sh ziranlang/ziran/scripts/ci_packages.sh build-essential python3-pil python3-cryptography
- name: Build the locked toolchain and pin game dependencies
id: pin
if: steps.updates.outputs.changed == 'true'
@@ -100,12 +99,10 @@ jobs:
python3 scripts/follow-game-releases.py art
echo "version=$(cat catalog/VERSION)" >> "$GITHUB_OUTPUT"
head -12 catalog/CHANGELOG.md
- name: Prepare game-owned exports
if: steps.updates.outputs.changed == 'true'
uses: ./waozixyz/arcade/.github/actions/game-exports
- name: Build and check the collection
if: steps.updates.outputs.changed == 'true'
run: |
make -C ../shovey levels landscape
make collection
python3 tests/collection_test.py
python3 tests/publisher_test.py
+1 -2
View File
@@ -64,12 +64,11 @@ jobs:
# Generate the game in its own checkout, never in the package cache.
printf '[overrides]\nshovey = "../shovey"\nziran = "../../ziranlang/ziran"\n' > ziran.local.toml
../../ziranlang/ziran/build/bin/ziran fetch
- name: Export games in their owning repositories
uses: ./waozixyz/arcade/.github/actions/game-exports
- name: Build and verify the node catalog
env:
EXPECTED_SHA256: ${{ inputs.sha256 }}
run: |
make -C ../shovey levels landscape
make collection
python3 tests/collection_test.py
python3 tests/publisher_test.py
+8 -17
View File
@@ -3,9 +3,7 @@ name: Website
# https://arcade.waozi.xyz runs Arcade in the browser: the latest published
# arcade.zx, the same one Inner Breeze downloads, with Arcade's own host
# compiled to WebAssembly. Every push to master and every Arcade release,
# manual or automatic, rebuilds and publishes it. The host builds from the
# source and toolchain that release was tagged at: master may already lock a
# newer program format the published arcade.zx does not carry yet.
# manual or automatic, rebuilds and publishes it.
on:
push:
branches: [master]
@@ -36,18 +34,6 @@ jobs:
path: waozixyz/arcade
ref: master
fetch-depth: 0
- name: Check out the published Arcade's source
id: published
env:
GH_TOKEN: ${{ github.token }}
run: |
tag=$(gh release list --repo waozixyz/arcade --limit 50 --json tagName,isDraft \
-q '[.[] | select(.isDraft | not) | .tagName | select(startswith("node-arcade-"))][0]')
test -n "$tag"
git fetch --force origin "refs/tags/$tag:refs/tags/$tag"
git checkout --detach "refs/tags/$tag"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "version=${tag#node-arcade-}" >> "$GITHUB_OUTPUT"
- name: Read the locked toolchain
id: toolchain
run: |
@@ -74,13 +60,18 @@ jobs:
printf '[overrides]\nziran = "../../ziranlang/ziran"\n' > ziran.local.toml
../../ziranlang/ziran/build/bin/ziran fetch
- name: Download the published Arcade
id: published
env:
GH_TOKEN: ${{ github.token }}
run: |
tag=$(gh release list --repo waozixyz/arcade --limit 50 --json tagName,isDraft \
-q '[.[] | select(.isDraft | not) | .tagName | select(startswith("node-arcade-"))][0]')
test -n "$tag"
mkdir -p build/published
# Its game archive holds the library art the site serves itself.
gh release download '${{ steps.published.outputs.tag }}' --repo waozixyz/arcade \
--pattern arcade.zx --pattern arcade.games.tar --dir build/published
gh release download "$tag" --repo waozixyz/arcade --pattern arcade.zx \
--pattern arcade.games.tar --dir build/published
echo "version=${tag#node-arcade-}" >> "$GITHUB_OUTPUT"
- name: Build the browser edition
run: |
python3 tests/web_library_art_test.py
+6 -15
View File
@@ -2,23 +2,14 @@
## [Unreleased]
- Runs games built for the latest Inner Breeze.
- Support evening chest reminders from compatible games on Android, with the device's notification permission and only the selected game counted as opened.
## 0.7.120
- Password fields start empty and show one star per character, including long passwords.
- Library covers show their original painted artwork again.
- Landscape uses the same cover carousel as portrait, on a scenic background.
- Clicking or tapping a cover beside the centre selects it; the centre cover starts the game.
- Missing games download on their cover with a progress bar while you keep browsing.
- Updating Arcade no longer brings back an older saved library with the wrong artwork.
- Shovey opens its proper title with the daily chest, profile and swipeable covers.
## 0.7.119
- Browse an artwork-led console shelf in portrait or landscape, with painted profile and Dew controls.
- Download games from their launch screens and return Home with progress saved; editors and drafts stay inside their games.
- Improve account sign-in, password entry and Android chest reminders.
- Preserve installed games and saves across library, host and Breeze updates.
- Use Entity's reviewed account authorization and shared Apps controller.
- Keep the full game collection within the host payload limit by packing opaque pictures without redundant alpha data; decoded pixels stay identical.
- On Android, Continue as can use the account from another signed-in Waozi app, once you approve it there.
- Arcade and its games open again in Breeze builds that read the previous app bundle format.
## 0.7.117
+2 -15
View File
@@ -7,8 +7,6 @@ KRYON_DIR = $(shell $(ZIRAN) pkg path kryon $(LOCK_FLAGS))
# The shared Apps controller is built from the locked Apps package. Arcade
# trusts only the reviewed digest committed in apps-controller.sha256.
ENTITY_DIR = $(shell $(ZIRAN) pkg path entity $(LOCK_FLAGS))
# Optional manifest of already exported game artifacts (never compiler inputs).
GAME_ARTIFACT_MANIFEST ?=
APPS_BUNDLE := build/apps-ui/apps.zx
APPS_SHA256 := $(shell cat apps-controller.sha256)
INBE_SOURCE ?= $(shell $(ZIRAN) pkg path inbe $(LOCK_FLAGS))
@@ -23,7 +21,7 @@ all: collection build/entity.zx build/arcade build/shovey
games:
python3 scripts/check-games.py --ziran '$(ZIRAN)' $(LOCK_FLAGS)
python3 scripts/build-games.py --ziran '$(ZIRAN)' $(LOCK_FLAGS) $(if $(GAME_ARTIFACT_MANIFEST),--artifact-manifest '$(GAME_ARTIFACT_MANIFEST)')
python3 scripts/build-games.py --ziran '$(ZIRAN)' $(LOCK_FLAGS)
$(APPS_BUNDLE): ziran.lock apps-controller.sha256 scripts/build-apps.py Makefile
$(ZIRAN) version > /dev/null
@@ -35,11 +33,6 @@ collection: games $(APPS_BUNDLE)
python3 scripts/build-collection.py --ziran '$(ZIRAN)' $(LOCK_FLAGS) \
--apps-bundle '$(APPS_BUNDLE)' --apps-sha256 '$(APPS_SHA256)'
.PHONY: game-artifacts-test
game-artifacts-test:
python3 tests/game_artifacts_test.py
python3 tests/wurm_export_test.py
collection-test:
python3 tests/collection_test.py
@@ -66,9 +59,6 @@ run: all
./build/arcade
test: all
python3 tests/catalog_versions_test.py
python3 tests/game_artifacts_test.py
python3 tests/wurm_export_test.py
python3 tests/game_host_compatibility_test.py
python3 tests/collection_notifications_test.py
python3 tests/game_module_paths_test.py
@@ -86,6 +76,7 @@ test: all
python3 tests/web_library_art_test.py
./build/arcade --list
sh tests/chess_engine_zi_test.sh '$(ZIRAN)'
sh tests/chess_app_test.sh '$(ZIRAN)'
python3 tests/sound_test.py
sh tests/collection_loading_test.sh
@@ -136,8 +127,6 @@ install-arcade: collection build/entity.zx build/arcade
mv -f '$(LIB_DIR)/arcade.new' '$(LIB_DIR)/arcade'
install -m 0644 build/entity.zx build/arcade.zx build/arcade.json '$(LIB_DIR)/'
install -m 0644 '$(APPS_BUNDLE)' '$(LIB_DIR)/apps.zx'
mkdir -p '$(LIB_DIR)/assets/hud'
install -m 0644 build/assets/hud/profile.webp build/assets/hud/dew.webp '$(LIB_DIR)/assets/hud/'
ln -sfn '$(LIB_DIR)/arcade' '$(BIN_DIR)/arcade'
install -m 0644 packaging/xyz.waozi.arcade.desktop '$(DATA_DIR)/applications/'
@@ -151,8 +140,6 @@ install: all install-arcade
mv -f '$(LIB_DIR)/shovey.new' '$(LIB_DIR)/shovey'
install -m 0644 build/entity.zx build/arcade.zx build/arcade.json build/shovey.zx build/shovey.json '$(LIB_DIR)/'
install -m 0644 '$(APPS_BUNDLE)' '$(LIB_DIR)/apps.zx'
mkdir -p '$(LIB_DIR)/assets/hud'
install -m 0644 build/assets/hud/profile.webp build/assets/hud/dew.webp '$(LIB_DIR)/assets/hud/'
ln -sfn '$(LIB_DIR)/arcade' '$(BIN_DIR)/arcade'
ln -sfn '$(LIB_DIR)/shovey' '$(BIN_DIR)/shovey'
mkdir -p '$(DATA_DIR)/icons/hicolor/256x256/apps'
+17 -61
View File
@@ -1,17 +1,9 @@
# Arcade
Games and entertainment, alongside Werkzeug for practical tools and Inner
Breeze for personal growth. Arcade opens on a console home from the shared Apps controller.
Landscape fills the screen with the selected game’s screenshot above one bottom
row of wide covers. Portrait centers a large tall cover, with neighbours peeking
in and the same game colouring the background. A glowing outline marks focus. There is no home title or cover caption.
Arrow keys, controller D-pad or left stick, swipes and the wheel select games;
Enter or controller A opens the selection. Click a cover to open
an installed game or open its artwork launch page first. Download consent,
progress and retry stay in that page, without a modal. Back keeps the transfer
running and returns to the same selected cover. Verified games open their own
title screen. A house-shaped Arcade control stays above hosted games and editors;
F1 or a controller’s View/Select button returns directly to the library after saving.
Breeze for personal growth. Arcade opens on a dark grid of large rounded
title-screen covers from the shared Apps controller. Click a cover to open
an installed game or download it first. There are no separate launch buttons.
Standalone Shovey opens on its own cover carousel;
swipe, use the arrows or scroll the wheel to choose, then press Play/Open.
Its desktop startup first draws a small full-colour title preview, then uses
@@ -21,21 +13,16 @@ existing saved games remain available for a later return.
Each edition has a separate save and earned unlocks. Unlocked puzzles show
their whole board; locked puzzles keep their lock until earned.
The published Arcade carries only its catalog, well under one megabyte. Its host supplies the shared Apps controller (Inner Breeze its own, standalone Arcade the `apps.zx` installed beside it), and the covers and previews download once as one separate art bundle. Library previews stay at 256 pixels. Real gameplay screenshots supply landscape heroes up to 1600 pixels and portrait covers up to 1080 pixels on the longest side, encoded as quality-80 WebP. The complete separate art bundle has a 2 MiB budget for the current games. Full-size originals stay in their game repositories. The verified art bundle stays cached across restarts and is replaced when its content changes. The art lives in `assets/arcade/library/` (`python3 scripts/library-art.py` refreshes it when a game's art changes; the build stops until it does). Inner Breeze needs host interface 35 for it. Each game
The published Arcade carries only its catalog, well under one megabyte. Its host supplies the shared Apps controller (Inner Breeze its own, standalone Arcade the `apps.zx` installed beside it), and the covers and previews download once as one separate art bundle. Library covers use thumbnails up to 640 pixels on their longest side, and logos up to 512 pixels, preserving full colours and transparency. Games keep their original artwork. The verified art bundle stays cached across restarts and is replaced when its content changes. The art lives in `assets/arcade/library/` (`python3 scripts/library-art.py` refreshes it when a game's art changes; the build stops until it does). Inner Breeze needs host interface 35 for it. Each game
downloads when opened, with its existing identity and saved progress. This
catalog requires Inner Breeze host API 43. Downloaded games work offline;
catalog requires Inner Breeze host API 41. Downloaded games work offline;
standalone Shovey keeps its complete offline collection. Apfelwurm comes from
its own package, with the same game identity and private editor records.
Arcade lists games only. Each game opens on its own normal title screen.
Editors open from inside their games; installed editor add-ons and saved drafts
keep their existing identities and records. Shovey’s Classic editor remains an
add-on. Its named install dialog lists Shovey when needed and shows the total
download size. The Island editor stays private. Once Shovey is installed, only
Shovey Editor is an add-on to Shovey. Its install dialog lists Shovey when it
is needed and shows the total download size. Once Shovey is installed, only
the editor’s additions download. The editor reuses the original game’s art
and sounds, and both remain available offline. The top-right HUD uses the shared
painted Dew jewel and profile medallion in one frame. Its two icons ship with the
host independently of the remote library, so they also work offline.
and sounds, and both remain available offline.
Chess’s retained implementation can choose a side and one of four computer
levels. A local game
@@ -61,17 +48,16 @@ review are not implemented.
Arcade includes the reviewed shared `apps.zx` controller and a small seed
catalog. It asks before connecting to its node for the signed app library
and compressed previews. Profile’s Library connection control can switch back to offline;
and compressed previews. The connection control can switch back to offline;
verified cached apps, previews and saved progress remain available.
The catalog fixes the digest of every separately downloaded game. Each game package lists its apps in its own `apps.json`:
the app's `catalog.json`, and for an app the library opens from a cover, the
cover's portrait art, landscape art and action. `games.json`
cover's portrait art, landscape art, logo, caption and action. `games.json`
names the game packages, and Arcade's own `apps.json` its own apps. Arcade
presents the games directly, and a cover opens the game's normal title screen.
Editor add-ons remain declared for verified installation and save compatibility,
and open from inside their game. Shovey’s separate standalone collection uses
the same game identities and saves. The shared Apps console handles navigation
and painting with Kryon widgets. Library refreshes use the reusable Apps signed catalog
presents every declared leaf directly, without a second chooser, and a cover
opens its app straight into play or editing. Shovey’s separate standalone
collection uses the same leaves and saves. Kryon’s shared `Carousel` handles
navigation and painting. Library refreshes use the reusable Apps signed catalog
loader and do not update the native host. Inbe supplies its own account and package policy.
Arcade's launcher icon is MingCute's `game_2` gamepad (Apache-2.0).
@@ -184,39 +170,9 @@ release. An APK's embedded seed catalog may have a different version from
its native host.
Game packages are registered in `games.json`; each declares its apps in its
`apps.json`. Arcade is a catalog and downloader: games build and publish
in their own repositories. `scripts/build-games.py` imports their portable
exports byte for byte and generates catalog metadata; it never compiles game
source, prepares assets, or runs game payloads. Disabled entries remain catalog
metadata only, and private external editions (including Island) stay excluded.
Before a local integrated build, export in each owning repository:
- Shovey: `build-queue -- python3 scripts/player.py collection --web` exports
`build/player/games/{shovey,shovey-editor}.zx` and `-resources.json`.
- Wurm: `build-queue -- python3 tools/build_portable.py` exports
`build/games/{wurm,wurm-editor}.zx`, `-resources.json` and `-preview.png`.
- Choano: `build-queue -- make portable` exports `build/choano.zx`.
Shovey and Choano previews come unchanged from their declared game preview
paths. Every payload must embed its public app catalog at
`assets/NAME/catalog.json`; add-ons must also embed `requirements.json` naming
the exact imported dependency hashes. Import rejects identity, entry, resource
link and dependency mismatches and payloads over 64 MiB before replacing prior
staged games or catalogs. No compiler fallback exists.
Clean locked/downloaded packages may have no local exports. Supply
`--artifact-manifest PATH` to the importer (or `make
GAME_ARTIFACT_MANIFEST=PATH`) with already exported artifacts. The JSON shape
is `{"apps":{"APP_ID":{"bundle":"exports/game.zx",
"preview":"exports/preview.png","resources":"exports/game-resources.json"}}}`.
Paths are relative to the manifest or absolute; name exactly the enabled public
IDs, including editor add-ons. `resources` may be omitted only for apps with
no dependencies. Payloads and supplied sidecars are copied unchanged.
Automatic remote release artifact retrieval/export wiring is not currently
available here: obtain exports from the game owner or run its command above.
The existing published web catalog build does not invoke game builds.
Inbe remains a dependency for the existing shared interface and signed publisher.
`apps.json`. `scripts/build-games.py` generates the catalog and bundles
every declared app. Inbe remains a dependency for the existing shared interface
and signed publisher, rather than for the Chess implementation.
## Saved games
+1 -1
View File
@@ -1 +1 @@
0.7.120
0.7.117
+1 -1
View File
@@ -1 +1 @@
72fcca7bdf1264c77e44a45c30d6d5dd32c137b5ab985d4335941aef4c0ab148
367e6e4a787467e0c2d3dc428749eb700031cc1cb0db16f730d2639bb8bcd33d
-4
View File
@@ -1,9 +1,5 @@
# Chess changelog
## [1.2.2] - 2026-11-07
- Runs in the latest Inner Breeze and Arcade.
## [1.2.1] - 2026-10-29
- Runs in Inner Breeze 2.1.61's smaller app format.
+1 -1
View File
@@ -5,7 +5,7 @@
"kind": "game",
"contract_version": 1,
"module_api": 2,
"host_api": 43,
"host_api": 41,
"save_schema": 1,
"harnesses": ["arcade", "inbe"],
"entry": "chess:Main",
+23 -23
View File
@@ -1,56 +1,56 @@
{
"host_api": 43,
"oldest_host_api": 43,
"host_api": 42,
"oldest_host_api": 41,
"module_api": 2,
"node_apps": {
"chess": {
"id": "inbe.chess",
"title": "Chess",
"version": "1.2.2",
"sequence": 7,
"host_api": 43
"version": "1.2.1",
"sequence": 6,
"host_api": 41
},
"choano": {
"id": "xyz.waozi.choano",
"title": "Choano",
"version": "0.1.9",
"sequence": 4,
"host_api": 43
"version": "0.1.8",
"sequence": 3,
"host_api": 41
},
"shovey": {
"id": "arcade.shovey",
"title": "Shovey",
"version": "0.6.169",
"sequence": 175,
"host_api": 43
"version": "0.6.163",
"sequence": 170,
"host_api": 41
},
"shovey-editor": {
"id": "arcade.shovey-editor",
"title": "Shovey Editor",
"version": "0.2.149",
"sequence": 151,
"host_api": 43
"version": "0.2.147",
"sequence": 149,
"host_api": 41
},
"arcade": {
"id": "inbe.arcade",
"title": "Arcade",
"version": "0.7.124",
"sequence": 203,
"host_api": 43
"version": "0.7.118",
"sequence": 197,
"host_api": 41
},
"wurm": {
"id": "xyz.waozi.wurm",
"title": "Apfelwurm",
"version": "0.2.33",
"sequence": 27,
"host_api": 43
"version": "0.2.29",
"sequence": 24,
"host_api": 42
},
"wurm-editor": {
"id": "xyz.waozi.wurm-editor",
"title": "Apfelwurm Editor",
"version": "0.1.2",
"sequence": 3,
"host_api": 43
"version": "0.1.1",
"sequence": 2,
"host_api": 41
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

+17 -42
View File
@@ -1,78 +1,53 @@
{
"choano-landscape": {
"source_sha256": "1ca6e31c1062a7cca41bace4cf1bb221291988aea4a1dd61271899c2f5f28307",
"crop_top": 0
"source_sha256": "1ca6e31c1062a7cca41bace4cf1bb221291988aea4a1dd61271899c2f5f28307"
},
"choano-portrait": {
"source_sha256": "47b07722c474a67ee4a06b7644a3aff211503674391e363c17eb06a34ce60d6c",
"crop_top": 0
"source_sha256": "47b07722c474a67ee4a06b7644a3aff211503674391e363c17eb06a34ce60d6c"
},
"choano-preview": {
"source_sha256": "1ca6e31c1062a7cca41bace4cf1bb221291988aea4a1dd61271899c2f5f28307",
"crop_top": 0
},
"hud-dew": {
"source_sha256": "5a08721b436dcbe99ce69758d02dd56d84f7f3b9990856528990e0ce11a77443",
"crop_top": 0
},
"hud-profile": {
"source_sha256": "0c38b54870cd7a921e6a63126724c4877d81bc5edbdf61e4baefe860e82b2c39",
"crop_top": 0
"source_sha256": "1ca6e31c1062a7cca41bace4cf1bb221291988aea4a1dd61271899c2f5f28307"
},
"shovey-editor-landscape": {
"source_sha256": "7b1eae4209ede14807806a4cbce1e2bf7a14d342e75c89042958a524cf60d67e",
"crop_top": 0
"source_sha256": "7b1eae4209ede14807806a4cbce1e2bf7a14d342e75c89042958a524cf60d67e"
},
"shovey-editor-logo": {
"source_sha256": "5417341ed432c49d4ce1df45e5e6bf7e07e11a81face45cb93d7cc9fa976f7a5",
"crop_top": 0
"source_sha256": "5417341ed432c49d4ce1df45e5e6bf7e07e11a81face45cb93d7cc9fa976f7a5"
},
"shovey-editor-portrait": {
"source_sha256": "bf0bbeb15249f3d73c1b410e9737f7fd207310dcb5f28b7c3ce45401b77c8f9e",
"crop_top": 0
"source_sha256": "bf0bbeb15249f3d73c1b410e9737f7fd207310dcb5f28b7c3ce45401b77c8f9e"
},
"shovey-editor-preview": {
"source_sha256": "bcbf63563187f9dcdb6c7580f638e2fb2770b221240ee5699e54dc3c00be172c",
"crop_top": 0
"source_sha256": "bcbf63563187f9dcdb6c7580f638e2fb2770b221240ee5699e54dc3c00be172c"
},
"shovey-landscape": {
"source_sha256": "40c01eb8300e4c5db52b2d75373e17cdaf7f68140c33c0a225613fc174660747",
"crop_top": 0
"source_sha256": "40c01eb8300e4c5db52b2d75373e17cdaf7f68140c33c0a225613fc174660747"
},
"shovey-logo": {
"source_sha256": "e47781aa3328f68077589f95d813e9c2e6fff10ebd62a9d003773bb2c2f7a092",
"crop_top": 0
"source_sha256": "e47781aa3328f68077589f95d813e9c2e6fff10ebd62a9d003773bb2c2f7a092"
},
"shovey-portrait": {
"source_sha256": "ddcbf989eab5971157d8cdc73494ed03660bb4c7a7679543248f45be260777e3",
"crop_top": 0
"source_sha256": "ddcbf989eab5971157d8cdc73494ed03660bb4c7a7679543248f45be260777e3"
},
"shovey-preview": {
"source_sha256": "96db251f36835c76cd03cd0104a6e1b5096e4c442d410960457edcd8e2377a38",
"crop_top": 0
"source_sha256": "96db251f36835c76cd03cd0104a6e1b5096e4c442d410960457edcd8e2377a38"
},
"wurm-editor-landscape": {
"source_sha256": "b3616e68f1b391d1a4f9dd5d91538a63a889a7f977991e625831ec9caffa71c5",
"crop_top": 0
"source_sha256": "b3616e68f1b391d1a4f9dd5d91538a63a889a7f977991e625831ec9caffa71c5"
},
"wurm-editor-portrait": {
"source_sha256": "07ff2ff0142c262cdcba3643bbc4d7d3d71643b7f9f4e678a910fee2bfd3eba1",
"crop_top": 0
"source_sha256": "07ff2ff0142c262cdcba3643bbc4d7d3d71643b7f9f4e678a910fee2bfd3eba1"
},
"wurm-editor-preview": {
"source_sha256": "b3616e68f1b391d1a4f9dd5d91538a63a889a7f977991e625831ec9caffa71c5",
"crop_top": 0
"source_sha256": "b3616e68f1b391d1a4f9dd5d91538a63a889a7f977991e625831ec9caffa71c5"
},
"wurm-landscape": {
"source_sha256": "472773b7c106325e12777a81a29209496e22e0853782ca76955b6587824b1b30",
"crop_top": 0
"source_sha256": "472773b7c106325e12777a81a29209496e22e0853782ca76955b6587824b1b30"
},
"wurm-portrait": {
"source_sha256": "e8962c969f554567d598eb0b54db5836f7f1ed7462619463040c6cc2887a5a47",
"crop_top": 0
"source_sha256": "e8962c969f554567d598eb0b54db5836f7f1ed7462619463040c6cc2887a5a47"
},
"wurm-preview": {
"source_sha256": "472773b7c106325e12777a81a29209496e22e0853782ca76955b6587824b1b30",
"crop_top": 0
"source_sha256": "472773b7c106325e12777a81a29209496e22e0853782ca76955b6587824b1b30"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

-41
View File
@@ -1,46 +1,5 @@
# Arcade catalog changelog
## 0.7.124
- Apfelwurm 0.2.33: Runs in the latest Inner Breeze and Arcade.
- Choano 0.1.9: Runs in the latest Inner Breeze and Arcade.
- Choano 0.1.9: Supply genuine gameplay screenshots and a self-identifying portable bundle for Arcade’s console library.
- Choano 0.1.9: Keep the Profile title bar clear of the camera and status bar on Android.
- Choano 0.1.9: Let the Android app reach the network, so online sign-in, backups and Friends work.
- Choano 0.1.9: Keep the account key out of Android system backups, which have no passphrase.
- Choano 0.1.9: Use Entity's reviewed account authorization and the shared game navigation modules.
- Choano 0.1.9: On Android, Continue as can use the account from another signed-in Waozi app, once you approve it there.
- Choano 0.1.9: Continue as no longer crashes the other app when it was closed.
## 0.7.123
- Arcade and its games run in the latest Inner Breeze: Shovey 0.6.169, Apfelwurm 0.2.33 and Choano 0.1.9.
## 0.7.122
- Shovey 0.6.168: Play the first 30 Island levels with working downloads and a working Play button.
- Shovey 0.6.168: Start Classic or Island levels of your own from the Editor.
- Shovey 0.6.168: Follow Shovey in his map circle, with more water along the landscape coast and a secret on the beach.
## 0.7.121
- Keep Apfelwurm and its editor available when the game library updates.
- Shovey 0.6.167: The level result, book, shop and item texts show again in every language.
- Shovey 0.6.167: Your account's progress arrives quietly and quickly; the map no longer says it is loading.
- Apfelwurm 0.2.32: Include Apfelwurm and its editor in Arcade's automatic game updates.
## 0.7.120
- Show the original painted covers for Shovey, Apfelwurm and Choano.
- Browse covers on a scenic background in portrait and landscape; a side cover selects, the centre cover plays.
- Download missing games on their cover with a progress bar while browsing.
- Shovey opens its proper title with the daily chest, profile and swipeable covers.
## 0.7.119
- Browse the new console shelf, open games from their artwork and return Home with progress saved.
- Keep editors and saved drafts inside their games.
## 0.7.118
- Apfelwurm 0.2.28: The editor title painting includes the Apfelwurm Editor logo in portrait and landscape.
+1 -1
View File
@@ -1 +1 @@
0.7.124
0.7.118
+2 -8
View File
@@ -1,10 +1,4 @@
{
"packages": [
"shovey",
"wurm",
"choano"
],
"artwork": {
"wurm": "wurm_art"
}
"packages": ["shovey", "wurm", "choano"],
"artwork": {"wurm": "wurm_art"}
}
+1 -1
View File
@@ -1 +1 @@
198
196
+1 -12
View File
@@ -7,7 +7,6 @@ import subprocess
from functools import lru_cache
from pathlib import Path
from node_config import node_source
from hud_assets import HUD_PATHS, hud_asset_hashes
ROOT = Path(__file__).resolve().parents[1]
ESSENTIALS = {'arcade.zx', 'arcade.json', 'apps.zx', 'entity.zx', 'kryon-font.ttf'}
@@ -27,15 +26,6 @@ def profile_asset_hashes():
return result
@lru_cache(maxsize=1)
def hud_hashes():
flags = [] if (ROOT / 'ziran.local.toml').is_file() else ['--locked']
package = Path(subprocess.check_output(
[str(ROOT / 'scripts/ziran.sh'), 'pkg', 'path', 'apps', *flags],
cwd=ROOT, text=True).strip())
return hud_asset_hashes(package)
def profile_assets():
return set(profile_asset_hashes())
@@ -83,12 +73,11 @@ def catalog_assets(payload):
def verify_assets(assets, essentials=True, edition='direct'):
expected = (ESSENTIALS if essentials else ESSENTIALS - {'entity.zx', 'kryon-font.ttf'}) | set(HUD_PATHS)
expected = ESSENTIALS if essentials else ESSENTIALS - {'entity.zx', 'kryon-font.ttf'}
if essentials and edition == 'gplay':
# AndroidX's generated ART startup profiles accompany Play Billing.
expected = expected | {'dexopt/baseline.prof', 'dexopt/baseline.profm'}
assert set(assets) == expected, 'Unexpected or missing Android asset: ' + str(set(assets) ^ expected)
assert {name: hashlib.sha256(assets[name]).hexdigest() for name in HUD_PATHS} == hud_hashes(), 'HUD icons differ from the pinned shared assets'
metadata = json.loads(assets['arcade.json'])
assert metadata['id'] == 'inbe.arcade' and metadata.get('games') != 'packed'
assert metadata.get('node') == node_source(ROOT), 'Node publisher binding differs from the reviewed host configuration'
+2 -6
View File
@@ -57,11 +57,8 @@ def stage_arcade():
for name in ('arcade.zx', 'arcade.json'):
shutil.copyfile(ROOT / 'build' / name, assets / name)
shutil.copyfile(collection / 'assets/apps/apps.zx', assets / 'apps.zx')
from hud_assets import stage_hud_assets
stage_hud_assets(package('apps'), assets)
from android_catalog import verify_assets
metadata = verify_assets({p.relative_to(assets).as_posix(): p.read_bytes()
for p in assets.rglob('*') if p.is_file()}, essentials=False)
metadata = verify_assets({p.name: p.read_bytes() for p in assets.iterdir()}, essentials=False)
if metadata['version'] != release['version']:
raise ValueError('The thin catalog version changed; rebuild the collection first')
# Android before 10 has no font lookup; the Windows build ships the same font.
@@ -111,8 +108,7 @@ def main():
sdk = Path(os.environ.get('ANDROID_SDK_ROOT') or os.environ.get('ANDROID_HOME') or Path.home() / 'Android/Sdk')
env = {key: value for key, value in os.environ.items() if key not in ('DISPLAY', 'WAYLAND_DISPLAY', 'XAUTHORITY', 'DBUS_SESSION_BUS_ADDRESS')}
env.update(ANDROID_HOME=str(sdk), ANDROID_SDK_ROOT=str(sdk),
LIBOQS_DIR=str(package('liboqs')), MONOCYPHER_DIR=str(package('monocypher')),
KRYON_ANDROID_WEBP_DIR=str(package('libwebp')))
LIBOQS_DIR=str(package('liboqs')), MONOCYPHER_DIR=str(package('monocypher')))
command = ['sh', str(ROOT / 'droid/gradlew'), '-p', str(ROOT / 'droid'), '--no-daemon', '--max-workers=2',
'-Papp.product=' + args.product, '-Papp.abis=' + args.abis,
'-Pkryon.dir=' + str(package('kryon')), '-Pziran.dir=' + str(package('ziran')),
+21 -5
View File
@@ -47,11 +47,27 @@ def build(root, output):
controller_context(root, context)
package = Path(subprocess.check_output(
['ziran', 'pkg', 'path', 'apps', '--locked'], cwd=context, text=True).strip())
# Every consumer trusts the same package-owned build, including its
# compiler and module identities. Recompiling with host-specific raw
# search paths changes the bytes and breaks nested collection trust.
subprocess.run([sys.executable, str(package / 'scripts/build-ui.py'),
'--output', str(output.resolve())], cwd=context, check=True)
subprocess.run([sys.executable, str(package / 'scripts/generate-ui-locales.py'), '--check'],
cwd=root, check=True)
toolchain = Path(subprocess.check_output(
['ziran', 'pkg', 'path', 'ziran', '--locked'], cwd=context, text=True).strip())
compiler = toolchain / 'build/bin/ziran'
if not compiler.is_file():
compiler = root / 'build/toolchain/bin/ziran'
subprocess.run(['make', '-s', '-C', str(toolchain),
'BUILD_DIR=' + str(root / 'build/toolchain'), 'all'], check=True)
output.mkdir(parents=True, exist_ok=True)
kryon = Path(subprocess.check_output(
['ziran', 'pkg', 'path', 'kryon', '--locked'], cwd=context, text=True).strip())
# Keep Apps' supported source entry mode with this host's exact graph.
subprocess.run([str(compiler), 'bundle',
'--module-path', str(package / 'src'),
'--module-path', 'kryon=' + str(kryon / 'src/ui'),
'--module-path', 'kryon=' + str(kryon / 'src/backend'),
'--module-path', str(toolchain / 'std'),
'--root', str(package / 'ui'), '--entry', 'apps:Main',
'--define', 'KRYON_HOSTED_UI', '-o', str(output.resolve() / 'apps.zx'),
str(package / 'ui/apps.zi')], cwd=context, check=True)
def main():
+4 -17
View File
@@ -17,7 +17,6 @@ from node_config import node_source
ROOT = Path(__file__).resolve().parents[1]
MAX_PAYLOAD_BYTES = 64 * 1024 * 1024
MAX_GAMES = 16
MAX_LIBRARY_ART_BYTES = 2 * 1024 * 1024
def payload_limit(size, label):
@@ -69,18 +68,16 @@ def catalog_version(root):
return version
def library_art(root, name, key, source, crop_top=0):
def library_art(root, name, key, source):
"""Arcade's committed library thumbnail (scripts/library-art.py), as
(bytes, suffix): a bounded WebP image. Never pack a copy
(bytes, suffix): a PNG, or a JPEG for opaque cover art. Never pack a copy
of outdated art."""
library = Path(root) / "assets/arcade/library"
sources = json.loads((library / "sources.json").read_text())
copy = f"{name}-{key}"
if sources.get(copy, {}).get("source_sha256") != hashlib.sha256(source).hexdigest():
raise ValueError(f"{copy} art changed; run scripts/library-art.py")
if sources.get(copy, {}).get("crop_top", 0) != crop_top:
raise ValueError(f"{copy} crop changed; run scripts/library-art.py")
for suffix in (".webp",):
for suffix in (".png", ".jpg"):
if (library / (copy + suffix)).is_file():
return (library / (copy + suffix)).read_bytes(), suffix
raise ValueError(f"{copy} has no library copy; run scripts/library-art.py")
@@ -104,10 +101,6 @@ def stage(root, controller, expected_controller_digest, output):
raise ValueError("Arcade needs 1 to 16 games")
ledger = json.loads((root / "apps/versions.json").read_text())["node_apps"]
children, copies, identities = [], [], set()
shared_apps = Path(subprocess.check_output([str(root / 'scripts/ziran.sh'), 'pkg', 'path', 'apps', *lock_flags], cwd=root, text=True).strip())
for icon in ('profile', 'dew'):
contents, suffix = library_art(root, 'hud', icon, (shared_apps / 'assets/hud' / (icon + '.webp')).read_bytes())
copies.append((contents, Path('arcade/library') / ('hud-' + icon + suffix)))
collection_ids = {package["id"] for package in packages}
for package in packages:
package["children"] = []
@@ -170,7 +163,7 @@ def stage(root, controller, expected_controller_digest, output):
relative = Path(cover[key])
if relative.is_absolute() or ".." in relative.parts or relative.suffix not in {".png", ".jpg"}:
raise ValueError("Invalid cover asset path")
contents, suffix = library_art(root, name, key, (app["art_source"] / relative).read_bytes(), app.get("cover_crops", {}).get(key, 0))
contents, suffix = library_art(root, name, key, (app["art_source"] / relative).read_bytes())
destination = Path("arcade/covers") / f"{name}-{key}{suffix}"
packed_cover[key] = "assets/" + destination.as_posix()
copies.append((contents, destination))
@@ -249,10 +242,6 @@ def stage_downloads(catalog, source, output, games, art):
destination = art / relative
destination.parent.mkdir(parents=True, exist_ok=True)
shutil.move(output / relative, destination)
for picture in (output / 'assets/arcade/library').glob('hud-*.webp'):
destination = art / picture.relative_to(output)
destination.parent.mkdir(parents=True, exist_ok=True)
shutil.move(picture, destination)
for digest, data in payloads.items():
(games / (digest + ".zx")).write_bytes(data)
@@ -261,8 +250,6 @@ def add_art(output, games, art_bundle):
"""Publish the art bundle beside the games and name it in the catalog."""
data = art_bundle.read_bytes()
payload_limit(len(data), "Library art bundle")
if len(data) > MAX_LIBRARY_ART_BYTES:
raise ValueError("Library art bundle exceeds the 2 MiB art budget")
digest = hashlib.sha256(data).hexdigest()
(games / (digest + ".zx")).write_bytes(data)
path = output / "assets/apps/catalog.json"
-2
View File
@@ -68,8 +68,6 @@ def main():
str(package('monocypher') / 'src/optional/monocypher-ed25519.c'), str(oqs / 'lib/liboqs.a'),
'-Wl,--gc-sections', *libraries, '-lX11', '-l:libcurl.so.4', '-lz', '-lm', '-lpthread', '-o', str(temporary)], check=True)
temporary.replace(output)
from hud_assets import stage_hud_assets
stage_hud_assets(package('apps'), output.parent)
if args.standalone_shovey:
from PIL import Image
source = Path(subprocess.check_output([ZIRAN, 'pkg', 'path', 'shovey', *lock], cwd=ROOT, text=True).strip())
+156 -221
View File
@@ -1,230 +1,168 @@
#!/usr/bin/env python3
"""Import game-owned portable exports unchanged; never build games in Arcade."""
"""Build the apps Arcade and its game packages declare, without copying source."""
import argparse
import hashlib
import json
import os
import re
import shutil
import struct
import tempfile
import subprocess
from pathlib import Path
from game_packages import declared_apps, portable_artifacts
from game_resources import dependency_order
from game_packages import declared_apps
from game_module_paths import kryon_module_paths
from game_resources import dependency_order, pack_opaque_pngs, share_resources
ROOT = Path(__file__).resolve().parents[1]
MAX_PAYLOAD_BYTES = 64 * 1024 * 1024
MAX_ASSET_BYTES = 16 * 1024 * 1024
METADATA_LIMIT = 1024 * 1024
def digest(path):
result = hashlib.sha256()
with path.open('rb') as source:
for block in iter(lambda: source.read(1024 * 1024), b''):
result.update(block)
return result.hexdigest()
def bundle_metadata(path, name):
"""Read bounded metadata and the asset index of ZX 26/27; execute nothing."""
size = path.stat().st_size
if not 0 < size <= MAX_PAYLOAD_BYTES:
raise ValueError(f'{path}: exceeds the host payload limit')
with path.open('rb') as source:
def skip(count):
if count > size - source.tell():
raise ValueError(f'{path}: truncated bundle')
source.seek(count, 1)
def take(count):
if count > size - source.tell():
raise ValueError(f'{path}: truncated bundle')
data = source.read(count)
if len(data) != count:
raise ValueError(f'{path}: truncated bundle')
return data
def number():
return struct.unpack('<I', take(4))[0]
def text():
length = number()
if length > METADATA_LIMIT:
raise ValueError(f'{path}: oversized metadata')
return take(length).decode('utf-8')
def count():
value = number()
if value > 100000:
raise ValueError(f'{path}: oversized bundle index')
return value
if take(8) not in (b'ZX\0\0\x1a\0\0\0', b'ZX\0\0\x1b\0\0\0'):
raise ValueError(f'{path}: unsupported bundle')
entry = text() + ':' + text()
for _ in range(count()):
text(); text()
for _ in range(count()):
for _ in range(7):
text()
skip(8); text(); skip(4)
for _ in range(count()):
text(); text(); text()
skip(number())
metadata, paths = {}, set()
wanted = {f'assets/{name}/catalog.json', f'assets/{name}/requirements.json'}
asset_count = count()
if not 1 <= asset_count <= 2048:
raise ValueError(f'{path}: invalid game asset count')
for _ in range(asset_count):
asset, length = text(), number()
if length > MAX_ASSET_BYTES:
raise ValueError(f'{path}: asset exceeds the host asset limit')
if asset in paths or asset.startswith('/') or '..' in Path(asset).parts:
raise ValueError(f'{path}: invalid or duplicate bundle asset {asset}')
paths.add(asset)
if asset in wanted:
if length > METADATA_LIMIT:
raise ValueError(f'{path}: oversized metadata')
metadata[asset.rsplit('/', 1)[1]] = json.loads(take(length))
def leave_out(rules_path, resources, release):
"""Removes what the game's bundle.json says its bundle leaves out (top-level
glob patterns of its assets), so the collection and the games a host opens
fit its memory budget; the manifest keeps only what remains."""
rules = json.loads(rules_path.read_text()) if rules_path.exists() else {}
patterns = rules.get("leave_out", []) + (rules.get("release_leave_out", []) if release else [])
for pattern in patterns:
for path in resources.glob(pattern):
if path.is_dir():
shutil.rmtree(path)
else:
skip(length)
if source.tell() != size:
raise ValueError(f'{path}: trailing bundle bytes')
return entry, metadata, paths
path.unlink()
art_path = resources / "art.json"
if patterns and art_path.exists():
art = json.loads(art_path.read_text())
art["files"] = [item for item in art["files"] if (resources / item["path"]).is_file()]
art_path.write_text(json.dumps(art, indent=2) + "\n")
def validate_artifact(app, bundle, resources, imported):
descriptor = app['descriptor']
name, identifier = descriptor['name'], descriptor['id']
entry, metadata, paths = bundle_metadata(bundle, name)
if any(not path.startswith(f'assets/{name}/') or path == f'assets/{name}/' for path in paths):
raise ValueError(f'{identifier}: exported assets escape the game namespace; re-export in its game repository')
public = {key: value for key, value in descriptor.items()
if key not in ('build_defines', 'prepare_assets')}
if entry != descriptor['entry'] or metadata.get('catalog.json') != public:
raise ValueError(f'{identifier}: embedded catalog/entry mismatch or missing; '
're-export the portable bundle in its game repository with its app catalog')
requires = app['requires']
if (not isinstance(resources, dict) or set(resources) != {'dependencies', 'resources'}
or resources['dependencies'] != requires):
raise ValueError(f'{identifier}: exported dependency identities mismatch')
links = resources['resources']
if not isinstance(links, list) or len(links) > 16:
raise ValueError(f'{identifier}: invalid resource links')
targets = set()
for link in links:
if not isinstance(link, dict) or set(link) != {'dependency', 'path', 'source'}:
raise ValueError(f'{identifier}: invalid resource link')
dependency, target, original = link['dependency'], link['path'], link['source']
if not isinstance(dependency, str) or dependency not in requires or dependency not in imported:
raise ValueError(f'{identifier}: undeclared resource dependency')
base = imported[dependency]
for value in (target, original):
if not isinstance(value, str) or value.startswith('/') or '..' in Path(value).parts:
raise ValueError(f'{identifier}: unsafe resource link')
if (not target.startswith(f'assets/{name}/') or target in targets
or not original.startswith(f'assets/{base["name"]}/')
or target.endswith('/') != original.endswith('/')):
raise ValueError(f'{identifier}: invalid resource namespace')
targets.add(target)
if not any(p.startswith(original) if original.endswith('/') else p == original for p in base['paths']):
raise ValueError(f'{identifier}: missing dependency resource')
if any(p.startswith(target) if target.endswith('/') else p == target for p in paths):
raise ValueError(f'{identifier}: resource link shadows bundled data')
expected = resources | {'sha256': {dep: imported[dep]['sha256'] for dep in requires}}
if requires and metadata.get('requirements.json') != expected:
raise ValueError(f'{identifier}: embedded requirements/hash mismatch')
if not requires and metadata.get('requirements.json') not in (None, expected):
raise ValueError(f'{identifier}: unexpected embedded requirements')
return dict(name=name, paths=paths, sha256=digest(bundle))
def build(ziran, lock_flags):
def package(name):
return Path(subprocess.check_output(
[ziran, "pkg", "path", name, *lock_flags], cwd=ROOT, text=True).strip())
def promote(replacements, scratch):
"""Rollback all prior outputs if promotion fails; validation precedes writes."""
completed = []
try:
for index, (candidate, target) in enumerate(replacements):
kryon = package("kryon")
game2d = package("game2d")
toolchain = package("ziran")
entity = package("entity")
compiler = toolchain / "build/bin/ziran"
if not compiler.is_file():
compiler = ROOT / "build/toolchain/bin/ziran"
# Resolve transitive packages from Arcade's lock, never their private graphs.
daochi_client = package("daochi_client")
crypto = package("crypto")
# Shared KSS themes (Choano 0.1.5 and later import kss/Kss).
kss = package("kss")
entries = []
apps = dependency_order(declared_apps(ROOT, ziran, lock_flags))
by_id = {app['descriptor']['id']: app for app in apps}
for app in apps:
source, manifest, descriptor = app["source"], app["manifest"], app["descriptor"]
if descriptor["kind"] != "game" or "arcade" not in descriptor["harnesses"]:
raise ValueError("Only games registered for Arcade belong in its catalog")
name = descriptor["name"]
if not name.isascii() or not name.replace("-", "").isalnum():
raise ValueError("Invalid game name")
staged = ROOT / "build/game-assets" / name
# Start empty: files a game no longer has must not reach its bundle.
shutil.rmtree(staged, ignore_errors=True)
resources = staged / "assets" / name
resources.mkdir(parents=True)
shutil.copytree(source / descriptor["assets"], resources, dirs_exist_ok=True)
shared = manifest.with_name("shared_assets.json")
for copy in json.loads(shared.read_text())["copies"] if shared.exists() else []:
asset_source, target = source / copy["from"], resources / copy["to"]
target.parent.mkdir(parents=True, exist_ok=True)
backup = scratch / f'previous-{index}'
existed = target.exists()
if existed:
os.replace(target, backup)
completed.append((target, backup, existed))
os.replace(candidate, target)
except BaseException:
for target, backup, existed in reversed(completed):
if target.is_dir():
shutil.rmtree(target)
elif target.exists():
target.unlink()
if existed:
os.replace(backup, target)
raise
def build(ziran, lock_flags, artifact_manifest=None):
apps = declared_apps(ROOT, ziran, lock_flags)
if not 1 <= len(apps) <= 16 or len({a['descriptor']['id'] for a in apps}) != len(apps):
raise ValueError('Arcade needs 1 to 16 distinct games')
if len({a['descriptor']['name'] for a in apps}) != len(apps):
raise ValueError('Duplicate game name')
apps = dependency_order(apps)
exports = None
if artifact_manifest is not None:
artifact_manifest = Path(artifact_manifest).resolve()
exports = json.loads(artifact_manifest.read_text())
if not isinstance(exports, dict) or set(exports) != {'apps'} or not isinstance(exports['apps'], dict):
raise ValueError('Artifact manifest must contain an apps mapping')
expected_ids = {a['descriptor']['id'] for a in apps if a['enabled']}
if set(exports['apps']) != expected_ids:
raise ValueError('Artifact manifest must name exactly the enabled public app IDs')
scratch_root = ROOT / 'work/console-redesign'
scratch_root.mkdir(parents=True, exist_ok=True)
with tempfile.TemporaryDirectory(prefix='game-import-', dir=scratch_root) as directory:
scratch = Path(directory)
games = scratch / 'games'
games.mkdir()
entries, imported = [], {}
for app in apps:
descriptor = app['descriptor']
name = descriptor['name']
if not re.fullmatch(r'[a-z0-9][a-z0-9-]*', name):
raise ValueError('Invalid game name')
if descriptor['kind'] != 'game' or 'arcade' not in descriptor['harnesses']:
raise ValueError('Only games registered for Arcade belong in its catalog')
entries.append(descriptor | {'enabled': app['enabled'], 'package': app['package']})
if not app['enabled']:
continue
locations, instruction = portable_artifacts(app, artifact_manifest, exports)
for kind, source in locations.items():
if not source.is_file():
raise ValueError(f'{descriptor["id"]}: missing {kind} export: {source}. {instruction}')
limit = METADATA_LIMIT if kind == 'resources' else MAX_PAYLOAD_BYTES
if not 0 < source.stat().st_size <= limit:
raise ValueError(f'{source}: exceeds the host payload limit')
suffix = {'bundle': '.zx', 'preview': '-preview.png', 'resources': '-resources.json'}[kind]
target = games / (name + suffix)
shutil.copyfile(source, target)
if not 0 < target.stat().st_size <= limit:
raise ValueError(f'{source}: export changed or exceeds the host payload limit')
resource_file = games / (name + '-resources.json')
if not resource_file.exists():
if app['requires']:
raise ValueError(f'{name}: dependencies require exported resources metadata')
resource_file.write_text(json.dumps(dict(dependencies=[], resources=[]), indent=2) + '\n')
resources = json.loads(resource_file.read_text())
imported[descriptor['id']] = validate_artifact(app, games / (name + '.zx'), resources, imported)
text, catalog = catalog_outputs(entries)
(scratch / 'catalog.zi').write_text(text)
(scratch / 'catalog.json').write_text(catalog)
promote([(games, ROOT / 'build/games'), (scratch / 'catalog.zi', ROOT / 'src/catalog.zi'),
(scratch / 'catalog.json', ROOT / 'build/catalog.json')], scratch)
print(f'Imported {len(imported)} verified game-owned artifacts unchanged')
def catalog_outputs(entries):
if asset_source.is_dir():
shutil.copytree(asset_source, target)
else:
shutil.copyfile(asset_source, target)
# Build flags are source metadata, not part of the signed node/2
# descriptor schema accepted by existing hosts.
(resources / 'catalog.json').write_text(json.dumps(
{key: value for key, value in descriptor.items() if key not in ('build_defines', 'prepare_assets')}, indent=2) + '\n')
defines = descriptor.get('build_defines', [])
if 'SHOVEY_RELEASE' in defines:
subprocess.run(["python3", str(source / 'scripts/release_assets.py'), str(resources)], check=True)
leave_out(manifest.with_name("bundle.json"), resources, 'SHOVEY_RELEASE' in defines)
locales = resources / "locales"
locales.mkdir(exist_ok=True)
translations = {}
for locale in sorted((source / descriptor["locales"]).glob("*.txt")):
blocks = []
values = {}
for block in locale.read_text().split("---\n"):
lines = block.splitlines()
heading = next((line for line in lines if line), "")
if heading.startswith("[" + descriptor["locale_prefix"]):
blocks.append(heading + "\n" + "\n".join(lines[lines.index(heading) + 1:]).rstrip() + "\n---\n")
values[heading[1:-1]] = "\n".join(lines[lines.index(heading) + 1:]).rstrip()
(locales / locale.name).write_text("".join(blocks))
translations[locale.stem] = values
# Text also lives in the game itself: released legacy hosts only know
# their own locale file and cannot provide newly added game strings.
generated = ROOT / 'build/game-generated' / name
generated.mkdir(parents=True, exist_ok=True)
if descriptor.get('prepare_assets'):
prepare = Path(descriptor['prepare_assets'])
if prepare.is_absolute() or '..' in prepare.parts or prepare.suffix not in ('.py', '.zi'):
raise ValueError('Invalid game asset preparation script')
if prepare.suffix == '.zi':
# A Ziran preparation program builds with Arcade's compiler and
# runs from the game's checkout, where its own files are.
tool = ROOT / 'build/game-tools' / name
subprocess.run([str(compiler), 'build', '--target=c', '--exe', '--root', str((source / prepare).parent),
'--module-path', 'std=' + str(toolchain / 'std'), '--entry', prepare.stem + ':main',
'-o', str(tool), str(source / prepare)], cwd=ROOT, check=True)
subprocess.run([str(tool / prepare.stem), str(resources), str(generated)], cwd=source, check=True)
else:
subprocess.run(['python3', str(source / prepare), str(resources), str(generated)], check=True)
pack_opaque_pngs(resources)
shared = share_resources(app, apps, resources, ROOT / 'build/game-assets')
metadata = ROOT / 'build/games' / (name + '-resources.json')
metadata.parent.mkdir(parents=True, exist_ok=True)
metadata.write_text(json.dumps(shared, indent=2) + '\n')
if shared['dependencies']:
# A base-art update must also invalidate cached editor images.
originals = {item['descriptor']['id']: item['descriptor']['name'] for item in apps}
required = shared | {'sha256': {identifier: hashlib.sha256(
(ROOT / 'build/games' / (originals[identifier] + '.zx')).read_bytes()).hexdigest()
for identifier in shared['dependencies']}}
(resources / 'requirements.json').write_text(json.dumps(required, sort_keys=True) + '\n')
code = 'GameLocaleText :: (language: string, key: string) -> string {\n'
for language, values in sorted(translations.items(), key=lambda item: item[0] == 'en'):
if language != 'en':
code += ' if language == ' + json.dumps(language) + ' {\n'
for key, value in values.items():
code += (' ' if language != 'en' else ' ') + 'if key == ' + json.dumps(key) + ' { return ' + json.dumps(value, ensure_ascii=False) + ' }\n'
if language != 'en':
code += ' }\n'
code += ' return ""\n}\n'
(generated / 'translations.zi').write_text(code)
bundle = ROOT / "build/games" / (name + ".zx")
bundle.parent.mkdir(parents=True, exist_ok=True)
subprocess.run([
ziran, "bundle", "--root", str((source / descriptor["source"]).parent),
# Game packages without a src folder (Shovey) keep sources beside their catalogs.
*(["--module-path", str(source / "src")] if (source / "src").is_dir() else []),
"--module-path", str(generated),
*kryon_module_paths(source, descriptor, kryon),
"--module-path", "game2d=" + str(game2d / "src"),
"--module-path", "std=" + str(toolchain / "std"),
"--module-path", str(toolchain / "std"),
"--module-path", "apps=" + str(package("apps") / "src"),
"--module-path", "mingcute=" + str(package("mingcute") / "src"),
"--module-path", "entity=" + str(entity / "src"),
"--module-path", "daochi_client=" + str(daochi_client),
"--module-path", "crypto=" + str(crypto / "src"),
"--module-path", "kss=" + str(kss / "src"),
*[flag for name in defines for flag in ('--define', name)],
*[flag for entry in app['library_entries'] for flag in ('--retain', entry)],
*[flag for dependency_id in app['requires'] if app['shared_code']
for flag in ('--library', str(ROOT / 'build/games' /
(by_id[dependency_id]['descriptor']['name'] + '.zx')))],
"--define", "KRYON_HOSTED_UI", "--asset-dir", "assets=" + str(staged / "assets"),
"--entry", descriptor["entry"], "-o", str(bundle),
str(source / descriptor["source"])], cwd=ROOT, check=True)
preview = ROOT / "build/games" / (name + "-preview.png")
shutil.copyfile(source / descriptor["preview"], preview)
entries.append(descriptor | {"enabled": app["enabled"], "package": app["package"]})
if not entries or len(entries) > 16 or len({entry["id"] for entry in entries}) != len(entries):
raise ValueError("Arcade needs 1 to 16 distinct games")
text = ("// Generated from the apps.json of Arcade and its game packages.\n"
@@ -238,16 +176,13 @@ def catalog_outputs(entries):
fields += ", .enabled = " + str(entry["enabled"]).lower()
text += f" if index == {index} {{ return Game.{{{fields}}} }}\n"
text += " return Game.{}\n}\n"
return text, json.dumps({"games": entries}, indent=2) + "\n"
(ROOT / "src/catalog.zi").write_text(text)
(ROOT / "build/catalog.json").write_text(json.dumps({"games": entries}, indent=2) + "\n")
if __name__ == '__main__':
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--ziran', default='ziran', help='package path resolver only')
parser.add_argument('--locked', action='store_true')
parser.add_argument('--artifact-manifest', type=Path, help='explicit already-exported app artifact paths')
parser.add_argument("--ziran", default="ziran")
parser.add_argument("--locked", action="store_true")
args = parser.parse_args()
try:
build(args.ziran, ['--locked'] if args.locked else [], args.artifact_manifest)
except (ValueError, OSError) as error:
parser.exit(1, f'Game artifact import failed: {error}\n')
build(args.ziran, ["--locked"] if args.locked else [])
+3 -7
View File
@@ -34,7 +34,7 @@ ROOT = Path(__file__).resolve().parents[1]
ZIRAN = str(ROOT / 'scripts/ziran.sh')
ART_LIMIT = 64 * 1024 * 1024
# The committed library copies are at most this large (scripts/library-art.py).
PICTURE_LONGEST = 1600
PICTURE_LONGEST = 640
COVER_QUALITY = 80
@@ -144,8 +144,7 @@ def stage_web_library_art(bundle, output):
covers = {path for child in catalog['children'] for key, path in child.get('cover', {}).items()
if key in ('portrait', 'landscape', 'logo')}
copies = {}
hud = {path for path in pictures if path.startswith('assets/arcade/library/hud-') and path.endswith('.webp')}
for path in sorted(previews | covers | hud):
for path in sorted(previews | covers):
if path not in pictures:
raise ValueError(f'The art bundle lacks {path}')
copies[path] = web_picture(pictures[path], path in previews)
@@ -184,8 +183,7 @@ def version_assets(output, receipt):
if '__ARCADE_ASSET_REVISION__' not in html:
return
digest = hashlib.sha256()
for name in ('runtime.js', 'runtime.wasm', 'runtime.data', 'arcade.json', 'apps.zx', 'library.json',
'assets/hud/profile.webp', 'assets/hud/dew.webp'):
for name in ('runtime.js', 'runtime.wasm', 'runtime.data', 'arcade.json', 'apps.zx', 'library.json'):
path = output / name
if path.is_file():
digest.update(name.encode() + b'\0')
@@ -255,8 +253,6 @@ def main():
print('No matching Apps controller beside the collection; it must pack its own')
if not args.shovey and stage_web_library_art(bundle, output) is None:
print('The collection packs its own library art')
from hud_assets import stage_hud_assets
stage_hud_assets(package('apps'), output)
version_assets(output, receipt)
print(f'{"Shovey" if args.shovey else "Arcade"} {args.version} for the browser in {output}')
-61
View File
@@ -1,61 +0,0 @@
#!/usr/bin/env python3
"""Download Wurm's portable exports from its exact pinned release; compile nothing."""
import argparse
import json
from pathlib import Path
import re
import shutil
import subprocess
import tarfile
import tempfile
EXPORT_FILES = {name + suffix for name in ('wurm', 'wurm-editor')
for suffix in ('.zx', '-resources.json', '-catalog.json', '-preview.png')}
MAX_FILE_BYTES = 64 * 1024 * 1024
def unpack(archive, source):
build = source / 'build'
build.mkdir(parents=True, exist_ok=True)
with tarfile.open(archive, 'r:gz') as bundle:
members = bundle.getmembers()
if len(members) != len(EXPORT_FILES) or {m.name for m in members} != EXPORT_FILES:
raise ValueError('Wurm release must contain exactly its eight portable exports')
if any(not m.isfile() or not 0 < m.size <= MAX_FILE_BYTES for m in members):
raise ValueError('Wurm release contains an invalid portable export')
# Validate the complete member list before any output is replaced.
with tempfile.TemporaryDirectory(prefix='portable-export-', dir=build) as directory:
stage = Path(directory)
for member in members:
with bundle.extractfile(member) as incoming, (stage / member.name).open('wb') as output:
shutil.copyfileobj(incoming, output)
exports = build / 'games'
exports.mkdir(exist_ok=True)
for name in EXPORT_FILES:
(stage / name).replace(exports / name)
def fetch(source, commit):
version = json.loads((source / 'version.json').read_text())['version']
if not re.fullmatch(r'\d+\.\d+\.\d+', version) or not re.fullmatch(r'[0-9a-f]{40}', commit):
raise ValueError('Invalid Wurm release identity')
tag = 'v' + version
released = subprocess.check_output(['gh', 'api', f'repos/waozixyz/wurm/commits/{tag}',
'--jq', '.sha'], text=True).strip()
if released != commit:
raise ValueError('Wurm release does not match Arcade\'s pinned commit')
downloads = source / 'build/downloads'
downloads.mkdir(parents=True, exist_ok=True)
name = f'wurm-portable-{tag}.tar.gz'
subprocess.run(['gh', 'release', 'download', tag, '--repo', 'waozixyz/wurm',
'--pattern', name, '--dir', str(downloads), '--clobber'], check=True)
unpack(downloads / name, source)
print(f'Imported Wurm {version} portable release at {commit}')
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--source', type=Path, required=True)
parser.add_argument('--commit', required=True)
args = parser.parse_args()
fetch(args.source.resolve(), args.commit)
+2 -4
View File
@@ -150,10 +150,8 @@ def art():
library = importlib.util.module_from_spec(spec)
spec.loader.exec_module(library)
recorded = json.loads((library.LIBRARY / 'sources.json').read_text())
# A changed source or cover crop rewrites the library copies.
current = {f'{name}-{key}': (hashlib.sha256(data).hexdigest(), crop_top)
for name, key, data, crop_top in library.art()}
if {copy: (item['source_sha256'], item.get('crop_top', 0)) for copy, item in recorded.items()} != current:
current = {f'{name}-{key}': hashlib.sha256(data).hexdigest() for name, key, data in library.art()}
if {copy: item['source_sha256'] for copy, item in recorded.items()} != current:
library.main()
+4 -55
View File
@@ -9,7 +9,7 @@ import re
from pathlib import Path
import subprocess
APP_KEYS = {'manifest', 'cover', 'enabled', 'requires', 'shared_code', 'library_entries', 'shared_records', 'external', 'standalone_bundle'}
APP_KEYS = {'manifest', 'cover', 'enabled', 'requires', 'shared_code', 'library_entries', 'shared_records'}
COVER_KEYS = {'portrait', 'landscape', 'logo', 'caption', 'action'}
@@ -48,11 +48,6 @@ def declared_packages(root, ziran=None, lock_flags=()):
for app in declaration['apps']:
if not set(app) <= APP_KEYS or not set(app.get('cover', {})) <= COVER_KEYS:
raise ValueError(f'{name}: unknown apps.json field')
if app.get('external', False):
# Independently published editions stay in their own game.
if app['external'] is not True or not str(relative_path(app.get('standalone_bundle', ''))).endswith('.zx'):
raise ValueError(f'{name}: invalid external game edition')
continue
manifest = source / relative_path(app['manifest'])
requires = app.get('requires', [])
if not isinstance(requires, list) or len(requires) > 8 or \
@@ -73,18 +68,9 @@ def declared_packages(root, ziran=None, lock_flags=()):
not re.fullmatch(r'[A-Za-z_][A-Za-z0-9_]*:[A-Za-z_][A-Za-z0-9_]*', item)
for item in library_entries) or len(set(library_entries)) != len(library_entries):
raise ValueError(f'{name}: invalid portable library entries')
app_art_source = art_source
descriptor = json.loads(manifest.read_text())
cover_crops = {}
cover = app.get('cover')
internal = descriptor['name'].endswith('-editor')
if cover:
cover = dict(cover)
if internal:
cover['action'] = 'internal'
apps.append(dict(package=name, source=source, art_source=app_art_source, manifest=manifest,
descriptor=descriptor,
cover=cover, cover_crops=cover_crops, internal=internal, requires=requires, shared_code=shared_code,
apps.append(dict(package=name, source=source, art_source=art_source, manifest=manifest,
descriptor=json.loads(manifest.read_text()),
cover=app.get('cover'), requires=requires, shared_code=shared_code,
shared_records=shared_records,
library_entries=library_entries, enabled=app.get('enabled', True)))
packages.append(dict(name=name, source=source, id=declaration['id'],
@@ -94,40 +80,3 @@ def declared_packages(root, ziran=None, lock_flags=()):
def declared_apps(root, ziran=None, lock_flags=()):
return [app for package in declared_packages(root, ziran, lock_flags) for app in package['apps']]
def portable_artifacts(app, manifest=None, exports=None):
"""Locate game-owned exports. Resolving paths never builds or runs a game.
An explicit manifest is useful with clean locked/downloaded packages whose
source cache deliberately has no build outputs. Paths are relative to it.
"""
descriptor, source = app['descriptor'], app['source']
name, package = descriptor['name'], app['package']
instruction = ('Supply --artifact-manifest with exports from the game owner; '
'Arcade never compiles games.')
if exports is not None:
record = exports['apps'][descriptor['id']]
if (not isinstance(record, dict) or not {'bundle', 'preview'} <= set(record)
or not set(record) <= {'bundle', 'preview', 'resources'}):
raise ValueError(f'{name}: artifact entry needs bundle, preview and optional resources paths')
locations = {}
for kind, value in record.items():
if not isinstance(value, str) or not value:
raise ValueError(f'{name}: invalid artifact path')
path = Path(value)
locations[kind] = path if path.is_absolute() else manifest.parent / path
return locations, instruction
folders = {'shovey': 'build/player/games', 'wurm': 'build/games', 'choano': 'build'}
commands = {'shovey': 'build-queue -- python3 scripts/player.py collection --web',
'wurm': 'build-queue -- python3 tools/build_portable.py',
'choano': 'build-queue -- make portable'}
if package not in folders:
raise ValueError(f'{name}: no game-owned artifact location. {instruction}')
folder = source / folders[package]
locations = dict(bundle=folder / (name + '.zx'),
preview=folder / (name + '-preview.png') if package == 'wurm'
else source / relative_path(descriptor['preview']))
if package in ('shovey', 'wurm'):
locations['resources'] = folder / (name + '-resources.json')
return locations, f'In {source}, run {commands[package]}. {instruction}'
-17
View File
@@ -1,17 +0,0 @@
"""The two shared painted HUD icons shipped with the host, independent of catalogs."""
import hashlib
from pathlib import Path
import shutil
HUD_PATHS = ('assets/hud/profile.webp', 'assets/hud/dew.webp')
def hud_asset_hashes(apps):
return {name: hashlib.sha256((Path(apps) / name).read_bytes()).hexdigest() for name in HUD_PATHS}
def stage_hud_assets(apps, output):
for name in HUD_PATHS:
target = Path(output) / name
target.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(Path(apps) / name, target)
+36 -44
View File
@@ -2,8 +2,9 @@
"""Stage bounded thumbnails for every game's library covers and previews.
Library covers retain full colour and transparency at thumbnail resolution:
opaque art uses quality-80 WebP, while transparent art uses lossless WebP.
Games keep their own original title artwork. Arcade downloads this small art
opaque cover art is a JPEG, a sixth of its PNG size, while logos keep their
transparency and previews their pixel art as PNG. Games keep their own
original title artwork. Arcade downloads this small art
bundle separately from its launcher and caches it by its content digest.
The copies and sources.json, which records the SHA-256 of the art each copy
@@ -14,25 +15,19 @@ game's art changes until this script makes fresh copies.
import hashlib
import io
import json
import subprocess
from pathlib import Path
from PIL import Image, ImageOps
from PIL import Image
from game_packages import declared_packages
ROOT = Path(__file__).resolve().parents[1]
LIBRARY = ROOT / 'assets/arcade/library'
# Previews stay at 256 px. Separately fetched painted covers are sized for
# full-screen landscape and focused portrait art, with a total 2 MiB budget.
PREVIEW_LONGEST = 256
LANDSCAPE_LONGEST = 1600
PORTRAIT_LONGEST = 1080
COVER_LONGEST = 256
ART_BUDGET = 2 * 1024 * 1024
LOGO_LONGEST = 256
PREVIEW_LONGEST = 480
COVER_LONGEST = 640
LOGO_LONGEST = 512
COVER_QUALITY = 80
SUFFIXES = ('.webp', '.png', '.jpg')
COVER_QUALITY = 85
SUFFIXES = ('.png', '.jpg')
def copy_path(name):
@@ -43,71 +38,68 @@ def copy_path(name):
raise FileNotFoundError(f'{name} has no library copy; run scripts/library-art.py')
def small_copy(data, key, crop_top=0):
def small_copy(data, key):
"""(bytes, suffix) of the library's copy of one picture."""
image = Image.open(io.BytesIO(data))
image.load()
if not 0 <= crop_top < image.height:
raise ValueError('Gameplay crop exceeds screenshot')
if crop_top:
image = image.crop((0, crop_top, image.width, image.height))
# Frame the original painted artwork for the shelf, never gameplay captures.
# Portrait paintings keep their title near the top; landscape art is centred.
if key in ('portrait', 'landscape'):
ratio = 2 / 3 if key == 'portrait' else 16 / 9
width = min(image.width, round(image.height * ratio))
height = min(image.height, round(image.width / ratio))
image = ImageOps.fit(image, (width, height), Image.Resampling.LANCZOS,
centering=(0.5, 0.0 if key == 'portrait' else 0.5))
longest = {'preview': PREVIEW_LONGEST, 'logo': LOGO_LONGEST, 'landscape': LANDSCAPE_LONGEST, 'portrait': PORTRAIT_LONGEST}.get(key, COVER_LONGEST)
# The shared library cards are 2:3. Keep the top of taller paintings,
# where their title lives, rather than letting the card centre-crop it.
# Originals remain untouched; this framing belongs to the thumbnail.
if key == 'portrait' and image.height > image.width * 1.5:
image = image.crop((0, 0, image.width, round(image.width * 1.5)))
longest = PREVIEW_LONGEST if key == 'preview' else LOGO_LONGEST if key == 'logo' else COVER_LONGEST
scale = min(1.0, longest / max(image.size))
alpha = ('A' in image.getbands() or 'transparency' in image.info) and key not in ('landscape', 'portrait')
alpha = 'A' in image.getbands() or 'transparency' in image.info
photo = key in ('portrait', 'landscape') and not alpha
if scale == 1.0 and key != 'preview' and not photo:
return data, '.png'
image = image.convert('RGBA' if alpha else 'RGB')
if scale < 1.0:
size = (max(1, round(image.width * scale)), max(1, round(image.height * scale)))
image = image.resize(size, Image.Resampling.LANCZOS)
if key == 'preview':
if alpha:
image = image.quantize(256, method=Image.Quantize.FASTOCTREE, dither=Image.Dither.FLOYDSTEINBERG)
else:
image = image.quantize(256, dither=Image.Dither.FLOYDSTEINBERG)
output = io.BytesIO()
# Lossless WebP preserves every resized alpha value and logo colour.
image.save(output, 'WEBP', quality=COVER_QUALITY, lossless=alpha, method=6, exact=True)
return output.getvalue(), '.webp'
if photo:
image.save(output, 'JPEG', quality=COVER_QUALITY, optimize=True, progressive=True)
return output.getvalue(), '.jpg'
image.save(output, 'PNG', optimize=True)
return output.getvalue(), '.png'
def art(root=ROOT):
"""(copy name, key, source bytes) for every enabled game's library art."""
flags = [] if (root / 'ziran.local.toml').exists() else ['--locked']
apps = Path(subprocess.check_output([str(root / 'scripts/ziran.sh'), 'pkg', 'path', 'apps', *flags], cwd=root, text=True).strip())
for icon in ('profile', 'dew'):
yield 'hud', icon, (apps / 'assets/hud' / (icon + '.webp')).read_bytes(), 0
for package in declared_packages(root)[1:]:
for app in package['apps']:
if not app['enabled']:
continue
name = app['descriptor']['name']
yield name, 'preview', (app['art_source'] / app['descriptor']['preview']).read_bytes(), 0
yield name, 'preview', (app['art_source'] / app['descriptor']['preview']).read_bytes()
for key in ('portrait', 'landscape', 'logo'):
if app['cover'] and key in app['cover']:
yield name, key, (app['art_source'] / app['cover'][key]).read_bytes(), app.get('cover_crops', {}).get(key, 0)
yield name, key, (app['art_source'] / app['cover'][key]).read_bytes()
def main():
LIBRARY.mkdir(parents=True, exist_ok=True)
sources = {}
written = set()
for name, key, data, crop_top in art():
for name, key, data in art():
copy = f'{name}-{key}'
contents, suffix = small_copy(data, 'preview' if name.endswith('-editor') else key, crop_top)
contents, suffix = small_copy(data, key)
(LIBRARY / (copy + suffix)).write_bytes(contents)
written.add(copy + suffix)
sources[copy] = {'source_sha256': hashlib.sha256(data).hexdigest(), 'crop_top': crop_top}
sources[copy] = {'source_sha256': hashlib.sha256(data).hexdigest()}
for suffix in SUFFIXES:
for stale in LIBRARY.glob('*' + suffix):
if stale.name not in written:
stale.unlink()
(LIBRARY / 'sources.json').write_text(json.dumps(dict(sorted(sources.items())), indent=2) + '\n')
total = sum((LIBRARY / name).stat().st_size for name in written)
if total > ART_BUDGET:
raise ValueError(f'Library art exceeds {ART_BUDGET} bytes: {total}')
print(f'{len(sources)} library images, {total / 1048576:.1f} MiB (budget 2 MiB)')
print(f'{len(sources)} library images, {total / 1048576:.1f} MiB')
if __name__ == '__main__':
+1 -8
View File
@@ -153,19 +153,12 @@
}),
bundle('apps.zx'),
bundle('runtime.data'),
library(),
Promise.all(['profile.webp', 'dew.webp'].map(function (name) {
return file('assets/hud/' + name);
}))
library()
]).then(function (loaded) {
Module.arcadeReceipt = loaded[0];
Module.preRun = [function () {
if (loaded[1]) FS.writeFile('/apps.zx', new Uint8Array(loaded[1]));
if (loaded[3]) writeLibrary(loaded[3]);
FS.mkdirTree('/assets/hud');
['profile.webp', 'dew.webp'].forEach(function (name, index) {
FS.writeFile('/assets/hud/' + name, new Uint8Array(loaded[4][index]));
});
}];
// The runtime's file package, already here, is not fetched again.
if (loaded[2]) {
+29 -153
View File
@@ -32,8 +32,6 @@
CollectionHost :: #import "kryon/app_context";
}
#import "kryon/key_input"
#import "kryon/tree"
#import "kryon/tree_input"
#import "kryon/system_clipboard"
#import "apps/host"
#import "apps/tree"
@@ -55,16 +53,14 @@ Codec :: #import "apps/node_codec";
#import "entity/leaderboard_native"
#import "kryon/widget_palette"
#import "kryon/image_raster"
#if #defined(ANDROID_BUILD) {
#import "kryon/app_asset"
}
#import "kryon/loading_indicator"
#import, file "collection_loading.zi";
#import "apps/connection"
#import "apps/remote_catalog"
Labels :: #import "apps/words";
#import "profile_palette"
#import "apps/game_hud"
ProfileIcon :: #import "mingcute/mingcute_regular_user_4";
DewIcon :: #import "mingcute/mingcute_filled_drop";
collection_dew_text: [32]u8;
using HostValueKind;
@@ -169,13 +165,6 @@ CollectionRecordsFor :: (id: string) -> *CollectionRecords {
return saved
}
CollectionDocuments :: (context: *void, node: *AppNode) -> *AppFiles {
unused context
if node == null || node.collection { return null }
saved := CollectionRecordsFor(TextUntilNul(node.identity.id[:]))
return ifx saved == null then null else *saved.files
}
CollectionAllows :: (context: *void, node: *AppNode, name: string) -> bool {
if name == KRYON_NOTIFICATION_SCHEDULE {
if node == null || node.collection { return false }
@@ -188,9 +177,6 @@ CollectionAllows :: (context: *void, node: *AppNode, name: string) -> bool {
return CollectionNotificationsAllowed()
}
return name == "AppRecordHost" || name == "SaveAppRecordHost" ||
(node != null && !node.collection && (name == "DocumentReadHost" ||
name == "DocumentStorageReadyHost" || name == "DocumentFlushHost" ||
name == "DocumentStatusHost" || name == "DocumentWriteHost")) ||
name == "AppFriendHost" || name == "AppSharedHost" || name == "AppSharedItemHost" ||
name == "AppInvitationHost" || name == "RefreshAppSharedHost" || name == "SendAppSharedHost" ||
name == "SmoothFramesHost" || name == "AppLocaleHost" || name == "AppSoundHost" || name == "AppNowHost" ||
@@ -205,33 +191,6 @@ CollectionAllows :: (context: *void, node: *AppNode, name: string) -> bool {
CollectionCall :: (context: *void, node: *AppNode, module: *u8, function: *u8,
arguments: *HostValue, count: s32, result: *HostValue) -> s32 {
name := TextFromCString(function)
if name == "DocumentReadHost" && count == 1 &&
HostScalarValid(arguments[0], "string", cast(s32)HostString) {
record := CollectionRecordsFor(TextUntilNul(node.identity.id[:]))
if record == null || node.collection { return 0 }
AppFileFree(record.text)
record.text = AppFileRead(*record.files, AppArgumentText(arguments[0]))
result.* = AppHostText(record.text)
return 1
}
if name == "DocumentWriteHost" && count == 2 &&
HostScalarValid(arguments[0], "string", cast(s32)HostString) &&
HostScalarValid(arguments[1], "string", cast(s32)HostString) {
saved := CollectionDocuments(context, node)
if saved == null {
result.* = HostScalar("bool", 0)
return 1
}
saved_document := AppFileWrite(saved, AppArgumentText(arguments[0]), AppArgumentText(arguments[1]))
result.* = HostScalar("bool", ifx saved_document then 1 else 0)
return 1
}
if name == "DocumentStatusHost" && count == 0 {
saved := CollectionDocuments(context, node)
if saved == null { return 0 }
result.* = HostScalar("s32", cast(s64)saved.status)
return 1
}
if name == "AppRecordHost" && count == 1 &&
HostScalarValid(arguments[0], "string", cast(s32)HostString) {
record := AppArgumentText(arguments[0])
@@ -581,7 +540,6 @@ CollectionStart :: (bundle: string, digest: string, harness_digest: string,
locale: string, packed: bool) -> bool {
platform := AppPlatform.{.allows = CollectionAllows, .call = CollectionCall,
.focused = CollectionNotificationFocused,
.documents = CollectionDocuments,
.widgets = CollectionWidgets, .save = CollectionSave, .state = CollectionState,
.effect = CollectionEffect, .host_api = GAME_HOST_API,
// Covers show only the art; the download dialog names the size.
@@ -641,7 +599,7 @@ CollectionOpenBytes :: (bytes: string, metadata: string, data: string) -> bool {
selected_digest := TextUntilNul(digest[:])
if !packed {
if !CollectionNodeOpen(metadata, data, bytes, selected_digest, TextUntilNul(harness[:]), language) { return false }
if collection_node_remote {
if collection_node.ready {
selected = collection_node.bytes
selected_digest = TextUntilNul(collection_node.release.artifacts[0].sha256[:])
}
@@ -693,7 +651,6 @@ CollectionOpenShoveyBytes :: (bytes: string, metadata: string, data: string) ->
language := ifx locale.count >= 2 then locale[:2] else "en"
platform := AppPlatform.{.allows = CollectionAllows, .call = CollectionCall,
.focused = CollectionNotificationFocused,
.documents = CollectionDocuments,
.widgets = CollectionWidgets, .save = CollectionSave, .state = CollectionState,
.effect = CollectionEffect, .host_api = GAME_HOST_API}
collection_ready = AppHostStart(*collection_host, bytes, "arcade.local", "arcade.shovey-player",
@@ -765,8 +722,7 @@ CollectionOpenGame :: (id: string) -> bool {
if root == null || !root.collection { Report("Arcade: no collection is open to start "); Report(id); Report("\n"); return false }
entry := AppCatalogAt(*root.catalog, AppCatalogFind(*root.catalog, id))
plan: AppInstallPlan
if entry != null && (TextUntilNul(entry.cover.action[:]) == "title" ||
(AppHostInstallPlan(*collection_host, root, entry, *plan) && plan.count > 0)) {
if entry != null && AppHostInstallPlan(*collection_host, root, entry, *plan) && plan.count > 0 {
unused CopyCString(id, collection_host.platform.presentation.download_id[:])
collection_host.platform.presentation.download_request += 1
return true
@@ -865,12 +821,7 @@ CollectionFrame :: (session: Session, viewport: Rectangle, key: s32, modifiers:
collection_toolbar_visible = true
defer { CollectionToolbar(session, viewport) }
if CollectionNodeScreen(session, viewport) { collection_toolbar_visible = false; return true }
if entity_visible {
collection_toolbar_visible = false
return EntityFrame(session, viewport, key, modifiers,
Labels.AppsLabel(TextUntilNul(collection_node_locale[:]), "library_connection"),
ifx collection_node.files != null then *collection_node_notice else null)
}
if entity_visible { return EntityFrame(session, viewport, key, modifiers) }
runtime := AppHostActiveRuntime(*collection_host)
if runtime == null { Report("Arcade: no app is running\n"); return false }
opening := !runtime.node.collection && (!collection_loading.shown ||
@@ -886,32 +837,13 @@ CollectionFrame :: (session: Session, viewport: Rectangle, key: s32, modifiers:
// The covers ask about new levels once; the question takes every key.
asking := runtime.node.collection && !collection_host.platform.presentation.cover_grid && CollectionUpdates() == 2
if asking { key = 0 }
// Console guest Home and its opaque strip are composed by shared Apps,
// including in Inner Breeze; the ordinary non-console host bar stays here.
top: s32 = ifx !covered && !runtime.node.collection && !collection_host.platform.presentation.cover_grid && (entity_ready || nested) then 56 else 0
if runtime.node.collection && collection_node.files != null && !collection_host.platform.presentation.cover_grid { top = 88 }
// The guest paints only its bounds below this host-owned bar. Paint an
// opaque base before its controls and any translucent navigation surface.
if top > 0 {
Box(session, BoxProps.{.key = cast(u64)49190,
.bounds = Rectangle.{viewport.x, viewport.y, viewport.width, cast(float32)top},
.fill = ColorFromPacked(ifx entity_shovey then ShoveyHostPalette().background else AppCoversPalette().background)})
}
top: s32 = ifx !covered && !runtime.node.collection && (entity_ready || nested) then 56 else 0
if runtime.node.collection && collection_node.files != null { top = 88 }
now := cast(float64)MonotonicMilliseconds() / 1000.0
runtime.app.session = session
runtime.app.bounds = Rectangle.{viewport.x, viewport.y + cast(float32)top, viewport.width, viewport.height - cast(float32)top}
runtime.app.scale = 1.0
runtime.app.font = 16
// Enter/Space routed to a focused host HUD action must not also activate
// the guest console's selected game. Kryon retains the HUD activation.
if key == 257 || key == 32 {
hud_index: s32
while hud_index < TreeCount(session) {
hud_node := TreeInputAt(session, hud_index)
if (hud_node.key == cast(u64)49200 || hud_node.key == cast(u64)49202 || hud_node.key == cast(u64)49210) && TreeFocusedAt(session, hud_index) { key = 0 }
hud_index += 1
}
}
runtime.app.key = key
runtime.app.modifiers = modifiers
// A focused text field in the game edits with what was typed this frame,
@@ -934,16 +866,12 @@ CollectionFrame :: (session: Session, viewport: Rectangle, key: s32, modifiers:
}
WidgetHostBegin(session, CollectionAssetAllowed, CollectionAssetPath)
collection_pictures_missing = false
drawn_handle := collection_host.tree.active
drawn := CollectionRunFrame()
WidgetHostEnd()
if !drawn {
Report("collection frame failed\n")
return false
}
// Shared host navigation can retire this guest after its frame. Its node
// no longer belongs to this route; the next frame draws the new page.
if !AppHandleEqual(collection_host.tree.active, drawn_handle) { return true }
if collection_leave_to_library {
collection_leave_to_library = false
unused AppHostBack(*collection_host)
@@ -983,49 +911,38 @@ CollectionFrame :: (session: Session, viewport: Rectangle, key: s32, modifiers:
if !VecPush(collection_frame_paths, title) { AppFileFree(title); return false }
Box(session, BoxProps.{.key = cast(u64)6, .bounds = Rectangle.{viewport.x, viewport.y, viewport.width, 56.0},
.fill = Color.{128, 140, 136, 40}})
if Button(session, ButtonProps.{.key = cast(u64)7, .id = 7, .label = "Back",
.bounds = Rectangle.{viewport.x + 8.0, viewport.y + 6.0, 76.0, 44.0},
.tone = ButtonTone.ButtonToneNeutral, .emphasis = ButtonEmphasis.ButtonEmphasisSoft}) != 0 {
unused AppHostBack(*collection_host)
}
Text(session, TextProps.{.key = cast(u64)8,
.text = title, .font = 20,
.bounds = Rectangle.{viewport.x + 150.0, viewport.y + 12.0, viewport.width - 166.0, 36.0}})
.bounds = Rectangle.{viewport.x + 100.0, viewport.y + 12.0, viewport.width - 116.0, 36.0}})
}
return true
}
// The HUD is part of the native shell, so it also works before library consent.
CollectionHudPath :: (icon: string) -> string {
#if #defined(ANDROID_BUILD) {
relative := Join("assets/hud", icon)
defer { AppFileFree(relative) }
bytes := ReadAppAsset(relative)
defer { FreeAppAsset(bytes) }
if bytes != "" { unused AppFileWrite(*collection_resources, relative, bytes) }
path := Join(collection_resources.root, relative)
if !VecPush(collection_frame_paths, path) { AppFileFree(path); return "" }
return path
} else #if #defined(PLATFORM_WEB) {
return ifx icon == "profile.webp" then "/assets/hud/profile.webp" else "/assets/hud/dew.webp"
} else {
directory := ExecutableDirectory()
defer { AppFileFree(directory) }
relative := Join("assets/hud", icon)
defer { AppFileFree(relative) }
path := Join(directory, relative)
if !VecPush(collection_frame_paths, path) { AppFileFree(path); return "" }
return path
}
}
CollectionToolbar :: (session: Session, viewport: Rectangle) {
if !entity_ready || !collection_toolbar_visible { return }
unused WidgetPaletteUse(session, ifx entity_shovey then ShoveyHostPalette() else AppCoversPalette())
defer { unused WidgetPaletteRestore(session) }
// The account's Dew beside the Profile: a drop and the number, 0 until an
// account is connected; it opens the Profile too.
dew := EntityDewBalanceText(collection_dew_text[:])
width := 144.0 + 10.0 * cast(float32)dew.count
profile_path := CollectionHudPath("profile.webp")
dew_path := CollectionHudPath("dew.webp")
if AppGameHud(session, AppGameHudProps.{.key = cast(u64)49200,
.bounds = Rectangle.{viewport.x + viewport.width - width - 12.0, viewport.y + 12.0, width, 56.0},
.dew_text = dew, .profile_label = Labels.AppsLabel(TextUntilNul(collection_host.locale[:]), "profile"), .dew_label = "Dew",
.profile_image = profile_path, .dew_image = dew_path}) != 0 { unused EntityShow() }
dew_width := 52.0 + 10.0 * cast(float32)dew.count
if Button(session, ButtonProps.{.key = cast(u64)49201, .id = 49201, .label = dew,
.bounds = Rectangle.{viewport.x + viewport.width - 64.0 - dew_width, viewport.y + 6.0, dew_width, 44.0},
.icon_shape = DewIcon.Shape, .tone = ButtonTone.ButtonToneNeutral, .emphasis = ButtonEmphasis.ButtonEmphasisSoft}) != 0 {
unused EntityShow()
}
if Button(session, ButtonProps.{.key = cast(u64)49200, .id = 49200, .label = "Profile",
.bounds = Rectangle.{viewport.x + viewport.width - 56.0, viewport.y + 6.0, 44.0, 44.0},
.icon_shape = ProfileIcon.Shape, .icon_only = true,
.selected = entity_visible,
.tone = ButtonTone.ButtonToneNeutral, .emphasis = ButtonEmphasis.ButtonEmphasisSoft}) != 0 {
unused EntityShow()
}
}
c :: #system_library "c";
@@ -1045,35 +962,6 @@ collection_seed: string;
collection_seed_digest: [65]u8;
collection_harness_digest: [65]u8;
collection_node_locale: [16]u8;
// The version of the catalog this build carries; "" when its receipt has none.
collection_seed_version: [32]u8;
CollectionVersionPart :: (text: string, at: *s64) -> s64 {
value: s64
while at.* < text.count && text[at.*] >= cast(u8)48 && text[at.*] <= cast(u8)57 {
value = value * 10 + cast(s64)(text[at.*] - cast(u8)48)
at.* += 1
}
if at.* < text.count && text[at.*] == cast(u8)46 { at.* += 1 }
return value
}
// A saved or fetched signed release replaces the catalog this build carries
// only when it is newer. An older or equal cached release never hides the
// build's own library, artwork or games.
CollectionNodeNewer :: () -> bool {
current := TextUntilNul(collection_seed_version[:])
if current == "" { return true }
candidate := TextUntilNul(collection_node.release.version[:])
left: s64
right: s64
for part: cast(s32)0..2 {
a := CollectionVersionPart(candidate, *left)
b := CollectionVersionPart(current, *right)
if a != b { return a > b }
}
return false
}
collection_signature :: #system_library "c";
CollectionCheckSignature :: (signature: *u8, public_key: *u8, message: *u8,
@@ -1102,15 +990,13 @@ CollectionNodeOpen :: (metadata: string, data: string, seed: string,
unused CopyCString(digest, collection_seed_digest[:])
unused CopyCString(harness, collection_harness_digest[:])
unused CopyCString(locale, collection_node_locale[:])
collection_seed_version[0] = 0
unused AppsReadText(metadata, 0, "version", collection_seed_version[:])
collection_package_origin = AppRemoteCopy(TextUntilNul(collection_node.source.origin[:]))
collection_node_choice = AppConnectionRead(*collection_node_files, collection_package_origin)
collection_node_notice = collection_node_choice == APP_CONNECTION_UNDECIDED
allowed := collection_node_choice == APP_CONNECTION_ALLOWED
CollectionDownloadsAllow(allowed)
AppRemoteCatalogAllow(*collection_node, allowed)
collection_node_remote = collection_node.ready && CollectionNodeNewer()
collection_node_remote = collection_node.ready
if allowed { unused AppRemoteCatalogRefresh(*collection_node) }
return true
}
@@ -1169,16 +1055,6 @@ CollectionNodePump :: () {
AppRemoteCatalogPump(*collection_node)
// A newer library applies on its own once the background fetch finishes.
if (collection_node_apply || collection_node_choice == APP_CONNECTION_ALLOWED) && collection_node.stage == 0 {
// The build's own newer catalog stays; the fetched release stays cached.
if collection_node.changed && !collection_node_remote && !CollectionNodeNewer() {
AppRemoteCatalogCollect(*collection_node)
}
// A newer signed release can reuse cached verified bytes without a
// download, so the catalog does not report it as changed.
if !collection_node.changed && !collection_node_remote && collection_node.ready &&
!collection_node.failed && CollectionNodeNewer() {
collection_node.changed = true
}
if collection_node.changed && !CollectionNodeActivate() { return }
collection_node_apply = false
collection_node_initial = false
+3 -4
View File
@@ -14,7 +14,6 @@
#import "kryon/carousel"
#import "apps/appearance"
#import "kryon/widget_palette"
#import "kryon/loading_indicator"
sdl :: #system_library "SDL2";
SetTitle :: (window: *void, title: *u8) #foreign sdl "SDL_SetWindowTitle";
@@ -35,8 +34,8 @@ DrawStartup :: (session: Session, directory: string, standalone: bool = true) ->
} else {
unused WidgetPaletteUse(session, AppCoversPalette())
Box(session, BoxProps.{.key = cast(u64)48000, .bounds = viewport, .fill = Color.{17, 18, 35, 255}})
LoadingIndicator(session, LoadingIndicatorProps.{.key = cast(u64)48001,
.bounds = viewport, .now = cast(float64)MonotonicMilliseconds() / 1000.0})
Text(session, TextProps.{.key = cast(u64)48001, .text = "Arcade", .font = 32,
.bounds = Rectangle.{20.0, 20.0, viewport.width - 40.0, 44.0}})
unused WidgetPaletteRestore(session)
}
if EndFrame(session) != FrameStatus.FrameOk { return false }
@@ -49,7 +48,7 @@ Draw :: (session: Session) -> bool {
BeginDesktopFrame()
KeyboardModifiersSend(session, DesktopModifiers())
key := DesktopPressedKey()
for candidate: cast(s32)0..511 {
for candidate: cast(s32)0..269 {
if TestDriverKeyPressed(candidate) { key = candidate; break }
}
if key == 256 && CollectionBack() { key = 0 }
+1 -7
View File
@@ -84,8 +84,7 @@ EntityBack :: () -> bool {
return true
}
EntityFrame :: (session: Session, viewport: Rectangle, key: s32, modifiers: s32,
connection_label: string = "", connection: *bool = null) -> bool {
EntityFrame :: (session: Session, viewport: Rectangle, key: s32, modifiers: s32) -> bool {
unused WidgetPaletteUse(session, ifx entity_shovey then ShoveyHostPalette() else AppCoversPalette())
defer { unused WidgetPaletteRestore(session) }
Box(session, BoxProps.{.key = cast(u64)49010, .bounds = viewport,
@@ -96,12 +95,7 @@ EntityFrame :: (session: Session, viewport: Rectangle, key: s32, modifiers: s32,
if height > 720.0 { height = 720.0 }
modal := ModalFrame(session, ModalFrameProps.{.key = cast(u64)49000, .id = 49000,
.title = "Profile", .width = cast(s32)width, .height = cast(s32)height, .scale = 1.0,
.has_left_action = connection != null, .left_label = connection_label,
.has_right_action = true, .right_label = "Back"})
if modal.left_clicked && connection != null && EntityHostSave() {
entity_visible = false
connection.* = true
}
if modal.dismissed || modal.right_clicked { unused EntityBack() }
if !modal.opened { return true }
input := TextFieldInputFor(key, modifiers, TypedTextTake(session, entity_typed[:]))
+2 -2
View File
@@ -3,8 +3,8 @@
// that declares a newer one is refused. scripts/check-games.py fails while it
// differs from the standard and the ledger.
GAME_CONTRACT_VERSION :: 1
GAME_OLDEST_HOST_API :: 43
GAME_HOST_API :: 43
GAME_OLDEST_HOST_API :: 41
GAME_HOST_API :: 42
// The older direct loader has no verified reminder dispatch. Products use
// CollectionHost; do not advertise its API42 authority from the direct loader.
GAME_DIRECT_HOST_API :: 41
+2 -2
View File
@@ -2,8 +2,8 @@
"name": "kryon-node-app",
"contract_version": 1,
"module_api": 2,
"host_api": 43,
"oldest_host_api": 43,
"host_api": 42,
"oldest_host_api": 41,
"identity": "Stable signed package ID; moving source must not rename installed games",
"frames": {
"matching": "Fields match by name",
-11
View File
@@ -50,22 +50,11 @@ class AndroidCatalogTests(unittest.TestCase):
def setUp(self):
self.assets = {name: (ROOT / 'build' / name).read_bytes()
for name in ('arcade.zx', 'arcade.json', 'apps.zx', 'entity.zx')}
self.assets.update({name: (ROOT / 'build/android-assets' / name).read_bytes()
for name in android_catalog.HUD_PATHS})
self.assets['kryon-font.ttf'] = b'font' # Content boundary, not a font renderer.
def test_standard_catalog(self):
verify_assets(self.assets)
def test_reject_modified_or_missing_startup_hud(self):
for name in android_catalog.HUD_PATHS:
with self.subTest(path=name), self.assertRaisesRegex(AssertionError, 'HUD icons differ'):
verify_assets(self.assets | {name: b'changed'})
without = dict(self.assets)
del without[name]
with self.assertRaisesRegex(AssertionError, 'Unexpected or missing'):
verify_assets(without)
def test_reject_changed_node_trust_binding(self):
for key, value in (('origin', 'https://example.org'), ('public_key', 'a' * 64),
('app_id', 'inbe.other'), ('minimum_sequence', 0)):
+33 -38
View File
@@ -14,7 +14,7 @@ import time
root = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(root / 'scripts'))
from android_catalog import verify_assets
from collection_ui_test import package_server, answer_library_question, answer_level_updates, enter_shovey_play, campaign_progress
from collection_ui_test import package_server, answer_library_question, answer_level_updates
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--binary', type=Path, required=True)
@@ -23,7 +23,7 @@ args = parser.parse_args()
assert int(os.environ['DISPLAY'].split(':')[-1].split('.')[0]) >= 400
assert os.environ['YUE_DESKTOP_RECOVERY'] == '0'
assets = root / 'build/android-assets'
metadata = verify_assets({p.relative_to(assets).as_posix(): p.read_bytes() for p in assets.rglob('*') if p.is_file()} |
metadata = verify_assets({p.name: p.read_bytes() for p in assets.iterdir() if p.is_file()} |
{'entity.zx': (root / 'build/entity.zx').read_bytes()})
entries = {entry['expected_id']: entry for entry in metadata['children']}
sys.path.insert(0, str(args.inbe_source / 'tests'))
@@ -38,7 +38,6 @@ with tempfile.TemporaryDirectory(prefix='host-', dir=output) as temporary, packa
shutil.copy2(args.binary, install / 'arcade')
for name in ('arcade.zx', 'arcade.json', 'apps.zx'):
shutil.copyfile(assets / name, install / name)
shutil.copytree(assets / 'assets/hud', install / 'assets/hud')
shutil.copyfile(root / 'build/entity.zx', install / 'entity.zx')
profile = Path(temporary) / 'profile'
retained = profile / 'games/inbe.chess/records/computer'
@@ -69,47 +68,33 @@ with tempfile.TemporaryDirectory(prefix='host-', dir=output) as temporary, packa
driver.press(key=action['key'], role='button')
def play():
enter_shovey_play(driver)
answer_level_updates(driver)
if driver.find(label='How do you want to move?', role='text'):
driver.press(label='Swipe and tap')
driver.wait(label='Restart', role='button', timeout=60)
assert not driver.find(label='Download', role='button')
def library():
for _ in range(8):
if driver.find(label='Shovey', role='button'):
return
driver.key('escape')
driver.wait_idle(frames=5)
raise driver._failure('Back did not return to the library')
def editor():
driver.wait(label='Editor', role='button')
driver.press(label='Editor', role='button')
if driver.find(label='Cancel', role='button'):
download()
driver.wait(label='Levels', role='button', timeout=60)
with application('install'):
answer_library_question(driver)
games = {entry['sha256'] for entry in metadata['children']}
assert not games & set(server['requests']), 'No game before download consent'
assert not driver.find(label='Shovey Editor', role='button'), 'Editors belong inside their game'
driver.press(label='Shovey', role='button')
driver.press(label='Shovey Editor', role='button')
driver.wait(label='Cancel', role='button')
driver.press(label='Cancel', role='button')
assert not games & set(server['requests']), 'Cancel must download nothing'
driver.press(label='Shovey', role='button')
driver.press(label='Shovey Editor', role='button')
server['corrupt_shovey'] = True
download()
driver.wait(label='Try again', role='button', timeout=60)
assert not driver.find(label='Play', role='button'), 'Corrupt game must not open'
assert not driver.find(label='New level', role='text'), 'Corrupt dependency must not open'
server['corrupt_shovey'] = False
download('Try again')
driver.wait(label='Play', role='button', timeout=60)
driver.wait(label='New level', role='text', timeout=60)
assert server['requests'].count(entries['shovey']['sha256']) == 2
assert entries['shovey-editor']['sha256'] not in server['requests']
assert server['requests'].count(entries['shovey-editor']['sha256']) == 1
driver.key('escape')
driver.wait(label='Shovey', role='button')
driver.press(label='Shovey', role='button')
play()
driver.key('right')
deadline = time.monotonic() + 20
@@ -117,14 +102,24 @@ with tempfile.TemporaryDirectory(prefix='host-', dir=output) as temporary, packa
driver.wait_idle(frames=5)
assert record.exists(), 'Game must persist progress'
driver.press(label='Back', role='button')
driver.wait(label='Editor', role='button')
editor()
assert server['requests'].count(entries['shovey-editor']['sha256']) == 1
library()
driver.wait(label='Shovey', role='button')
driver.press(label='Apfelwurm', role='button')
download()
driver.wait(label='Play', role='button', timeout=60)
library()
driver.key('escape')
driver.wait(label='Shovey', role='button')
driver.press(label='Profile', role='button')
driver.wait(label='Account', role='text')
driver.press(label='Leaderboard', role='button')
driver.wait(label='Apfelwurm', role='button')
driver.press(label='Apfelwurm', role='button')
# The profile stays usable with its optional game sheets omitted.
driver.wait(label='Back', role='button')
driver.press(label='Back', role='button')
driver.wait(label='Account', role='text')
driver.press(label='Back', role='button')
driver.key('escape')
driver.wait(label='Shovey', role='button')
assert not driver.find(label='Node connection', role='button'), 'The library has no node controls'
assert not driver.find(label='Refresh library', role='button'), 'The library refreshes by itself'
saved = record.read_bytes()
@@ -136,18 +131,18 @@ with tempfile.TemporaryDirectory(prefix='host-', dir=output) as temporary, packa
requested = list(server['requests'])
server['offline'] = True
with application('offline'):
driver.wait(label='Shovey', role='button')
assert not driver.find(label='Allow fetching content and automatic app updates?', role='text'), 'Consent stays saved'
answer_library_question(driver)
driver.press(label='Shovey', role='button')
play()
driver.press(label='Back', role='button')
driver.wait(label='Editor', role='button')
editor()
library()
driver.wait(label='Shovey Editor', role='button')
driver.press(label='Shovey Editor', role='button')
driver.wait(label='New level', role='text', timeout=60)
driver.key('escape')
driver.wait(label='Apfelwurm', role='button')
driver.press(label='Apfelwurm', role='button')
driver.wait(label='Play', role='button', timeout=60)
cached_payloads = games | {metadata['art']['sha256']}
assert not cached_payloads & set(server['requests'][len(requested):]), 'Installed apps/art must reopen offline without requests'
assert campaign_progress(record.read_bytes()) == campaign_progress(saved), 'Offline restart must preserve saved progress'
assert server['requests'] == requested, 'Installed apps/art must reopen offline without requests'
assert record.read_bytes() == saved, 'Offline restart must preserve saved progress'
assert retained.read_bytes() == b'existing private save'
print('Android catalog: consent, dependency verification/retry, install/open, cached offline and retained saves passed')
+11 -7
View File
@@ -32,10 +32,13 @@ class ControllerSourceTests(unittest.TestCase):
(root / 'ziran.local.toml').write_text('unreviewed local dependency')
package = root / 'cached-apps'
output = root / 'output'
compiler = root / 'cached-ziran/build/bin/ziran'
compiler.parent.mkdir(parents=True)
compiler.write_text('fixture compiler path; subprocess calls are mocked')
contexts = []
def resolve(command, *, cwd, text):
self.assertEqual(command, ['ziran', 'pkg', 'path', 'apps', '--locked'])
self.assertIn(command, [['ziran', 'pkg', 'path', name, '--locked'] for name in ('apps', 'ziran', 'kryon')])
self.assertTrue(text)
self.assertNotIn('dependencies.wurm', (cwd / 'ziran.toml').read_text())
selected = json.loads((cwd / 'ziran.lock').read_text())
@@ -44,17 +47,18 @@ class ControllerSourceTests(unittest.TestCase):
self.assertEqual(selected['toolchain'], lock['toolchain'])
self.assertEqual({p.name for p in cwd.iterdir()}, {'ziran.toml', 'ziran.lock'})
contexts.append(cwd)
return str(package) + '\n'
return str(package if command[3] == 'apps' else root / ('cached-' + command[3])) + '\n'
with patch.object(builder.subprocess, 'check_output', side_effect=resolve), \
patch.object(builder.subprocess, 'run') as run:
builder.build(root, output)
self.assertEqual(run.call_count, 1)
self.assertEqual(run.call_count, 2)
command = run.call_args.args[0]
self.assertEqual(command, [builder.sys.executable,
str(package / 'scripts/build-ui.py'),
'--output', str(output.resolve())])
self.assertEqual(run.call_args.kwargs, {'cwd': contexts[0], 'check': True})
self.assertEqual(command[0], str(compiler))
self.assertIn(str(package / 'ui/apps.zi'), command)
self.assertIn('kryon=' + str(root / 'cached-kryon/src/ui'), command)
self.assertIn(str(root / 'cached-ziran/std'), command)
self.assertNotIn('--project', command)
self.assertFalse(contexts[0].exists())
self.assertEqual((root / 'ziran.toml').read_text(), manifest)
self.assertEqual(json.loads((root / 'ziran.lock').read_text()), lock)
+3 -2
View File
@@ -25,7 +25,7 @@ assert chess["kind"] == "game"
assert (ROOT / "apps/chess/engine.zi").is_file(), "Arcade must own the game"
assert not (inbe / "apps/chess").exists(), "Inbe must consume Chess, not own another copy"
assert chess["contract_version"] == 1 and chess["module_api"] == 2
assert chess["host_api"] == 43 and chess["save_schema"] == 1
assert chess["host_api"] == 41 and chess["save_schema"] == 1
assert (ROOT / chess["preview"]).is_file()
env = {key: value for key, value in os.environ.items()
if key not in {"DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "DBUS_SESSION_BUS_ADDRESS"}}
@@ -37,9 +37,10 @@ assert b"xyz.waozi.choano\n" in listed_output
unknown = subprocess.run([str(ROOT / "build/arcade"), "--app", "unknown"],
env=env, capture_output=True, timeout=10)
assert unknown.returncode == 1 and b"unknown game" in unknown.stderr
original = (ROOT / 'build/games/chess.zx').read_bytes()
container = (ROOT / 'build/arcade.zx').read_bytes()
metadata = json.loads((ROOT / 'build/arcade.json').read_text())
assert not (ROOT / 'build/games/chess.zx').exists(), 'Disabled Chess must not be exported'
assert original not in container, 'Disabled Chess must not remain in the published collection'
assert {child['id'] for child in metadata['children']} == {
'arcade.shovey', 'arcade.shovey-editor', 'xyz.waozi.choano',
'xyz.waozi.wurm', 'xyz.waozi.wurm-editor'
-3
View File
@@ -157,7 +157,6 @@ class AndroidVerifierTests(Fixture):
(self.root / 'apps/versions.json').write_text(json.dumps(ledger))
self.metadata['node'] = builder.node_source(self.root)
self.assets = {'assets/arcade.zx': payload, 'assets/apps.zx': controller,
**{'assets/' + name: b'fixture-hud' for name in android_catalog.HUD_PATHS},
'assets/entity.zx': bundle({}), 'assets/kryon-font.ttf': b'font',
'res/icon.png': b'icon', 'lib/arm64-v8a/libmain.so': b'arm64',
'lib/armeabi-v7a/libmain.so': b'arm', 'classes.dex': b'normal'}
@@ -182,8 +181,6 @@ class AndroidVerifierTests(Fixture):
with patch.object(release, 'ROOT', self.root), patch.object(android_catalog, 'ROOT', self.root), \
patch.object(android_catalog, 'profile_asset_hashes', return_value={}), \
patch.object(android_catalog, 'hud_hashes', return_value={
name: hashlib.sha256(b'fixture-hud').hexdigest() for name in android_catalog.HUD_PATHS}), \
patch.object(release, 'verify_launcher'), \
patch.object(release.subprocess, 'check_output', side_effect=command), \
patch.object(release.subprocess, 'run'):
+1 -1
View File
@@ -167,7 +167,7 @@ Check :: () -> s32 {
if protocol == APPS_NODE_PROTOCOL {
if Open(key, protocol, true) { return 120 }
AppHostStop(*collection_host); AppHostCollect(*collection_host)
if Open(key, protocol, false, 42) { return 121 }
if Open(key, protocol, false, 41) { return 121 }
AppHostStop(*collection_host); AppHostCollect(*collection_host)
}
}
+4 -10
View File
@@ -10,7 +10,7 @@ import subprocess
ROOT = Path(__file__).resolve().parents[1]
WORK = ROOT / 'work/notification-api42'
ZIRAN = ROOT / 'scripts/ziran.sh'
LOCK = [] if (ROOT / 'ziran.local.toml').exists() else ['--locked']
LOCK = ['--locked']
def run(*args):
@@ -49,7 +49,7 @@ def main():
assets = WORK / game / 'assets/notification'
assets.mkdir(parents=True, exist_ok=True)
(assets / 'catalog.json').write_text(json.dumps(dict(id=identifier, name='notification',
contract_version=1, module_api=2, host_api=43, save_schema=1)))
contract_version=1, module_api=2, host_api=42, save_schema=1)))
for protocol in (1, 2):
defines = ['--define', 'KRYON_HOSTED_UI']
if protocol == 2:
@@ -73,9 +73,7 @@ def main():
lines = (ROOT / 'build/.ziran/module-map.tsv').read_text().splitlines()
replacements = {'notification_schedule': apps / 'tests/notification_provider.zi',
'collection_notification_platform': ROOT / 'tests/collection_notification_native_fixture.zi'}
kryon_id = next(fields[3] for line in lines
if len(fields := line.split('\t')) == 5
and fields[:3] == ['D', 'root', 'kryon/notification_schedule'])
kryon_id = json.loads((ROOT / 'ziran.lock').read_text())['root']['dependencies']['kryon']
replaced = dict.fromkeys(replacements, 0)
for index, line in enumerate(lines):
fields = line.split('\t')
@@ -90,9 +88,6 @@ def main():
lines[index] = '\t'.join(fields)
if any(count != 1 for count in replaced.values()):
raise RuntimeError(f'Expected unique OS providers: {replaced}')
# Reuse Apps' display-free raster exports without exposing test modules
# through either package's production module roots.
lines.append(f'M\troot\tgame_hud_host\t{apps / "tests/game_hud_host.zi"}')
mapping = WORK / 'module-map.tsv'
mapping.write_text('\n'.join(lines) + '\n')
os.environ['ZIRAN_PACKAGE_MAP'] = str(mapping)
@@ -100,8 +95,7 @@ def main():
run(compiler, '--prune-stale', '--module-path', toolchain / 'std', '--no-main',
'--define', 'PLATFORM_DESKTOP', *(['--define', 'ARCADE_API41_GAMES'] if args.api41_games else []),
'--entry', 'collection_notifications_behavior:Check',
'--root', ROOT / 'tests', '-o', output, ROOT / 'tests/collection_notifications_behavior.zi',
apps / 'tests/game_hud_host.zi')
'--root', ROOT / 'tests', '-o', output, ROOT / 'tests/collection_notifications_behavior.zi')
(output / 'entry.c').write_text('#include <stdio.h>\n#include "collection_notifications_behavior.h"\n'
'int main(void) { int r=Check(); if(r) fprintf(stderr,"Arcade notification test %d failed\\n",r); return r; }\n')
runtime = ROOT / 'build/ziran/libziran.a'
+29 -68
View File
@@ -117,16 +117,15 @@ class CollectionTests(unittest.TestCase):
for path in (self.root / "build/games").glob("*.zx"):
path.write_bytes(b"game fixture".ljust(32 * 1024, b"\0"))
for path in (self.root / "assets/arcade/library").iterdir():
if path.suffix in (".webp",):
if path.suffix in (".png", ".jpg"):
path.write_bytes(b"art fixture".ljust(128, b"\0"))
def test_separately_loaded_games_can_exceed_one_root_limit_together(self):
# Five bounded fixture payloads exceed 64 MiB together, while every
# game and the Shovey standalone pair fit. Their sizes are independent
# of future game-art growth. Never alter the real build outputs.
# The registered games exceed 64 MiB together; each game and the
# Shovey standalone pair still fit. Never alter the real build outputs.
for path in (self.root / "build/games").glob("*.zx"):
with path.open("r+b") as data:
data.truncate(16 * 1024 * 1024)
data.truncate(max(path.stat().st_size, 16 * 1024 * 1024))
catalog = self.stage()
self.assertGreater(sum(child["bytes"] for child in catalog["children"]), 64 * 1024 * 1024)
small, games, art = (self.root / name for name in ("small", "downloads", "art"))
@@ -169,7 +168,7 @@ class CollectionTests(unittest.TestCase):
path.write_bytes(b"game")
# Art is one separately loaded root, even though it has many files.
pictures = [path for path in (self.root / "assets/arcade/library").iterdir()
if path.suffix in (".webp",)]
if path.suffix in (".png", ".jpg")]
for path in pictures:
path.write_bytes(b"x" * 8192)
with patch.object(builder, "MAX_PAYLOAD_BYTES", 48 * 1024):
@@ -206,25 +205,10 @@ class CollectionTests(unittest.TestCase):
compile_art()
self.assertEqual(target.read_bytes(), previous)
def test_oversized_art_bundle_is_not_published(self):
output = self.root / "art-budget-catalog"
games = self.root / "art-budget-downloads"
(output / "assets/apps").mkdir(parents=True)
games.mkdir()
catalog = output / "assets/apps/catalog.json"
catalog.write_text('{"children": []}\n')
bundle = self.root / "over-budget-art.zx"
bundle.write_bytes(b"art" + bytes(builder.MAX_LIBRARY_ART_BYTES))
with self.assertRaisesRegex(ValueError, "2 MiB art budget"):
builder.add_art(output, games, bundle)
self.assertEqual(catalog.read_text(), '{"children": []}\n')
self.assertEqual(list(games.iterdir()), [])
def test_staging_uses_locked_packages_unless_local_overrides_exist(self):
packages = builder.declared_packages(self.root, lock_flags=self.lock_flags)
artwork = json.loads((self.root / "games.json").read_text()).get("artwork", {})
sources = {package["name"]: package["source"] for package in packages[1:]}
sources["apps"] = Path(subprocess.check_output([str(ROOT / "scripts/ziran.sh"), "pkg", "path", "apps", *self.lock_flags], cwd=ROOT, text=True).strip())
for package in packages[1:]:
if package["name"] in artwork:
sources[artwork[package["name"]]] = package["apps"][0]["art_source"]
@@ -309,7 +293,6 @@ class CollectionTests(unittest.TestCase):
registration = self.root / 'games.json'
value = json.loads(registration.read_text())
value.pop('artwork', None)
value.get('screenshots', {}).pop('wurm', None)
registration.write_text(json.dumps(value))
source = self.root / "fixture-packages/wurm"
(source / "editor").mkdir(parents=True)
@@ -328,7 +311,7 @@ class CollectionTests(unittest.TestCase):
}))
(source / "editor/catalog.json").write_text(json.dumps({
"id": "xyz.waozi.wurm-editor", "name": "wurm-editor", "title": "Apfelwurm Editor",
"kind": "game", "contract_version": 1, "module_api": 2, "host_api": 43,
"kind": "game", "contract_version": 1, "module_api": 2, "host_api": 41,
"harnesses": ["arcade"], "preview": "assets/wurm-editor-preview.png",
}))
images = {
@@ -362,7 +345,7 @@ class CollectionTests(unittest.TestCase):
self.add_library_copy(name, key, images[f"{name}-{key}"])
ledger["node_apps"]["wurm-editor"] = {
"id": "xyz.waozi.wurm-editor", "title": "Apfelwurm Editor", "version": "0.1.0",
"sequence": 1, "host_api": 43,
"sequence": 1, "host_api": 41,
}
ledger_path.write_text(json.dumps(ledger))
resolver = self.root / "scripts/ziran.sh"
@@ -469,16 +452,7 @@ class CollectionTests(unittest.TestCase):
with self.assertRaisesRegex(ValueError, 'Invalid artwork package'):
self.stage()
def test_library_covers_use_original_painted_art(self):
approved = json.loads((ROOT / 'tests/library_art_sources.json').read_text())
sources = json.loads((self.root / 'assets/arcade/library/sources.json').read_text())
for game in ('shovey', 'wurm', 'choano'):
for view in ('portrait', 'landscape'):
name = game + '-' + view
self.assertEqual(sources[name]['source_sha256'], approved[name])
self.assertNotIn('screenshots', json.loads((self.root / 'games.json').read_text()))
def test_library_heroes_are_bounded_and_editor_art_stays_small(self):
def test_every_library_cover_uses_a_bounded_thumbnail(self):
catalog, packages = builder.stage(self.root, self.controller, self.controller_digest, self.output)
children = {child['id']: child for child in catalog['children']}
for package in packages:
@@ -493,16 +467,19 @@ class CollectionTests(unittest.TestCase):
with self.subTest(app=child['id'], image=key):
with Image.open(io.BytesIO(original)) as source:
with Image.open(self.output / child['cover'][key]) as thumbnail:
limit = 256 if app['internal'] or key == 'logo' else (1600 if key == 'landscape' else 1080)
limit = 512 if key == 'logo' else 640
self.assertLessEqual(max(thumbnail.size), limit)
self.assertLessEqual(thumbnail.width, source.width)
self.assertLessEqual(thumbnail.height, source.height)
expected_ratio = 2 / 3 if key == 'portrait' else 16 / 9 if key == 'landscape' else source.width / source.height
if app['internal']: expected_ratio = source.width / source.height
expected_ratio = source.width / source.height
if key == 'portrait':
expected_ratio = max(2 / 3, expected_ratio)
self.assertAlmostEqual(thumbnail.width / thumbnail.height,
expected_ratio, delta=(1 + expected_ratio) / thumbnail.height)
expected_ratio, delta=0.01)
self.assertIn(thumbnail.mode, ('RGB', 'RGBA'))
self.assertEqual(thumbnail.format, 'WEBP')
# Opaque cover art is a JPEG; transparency stays PNG.
self.assertEqual(thumbnail.format, 'JPEG' if key != 'logo' and
thumbnail.mode == 'RGB' else 'PNG')
def test_editor_download_reuses_verified_shovey_assets(self):
catalog = self.stage()
@@ -655,11 +632,11 @@ class LibraryThumbnailTests(unittest.TestCase):
data = io.BytesIO()
source.save(data, 'PNG')
contents, suffix = artist.small_copy(data.getvalue(), 'portrait')
self.assertEqual(suffix, '.webp')
self.assertEqual(suffix, '.jpg')
with Image.open(io.BytesIO(contents)) as thumbnail:
self.assertEqual(thumbnail.size, (720, 1080))
self.assertEqual(thumbnail.size, (427, 640))
# The real card's centred cover fit now leaves the title intact.
red, green, blue = thumbnail.getpixel((360, 144))
red, green, blue = thumbnail.getpixel((213, 85))
self.assertGreater(red, 200)
self.assertGreater(green, 160)
self.assertLess(blue, 60)
@@ -671,63 +648,47 @@ class LibraryThumbnailTests(unittest.TestCase):
data = io.BytesIO()
source.save(data, 'PNG')
contents, suffix = artist.small_copy(data.getvalue(), 'portrait')
self.assertEqual(suffix, '.webp')
self.assertEqual(suffix, '.jpg')
with Image.open(io.BytesIO(contents)) as thumbnail:
self.assertEqual(thumbnail.format, 'WEBP')
self.assertEqual(thumbnail.size, (720, 1080))
self.assertEqual(thumbnail.format, 'JPEG')
self.assertEqual(thumbnail.size, (480, 640))
self.assertEqual(thumbnail.mode, 'RGB')
self.assertIsNone(thumbnail.getcolors(256))
def test_gameplay_crop_removes_only_the_game_toolbar(self):
source = Image.new('RGB', (1440, 900), (20, 100, 180))
source.paste((240, 20, 220), (0, 0, 1440, 52))
encoded = io.BytesIO()
source.save(encoded, 'PNG')
contents, _ = artist.small_copy(encoded.getvalue(), 'landscape', crop_top=52)
with Image.open(io.BytesIO(contents)) as cover:
self.assertEqual(cover.size, (1440, 810))
red, green, blue = cover.getpixel((720, 0))
self.assertLess(red, 40)
self.assertGreater(blue, 150)
self.assertEqual(source.getpixel((720, 0)), (240, 20, 220))
def test_logo_retains_transparency(self):
source = Image.new('RGBA', (1200, 400), (45, 155, 90, 0))
source.paste((200, 35, 100, 255), (100, 50, 1100, 350))
data = io.BytesIO()
source.save(data, 'PNG')
contents, suffix = artist.small_copy(data.getvalue(), 'logo')
self.assertEqual(suffix, '.webp')
self.assertEqual(suffix, '.png')
with Image.open(io.BytesIO(contents)) as thumbnail:
self.assertEqual(thumbnail.size, (256, 85))
self.assertEqual(thumbnail.size, (512, 171))
self.assertEqual(thumbnail.mode, 'RGBA')
self.assertEqual(thumbnail.getpixel((0, 0))[3], 0)
self.assertEqual(thumbnail.getpixel((128, 42))[3], 255)
self.assertEqual(thumbnail.getpixel((256, 85))[3], 255)
def test_small_covers_are_not_enlarged(self):
source = Image.new('RGB', (120, 180), (25, 50, 75))
data = io.BytesIO()
source.save(data, 'PNG')
contents, suffix = artist.small_copy(data.getvalue(), 'portrait')
self.assertEqual(suffix, '.webp')
self.assertEqual(suffix, '.jpg')
with Image.open(io.BytesIO(contents)) as thumbnail:
self.assertEqual(thumbnail.size, (120, 180))
def test_small_transparent_art_keeps_exact_pixels(self):
def test_small_transparent_art_is_not_reencoded(self):
source = Image.new('RGBA', (120, 60), (25, 50, 75, 128))
data = io.BytesIO()
source.save(data, 'PNG')
contents, suffix = artist.small_copy(data.getvalue(), 'logo')
self.assertEqual(suffix, '.webp')
with Image.open(io.BytesIO(contents)) as thumbnail:
self.assertEqual(thumbnail.tobytes(), source.tobytes())
self.assertEqual(artist.small_copy(data.getvalue(), 'logo'), (data.getvalue(), '.png'))
def test_thin_logos_keep_at_least_one_pixel(self):
source = Image.new('RGBA', (4096, 1), (25, 50, 75, 255))
data = io.BytesIO()
source.save(data, 'PNG')
with Image.open(io.BytesIO(artist.small_copy(data.getvalue(), 'logo')[0])) as thumbnail:
self.assertEqual(thumbnail.size, (256, 1))
self.assertEqual(thumbnail.size, (512, 1))
if __name__ == "__main__":
+133 -190
View File
@@ -1,4 +1,4 @@
"""Exercise the real shared library and normal game titles and console navigation privately."""
"""Exercise the real shared library and both unchanged games privately."""
import argparse
import contextlib
from http.server import BaseHTTPRequestHandler, HTTPServer
@@ -46,58 +46,11 @@ def answer_level_updates(driver, timeout=20):
return
time.sleep(0.05)
def campaign_progress(data):
# Keep unlocks/completions and the player/move state, allowing decorative
# animals to animate independently while an installed game is open.
value = data.decode()
assert value[:2] in ("C2", "C3", "C4", "C5", "C6")
start = value.index("P")
state = value[start:]
assert state[:2] in ("P1", "P2", "P3")
return value[:start], state[:32]
def enter_shovey_play(driver):
"""Use the game's normal title and, where present, its world map."""
driver.wait(label='Play', role='button', timeout=60)
driver.press(label='Play', role='button')
deadline = time.monotonic() + 30
while time.monotonic() < deadline:
if driver.find(key=20105, visible=True):
driver.press(key=33001, role='button')
driver.press(key=20122, role='button')
return
if driver.find(label='Restart', role='button') or driver.find(label=LEVEL_UPDATES, role='text'):
return
if driver.find(label='Continue', role='button'):
driver.press(label='Continue', role='button')
return
time.sleep(.05)
raise driver._failure('Shovey did not enter its normal map or gameplay')
def enter_wurm_play(driver):
"""The title opens the stage chooser, whose Play starts the game."""
driver.wait(label='Play', role='button', timeout=60)
deadline = time.monotonic() + 30
while time.monotonic() < deadline:
if driver.find(label='Pause', role='button'):
return
if driver.find(label='How do you want to move?', role='text'):
driver.press(label='Swipe', role='button')
elif driver.find(label='Play', role='button'):
driver.press(label='Play', role='button')
elif driver.find(label='Start', role='button'):
driver.press(label='Start', role='button')
time.sleep(.05)
raise driver._failure('Apfelwurm did not enter play through its title and stages')
@contextlib.contextmanager
def package_server(root):
metadata = json.loads((root / 'build/arcade.json').read_text())
by_digest = {entry['sha256']: entry for entry in metadata['children']}
state = {'requests': [], 'corrupt_wurm': False, 'corrupt_shovey': False, 'offline': False, 'game_delay': 0}
state = {'requests': [], 'corrupt_wurm': False, 'corrupt_shovey': False, 'offline': False}
class Handler(BaseHTTPRequestHandler):
def log_message(self, *args):
pass
@@ -113,8 +66,6 @@ def package_server(root):
data = published.read_bytes()
if (state['corrupt_wurm'] and entry.get('expected_id') == 'wurm') or (state['corrupt_shovey'] and entry.get('expected_id') == 'shovey'):
data = data[:-1] + bytes([data[-1] ^ 1])
if entry and state['game_delay']:
time.sleep(state['game_delay'])
self.send_response(200)
self.send_header('Content-Length', str(len(data)))
self.end_headers()
@@ -134,7 +85,6 @@ def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--binary", type=Path, required=True)
parser.add_argument("--inbe-source", type=Path, required=True)
parser.add_argument("--output", type=Path, help="Private test receipts and captures")
args = parser.parse_args()
assert int(os.environ["DISPLAY"].split(":")[-1].split(".")[0]) >= 400
assert os.environ["YUE_DESKTOP_RECOVERY"] == "0"
@@ -146,7 +96,7 @@ def main():
def size_text(size):
return f"{(size * 10 + 500000) // 1000000 / 10:.1f} MB"
sizes = {name: size_text(entry['bytes']) for name, entry in by_name.items()}
output = args.output or root / "work/collection-ui-test"
output = root / "work/collection-ui-test"
# The Classic heading counts its levels, which Shovey's level file lists.
shovey = Path(subprocess.check_output([str(root / "scripts/ziran.sh"), "pkg", "path", "shovey"], text=True).strip())
classic = len(json.loads((shovey / "levels/approved.json").read_text())["levels"])
@@ -197,52 +147,34 @@ def main():
def grid(child, name, phone=False):
driver.wait_idle(frames=20)
assert not driver.find(label="Arcade", role="text"), "Home has no app-name header"
driver.wait(label="Arcade", role="text")
assert not driver.find(label="Chess"), "Chess is temporarily disabled"
assert not driver.find(label="Monkey"), "Monkey does not belong in Arcade"
covers = [node for node in driver.find(role="button", visible=True)
if node['height'] > 100 and node['selected']]
assert len(covers) == 1
cover = covers[0]
ratio = cover['width'] / cover['height']
assert abs(ratio - (2 / 3 if phone else 16 / 9)) < .02, (name, ratio)
assert cover['width'] >= (250 if phone else 200)
assert cover['selected'], "A console always has a focused game"
assert not driver.find(label="Next", role="button"), "Arcade must open on its app grid"
classic_card = driver.wait(label="Shovey", role="button")
editor_card = driver.wait(label="Shovey Editor", role="button")
assert classic_card['y'] == editor_card['y'], "Apps must share a grid row"
assert classic_card['x'] != editor_card['x']
if phone:
# Phones show small covers, two or three a row.
wurm_card = driver.wait(label='Apfelwurm', role='button')
assert wurm_card['y'] == classic_card['y'], 'A phone row holds all three covers'
assert 100 <= classic_card['width'] < 200, 'Phone covers must be small cards'
else:
# Short landscape windows use wide artwork above the title.
assert classic_card['width'] >= 200 and classic_card['height'] >= 156
assert not driver.find(label='Play', role='button')
assert not driver.find(label='Open', role='button')
for label in ('Shovey', 'Apfelwurm', 'Choano'):
assert not driver.find(label=label, role='text'), "Artwork replaces cover captions"
if not phone or label == cover['label']:
assert driver.find(label=label, role='button'), "Names stay accessible in the shelf"
assert not driver.find(label='Shovey Editor', role='button'), 'Editors open from inside their game'
assert not driver.find(label='Apfelwurm Editor', role='button')
assert len([node for node in driver.find(role='image', visible=True)
if node['width'] >= 150 and node['height'] >= 100]) >= 1
for label in ('Shovey', 'Shovey Editor', 'Apfelwurm'):
assert driver.find(label=label, role='text'), 'Every library cover shows its declared title'
driver.wait(label='Apfelwurm', role='button', visible=False)
smallest = (100, 140) if phone else (180, 120)
covers = [node for node in driver.find(role='image', visible=True)
if node['width'] >= smallest[0] and node['height'] >= smallest[1]]
assert len(covers) >= 2, "Apps must use large title-screen artwork"
capture(child, name)
with Image.open(output / (name + ".png")) as image:
assert len(image.convert("RGB").getcolors(1000000) or []) > 100, "Cover artwork was not painted"
# Full viewport art must cover the former light host reservation.
top = image.convert('RGB').crop((0, 0, image.width // 2, 88))
pixels = list(top.resize((30, 10)).getdata())
clear = sum(all(abs(a-b) <= 3 for a,b in zip(pixel, (248, 250, 252))) for pixel in pixels)
assert clear < len(pixels) // 2, "Home leaves a light header band"
assert len(set(pixels)) > 20, "Focused art must color the background"
def open_game(label):
order = ['Shovey', 'Apfelwurm', 'Choano']
current = next(n for n in driver.tree() if n['kind']=='button' and n['selected'] and n['height']>100)
while current['label'] != label:
driver.key('right' if order.index(current['label']) < order.index(label) else 'left')
driver.wait_idle(frames=20)
current = next(n for n in driver.tree() if n['kind']=='button' and n['selected'] and n['height']>100)
driver.press(key=current['key'],role='button')
def finish_download(label):
entry = next(e for e in by_name.values() if e['title']==label)
wait(lambda: (profile/'resources/downloads'/(entry['sha256']+'.zx')).exists() and
not driver.find(label='Downloading',role='text'), 'Download did not finish on shelf')
assert driver.find(label=label,role='button'), 'Download left the shelf'
open_game(label)
assert len(image.convert("RGB").getcolors(1000000) or []) > 100, "App icons were not painted"
def primary_download(label='Download'):
driver.wait(label=label, role='button')
@@ -252,6 +184,31 @@ def main():
with package_server(root) as (origin, server), tempfile.TemporaryDirectory(prefix="profile-", dir=output) as temporary:
profile = Path(temporary)
dependency_profile = profile / 'editor-first'
with application(dependency_profile, 'editor-dependencies') as child:
answer_library_question(driver)
driver.press(label='Shovey Editor', role='button')
driver.wait(label='Shovey (required) · ' + sizes['shovey'], role='text')
driver.wait(label='Shovey Editor · ' + sizes['shovey-editor'], role='text')
total = size_text(by_name['shovey']['bytes'] + by_name['shovey-editor']['bytes'])
driver.wait(label='Download size: ' + total, role='text')
capture(child, 'editor-download-plan')
driver.press(label='Cancel', role='button')
assert not games & set(server['requests']), 'Dependency consent must precede every download'
driver.press(label='Shovey Editor', role='button')
server['corrupt_shovey'] = True
primary_download()
driver.wait(label='Try again', role='button', timeout=60)
assert not driver.find(label='New level', role='text'), 'An editor must not open with a corrupt dependency'
server['corrupt_shovey'] = False
primary_download('Try again')
driver.wait(label='New level', role='text', timeout=60)
capture(child, 'editor-shared-assets')
assert server['requests'].count(by_name['shovey']['sha256']) == 2
assert server['requests'].count(by_name['shovey-editor']['sha256']) == 1
assert len([digest for digest in server['requests'] if digest in games]) == 3, 'Retry must reuse the already downloaded editor'
assert by_name['shovey-editor']['bytes'] < by_name['shovey']['bytes'], 'The editor must carry only its additions'
server['requests'].clear()
# Disabling an entry must leave a person's older Chess save untouched.
chess = profile / "games/inbe.chess/records/computer"
chess.parent.mkdir(parents=True)
@@ -259,6 +216,14 @@ def main():
# Active play stays on this device; account sync shares completions.
record = profile / "games/arcade.shovey/records/local.campaign"
def progress(data):
# Unlocks, completion marks and the board in play.
value = data.decode()
assert value[:2] in ("C2", "C3", "C4", "C5")
start = value.index("P")
state = value[start:]
assert state[:2] in ("P1", "P2", "P3")
return value[:start], state[:32]
with application(profile, "grid") as child:
# A fresh profile asks for consent before it shows the library.
@@ -266,52 +231,33 @@ def main():
window = subprocess.check_output(['xdotool', 'search', '--onlyvisible', '--pid', str(child.pid)], text=True).splitlines()[0]
subprocess.run(['xdotool', 'windowsize', window, '480', '820'], check=True)
grid(child, "apps-portrait", phone=True)
driver.key('right')
driver.wait_idle(frames=20)
editor = [n for n in driver.find(label='Apfelwurm', role='button') if n['height'] > 100]
assert editor and editor[0]['selected'], 'Right selects the next game'
driver.key('left')
driver.wait_idle(frames=20)
subprocess.run(['xdotool', 'windowsize', window, '1120', '700'], check=True)
grid(child, "apps-landscape")
subprocess.run(['xdotool', 'windowsize', window, '900', '420'], check=True)
grid(child, "apps-short-landscape")
selected = [n for n in driver.find(role='button') if n['selected'] and n['height'] > 100][0]
cx, cy = UiDriver.center(selected)
driver.pointer(cx, cy, wheel=-1)
driver.wait_idle(frames=20)
assert any(n['selected'] and n['height'] > 100 for n in driver.find(label='Apfelwurm', role='button')), 'Wheel selects the next game'
driver.drag((cx - 100, cy), (cx + 100, cy))
driver.wait_idle(frames=20)
assert any(n['selected'] and n['height'] > 100 for n in driver.find(label='Shovey', role='button')), 'Swipe returns to the previous game'
assert not driver.find(role='modal'), 'A swipe selects without opening an install dialog'
subprocess.run(['xdotool', 'windowsize', window, '480', '820'], check=True)
grid(child, "apps-portrait-return", phone=True)
assert not games & set(server['requests']), "Covers must not predownload games"
# Covers show only the art; the download dialog names the size.
cover_sizes = dict(sizes, **{'shovey-editor': size_text(by_name['shovey']['bytes'] + by_name['shovey-editor']['bytes'])})
for text in cover_sizes.values():
assert not driver.find(label=text, role='text'), "Covers must not show download sizes"
(output / 'before-profile-tree.json').write_text(json.dumps(driver.tree(), indent=2))
reply = driver.press(label='Profile', role='button')
(output / 'profile-press.json').write_text(json.dumps(reply, indent=2))
driver.press(label='Profile', role='button')
driver.wait(label='Account', role='text')
capture(child, 'arcade-profile')
driver.press(label='Leaderboard', role='button')
driver.wait_idle(frames=3)
# Entity uses the native host's navigation. With no installed
# boards its page contains no duplicate heading or empty rows.
assert not driver.find(role='scroll', visible=True), 'An undownloaded game has a board'
assert not driver.find(label='Account', role='text', visible=True)
driver.wait(label='Back', role='button')
capture(child, 'leaderboard-empty')
driver.press(label='Back', role='button')
driver.wait(label='Account', role='text')
driver.press(label="Back", role="button")
driver.wait(label='Shovey', role='button')
assert not [path for path in (profile / 'resources/downloads').glob('*.zx') if path.stem in games]
server['game_delay'] = 3
open_game('Shovey')
driver.wait(label='Downloading',role='text')
assert driver.find(label='Apfelwurm',role='button'), 'Download must keep the carousel available'
assert not driver.find(role='modal'), 'Transfer progress must not capture modal focus'
assert any(n['selected'] and n['height']>100 for n in driver.find(label='Shovey',role='button'))
finish_download('Shovey')
server['game_delay'] = 0
driver.wait(label='Play',role='button',timeout=60)
assert not driver.find(label="Restart", role="button"), "A game opens its own title"
capture(child, "shovey-title")
enter_shovey_play(driver)
driver.press(label="Shovey", role="button")
driver.wait(label='Cancel', role='button')
driver.press(label='Cancel', role='button')
assert not games & set(server['requests']), 'Cancel must download nothing'
driver.press(label="Shovey", role="button")
primary_download()
driver.wait(label=f"Level 1 / {classic}")
answer_level_updates(driver)
# Desktop input already chooses keyboard controls; touch hosts
@@ -320,69 +266,84 @@ def main():
driver.press(label="Swipe and tap")
driver.wait_gone(label="How do you want to move?", role="text")
driver.wait(label='Restart', role='button')
assert not driver.find(label="Play", role="button"), "Play enters gameplay from the game title"
assert not driver.find(label="Play", role="button"), "Arcade must skip the second title screen"
assert len(driver.find(label="Back", role="button", visible=True)) == 1
home = driver.find(label='Arcade', role='button', visible=True)[0]
back = driver.find(label='Back', role='button', visible=True)[0]
assert back['y'] >= home['y'] + home['height'], 'Home must not overlap game navigation'
driver.press(label="Levels", role="button")
driver.wait(label="Continue", role="button")
back = driver.wait(label="Back", role="button", visible=True)
assert back['width'] >= 100 and back['height'] >= 48
scroll = driver.wait(role="scroll")
driver.pointer(*UiDriver.center(scroll), wheel=-200)
driver.wait_idle(frames=20)
assert driver.find(label="Back", role="button", visible=True)[0]['y'] == back['y']
driver.press(label="Back", role="button")
driver.wait(label="Restart", role="button")
driver.press(label="Levels", role="button")
driver.wait(label="Continue", role="button")
driver.key("escape")
driver.wait(label="Restart", role="button")
capture(child, "classic-playing")
for direction in ("left", "right", "up", "down"):
driver.key(direction)
driver.wait_idle(frames=5)
driver.press(label="Back", role="button")
driver.wait(label="Play", role="button")
driver.key(290)
driver.wait(key=50400,visible=True)
saved = wait(lambda: record.read_bytes() if record.exists() else None, "Classic did not save")
driver.press(label="Back", role="button")
driver.wait(label="Shovey Editor", role="button")
driver.press(label='Profile', role='button')
driver.press(label='Leaderboard', role='button')
# A single installed board needs no app selector. Its metric and
# local row still appear, and disappear when that game is removed.
driver.wait(label='Levels solved', role='text')
driver.wait(label='local', role='text')
assert not driver.find(label='Apfelwurm', role='button'), 'An undownloaded game has a board'
assert not driver.find(label='Shovey Editor', role='button'), 'An unranked editor has a board'
capture(child, 'leaderboard-installed')
state = profile / 'resources/state/arcade.shovey.json'
state.parent.mkdir(parents=True, exist_ok=True)
state.write_text('{"v":1,"installed":0,"favorite":0}')
driver.wait_gone(label='Levels solved', role='text')
assert not driver.find(role='scroll', visible=True), 'An uninstalled board kept its rows'
assert not driver.find(label='Shovey', role='button'), 'A retained score kept an uninstalled board visible'
state.write_text('{"v":1,"installed":1,"favorite":0}')
driver.wait(label='Levels solved', role='text')
driver.wait(label='local', role='text')
driver.press(label='Back', role='button')
driver.wait(label='Account', role='text')
driver.press(label='Back', role='button')
driver.wait(label='Shovey Editor', role='button')
assert not driver.find(label=sizes["shovey"], role="text"), "Installed games must omit their download size"
open_game('Shovey')
driver.wait(label='Next',role='button')
driver.press(label='Next',role='button')
driver.wait_idle(frames=20)
driver.press(label='Open',role='button')
driver.press(label="Shovey Editor", role="button")
driver.wait(label='Download size: ' + sizes['shovey-editor'], role='text')
primary_download()
assert server['requests'].count(by_name['shovey']['sha256']) == 1, 'Installed dependencies must not download again'
# The editor opens on a blank board.
driver.wait(label="New level", role="text")
driver.press(label="Levels", role="button")
driver.wait(label="Your levels", role="text")
driver.wait(label="Story levels", role="text")
back = driver.wait(label="Back", role="button", visible=True)
assert back['width'] >= 64 and back['height'] >= 40
assert back['width'] >= 100 and back['height'] >= 48
driver.press(label="Back", role="button")
driver.wait(label="New level", role="text")
capture(child, "editor-open")
driver.key("escape")
driver.wait(label='Open',role='button')
driver.press(label='Previous',role='button')
driver.wait(label='Play',role='button')
assert not driver.find(key=50400,visible=True), 'Editor Back returns to the game title'
driver.key(290)
driver.wait(key=50400,visible=True)
driver.wait(label="Shovey Editor", role="button")
window = subprocess.check_output(["xdotool", "search", "--onlyvisible", "--pid", str(child.pid)], text=True).splitlines()[0]
subprocess.run(["xdotool", "windowsize", window, "900", "540"], check=True)
grid(child, "apps-landscape")
server['corrupt_wurm'] = True
open_game('Apfelwurm')
driver.wait(label='Download failed',role='text',timeout=60)
driver.press(label='Apfelwurm', role='button')
primary_download()
driver.wait(label='Try again', role='button', timeout=60)
assert not driver.find(label='Pause', role='button'), 'Unverified bytes must never run'
server['corrupt_wurm'] = False
open_game('Apfelwurm')
finish_download('Apfelwurm')
# Both the built-in editor and retained add-on open inside Wurm.
primary_download('Try again')
# The hosted player opens its title before its first steering choice.
driver.wait(label='Play', role='button', timeout=60)
driver.press(label='Level editor', role='button')
driver.wait(label='My levels', role='button')
driver.press(label='Apfelwurm Editor', role='button')
driver.wait(label='Cancel', role='button')
primary_download()
driver.wait(label='My levels', role='button', timeout=60)
assert not driver.find(label='Apfelwurm Editor', role='button'), 'A legacy add-on must not link to itself'
driver.key('escape')
driver.wait(label='Apfelwurm Editor', role='button')
driver.press(label='Back', role='button')
driver.wait(label='Play', role='button')
enter_wurm_play(driver)
driver.press(label='Play', role='button')
wait(lambda: driver.find(label='How do you want to move?', role='text') or
driver.find(label='Pause', role='button'), 'Apfelwurm did not open play or its controls choice')
if driver.find(label='How do you want to move?', role='text'):
driver.press(label='Swipe', role='button')
driver.wait(label='Pause', role='button')
capture(child, 'wurm-playing')
driver.press(label='Pause', role='button')
@@ -390,26 +351,9 @@ def main():
driver.press(label='Back to title', role='button')
driver.wait(label='Play', role='button')
capture(child, 'wurm-title')
driver.key(290)
driver.key('escape')
driver.wait(label='Shovey', role='button')
open_game('Choano')
finish_download('Choano')
driver.wait(label='Play', role='button', timeout=60)
assert not driver.find(label='Pause', role='button'), 'Choano keeps its own title screen'
driver.press(label='Play', role='button')
if driver.find(label='Swipe', role='button'):
driver.press(label='Swipe', role='button')
driver.wait(label='Pause', role='button', timeout=60)
driver.key('right')
driver.press(label='Pause', role='button')
driver.press(label='Title screen', role='button')
driver.wait(label='New game', role='button')
capture(child, 'choano-title')
subprocess.run(['xdotool', 'windowsize', window, '480', '820'], check=True)
driver.wait_idle(frames=15)
driver.press(label='Arcade', role='button')
driver.wait(label='Shovey', role='button')
exercised = [by_name[name] for name in ('shovey', 'shovey-editor', 'wurm', 'wurm-editor', 'choano')]
exercised = [by_name[name] for name in ('shovey', 'shovey-editor', 'wurm')]
expected_downloads = {entry['sha256'] for entry in exercised}
actual_downloads = {path.stem for path in (profile / 'resources/downloads').glob('*.zx') if path.stem in games}
assert actual_downloads == expected_downloads, 'Only the games opened with consent may download'
@@ -419,9 +363,8 @@ def main():
requested = list(server['requests'])
server['offline'] = True
with application(profile, "restore", "--app", "arcade.shovey"):
driver.wait(label="Play", role="button")
assert not driver.find(label="Restart", role="button"), "Offline reopen retains normal title entry"
assert campaign_progress(record.read_bytes()) == campaign_progress(saved), "Classic progress changed on restart"
driver.wait(label=f"Level 1 / {classic}")
assert progress(record.read_bytes()) == progress(saved), "Classic progress changed on restart"
# Allowed automatic library refresh may retry its metadata while
# offline. Cached game/art bytes must never be requested again.
cached_payloads = games | {json.loads((root / 'build/arcade.json').read_text())['art']['sha256']}
@@ -430,7 +373,7 @@ def main():
assert not (profile / "inbe.db").exists()
refused = subprocess.run([str(args.binary.resolve()), "--app", "chess"], env=os.environ | {"ARCADE_DATA": str(profile)}, capture_output=True, timeout=10)
assert refused.returncode == 1 and b"unknown game" in refused.stderr
print("Arcade: console covers, selection and in-place downloads, digest failure/retry, all three game titles/play, in-game editors, Back, rotation, offline reopen and retained saves passed")
print("Arcade: rounded covers, download consent/cancel, digest failure/retry, Shovey and Apfelwurm play, Back, rotation, offline reopen and retained saves passed")
if __name__ == "__main__":
-214
View File
@@ -1,214 +0,0 @@
"""Real console home, artwork pixels, rotation, input and profile roundtrip privately."""
import argparse, contextlib, json, os, subprocess, sys, tempfile, time
from pathlib import Path
from PIL import Image, ImageOps, ImageChops, ImageStat
root = Path(__file__).resolve().parents[1]
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--binary', type=Path, default=root / 'build/arcade')
parser.add_argument('--inbe-source', type=Path, required=True)
args = parser.parse_args()
assert int(os.environ['DISPLAY'].split(':')[-1].split('.')[0]) >= 400
assert os.environ['YUE_DESKTOP_RECOVERY'] == '0'
sys.path.insert(0, str(root / 'tests'))
sys.path.insert(0, str(args.inbe_source / 'tests'))
from collection_ui_test import package_server, answer_library_question
from ui_driver import UiDriver
out = root / 'backup/console-fixes/results'
out.mkdir(parents=True, exist_ok=True)
driver = UiDriver(out / 'driver')
metadata = json.loads((root / 'build/arcade.json').read_text())
approved = json.loads((root / 'tests/library_art_sources.json').read_text())
sources = json.loads((root / 'assets/arcade/library/sources.json').read_text())
for name, digest in approved.items():
assert sources[name]['source_sha256'] == digest, 'Cover replaced the original painted artwork: ' + name
assert metadata['art']['bytes'] <= 2 * 1024 * 1024
def selected_cover():
return next(n for n in driver.tree() if n['kind'] == 'button' and n['selected'] and n['height'] > 100)
def viewport_width():
# Scenery shapes may extend past the window; the window-sized background starts at its origin.
return max(n['width'] for n in driver.tree() if n['x'] == 0 and n['y'] == 0)
def tap_cover(label, mouse):
cover = next(n for n in driver.find(label=label, role='button') if n['height'] > 100 and n['visible'])
width = viewport_width()
x = max(4, min(width - 4, cover['x'] + cover['width'] / 2))
y = cover['y'] + cover['height'] / 2
if mouse:
# A real X11 click held like a person's: SDL sees the move, press and release.
subprocess.run(['xdotool', 'mousemove', '--window', window, str(int(x)), str(int(y))], check=True)
time.sleep(.25)
subprocess.run(['xdotool', 'mousedown', '1'], check=True)
time.sleep(.15)
subprocess.run(['xdotool', 'mouseup', '1'], check=True)
time.sleep(.3)
else:
driver.pointer(x, y)
driver.pointer(x, y, down=True)
driver.wait_idle(frames=2)
driver.pointer(x, y, down=False)
driver.release_pointer()
driver.wait_idle(frames=20)
with package_server(root) as (origin, server), tempfile.TemporaryDirectory(dir=out) as temporary, (out / 'capture.log').open('w') as log:
profile = Path(temporary)
child = subprocess.Popen([str(args.binary.resolve())], cwd=root, env=os.environ | driver.environment() | {
'ARCADE_DATA': str(profile), 'ENTITY_DATA': str(profile / 'entity'), 'XDG_DATA_HOME': str(profile / 'share'),
'XDG_CONFIG_HOME': str(profile / 'config'), 'XDG_CACHE_HOME': str(profile / 'cache'),
'LANG': 'en_US.UTF-8', 'ARCADE_PACKAGE_ORIGIN': origin}, stdout=log, stderr=subprocess.STDOUT)
driver.attach(child, out / 'capture.log')
try:
answer_library_question(driver)
art = json.loads((root / 'build/arcade.json').read_text())['art']['sha256']
deadline = time.monotonic() + 60
while not (profile / 'resources/downloads' / (art + '.zx')).exists():
assert time.monotonic() < deadline, 'Library art did not download'
time.sleep(.1)
window = subprocess.check_output(['xdotool', 'search', '--onlyvisible', '--pid', str(child.pid)], text=True).splitlines()[0]
assert int(subprocess.check_output(['xdotool', 'getwindowpid', window], text=True)) == child.pid
for name, width, height in [('home-landscape', 1200, 720), ('home-portrait', 480, 820)]:
subprocess.run(['xdotool', 'windowsize', window, str(width), str(height)], check=True)
# Keep the whole window on the private screen so captures are never clipped.
subprocess.run(['xdotool', 'windowmove', window, '0', '0'], check=True)
deadline = time.monotonic() + 10
while viewport_width() != width:
assert time.monotonic() < deadline
time.sleep(.05)
driver.wait_idle(frames=30)
nodes = driver.tree()
assert not driver.find(label='Arcade', role='text'), 'No app-name header'
assert not [n for n in nodes if n['kind'] in ('button', 'text') and 'Editor' in n['label']], 'Games only'
for title in ('Shovey', 'Apfelwurm', 'Choano'):
assert driver.find(label=title, role='button'), 'Accessible game name missing'
assert not driver.find(label=title, role='text'), 'No captions under artwork'
# Both orientations draw the same scenic pattern, never game art behind the covers.
scenery = next(n for n in nodes if n['key'] == 50400)
assert (scenery['x'], scenery['y'], scenery['width'], scenery['height']) == (0, 0, width, height)
assert not any(n['key'] == 50021 for n in nodes), 'No full-screen game artwork behind the covers'
assert not [n for n in nodes if n['role'] == 'image' and n['width'] >= width * .9 and n['height'] >= height * .9], 'No hero image'
selected = [n for n in nodes if n['kind'] == 'button' and n['selected'] and n['height'] > 100]
(out / 'latest-debug-tree.json').write_text(json.dumps(nodes,indent=2))
assert len(selected) == 1, [(n['label'],n['selected'],n['width'],n['height']) for n in nodes if n['kind']=='button']
selected = selected[0]
assert abs(selected['width'] / selected['height'] - (16/9 if width > height else 2/3)) < .02
covers = [n for n in nodes if n['role'] == 'image' and n['label'] in ('Shovey','Apfelwurm','Choano') and n['visible']]
assert len(covers) >= 2, 'Real neighbouring covers must be visible'
# The portrait carousel layout in landscape too: one large centred cover,
# neighbours cut by the screen edges and the small cover markers below.
assert abs(selected['x'] + selected['width'] / 2 - width / 2) < 2, 'Selected cover is centred'
assert selected['width'] >= width * (.55 if width > height else .65)
assert height * .15 < selected['y'] and selected['y'] + selected['height'] < height * .9
neighbours = [n for n in covers if n['label'] != selected['label']]
assert neighbours and all(n['x'] <= 0 or n['x'] + n['width'] >= width for n in neighbours), 'Neighbours peek in from the sides'
assert all(abs(n['y'] + n['height'] / 2 - (selected['y'] + selected['height'] / 2)) < 2 for n in neighbours)
markers = [n for n in nodes if 50300 <= n['key'] <= 50302 and n['role'] == 'image']
assert len(markers) == 3 and all(n['y'] > selected['y'] + selected['height'] for n in markers)
assert all(n['detail'].endswith(('landscape.webp' if width > height else 'portrait.webp')) for n in markers)
for icon in ('profile', 'dew'):
assert any(n['role'] == 'image' and n['detail'].endswith('/assets/hud/' + icon + '.webp') for n in nodes), 'Painted startup icon missing'
subprocess.run(['import', '-window', window, str(out / (name + '.png'))], check=True)
(out / (name + '-tree.json')).write_text(json.dumps(driver.tree(), indent=2))
with Image.open(out / (name + '.png')) as im:
rgb = im.convert('RGB')
# The sky above the covers is the dusk scenic pattern, not a white band or game art.
sky = ImageStat.Stat(rgb.crop((0, 0, width - 260, 80))).mean
assert sky[2] > sky[0] + 15 and max(sky) < 170 and min(sky) > 12, ('Scenic sky must fill the top', sky)
hills = ImageStat.Stat(rgb.crop((0, int(height * .93), width, height))).mean
assert hills[1] > hills[0] and max(hills) < 140, ('Scenic hills must fill the bottom', hills)
for cover in covers:
x,y,w,h = (cover[k] for k in ('x','y','width','height'))
crop = rgb.crop((max(0,x),max(0,y),min(width,x+w),min(height,y+h)))
assert len(crop.getcolors(1000000) or []) > 100, 'A neighbour became a blank grey block'
# Compare the rendered focused cover to the approved painted asset.
view = 'landscape' if width > height else 'portrait'
game = {'Shovey':'shovey', 'Apfelwurm':'wurm', 'Choano':'choano'}[selected['label']]
asset = root / 'assets/arcade/library' / (game + '-' + view + '.webp')
with Image.open(asset) as painting:
expected = ImageOps.fit(painting.convert('RGB'), (round(selected['width']), round(selected['height'])))
actual = rgb.crop(tuple(round(v) for v in (selected['x'],selected['y'],selected['x']+selected['width'],selected['y']+selected['height'])))
# Ignore the rounded corners and lower action icon.
region = (20,20,expected.width-20,expected.height-50)
error = ImageStat.Stat(ImageChops.difference(actual.crop(region),expected.crop(region))).mean
assert sum(error)/3 < 12, ('Rendered cover must show the original painting',game,error)
mint = rgb.getpixel((int(selected['x'])-2,int(selected['y']+selected['height']/2)))
assert mint[0] > 160 and mint[1] > 200 and mint[2] > 180, ('Missing focus glow',mint)
before = selected['label']
driver.key('right')
driver.wait_idle(frames=20)
changed = selected_cover()['label']
assert changed != before, 'Keyboard selection moves to the next cover'
assert not any(n['key'] == 50021 for n in driver.tree()), 'Selection never adds a game background'
# Physical mouse and the held pointer/touch path both select only.
requests = list(server['requests'])
for mouse in (True, False):
tap_cover('Shovey', mouse)
assert selected_cover()['label'] == 'Shovey'
tap_cover('Apfelwurm', mouse)
assert selected_cover()['label'] == 'Apfelwurm'
assert any(n['key'] == 50400 for n in driver.tree()), 'A side-cover tap stays on the carousel'
assert server['requests'] == requests, 'Side-cover tap launched/downloaded a game'
assert not driver.find(label='Cancel',role='button')
tap_cover('Shovey', False)
driver.wait_idle(frames=20)
driver.press(label='Profile', role='button')
driver.wait(label='Account', role='text')
driver.press(label='Back', role='button')
driver.wait(label='Shovey', role='button')
driver.wait_idle(frames=20)
# Native keyboard focus reaches the HUD without opening a game too.
for _ in range(16):
driver.key('tab')
driver.wait_idle(frames=3)
if any(n['label']=='Profile' and n['focused'] for n in driver.tree()):
break
else:
raise AssertionError('Tab cannot reach Profile')
driver.key('enter')
driver.wait(label='Account', role='text')
driver.press(label='Back', role='button')
driver.wait(label='Shovey', role='button')
assert not driver.find(role='modal'), 'HUD keyboard activation also opened a game dialog'
with Image.open(out / 'home-landscape.png') as im:
im.crop((im.width - 240, 0, im.width, 90)).resize((960, 360), Image.Resampling.LANCZOS).save(out / 'dew-profile-closeup.png')
assert not any(entry['sha256'] in server['requests'] for entry in metadata['children']), 'Browsing does not predownload games'
# Each orientation starts a missing game on the same shelf, immediately.
for label, width, height in [('Apfelwurm',1200,720),('Shovey',480,820)]:
subprocess.run(['xdotool','windowsize',window,str(width),str(height)],check=True)
driver.wait_idle(frames=30)
if selected_cover()['label'] != label: tap_cover(label, False)
entry = next(e for e in metadata['children'] if e['title'] == label)
server['game_delay'] = 3
tap_cover(label, width > height)
driver.wait(label='Downloading',role='text',timeout=10)
nodes = driver.tree()
assert any(n['key']==50400 for n in nodes), 'Download left the carousel'
assert selected_cover()['label'] == label, 'Download moved selection'
assert not driver.find(role='modal') and not driver.find(label='Cancel',role='button')
cover = selected_cover()
track = next(n for n in nodes if n['key']==cover['key']+14)
assert track['width'] > 40 and cover['y'] < track['y'] < cover['y']+cover['height'], 'Progress bar must be on the downloading cover'
other = 'Shovey' if label=='Apfelwurm' else 'Apfelwurm'
tap_cover(other,False)
assert selected_cover()['label']==other, 'Download blocked browsing'
deadline = time.monotonic()+60
while driver.find(label='Downloading',role='text') or not (profile/'resources/downloads'/(entry['sha256']+'.zx')).exists():
assert time.monotonic()<deadline,'Background installation did not finish'
time.sleep(.1)
assert any(n['key']==50400 for n in driver.tree()), 'Finishing download interrupted browsing'
assert server['requests'].count(entry['sha256'])==1,'Repeated activation queued duplicate transfers'
server['game_delay']=0
# A fresh activation now opens the installed game through its real title.
tap_cover('Shovey',False)
tap_cover('Shovey',False)
driver.wait(label='Play',role='button',timeout=60)
assert not any(n['key']==50400 for n in driver.tree()), 'Centred installed cover did not launch'
print('PASS console home: original painted cover pixels, scenic pattern with no game-art backdrop, same centred carousel in landscape and portrait, no title/captions/editors, focus glow, keyboard, side-cover mouse/touch selection only, immediate inline download and browsing, installed title, Profile roundtrip')
print('Captured only owned private-Xvfb window:', child.pid)
for name in ('home-landscape.png', 'home-portrait.png', 'dew-profile-closeup.png'):
print(out / name)
finally:
if child.poll() is None: child.terminate()
child.wait(timeout=10)
-240
View File
@@ -1,240 +0,0 @@
"""Import portable exports without compiling, executing or transforming games."""
import hashlib
import importlib.util
import json
from pathlib import Path
import struct
import sys
import tempfile
import unittest
from unittest.mock import patch
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / 'scripts'))
from game_packages import portable_artifacts, declared_apps
spec = importlib.util.spec_from_file_location('game_importer', ROOT / 'scripts/build-games.py')
importer = importlib.util.module_from_spec(spec)
spec.loader.exec_module(importer)
def zx(descriptor, requirements=None, extra=(), version=27):
def number(value):
return struct.pack('<I', value)
def text(value):
value = value.encode() if isinstance(value, str) else value
return number(len(value)) + value
public = {k: v for k, v in descriptor.items() if k not in ('build_defines', 'prepare_assets')}
name = descriptor['name']
assets = [(f'assets/{name}/catalog.json', json.dumps(public).encode()),
(f'assets/{name}/picture.png', b'unchanged resource'), *extra]
if requirements is not None:
assets.append((f'assets/{name}/requirements.json', json.dumps(requirements).encode()))
return (b'ZX\0\0' + number(version) + text('portable') + text('Main') + number(0) * 4
+ number(len(assets)) + b''.join(text(k) + text(v) for k, v in assets))
class ArtifactTests(unittest.TestCase):
def setUp(self):
scratch = ROOT / 'work/console-redesign'
scratch.mkdir(parents=True, exist_ok=True)
self.temp = tempfile.TemporaryDirectory(prefix='import-test-', dir=scratch)
self.addCleanup(self.temp.cleanup)
self.root = Path(self.temp.name)
self.source = self.root / 'owner'
self.source.mkdir()
self.apps = []
for name, requires in [('base', []), ('base-editor', ['test.base'])]:
descriptor = dict(id='test.' + name, name=name, title=name, kind='game',
harnesses=['arcade'], entry='portable:Main', host_api=43,
contract_version=1, module_api=2, save_schema=1,
preview='preview.png', build_defines=['OWNER_ONLY'])
self.apps.append(dict(descriptor=descriptor, requires=requires, enabled=True,
source=self.source, package='fixture'))
self.resources = [dict(dependencies=[], resources=[]), dict(dependencies=['test.base'], resources=[
dict(dependency='test.base', path='assets/base-editor/shared.png', source='assets/base/picture.png')])]
self.manifest = self.root / 'exports.json'
self.write_exports()
(self.root / 'src').mkdir()
(self.root / 'build/games').mkdir(parents=True)
(self.root / 'build/games/previous.zx').write_bytes(b'previous payload')
(self.root / 'src/catalog.zi').write_text('previous source catalog')
(self.root / 'build/catalog.json').write_text('previous catalog')
self.before = self.snapshot()
def write_exports(self):
records = {}
for index, app in enumerate(self.apps):
name = app['descriptor']['name']
required = None if index == 0 else self.resources[index] | {'sha256': {
'test.base': hashlib.sha256((self.source / 'base.zx').read_bytes()).hexdigest()}}
(self.source / (name + '.zx')).write_bytes(zx(app['descriptor'], required))
(self.source / (name + '-resources.json')).write_text(json.dumps(self.resources[index]))
(self.source / (name + '.png')).write_bytes(b'unchanged preview')
records[app['descriptor']['id']] = dict(bundle=f'owner/{name}.zx',
resources=f'owner/{name}-resources.json', preview=f'owner/{name}.png')
self.manifest.write_text(json.dumps(dict(apps=records)))
def snapshot(self):
return {str(p.relative_to(self.root)): p.read_bytes()
for folder in ('src', 'build') for p in (self.root / folder).rglob('*') if p.is_file()}
def run_import(self):
with patch.object(importer, 'ROOT', self.root), patch.object(importer, 'declared_apps', return_value=self.apps), \
patch('subprocess.run', side_effect=AssertionError('No game subprocess')), \
patch('subprocess.check_output', side_effect=AssertionError('No compiler/resolver needed with fixtures')):
importer.build('must-not-run', [], self.manifest)
def reject(self, message):
with self.assertRaisesRegex(ValueError, message):
self.run_import()
self.assertEqual(self.snapshot(), self.before)
def test_byte_identical_exports_catalog_and_legacy_editor_id(self):
self.run_import()
for app in self.apps:
name = app['descriptor']['name']
for suffix in ('.zx', '-resources.json'):
self.assertEqual((self.root / 'build/games' / (name + suffix)).read_bytes(),
(self.source / (name + suffix)).read_bytes())
self.assertEqual((self.root / 'build/games' / (name + '-preview.png')).read_bytes(),
(self.source / (name + '.png')).read_bytes())
self.assertFalse((self.root / 'build/games/previous.zx').exists())
catalog = json.loads((self.root / 'build/catalog.json').read_text())
self.assertEqual([g['id'] for g in catalog['games']], ['test.base', 'test.base-editor'])
self.assertIn('test.base-editor', (self.root / 'src/catalog.zi').read_text())
def test_missing_export_preserves_all_previous_outputs(self):
(self.source / 'base-editor.zx').unlink()
self.reject('missing bundle export.*Arcade never compiles')
def test_native_packaging_manifest_cannot_escape_game_namespace(self):
(self.source / 'base.zx').write_bytes(zx(self.apps[0]['descriptor'],
extra=[('assets/manifest.json', b'{}')]))
self.reject('assets escape the game namespace')
def test_asset_cannot_use_another_games_namespace(self):
(self.source / 'base.zx').write_bytes(zx(self.apps[0]['descriptor'],
extra=[('assets/other/private.png', b'not a declared dependency')]))
self.reject('assets escape the game namespace')
def test_individual_asset_host_limit(self):
(self.source / 'base.zx').write_bytes(zx(self.apps[0]['descriptor'],
extra=[('assets/base/large.bin', b'x' * (importer.MAX_ASSET_BYTES + 1))]))
self.reject('asset exceeds the host asset limit')
def test_wrong_embedded_identity(self):
wrong = self.apps[1]['descriptor'] | {'id': 'other.game'}
(self.source / 'base-editor.zx').write_bytes(zx(wrong))
self.reject('embedded catalog/entry mismatch')
def test_missing_catalog(self):
data = zx(self.apps[1]['descriptor']).replace(b'catalog.json', b'ignored.json')
(self.source / 'base-editor.zx').write_bytes(data)
self.reject('embedded catalog/entry mismatch')
def test_wrong_dependency_id(self):
(self.source / 'base-editor-resources.json').write_text(json.dumps(dict(dependencies=['other.game'], resources=[])))
self.reject('dependency identities mismatch')
def test_wrong_dependency_hash(self):
requirement = self.resources[1] | {'sha256': {'test.base': '0' * 64}}
(self.source / 'base-editor.zx').write_bytes(zx(self.apps[1]['descriptor'], requirement))
self.reject('requirements/hash mismatch')
def test_wrong_resource_source(self):
self.resources[1]['resources'][0]['source'] = 'assets/base/missing.png'
self.write_exports()
self.reject('missing dependency resource')
def test_traversal_resource(self):
self.resources[1]['resources'][0]['path'] = 'assets/base-editor/../outside'
self.write_exports()
self.reject('unsafe resource link')
def test_over_budget(self):
with patch.object(importer, 'MAX_PAYLOAD_BYTES', 32):
self.reject('payload limit')
def test_truncated_and_duplicate_zx(self):
for data in (zx(self.apps[0]['descriptor'])[:-1],
zx(self.apps[0]['descriptor'], extra=[('assets/base/picture.png', b'duplicate')])):
with self.subTest(length=len(data)):
(self.source / 'base.zx').write_bytes(data)
self.reject('truncated|duplicate')
def test_manifest_rejects_external_private_id(self):
manifest = json.loads(self.manifest.read_text())
manifest['apps']['private.island'] = dict(bundle='island.zx', preview='island.png')
self.manifest.write_text(json.dumps(manifest))
self.reject('exactly the enabled public app IDs')
def test_disabled_metadata_needs_no_artifact(self):
self.apps.append(dict(descriptor=self.apps[0]['descriptor'] | {'id': 'test.disabled', 'name': 'disabled'},
requires=[], enabled=False, source=self.source, package='self'))
self.run_import()
catalog = json.loads((self.root / 'build/catalog.json').read_text())
self.assertFalse(catalog['games'][-1]['enabled'])
self.assertFalse((self.root / 'build/games/disabled.zx').exists())
def test_duplicate_ids_and_cycles(self):
self.apps[1]['descriptor']['id'] = 'test.base'
self.reject('distinct games')
self.apps[1]['descriptor']['id'] = 'test.base-editor'
self.apps[0]['requires'] = ['test.base-editor']
self.reject('Cyclic')
def test_promotion_failure_rolls_back_every_output(self):
original = importer.os.replace
calls = 0
def fail_once(source, target):
nonlocal calls
calls += 1
if calls == 6:
raise OSError('simulated promotion failure')
return original(source, target)
with patch.object(importer.os, 'replace', side_effect=fail_once), self.assertRaisesRegex(OSError, 'promotion failure'):
self.run_import()
self.assertEqual(self.snapshot(), self.before)
def test_canonical_game_owned_paths_and_missing_guidance(self):
expected = {'shovey': 'build/player/games/base.zx', 'wurm': 'build/games/base.zx', 'choano': 'build/base.zx'}
for package, path in expected.items():
app = self.apps[0] | {'package': package}
locations, guidance = portable_artifacts(app)
self.assertEqual(locations['bundle'], self.source / path)
self.assertIn('build-queue --', guidance)
def test_zx26_supported_without_running_payload(self):
bundle = self.source / 'v26.zx'
bundle.write_bytes(zx(self.apps[0]['descriptor'], version=26))
self.assertEqual(importer.bundle_metadata(bundle, 'base')[0], 'portable:Main')
def test_base_app_can_omit_resource_sidecar(self):
manifest = json.loads(self.manifest.read_text())
del manifest['apps']['test.base']['resources']
self.manifest.write_text(json.dumps(manifest))
self.run_import()
resources = json.loads((self.root / 'build/games/base-resources.json').read_text())
self.assertEqual(resources, dict(dependencies=[], resources=[]))
def test_addon_cannot_omit_resource_sidecar(self):
manifest = json.loads(self.manifest.read_text())
del manifest['apps']['test.base-editor']['resources']
self.manifest.write_text(json.dumps(manifest))
self.reject('dependencies require exported resources metadata')
def test_invalid_metadata_type_rejected_atomically(self):
(self.source / 'base-editor-resources.json').write_text('[]')
self.reject('dependency identities mismatch')
def test_external_declaration_filtered_before_manifest_read(self):
(self.root / 'games.json').write_text('{"packages": []}')
(self.root / 'apps.json').write_text(json.dumps(dict(id='test', title='test', apps=[
dict(manifest='private/not-readable.json', external=True, standalone_bundle='private/island.zx')])))
self.assertEqual(declared_apps(self.root), [])
if __name__ == '__main__':
unittest.main()
-30
View File
@@ -1,30 +0,0 @@
"""Supported host range retains older games and refuses unsupported metadata."""
import importlib.util
import json
from pathlib import Path
import sys
import unittest
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / 'scripts'))
spec = importlib.util.spec_from_file_location('check_games', ROOT / 'scripts/check-games.py')
checker = importlib.util.module_from_spec(spec)
spec.loader.exec_module(checker)
class HostCompatibility(unittest.TestCase):
def test_supported_and_unsupported_interfaces(self):
standard = json.loads((ROOT / 'standards/game-v1.json').read_text())
for host_api in (43,):
checker.compatible(dict(name='fixture', contract_version=1, module_api=2,
host_api=host_api), standard)
for field, value in [('host_api', 42), ('host_api', 44), ('host_api', True),
('module_api', 1), ('contract_version', 2)]:
game = dict(name='fixture', contract_version=1, module_api=2, host_api=43)
game[field] = value
with self.subTest(field=field, value=value), self.assertRaises(AssertionError):
checker.compatible(game, standard)
if __name__ == '__main__':
unittest.main()
-8
View File
@@ -1,8 +0,0 @@
{
"choano-landscape": "1ca6e31c1062a7cca41bace4cf1bb221291988aea4a1dd61271899c2f5f28307",
"choano-portrait": "47b07722c474a67ee4a06b7644a3aff211503674391e363c17eb06a34ce60d6c",
"shovey-landscape": "40c01eb8300e4c5db52b2d75373e17cdaf7f68140c33c0a225613fc174660747",
"shovey-portrait": "ddcbf989eab5971157d8cdc73494ed03660bb4c7a7679543248f45be260777e3",
"wurm-landscape": "472773b7c106325e12777a81a29209496e22e0853782ca76955b6587824b1b30",
"wurm-portrait": "e8962c969f554567d598eb0b54db5836f7f1ed7462619463040c6cc2887a5a47"
}
+14 -56
View File
@@ -43,21 +43,16 @@ def live_library(binary, driver, work):
stdout=log, stderr=subprocess.STDOUT)
driver.attach(child, log_path)
try:
driver.wait(label='Allow', role='button', timeout=60)
driver.press(label='Allow', role='button')
driver.wait(label='Apfelwurm', role='button', timeout=60)
driver.wait(label='Connect', role='button', timeout=60)
driver.press(label='Connect', role='button')
driver.wait(label='Apfelwurm Editor', role='button', timeout=60)
driver.wait(label='Choano', role='button', timeout=60)
metadata = json.loads((profile / 'node/current.json').read_text())
assert metadata['app_id'] == 'inbe.arcade'
bundled = json.loads((ROOT / 'build/arcade.json').read_text())
source = bundled['node']
source = json.loads((ROOT / 'build/arcade.json').read_text())['node']
assert metadata['sequence'] >= source['minimum_sequence']
digest = next(item['sha256'] for item in metadata['artifacts'] if item['variant'] == 'module')
catalog = catalog_assets((profile / 'node' / (digest + '.zx')).read_bytes())
# Equal or older signed releases stay cached; the newer build's
# own art remains authoritative, as it does in installed Arcade.
if tuple(map(int, metadata['version'].split('.'))) <= tuple(map(int, bundled['version'].split('.'))):
catalog = bundled
art = profile / 'resources/downloads' / (catalog['art']['sha256'] + '.zx')
deadline = time.monotonic() + 60
while (not art.exists() or art.stat().st_size != catalog['art']['bytes']) and time.monotonic() < deadline:
@@ -148,11 +143,7 @@ def main():
relative = self.path.removeprefix('/api/v2/packages/inbe.arcade/')
if relative.startswith('latest?'):
index = state['revision']
if state.get('older'):
# Signed, valid and newer in sequence, but an older app version.
data = json.dumps(descriptor(key, payloads[0], 195, module_api=2, version='0.0.1')).encode()
else:
data = json.dumps(descriptor(key, payloads[index], 196 + index, module_api=2)).encode()
data = json.dumps(descriptor(key, payloads[index], 196 + index, module_api=2)).encode()
elif relative.removesuffix('.zx') in digests:
data = payloads[digests.index(relative.removesuffix('.zx'))]
else:
@@ -178,8 +169,6 @@ def main():
shutil.copy2(args.binary, app / 'arcade')
for name in ('arcade.zx', 'apps.zx', 'entity.zx'):
shutil.copyfile(ROOT / 'build' / name, app / name)
# The installed HUD icons sit beside the binary, as in a release.
shutil.copytree(ROOT / 'build/assets/hud', app / 'assets/hud')
receipt = json.loads((ROOT / 'build/arcade.json').read_text())
receipt['node'] = dict(origin=origin, app_id='inbe.arcade', key_id='fixture-2026', minimum_sequence=195,
public_key=key.public_key().public_bytes(serialization.Encoding.Raw, serialization.PublicFormat.Raw).hex())
@@ -216,7 +205,7 @@ def main():
# event is still queued. Wait for the accepted viewport first.
import time
deadline = time.monotonic() + 10
while max(node['width'] for node in driver.tree() if node['x'] == 0 and node['y'] == 0) != width:
while max(node['width'] for node in driver.tree()) != width:
assert time.monotonic() < deadline, 'The host did not accept the new viewport'
time.sleep(0.05)
driver.wait_idle(frames=20)
@@ -232,7 +221,7 @@ def main():
'Node language must not reach players: ' + text
with application('consent-offline') as child:
driver.wait(label='Allow', role='button')
driver.wait(label='Connect', role='button')
driver.wait_idle(frames=20)
assert not state['requests'], 'No node traffic before consent'
capture(child, 'consent')
@@ -245,39 +234,16 @@ def main():
assert not state['requests'], 'Offline choice must prevent preview downloads'
assert_plain_library()
consent.unlink()
# A signed release older than the catalog this build carries is kept
# cached but never replaces the bundled library, then or after restart.
state['older'] = True
with application('older-release'):
import time
driver.wait(label='Allow', role='button')
driver.press(label='Allow', role='button')
cached = profile / 'node/current.json'
deadline = time.monotonic() + 60
while not (cached.is_file() and json.loads(cached.read_text() or '{}').get('version') == '0.0.1'):
assert time.monotonic() < deadline, 'The older signed release was not fetched'
time.sleep(0.1)
driver.wait_idle(frames=60)
assert driver.find(label='Choano', role='button'), 'An older release replaced the bundled library'
assert not driver.find(label='Node Shovey', role='button')
with application('older-cached'):
driver.wait(label='Choano', role='button', timeout=60)
driver.wait_idle(frames=40)
assert not driver.find(label='Node Shovey', role='button'), 'A cached older release replaced the bundled library'
state['older'] = False
consent.unlink()
with application('consent-refresh') as child:
driver.wait(label='Allow', role='button')
driver.press(label='Allow', role='button')
driver.wait(label='Connect', role='button')
driver.press(label='Connect', role='button')
driver.wait(label='Node Shovey', role='button', timeout=60)
assert not driver.find(label='Choano', role='button'), 'Membership must come from the signed node catalog'
driver.wait_idle(frames=60)
assert any(path.endswith(catalog['art']['sha256'] + '.zx') for path in state['requests']), 'Node previews must be fetched'
assert driver.find(role='image', visible=True), 'Verified previews must draw'
card = driver.wait(label='Node Shovey', role='button')
assert card['selected'] and card['width'] > card['height'], 'Wide library uses a focused landscape cover'
assert not driver.find(label='Arcade', role='text')
assert not driver.find(label='Node Shovey', role='text'), 'Cover identity belongs to the art and accessible action'
assert card['y'] < 88, 'The library must not reserve room for removed controls'
assert_plain_library()
with Image.open(capture(child, 'node-library')) as image:
crop = image.crop((card['x'], card['y'], card['x'] + card['width'], card['y'] + card['height']))
@@ -288,7 +254,7 @@ def main():
with application('automatic-refresh') as child:
# A newer signed library appears without any refresh control.
driver.wait(label='Choano', role='button', timeout=60)
driver.wait(label='Apfelwurm', role='button')
driver.wait(label='Apfelwurm Editor', role='button')
driver.wait_idle(frames=20)
assert_plain_library()
capture(child, 'refreshed-library')
@@ -296,18 +262,10 @@ def main():
capture(child, 'phone-library')
resize(child, 1000, 820)
assert save.read_bytes() == b'prior saved game'
with application('change-connection'):
driver.wait(label='Shovey', role='button', timeout=60)
driver.press(label='Profile', role='button')
driver.wait(label='Account', role='text')
driver.press(label='Library connection', role='button')
driver.wait(label='Allow fetching content and automatic app updates?', role='text')
driver.press(label='Stay offline', role='button')
driver.wait(label='Choano', role='button')
assert consent.read_text() == 'off\n' + origin
consent.write_text('off\n' + origin)
with application('cached-offline'):
driver.wait(label='Choano', role='button', timeout=60)
driver.wait(label='Apfelwurm', role='button')
driver.wait(label='Apfelwurm Editor', role='button')
driver.wait_idle(frames=40)
count = len(state['requests'])
driver.wait_idle(frames=40)
@@ -318,7 +276,7 @@ def main():
server.shutdown()
server.server_close()
thread.join()
print('Arcade node consent, older releases never replacing the bundled library, automatic signed membership refresh, preview rendering, game download consent and offline restart passed')
print('Arcade node consent, automatic signed membership refresh, preview rendering, game download consent and offline restart passed')
if __name__ == '__main__':
+10 -10
View File
@@ -36,23 +36,23 @@ with tempfile.TemporaryDirectory(prefix='arcade-publisher-') as directory:
store = work / 'store'
def stage():
return publisher.stage_node_app(store, 'arcade', private, 'test-key', pins,
ledger_path=ledger, bundle_directory=ROOT / 'build/node-apps')
return publisher.stage_node_app(store, 'chess', private, 'test-key', pins,
ledger_path=ledger, bundle_directory=ROOT / 'build/games')
value = stage()
assert stage() == value
assert value['app_id'] == 'inbe.arcade'
assert value['artifacts'][0]['sha256'] == sha256((ROOT / 'build/node-apps/arcade.zx').read_bytes()).hexdigest()
assert value['app_id'] == 'inbe.chess'
assert value['artifacts'][0]['sha256'] == sha256((ROOT / 'build/games/chess.zx').read_bytes()).hexdigest()
key.public_key().verify(bytes.fromhex(value['signature']), publisher.signing_message(value))
# The upload carries the release files; the node writes its own history.
entries = {str(path.relative_to(store)): path.read_bytes() for path in store.rglob('*')
if path.is_file() and path.name not in ('.publish.lock', 'history-v2.json')}
remote = work / 'receiver'
publisher.import_node_app(entries, remote, json.loads(pins.read_text()), 'inbe.arcade')
assert json.loads((remote / 'inbe.arcade/latest-v2.json').read_bytes()) == value
component = owned['node_apps']['arcade']
publisher.import_node_app(entries, remote, json.loads(pins.read_text()), 'inbe.chess')
assert json.loads((remote / 'inbe.chess/latest-v2.json').read_bytes()) == value
component = owned['node_apps']['chess']
component['version'] = '1.0.1'
component['sequence'] = 1
component['sequence'] = 2
ledger.write_text(json.dumps(owned))
try:
stage()
@@ -60,8 +60,8 @@ with tempfile.TemporaryDirectory(prefix='arcade-publisher-') as directory:
pass
else:
raise AssertionError('Publisher accepted an older game release')
assert json.loads((store / 'inbe.arcade/latest-v2.json').read_bytes()) == value
component['id'] = 'arcade.renamed'
assert json.loads((store / 'inbe.chess/latest-v2.json').read_bytes()) == value
component['id'] = 'arcade.chess'
ledger.write_text(json.dumps(owned))
try:
stage()
-77
View File
@@ -1,77 +0,0 @@
"""Verify Arcade's host bar pixels on a private display, including repaint."""
import argparse
import os
from pathlib import Path
import subprocess
import sys
import tempfile
from PIL import Image
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--binary', type=Path, required=True)
parser.add_argument('--inbe-source', type=Path, required=True)
args = parser.parse_args()
assert int(os.environ['DISPLAY'].split(':')[-1].split('.')[0]) >= 400
assert os.environ['YUE_DESKTOP_RECOVERY'] == '0'
root = Path(__file__).resolve().parents[1]
subprocess.run(['git', 'check-ignore', 'work/titlebar-background-ui'], cwd=root, check=True)
output = root / 'work/titlebar-background-ui'
output.mkdir(parents=True, exist_ok=True)
sys.path.insert(0, str(args.inbe_source / 'tests'))
from ui_driver import UiDriver
driver = UiDriver(output / 'driver')
with tempfile.TemporaryDirectory(dir=output) as temporary, (output / 'app.log').open('w') as log:
profile = Path(temporary)
child = subprocess.Popen([str(args.binary.resolve())], cwd=root,
env=os.environ | driver.environment() | {
'ARCADE_DATA': str(profile), 'ENTITY_DATA': str(profile / 'entity'),
'XDG_DATA_HOME': str(profile / 'share'), 'XDG_CONFIG_HOME': str(profile / 'config'),
'XDG_CACHE_HOME': str(profile / 'cache'), 'LANG': 'en_US.UTF-8'},
stdout=log, stderr=subprocess.STDOUT)
driver.attach(child, output / 'app.log')
try:
driver.wait(label='Stay offline', role='button', timeout=60)
driver.press(label='Stay offline', role='button')
driver.wait(label='Profile', role='button', timeout=60)
window = subprocess.check_output(['xdotool', 'search', '--onlyvisible', '--pid', str(child.pid)],
text=True, timeout=10).splitlines()[0]
assert int(subprocess.check_output(['xdotool', 'getwindowpid', window], text=True)) == child.pid
def capture(name, size=None):
driver.wait_idle(frames=15)
path = output / (name + '.png')
subprocess.run(['import', '-window', window, str(path)], check=True, timeout=10)
with Image.open(path) as source:
image = source.convert('RGB')
if size is not None:
assert image.size == size, (name, image.size, size)
# Sample both edges of the former reserved area, away
# from controls and cards. The full-canvas library may
# have a subtle gradient, but must never expose the host's
# light clear color after resizing or changing screens.
expected = (17, 18, 35)
for x, y in [(2, 2), (2, 54), (2, 80), (image.width - 8, 80)]:
pixel = image.getpixel((x, y))
assert max(pixel) < 72, (name, (x, y), pixel, 'opaque dark home')
capture('library')
for width, height in [(480, 820), (1200, 900)]:
subprocess.run(['xdotool', 'windowsize', window, str(width), str(height)], check=True)
capture(f'resized-{width}', (width, height))
driver.press(label='Profile', role='button')
driver.wait(label='Back', role='button')
driver.press(label='Back', role='button')
driver.wait_gone(label='Back', role='button')
capture('returned-from-profile')
print('Local titlebar pixel test passed: library, narrow/wide resize, profile return')
finally:
if child.poll() is None:
child.terminate()
child.wait(timeout=10)
if __name__ == '__main__':
main()
-237
View File
@@ -1,237 +0,0 @@
"""Run the actual WASM console in a disposable Chromium with no Node dependency."""
import argparse
import base64
import contextlib
import http.server
import json
import os
from pathlib import Path
import select
import subprocess
import tempfile
import threading
import time
import urllib.parse
ROOT = Path(__file__).resolve().parents[1]
class Cdp:
def __init__(self, profile, log):
incoming, self.write = os.pipe()
self.read, outgoing = os.pipe()
# Chromium's documented debugging pipe is fd3 (input), fd4 (output).
def child_pipes():
os.dup2(incoming, 3)
os.dup2(outgoing, 4)
env = {k: v for k, v in os.environ.items() if k not in
('DISPLAY', 'WAYLAND_DISPLAY', 'XAUTHORITY', 'DBUS_SESSION_BUS_ADDRESS', 'SESSION_MANAGER', 'GDK_DISPLAY')}
env['YUE_DESKTOP_RECOVERY'] = '0'
scratch = ROOT / 'work/webtmp'
scratch.mkdir(parents=True,exist_ok=True)
env['TMPDIR'] = str(scratch)
self.child = subprocess.Popen(['chromium', '--headless=new', '--no-sandbox',
'--disable-dev-shm-usage', '--no-first-run', '--no-default-browser-check',
'--use-angle=swiftshader', '--enable-unsafe-swiftshader', '--remote-debugging-pipe',
'--user-data-dir=' + str(profile), 'about:blank'], env=env,
pass_fds=tuple(set((incoming, outgoing, 3, 4))), preexec_fn=child_pipes,
stdout=log, stderr=log)
os.close(incoming)
os.close(outgoing)
self.buffer = b''
self.sequence = 0
self.session = None
self.errors = []
target = self.call('Target.createTarget', {'url': 'about:blank'})['targetId']
self.session = self.call('Target.attachToTarget', {'targetId': target, 'flatten': True})['sessionId']
self.call('Runtime.enable')
self.call('Page.enable')
def call(self, method, params=None):
self.sequence += 1
request = dict(id=self.sequence, method=method, params=params or {})
if self.session:
request['sessionId'] = self.session
os.write(self.write, json.dumps(request).encode() + b'\0')
deadline = time.monotonic() + 45
while True:
while b'\0' not in self.buffer:
if not select.select([self.read], [], [], max(0, deadline-time.monotonic()))[0]:
raise TimeoutError(method)
data = os.read(self.read, 65536)
if not data:
raise RuntimeError('Chromium debugging pipe closed')
self.buffer += data
assert len(self.buffer) <= 16 * 1024 * 1024
line, self.buffer = self.buffer.split(b'\0', 1)
if not line:
continue
reply = json.loads(line)
if reply.get('method') == 'Runtime.exceptionThrown':
self.errors.append(reply['params']['exceptionDetails'].get('text', '')[:300])
if reply.get('id') == self.sequence:
if 'error' in reply:
raise RuntimeError(reply['error'])
return reply.get('result', {})
def evaluate(self, expression):
result = self.call('Runtime.evaluate', dict(expression=expression, returnByValue=True, awaitPromise=True))
if 'exceptionDetails' in result:
raise RuntimeError(result['exceptionDetails'])
return result.get('result', {}).get('value')
def close(self):
if self.child.poll() is None:
self.child.terminate()
self.child.wait(timeout=15)
os.close(self.read)
os.close(self.write)
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('site', type=Path)
args = parser.parse_args()
site = args.site.resolve()
work = ROOT / 'work/web-console-ui'
work.mkdir(parents=True, exist_ok=True)
requests = []
class Handler(http.server.SimpleHTTPRequestHandler):
def __init__(self, *a, **kw):
super().__init__(*a, directory=site, **kw)
def log_message(self, *a):
pass
def do_GET(self):
path = urllib.parse.urlsplit(self.path).path
requests.append(path)
if path in ('/', '/index.html'):
html = (site / 'index.html').read_text().replace(
'document.body.appendChild(script);',
"Module.preRun = (Module.preRun || []).concat(function () { FS.mkdirTree('/arcade-test'); ENV.KRYON_TEST_DRIVER='/arcade-test'; }); document.body.appendChild(script);")
# No personal account/provider is part of this disposable UI test.
html = html.replace('https://account.waozi.xyz/share.js', '/test-account.js')
data = html.encode()
self.send_response(200)
self.send_header('Content-Type', 'text/html')
self.send_header('Content-Length', str(len(data)))
self.end_headers()
self.wfile.write(data)
elif path == '/test-account.js':
self.send_response(200)
self.end_headers()
self.wfile.write(b'window.WaoziAccount={attach:function(){return Promise.resolve();}};')
else:
super().do_GET()
server = http.server.ThreadingHTTPServer(('127.0.0.1', 0), Handler)
thread = threading.Thread(target=server.serve_forever, daemon=True)
thread.start()
try:
with tempfile.TemporaryDirectory(dir=work) as profile, (work / 'chromium.log').open('w') as log:
cdp = Cdp(Path(profile), log)
try:
cdp.call('Emulation.setDeviceMetricsOverride', dict(width=1200, height=720, deviceScaleFactor=1, mobile=False))
cdp.call('Page.navigate', {'url': f'http://127.0.0.1:{server.server_port}/'})
deadline = time.monotonic() + 90
while not cdp.evaluate("typeof FS !== 'undefined' && FS.analyzePath('/arcade-test').exists"):
assert time.monotonic() < deadline, 'WASM did not start'
time.sleep(.1)
serial = 0
def driver(verb, **fields):
nonlocal serial
serial += 1
command = '\t'.join([str(serial), verb, *[f'{k}={v}' for k,v in fields.items()]]) + '\n'
cdp.evaluate("if(FS.analyzePath('/arcade-test/reply').exists)FS.unlink('/arcade-test/reply');FS.writeFile('/arcade-test/command'," + json.dumps(command) + ");")
stop = time.monotonic() + 15
while True:
reply = cdp.evaluate("FS.analyzePath('/arcade-test/reply').exists ? FS.readFile('/arcade-test/reply',{encoding:'utf8'}) : ''")
if reply:
value = json.loads(reply)
if value.get('serial') == serial:
assert value.get('ok', True), value
return value
assert time.monotonic() < stop, 'WASM test driver did not reply'
time.sleep(.03)
def nodes():
return driver('tree')['nodes']
def wait_label(label):
stop = time.monotonic() + 30
while True:
found = [n for n in nodes() if n['label'] == label and n['visible']]
if found:
return found[0]
assert time.monotonic() < stop, (label, cdp.errors)
time.sleep(.05)
offline = wait_label('Stay offline')
position = dict(x=offline['visible_x']+offline['visible_width']/2, y=offline['visible_y']+offline['visible_height']/2)
cdp.call('Input.dispatchMouseEvent', dict(type='mouseMoved', **position))
cdp.call('Input.dispatchMouseEvent', dict(type='mousePressed',button='left',buttons=1,clickCount=1, **position))
time.sleep(.08)
cdp.call('Input.dispatchMouseEvent', dict(type='mouseReleased',button='left',buttons=0,clickCount=1, **position))
wait_label('Shovey')
for width,height,name in [(1200,720,'landscape'),(480,820,'portrait')]:
cdp.call('Emulation.setDeviceMetricsOverride', dict(width=width,height=height,deviceScaleFactor=1,mobile=False))
time.sleep(.5)
tree = nodes()
assert not any(n['label'] == 'Arcade' and n['kind'] == 'text' for n in tree)
assert not any('Editor' in n['label'] for n in tree)
selected = [n for n in tree if n['kind']=='button' and n['selected'] and n['height']>100]
assert len(selected)==1
assert abs(selected[0]['width']/selected[0]['height']-(16/9 if width>height else 2/3))<.02
backdrop = next(n for n in tree if n['key']==50021)
assert (backdrop['x'],backdrop['y'],backdrop['width'],backdrop['height'])==(0,0,width,height)
assert all(any(n['kind']=='image' and n['detail'].endswith('/assets/hud/'+icon+'.webp') for n in tree) for icon in ('profile','dew'))
assert all(any(n['kind']=='image' and n['label']==title for n in tree) for title in ('Shovey','Apfelwurm'))
(work/(name+'-tree.json')).write_text(json.dumps(tree,indent=2))
shot=cdp.call('Page.captureScreenshot',{'format':'png'})
(work/(name+'.png')).write_bytes(base64.b64decode(shot['data']))
# Exercise the production browser Gamepad adapter in real WASM.
cdp.call('Emulation.setFocusEmulationEnabled', {'enabled': True})
cdp.evaluate("""window.arcadePad = {connected:true,index:0,id:'Arcade local test',mapping:'standard',
axes:[0,0],buttons:Array.from({length:17},()=>({pressed:false,touched:false,value:0}))};
Object.defineProperty(navigator,'getGamepads',{configurable:true,value:()=>[window.arcadePad]});
document.querySelector('canvas').focus(); window.dispatchEvent(new Event('focus'));""")
time.sleep(.2)
def pad(button, down):
cdp.evaluate('window.arcadePad.buttons[' + str(button) + ']=' +
json.dumps(dict(pressed=down,touched=down,value=1 if down else 0)) + ';')
def selected_label():
return next(n['label'] for n in nodes() if n['kind']=='button' and n['selected'] and n['height']>100)
def wait_selected(label):
stop=time.monotonic()+5
while selected_label()!=label:
assert time.monotonic()<stop, ('Gamepad did not select',label)
time.sleep(.05)
pad(15, True)
wait_selected('Apfelwurm')
time.sleep(.2)
assert selected_label()=='Apfelwurm', 'A held button must not skip games'
pad(15, False)
time.sleep(.1)
pad(14, True)
wait_selected('Shovey')
pad(14, False)
time.sleep(.1)
pad(0, True)
wait_label('Cancel')
assert not any(n['kind']=='modal' for n in nodes()), 'Launch progress must be a normal full-art page'
assert any(n['kind']=='text' and n['label']=='Shovey' for n in nodes())
pad(0, False)
time.sleep(.1)
pad(8, True)
stop=time.monotonic()+5
while any(n['kind']=='text' and n['label']=='Shovey' for n in nodes()):
assert time.monotonic()<stop, 'Gamepad View must return from the launch page'
time.sleep(.05)
pad(8, False)
assert '/assets/hud/profile.webp' in requests and '/assets/hud/dew.webp' in requests
print('PASS browser WASM console: landscape/portrait geometry, full background, games only, no title/captions, canonical HUD assets, real browser Gamepad selection/activate/Back')
finally:
cdp.close()
finally:
server.shutdown()
server.server_close()
thread.join(timeout=5)
if __name__ == '__main__':
main()
+2 -6
View File
@@ -80,8 +80,6 @@ class WebLibraryArtTests(unittest.TestCase):
'assets/arcade/covers/wurm-landscape.jpg': self.landscape,
'assets/arcade/covers/wurm-logo.png': self.logo,
'assets/arcade/previews/wurm.png': self.preview,
'assets/arcade/library/hud-profile.webp': self.logo,
'assets/arcade/library/hud-dew.webp': self.logo,
})
def tearDown(self):
@@ -124,9 +122,7 @@ class WebLibraryArtTests(unittest.TestCase):
self.assertEqual(set(pictures), {'assets/arcade/covers/wurm-portrait.jpg',
'assets/arcade/covers/wurm-landscape.jpg',
'assets/arcade/covers/wurm-logo.png',
'assets/arcade/previews/wurm.png',
'assets/arcade/library/hud-profile.webp',
'assets/arcade/library/hud-dew.webp'})
'assets/arcade/previews/wurm.png'})
copies = {}
for name, picture in pictures.items():
data = (self.site / picture['file']).read_bytes()
@@ -136,7 +132,7 @@ class WebLibraryArtTests(unittest.TestCase):
copies[name] = data
portrait = decoded(copies['assets/arcade/covers/wurm-portrait.jpg'])
self.assertEqual(portrait.format, 'WEBP')
self.assertEqual(portrait.size, (800, 1200))
self.assertEqual(portrait.size, (427, 640))
landscape = copies['assets/arcade/covers/wurm-landscape.jpg']
self.assertEqual(decoded(landscape).format, 'WEBP')
self.assertLess(len(landscape), len(self.landscape))
+21 -20
View File
@@ -3,7 +3,7 @@
// library's art never comes from api.waozi.xyz: those requests are refused,
// and the covers must draw from the site's own copies or its exact art.
// Usage: node tests/web_site_test.mjs SITE_DIR
// ARCADE_TEST_LIBRARY_ONLY=1 checks painted console covers and accessible names without downloading games.
// ARCADE_TEST_LIBRARY_ONLY=1 checks painted library covers and titles without downloading games.
// ARCADE_TEST_PACKAGES=DIR serves local packages by their verified SHA-256 for unpublished builds.
import { spawn } from 'node:child_process';
import { createHash } from 'node:crypto';
@@ -16,7 +16,7 @@ import { setTimeout as delay } from 'node:timers/promises';
const site = process.argv[2];
const libraryOnly = process.env.ARCADE_TEST_LIBRARY_ONLY === '1';
const requiredTitles = ['Shovey', 'Apfelwurm', 'Choano'];
const requiredTitles = ['Apfelwurm', 'Apfelwurm Editor', 'Choano'];
const game = process.env.ARCADE_TEST_GAME || 'Apfelwurm';
const packages = process.env.ARCADE_TEST_PACKAGES;
if (!site) throw new Error('Usage: node tests/web_site_test.mjs SITE_DIR');
@@ -256,21 +256,26 @@ try {
throw new Error('The covers did not come from the small copies alone: ' + JSON.stringify({ served, refusedArt, fetched }));
await command('Emulation.setDeviceMetricsOverride', { width: 1280, height: 1400, deviceScaleFactor: 1, mobile: false });
await delay(500);
// Art carries the name. Accessible actions retain every catalog title.
for (const [width, height, ratio] of [[1280, 800, 16 / 9], [480, 820, 2 / 3]]) {
await command('Emulation.setDeviceMetricsOverride', { width, height, deviceScaleFactor: 1, mobile: false });
await delay(500);
const nodes = await tree();
const focused = nodes.filter(node => node.kind === 'button' && node.selected && node.height > 100);
if (focused.length !== 1 || Math.abs(focused[0].width / focused[0].height - ratio) > .02)
throw new Error('Console cover orientation or selection is wrong: ' + JSON.stringify(focused));
if (nodes.some(node => node.kind === 'text' && (requiredTitles.includes(node.label) || node.label === 'Arcade')))
throw new Error('The console must not show a home title or cover captions');
for (const title of requiredTitles)
if (!nodes.some(node => node.kind === 'button' && node.label === title))
throw new Error('Game name missing from accessible shelf: ' + title);
// Sample only the Text widget's rectangle below each cover. Neither the
// cover image nor its invisible button/alt text can satisfy this check.
const titles = (await tree()).filter(node => node.kind === 'text' && node.visible &&
node.visible_height >= 20 && requiredTitles.includes(node.label));
const paintedTitles = await evaluate(`(() => {
const canvas = document.getElementById('canvas'), context = canvas.getContext('2d');
const scale = canvas.width / canvas.clientWidth;
return Object.fromEntries(${JSON.stringify(titles)}.map(node => {
const pixels = context.getImageData(Math.round(node.visible_x * scale), Math.round(node.visible_y * scale),
Math.round(node.visible_width * scale), Math.round(node.visible_height * scale)).data;
let ink = 0;
for (let at = 0; at < pixels.length; at += 4)
if (pixels[at] > 120 && pixels[at + 1] > 120 && pixels[at + 2] > 120) ink++;
return [node.label, ink];
}));
})()`);
for (const title of requiredTitles) {
if (!(paintedTitles[title] >= 100)) throw new Error(`Game title was not painted: ${title}: ${JSON.stringify(paintedTitles)}`);
}
console.log(`Console covers drew from ${served.pictures} bounded pictures; art ${library.bytes} bytes; landscape/portrait, accessible names and removed captions verified`);
console.log(`Covers drew from ${served.pictures} small copies (${Object.values(library.pictures).reduce((sum, picture) => sum + picture.bytes, 0)} bytes, art ${library.bytes} bytes); colours ${colours}; title ink pixels ${JSON.stringify(paintedTitles)}`);
}
if (!libraryOnly) {
await command('Emulation.setDeviceMetricsOverride', { width: 1280, height: 800, deviceScaleFactor: 1, mobile: false });
@@ -278,10 +283,6 @@ try {
const cover = button(await tree(), game);
if (!cover) throw new Error('Game cover missing');
await click(cover);
if (cover.height <= 100) {
await delay(700);
await click(button(await tree(), game));
}
const download = (await tree()).findLast(node => node.kind === 'button' && node.label === 'Download');
if (!download) throw new Error('The cover did not offer its download');
await click(download);
-98
View File
@@ -1,98 +0,0 @@
"""Wurm releases are imported unchanged, with the exact source/release identity."""
import importlib.util
import io
import json
import os
from pathlib import Path
import sys
import tarfile
import tempfile
import unittest
from unittest.mock import patch
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / 'scripts'))
def load(name, path):
spec = importlib.util.spec_from_file_location(name, ROOT / path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module
exports = load('wurm_exports', 'scripts/fetch-wurm-export.py')
class WurmExports(unittest.TestCase):
def setUp(self):
scratch = ROOT / 'work/console-redesign'
scratch.mkdir(parents=True, exist_ok=True)
self.temporary = tempfile.TemporaryDirectory(dir=scratch)
self.addCleanup(self.temporary.cleanup)
self.root = Path(self.temporary.name)
def archive(self, bad=None):
archive = self.root / 'exports.tar.gz'
with tarfile.open(archive, 'w:gz') as output:
for name in sorted(exports.EXPORT_FILES):
member = tarfile.TarInfo(name)
data = name.encode()
member.size = len(data)
if name == 'wurm.zx' and bad:
if bad == 'link':
member.type, member.linkname = tarfile.SYMTYPE, 'private'
else:
member.name = '../wurm.zx'
output.addfile(member, io.BytesIO(data))
return archive
def test_complete_archive_is_copied_unchanged(self):
exports.unpack(self.archive(), self.root)
for name in exports.EXPORT_FILES:
self.assertEqual((self.root / 'build/games' / name).read_bytes(), name.encode())
def test_invalid_members_preserve_previous_export(self):
target = self.root / 'build/games/wurm.zx'
target.parent.mkdir(parents=True)
target.write_bytes(b'previous export')
for bad in ('link', 'traversal'):
with self.assertRaises(ValueError):
exports.unpack(self.archive(bad), self.root)
self.assertEqual(target.read_bytes(), b'previous export')
def test_wrong_release_commit_is_rejected_before_download(self):
(self.root / 'version.json').write_text('{"version":"0.2.32"}')
with patch.object(exports.subprocess, 'check_output', return_value='1' * 40), \
patch.object(exports.subprocess, 'run') as download:
with self.assertRaisesRegex(ValueError, 'pinned commit'):
exports.fetch(self.root, '2' * 40)
download.assert_not_called()
@unittest.skipUnless(os.environ.get('WURM_EXPORT_ARCHIVE'), 'set WURM_EXPORT_ARCHIVE and WURM_SOURCE for real bundle test')
def test_real_release_passes_arcade_import_contract(self):
importer = load('game_importer', 'scripts/build-games.py')
source = Path(os.environ['WURM_SOURCE'])
archive = Path(os.environ['WURM_EXPORT_ARCHIVE'])
exports.unpack(archive, self.root)
apps, records = [], {}
for declaration in json.loads((source / 'apps.json').read_text())['apps']:
descriptor = json.loads((source / declaration['manifest']).read_text())
name = descriptor['name']
apps.append(dict(descriptor=descriptor, requires=declaration.get('requires', []),
enabled=True, source=source, package='wurm'))
records[descriptor['id']] = {
kind: str(self.root / 'build/games' / (name + suffix))
for kind, suffix in [('bundle', '.zx'), ('resources', '-resources.json'), ('preview', '-preview.png')]}
manifest = self.root / 'exports.json'
manifest.write_text(json.dumps({'apps': records}))
before = {path.name: importer.digest(path) for path in (self.root / 'build/games').iterdir()}
with patch.object(importer, 'ROOT', self.root), patch.object(importer, 'declared_apps', return_value=apps):
importer.build('unused', [], manifest)
for name, digest in before.items():
if '-catalog.json' not in name:
self.assertEqual(importer.digest(self.root / 'build/games' / name), digest)
if __name__ == '__main__':
unittest.main()
+233 -218
View File
@@ -4,20 +4,20 @@
{
"commit": "907e90ddd4c78f02e0d49e90384e4197f7dcdf26",
"dependencies": {},
"id": "p002f6ed23e3a3576",
"id": "p0002f862b297522d",
"name": "monocypher",
"ref": "master",
"source": true,
"url": "https://github.com/LoupVaillant/Monocypher.git"
},
{
"commit": "5e609079d1e91699a627b5d938d1fffa4a31ac07",
"commit": "b31299434c785d0f2bd82f36b5bfd2fd36ba1216",
"dependencies": {},
"id": "p02e33d091b212961",
"name": "wurm_art",
"ref": "5e609079d1e91699a627b5d938d1fffa4a31ac07",
"id": "p09fa77e94b0dfc6c",
"name": "rini",
"ref": "main",
"source": true,
"url": "https://github.com/waozixyz/wurm.git"
"url": "https://github.com/raysan5/rini.git"
},
{
"commit": "2944b2e668e735438d8ce24e47a39be3f5c36af5",
@@ -27,28 +27,9 @@
"ref": "master",
"url": "https://github.com/ziranlang/qrcode.git"
},
{
"commit": "8b5a989dea686250078da2d209fde1cd2946fc77",
"dependencies": {"kryon": "pe42819128210d99c"},
"dependency_refs": {"kryon": "1cd873fda5d12cd4dd562956da94cee33c3e364c"},
"id": "p0e63706817d43aba",
"name": "Game2D",
"ref": "8b5a989dea686250078da2d209fde1cd2946fc77",
"url": "https://github.com/kryonlabs/game2d.git"
},
{
"commit": "829a65d769d935c4852f8159e964312c0957260a",
"dependencies": {},
"id": "p16cd0434af3dff7b",
"name": "sdl3",
"ref": "829a65d769d935c4852f8159e964312c0957260a",
"source": true,
"url": "https://github.com/libsdl-org/SDL.git"
},
{
"commit": "d74348c2e288ac55740461f7e106cda365b4db4a",
"dependencies": {"apps": "p2bf10414e9201651", "crypto": "pc23fbf455e97614d", "curl": "p8da229d15597ab5c", "daochi_client": "p89503086b39ba0fb", "entity": "peb3fb337c2b79068", "game2d": "pf2f54c7603f6e861", "kryon": "pe4419a225f95e507", "kss": "p1b13dda539ed2a39", "liboqs": "p5c52c96443a2bf32", "mingcute": "pe1027b9d16704793", "monocypher": "p002f6ed23e3a3576", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "practices": "p71f489a3ce887de0", "qrcode": "p0dfa70137405b096", "rini": "p8ea355e8cb04093e", "sqlite": "p810dc0509cd1b75d"},
"dependency_refs": {"apps": "master", "crypto": "master", "curl": "master", "daochi_client": "master", "entity": "master", "game2d": "master", "kryon": "master", "kss": "master", "liboqs": "main", "mingcute": "master", "monocypher": "master", "oqs": "master", "plot": "master", "practices": "master", "qrcode": "master", "rini": "main", "sqlite": "master"},
"dependencies": {"apps": "pdea1492d0d16298f", "crypto": "pc23fbf455e97614d", "curl": "p1ca0e8d3c19dbe4c", "daochi_client": "p89503086b39ba0fb", "entity": "p53f5eefa1f190fe5", "game2d": "pf2f54c7603f6e861", "kryon": "p1f27ccd7e2463271", "kss": "p1b13dda539ed2a39", "liboqs": "p7bc48564c6b606fe", "mingcute": "pe1027b9d16704793", "monocypher": "p0002f862b297522d", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "practices": "p9079dde0fcc11248", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "sqlite": "p1d80baafaa5fa18a"},
"id": "p183b01bccc6424e7",
"name": "Inbe",
"ref": "master",
@@ -56,116 +37,25 @@
},
{
"commit": "1cb9df183089a77c8a16448a556186f30b261a98",
"dependencies": {"kryon": "pe4419a225f95e507"},
"dependency_refs": {"kryon": "master"},
"dependencies": {"kryon": "p1f27ccd7e2463271"},
"id": "p1b13dda539ed2a39",
"name": "Kss",
"ref": "master",
"url": "https://github.com/kryonlabs/kss.git"
},
{
"commit": "cd72a242f8cdfd3ec3fc839fc11d9e7d7fc3b8fc",
"dependencies": {"crypto": "pc23fbf455e97614d", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pbb0d432304fad5c6"},
"dependency_refs": {"crypto": "master", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "b5ac5d1a303326009012d68016c1d8859b6b3a13"},
"id": "p2b1c0e80f47c3873",
"name": "Apps",
"ref": "cd72a242f8cdfd3ec3fc839fc11d9e7d7fc3b8fc",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "7364520deacb9ead8b46771a24a066220dedf144",
"dependencies": {"crypto": "pc23fbf455e97614d", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pe4419a225f95e507"},
"dependency_refs": {"crypto": "master", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "7865957626e67e6c291e3db3b474c6082691d6c6"},
"id": "p2bf10414e9201651",
"name": "Apps",
"ref": "master",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "eada9baf35b45a7ebea4fb93728403dcca34cb41",
"dependencies": {"apps": "pf7f4c26f3cf01fbe", "entity": "p507e86a4cf18dc9c", "game2d": "p0e63706817d43aba", "kryon": "pe42819128210d99c", "kss": "pa3347b028712cc32", "mingcute": "pe1027b9d16704793"},
"dependency_refs": {"apps": "3515cdf3af20e79001f7774eed224e94180540ed", "entity": "075784438af94fe4a0aba48ed4d8c7208c161bf1", "game2d": "8b5a989dea686250078da2d209fde1cd2946fc77", "kryon": "1cd873fda5d12cd4dd562956da94cee33c3e364c", "kss": "e3536e6d056961d2ba7fa5f18af81f75c80e8f62", "mingcute": "master"},
"id": "p2f197edc2542d0f6",
"name": "Choano",
"ref": "eada9baf35b45a7ebea4fb93728403dcca34cb41",
"url": "https://github.com/waozixyz/choano.git"
},
{
"commit": "1844042d1ca751e62e61df7617dba19c98588339",
"commit": "19b299005fbe2d895f4ad525cfdae62a2220c3ea",
"dependencies": {},
"id": "p3b3c785a0e17e605",
"name": "libwebp",
"ref": "1844042d1ca751e62e61df7617dba19c98588339",
"source": true,
"url": "https://github.com/webmproject/libwebp.git"
},
{
"commit": "075784438af94fe4a0aba48ed4d8c7208c161bf1",
"dependencies": {"curl": "p8da229d15597ab5c", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pe42819128210d99c", "monocypher": "p002f6ed23e3a3576", "oqs": "p7098ac9cd92f7e5f", "qrcode": "p0dfa70137405b096", "zlib": "p82dbc05081cd4d96"},
"dependency_refs": {"curl": "19b299005fbe2d895f4ad525cfdae62a2220c3ea", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "1cd873fda5d12cd4dd562956da94cee33c3e364c", "monocypher": "master", "oqs": "master", "qrcode": "master", "zlib": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf"},
"id": "p507e86a4cf18dc9c",
"name": "Entity",
"ref": "075784438af94fe4a0aba48ed4d8c7208c161bf1",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "7bf154f197696f5bf04be2ea4c576db86bb6a238",
"dependencies": {},
"id": "p5c52c96443a2bf32",
"name": "liboqs",
"ref": "main",
"source": true,
"url": "https://github.com/open-quantum-safe/liboqs.git"
},
{
"commit": "2c56268db0b270ad53e51af9cae5dc46876a65d9",
"dependencies": {"curl": "p8da229d15597ab5c", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pbb0d432304fad5c6", "monocypher": "p002f6ed23e3a3576", "oqs": "p7098ac9cd92f7e5f", "qrcode": "p0dfa70137405b096", "zlib": "p82dbc05081cd4d96"},
"dependency_refs": {"curl": "19b299005fbe2d895f4ad525cfdae62a2220c3ea", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "b5ac5d1a303326009012d68016c1d8859b6b3a13", "monocypher": "master", "oqs": "master", "qrcode": "master", "zlib": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf"},
"id": "p6ab8e2a733002786",
"name": "Entity",
"ref": "2c56268db0b270ad53e51af9cae5dc46876a65d9",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "970d5e44b1702158cb16469892da6ff50f142427",
"dependencies": {"crypto": "pc23fbf455e97614d", "oqs": "p7098ac9cd92f7e5f"},
"dependency_refs": {"crypto": "master", "oqs": "master"},
"id": "p6af0b5bd9fd0cd31",
"name": "DaochiClient",
"ref": "970d5e44b1702158cb16469892da6ff50f142427",
"url": "https://github.com/ziranlang/daochi-client.git"
},
{
"commit": "22d2ddbdc236796953c905a05a2cebf5ab1b4ff3",
"dependencies": {"liboqs": "p5c52c96443a2bf32"},
"dependency_refs": {"liboqs": "main"},
"id": "p7098ac9cd92f7e5f",
"name": "Oqs",
"ref": "master",
"url": "https://github.com/ziranlang/oqs.git"
},
{
"commit": "8b81994303400255ddb0ee2da49044dbaef4397f",
"dependencies": {},
"id": "p71f489a3ce887de0",
"name": "practices",
"id": "p1ca0e8d3c19dbe4c",
"name": "curl",
"ref": "master",
"source": true,
"url": "https://github.com/waozixyz/practices.git"
},
{
"commit": "a9c85df73fa1ed7af55da8a6ab3ca7d3cdf5e6a8",
"dependencies": {"kryon": "pbb0d432304fad5c6"},
"dependency_refs": {"kryon": "b5ac5d1a303326009012d68016c1d8859b6b3a13"},
"id": "p7e2abf6e63acf588",
"name": "Game2D",
"ref": "a9c85df73fa1ed7af55da8a6ab3ca7d3cdf5e6a8",
"url": "https://github.com/kryonlabs/game2d.git"
"url": "https://github.com/curl/curl.git"
},
{
"commit": "5d1ee888094efc63d1fb25a58af93478b103d441",
"dependencies": {},
"id": "p810dc0509cd1b75d",
"id": "p1d80baafaa5fa18a",
"name": "sqlite",
"ref": "master",
"source": true,
@@ -174,84 +64,184 @@
{
"commit": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf",
"dependencies": {},
"id": "p82dbc05081cd4d96",
"id": "p1dff88558141400b",
"name": "zlib",
"ref": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf",
"source": true,
"url": "https://github.com/madler/zlib.git"
},
{
"commit": "3152a6e501bcc6ed05e9ec2e8ce1f4eb59cc74a2",
"dependencies": {"libwebp": "p651a2c7a393977c0", "raylib": "p5a77c9c35110e925"},
"id": "p1f27ccd7e2463271",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "f7ff3e546657a0f90de16802fc9fc4a700412481",
"dependencies": {"libwebp": "p651a2c7a393977c0", "raylib": "p5a77c9c35110e925"},
"id": "p2a656232910109dd",
"name": "kryon",
"ref": "f7ff3e546657a0f90de16802fc9fc4a700412481",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "43701aaf0da1e114df7793bf9876a044b96572e1",
"dependencies": {"curl": "p1ca0e8d3c19dbe4c", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "p2a656232910109dd", "monocypher": "p0002f862b297522d", "oqs": "p7098ac9cd92f7e5f", "qrcode": "p0dfa70137405b096", "zlib": "p1dff88558141400b"},
"id": "p300040f426184cc0",
"name": "Entity",
"ref": "43701aaf0da1e114df7793bf9876a044b96572e1",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "4204ef694f54aff644ac6627e74a9fb9bcc6b643",
"dependencies": {"apps": "pdea1492d0d16298f", "entity": "p53f5eefa1f190fe5", "kryon": "pcd450c600194cee7", "mingcute": "pe1027b9d16704793"},
"id": "p352b02504698188c",
"name": "Shovey",
"ref": "4204ef694f54aff644ac6627e74a9fb9bcc6b643",
"url": "https://github.com/waozixyz/shovey.git"
},
{
"commit": "6a29dfde2742a5081d477bebefcddf3a733383c5",
"dependencies": {"apps": "p9b5024e78127fbee", "entity": "pca086a043cf8d1f9", "game2d": "p9d83dc63fcae6cd0", "kryon": "pfa65f8437b3d3740", "kss": "paedcd9d605ed94a1", "mingcute": "pe1027b9d16704793"},
"id": "p36c2bd12ffeea1c8",
"name": "Choano",
"ref": "6a29dfde2742a5081d477bebefcddf3a733383c5",
"url": "https://github.com/waozixyz/choano.git"
},
{
"commit": "d208dc030fe068ff8a40ed49444536736b4b45d6",
"dependencies": {"kryon": "pcec085fc76d6fd7b"},
"id": "p415d809184a859cd",
"name": "Kss",
"ref": "d208dc030fe068ff8a40ed49444536736b4b45d6",
"url": "https://github.com/kryonlabs/kss.git"
},
{
"commit": "925ceb810d9b6e3b2fcb3e95adb3dd9c35ecb41f",
"dependencies": {"curl": "p1ca0e8d3c19dbe4c", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pb9d1c52c45ad3f51", "monocypher": "p0002f862b297522d", "oqs": "p7098ac9cd92f7e5f", "qrcode": "p0dfa70137405b096", "zlib": "p1dff88558141400b"},
"id": "p53f5eefa1f190fe5",
"name": "Entity",
"ref": "master",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"dependencies": {},
"id": "p5a77c9c35110e925",
"name": "raylib",
"ref": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"source": true,
"url": "https://github.com/raysan5/raylib.git"
},
{
"commit": "1844042d1ca751e62e61df7617dba19c98588339",
"dependencies": {},
"id": "p651a2c7a393977c0",
"name": "libwebp",
"ref": "1844042d1ca751e62e61df7617dba19c98588339",
"source": true,
"url": "https://github.com/webmproject/libwebp.git"
},
{
"commit": "970d5e44b1702158cb16469892da6ff50f142427",
"dependencies": {"crypto": "pc23fbf455e97614d", "oqs": "p7098ac9cd92f7e5f"},
"id": "p6af0b5bd9fd0cd31",
"name": "DaochiClient",
"ref": "970d5e44b1702158cb16469892da6ff50f142427",
"url": "https://github.com/ziranlang/daochi-client.git"
},
{
"commit": "22d2ddbdc236796953c905a05a2cebf5ab1b4ff3",
"dependencies": {"liboqs": "p7bc48564c6b606fe"},
"id": "p7098ac9cd92f7e5f",
"name": "Oqs",
"ref": "master",
"url": "https://github.com/ziranlang/oqs.git"
},
{
"commit": "619888d404e7d7e441921702c41a5838a8981408",
"dependencies": {},
"id": "p7bc48564c6b606fe",
"name": "liboqs",
"ref": "main",
"source": true,
"url": "https://github.com/open-quantum-safe/liboqs.git"
},
{
"commit": "256fe6ff049d48a25dfe2a8b0db7ad84477fd282",
"dependencies": {"crypto": "pc23fbf455e97614d", "oqs": "p7098ac9cd92f7e5f"},
"dependency_refs": {"crypto": "master", "oqs": "master"},
"id": "p89503086b39ba0fb",
"name": "DaochiClient",
"ref": "master",
"url": "https://github.com/ziranlang/daochi-client.git"
},
{
"commit": "19b299005fbe2d895f4ad525cfdae62a2220c3ea",
"commit": "8b81994303400255ddb0ee2da49044dbaef4397f",
"dependencies": {},
"id": "p8da229d15597ab5c",
"name": "curl",
"id": "p9079dde0fcc11248",
"name": "practices",
"ref": "master",
"source": true,
"url": "https://github.com/curl/curl.git"
"url": "https://github.com/waozixyz/practices.git"
},
{
"commit": "b31299434c785d0f2bd82f36b5bfd2fd36ba1216",
"dependencies": {},
"id": "p8ea355e8cb04093e",
"name": "rini",
"ref": "main",
"source": true,
"url": "https://github.com/raysan5/rini.git"
"commit": "5d1541025b33a4b19c6ec73bea19dc314e0ef5cb",
"dependencies": {"crypto": "pc23fbf455e97614d", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pfa65f8437b3d3740"},
"id": "p9b5024e78127fbee",
"name": "Apps",
"ref": "5d1541025b33a4b19c6ec73bea19dc314e0ef5cb",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "e3536e6d056961d2ba7fa5f18af81f75c80e8f62",
"dependencies": {"kryon": "pe42819128210d99c"},
"dependency_refs": {"kryon": "1cd873fda5d12cd4dd562956da94cee33c3e364c"},
"id": "pa3347b028712cc32",
"name": "Kss",
"ref": "e3536e6d056961d2ba7fa5f18af81f75c80e8f62",
"url": "https://github.com/kryonlabs/kss.git"
"commit": "fd4541da5ba2b4da9d0489f20ac463c6e6576253",
"dependencies": {"kryon": "pfa65f8437b3d3740"},
"id": "p9d83dc63fcae6cd0",
"name": "Game2D",
"ref": "fd4541da5ba2b4da9d0489f20ac463c6e6576253",
"url": "https://github.com/kryonlabs/game2d.git"
},
{
"commit": "5157b63b703981c1e637c78c71b4c475d9699932",
"dependencies": {"crypto": "pc23fbf455e97614d", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "p2a656232910109dd"},
"id": "pa53467b904293b28",
"name": "Apps",
"ref": "5157b63b703981c1e637c78c71b4c475d9699932",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "3f888653b6b97010163d824c4cc72476be3214f3",
"dependencies": {"kryon": "pe4419a225f95e507"},
"dependency_refs": {"kryon": "master"},
"dependencies": {"kryon": "p1f27ccd7e2463271"},
"id": "pab5377a2950368a2",
"name": "plot",
"ref": "master",
"url": "https://github.com/kryonlabs/plot.git"
},
{
"commit": "3b7fbaf580d3c7e2a729a6f3d133737d8167f7b5",
"dependencies": {"apps": "pb91195370ac0cb93", "crypto": "pc23fbf455e97614d", "entity": "p6ab8e2a733002786", "game2d": "p7e2abf6e63acf588", "kryon": "pbb0d432304fad5c6", "mingcute": "pe1027b9d16704793"},
"dependency_refs": {"apps": "3c0a7d9e7f941381a7c07169f94240b9fe801bb8", "crypto": "master", "entity": "2c56268db0b270ad53e51af9cae5dc46876a65d9", "game2d": "a9c85df73fa1ed7af55da8a6ab3ca7d3cdf5e6a8", "kryon": "b5ac5d1a303326009012d68016c1d8859b6b3a13", "mingcute": "master"},
"id": "pb0ffd96a1a0f002c",
"name": "Apfelwurm",
"ref": "3b7fbaf580d3c7e2a729a6f3d133737d8167f7b5",
"url": "https://github.com/waozixyz/wurm.git"
"commit": "7b125ad80a1398bd122f9c8e2017ebdb66b9e141",
"dependencies": {"kryon": "pfa65f8437b3d3740"},
"id": "paedcd9d605ed94a1",
"name": "Kss",
"ref": "7b125ad80a1398bd122f9c8e2017ebdb66b9e141",
"url": "https://github.com/kryonlabs/kss.git"
},
{
"commit": "3c0a7d9e7f941381a7c07169f94240b9fe801bb8",
"dependencies": {"crypto": "pc23fbf455e97614d", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pbb0d432304fad5c6"},
"dependency_refs": {"crypto": "master", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "b5ac5d1a303326009012d68016c1d8859b6b3a13"},
"id": "pb91195370ac0cb93",
"name": "Apps",
"ref": "3c0a7d9e7f941381a7c07169f94240b9fe801bb8",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "b5ac5d1a303326009012d68016c1d8859b6b3a13",
"dependencies": {"libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b"},
"dependency_refs": {"libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a"},
"id": "pbb0d432304fad5c6",
"commit": "bd34ddbe3b169f3fdec1a93cea1aba9fc3c62bbf",
"dependencies": {"libwebp": "p651a2c7a393977c0", "raylib": "p5a77c9c35110e925"},
"id": "pb9d1c52c45ad3f51",
"name": "kryon",
"ref": "b5ac5d1a303326009012d68016c1d8859b6b3a13",
"ref": "bd34ddbe3b169f3fdec1a93cea1aba9fc3c62bbf",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "42db0b20e0fd431f254ea8a06e553accda7d2e84",
"dependencies": {"kryon": "p1f27ccd7e2463271"},
"id": "pbebe1f485bbc1a48",
"name": "Game2D",
"ref": "42db0b20e0fd431f254ea8a06e553accda7d2e84",
"url": "https://github.com/kryonlabs/game2d.git"
},
{
"commit": "944826f70779a6b6cd53f6b06a75b36f4d8a2558",
"dependencies": {},
@@ -261,13 +251,52 @@
"url": "https://github.com/ziranlang/crypto.git"
},
{
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"dependencies": {},
"id": "pcc7aa76725f2fb2f",
"name": "raylib",
"ref": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"source": true,
"url": "https://github.com/raysan5/raylib.git"
"commit": "139f299d00f3921b386e07ee1fc5e9fad5216b9b",
"dependencies": {"libwebp": "p651a2c7a393977c0", "raylib": "p5a77c9c35110e925"},
"id": "pc9ddbcb0ebcff235",
"name": "kryon",
"ref": "139f299d00f3921b386e07ee1fc5e9fad5216b9b",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "b8f959234e41a597bde5c3d8508e9c3052897349",
"dependencies": {"curl": "p1ca0e8d3c19dbe4c", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pfa65f8437b3d3740", "monocypher": "p0002f862b297522d", "qrcode": "p0dfa70137405b096", "zlib": "p1dff88558141400b"},
"id": "pca086a043cf8d1f9",
"name": "Entity",
"ref": "b8f959234e41a597bde5c3d8508e9c3052897349",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "e373b8a7f8821256b86de12dd5ee05a32d373e87",
"dependencies": {"raylib": "p5a77c9c35110e925"},
"id": "pcd450c600194cee7",
"name": "kryon",
"ref": "e373b8a7f8821256b86de12dd5ee05a32d373e87",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "7dc62902389544bf8d1fb3a159152cbd3b889c78",
"dependencies": {"libwebp": "p651a2c7a393977c0", "raylib": "p5a77c9c35110e925"},
"id": "pcec085fc76d6fd7b",
"name": "kryon",
"ref": "7dc62902389544bf8d1fb3a159152cbd3b889c78",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "1b7d5c8472e52eecd4de0faa7c94a422a1ade4a3",
"dependencies": {"crypto": "pc23fbf455e97614d", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pc9ddbcb0ebcff235"},
"id": "pd6fdf2b1210fe2cb",
"name": "Apps",
"ref": "1b7d5c8472e52eecd4de0faa7c94a422a1ade4a3",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "0dd054932180a8e8cda4550af7030b527ee3c285",
"dependencies": {"crypto": "pc23fbf455e97614d", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pb9d1c52c45ad3f51"},
"id": "pdea1492d0d16298f",
"name": "Apps",
"ref": "master",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "9cc6872f75447c3a24c16764f9829d0f58751cb0",
@@ -278,68 +307,54 @@
"url": "https://github.com/kryonlabs/mingcute.git"
},
{
"commit": "1cd873fda5d12cd4dd562956da94cee33c3e364c",
"dependencies": {"libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b"},
"dependency_refs": {"libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a"},
"id": "pe42819128210d99c",
"name": "kryon",
"ref": "1cd873fda5d12cd4dd562956da94cee33c3e364c",
"url": "https://github.com/kryonlabs/kryon.git"
"commit": "a9e6431c8c4d688e9395f7f68d30a6ee726528f9",
"dependencies": {"apps": "pd6fdf2b1210fe2cb", "crypto": "pc23fbf455e97614d", "entity": "pf5085d0b43200dc5", "game2d": "pbebe1f485bbc1a48", "kryon": "pc9ddbcb0ebcff235", "mingcute": "pe1027b9d16704793"},
"id": "pe22548296a8e67a7",
"name": "Apfelwurm",
"ref": "a9e6431c8c4d688e9395f7f68d30a6ee726528f9",
"url": "https://github.com/waozixyz/wurm.git"
},
{
"commit": "7865957626e67e6c291e3db3b474c6082691d6c6",
"dependencies": {"libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b"},
"dependency_refs": {"libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a"},
"id": "pe4419a225f95e507",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "6a8206d4b5615c1c8bc5cbc39ac27fb4a27f5ae7",
"dependencies": {"apps": "pb91195370ac0cb93", "crypto": "pc23fbf455e97614d", "entity": "p6ab8e2a733002786", "kryon": "pbb0d432304fad5c6", "mingcute": "pe1027b9d16704793"},
"dependency_refs": {"apps": "3c0a7d9e7f941381a7c07169f94240b9fe801bb8", "crypto": "944826f70779a6b6cd53f6b06a75b36f4d8a2558", "entity": "2c56268db0b270ad53e51af9cae5dc46876a65d9", "kryon": "b5ac5d1a303326009012d68016c1d8859b6b3a13", "mingcute": "master"},
"id": "pe5f45d325747aa4d",
"name": "Shovey",
"ref": "6a8206d4b5615c1c8bc5cbc39ac27fb4a27f5ae7",
"url": "https://github.com/waozixyz/shovey.git"
},
{
"commit": "7e39f9fa43e0bde4bcc2426c79579e4f16c3749a",
"dependencies": {"curl": "p8da229d15597ab5c", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pe4419a225f95e507", "monocypher": "p002f6ed23e3a3576", "oqs": "p7098ac9cd92f7e5f", "qrcode": "p0dfa70137405b096", "zlib": "p82dbc05081cd4d96"},
"dependency_refs": {"curl": "19b299005fbe2d895f4ad525cfdae62a2220c3ea", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "7865957626e67e6c291e3db3b474c6082691d6c6", "monocypher": "master", "oqs": "master", "qrcode": "master", "zlib": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf"},
"id": "peb3fb337c2b79068",
"name": "Entity",
"ref": "master",
"url": "https://github.com/waozixyz/entity.git"
"commit": "2fa52f64eb0c29e8351b437176e896b938ece8e8",
"dependencies": {},
"id": "pef8c9ab30363ef38",
"name": "wurm_art",
"ref": "2fa52f64eb0c29e8351b437176e896b938ece8e8",
"source": true,
"url": "https://github.com/waozixyz/wurm.git"
},
{
"commit": "cee04692f3461dcb098833472f071c434980debb",
"dependencies": {"kryon": "pe4419a225f95e507"},
"dependency_refs": {"kryon": "master"},
"dependencies": {"kryon": "p1f27ccd7e2463271"},
"id": "pf2f54c7603f6e861",
"name": "Game2D",
"ref": "master",
"url": "https://github.com/kryonlabs/game2d.git"
},
{
"commit": "3515cdf3af20e79001f7774eed224e94180540ed",
"dependencies": {"crypto": "pc23fbf455e97614d", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pe42819128210d99c"},
"dependency_refs": {"crypto": "master", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "1cd873fda5d12cd4dd562956da94cee33c3e364c"},
"id": "pf7f4c26f3cf01fbe",
"name": "Apps",
"ref": "3515cdf3af20e79001f7774eed224e94180540ed",
"url": "https://github.com/waozixyz/apps.git"
"commit": "463f3bd4ea7ea8a3ace207cc21d72b3a56287c3b",
"dependencies": {"curl": "p1ca0e8d3c19dbe4c", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pc9ddbcb0ebcff235", "monocypher": "p0002f862b297522d", "oqs": "p7098ac9cd92f7e5f", "qrcode": "p0dfa70137405b096", "zlib": "p1dff88558141400b"},
"id": "pf5085d0b43200dc5",
"name": "Entity",
"ref": "463f3bd4ea7ea8a3ace207cc21d72b3a56287c3b",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68",
"dependencies": {"raylib": "p5a77c9c35110e925"},
"id": "pfa65f8437b3d3740",
"name": "kryon",
"ref": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68",
"url": "https://github.com/kryonlabs/kryon.git"
}
],
"root": {
"dependencies": {"apps": "p2b1c0e80f47c3873", "choano": "p2f197edc2542d0f6", "daochi_client": "p6af0b5bd9fd0cd31", "entity": "p6ab8e2a733002786", "game2d": "p0e63706817d43aba", "inbe": "p183b01bccc6424e7", "kryon": "pbb0d432304fad5c6", "kss": "pa3347b028712cc32", "mingcute": "pe1027b9d16704793", "shovey": "pe5f45d325747aa4d", "wurm": "pb0ffd96a1a0f002c", "wurm_art": "p02e33d091b212961"},
"dependency_refs": {"apps": "cd72a242f8cdfd3ec3fc839fc11d9e7d7fc3b8fc", "choano": "eada9baf35b45a7ebea4fb93728403dcca34cb41", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "entity": "2c56268db0b270ad53e51af9cae5dc46876a65d9", "game2d": "8b5a989dea686250078da2d209fde1cd2946fc77", "inbe": "master", "kryon": "b5ac5d1a303326009012d68016c1d8859b6b3a13", "kss": "e3536e6d056961d2ba7fa5f18af81f75c80e8f62", "mingcute": "master", "shovey": "6a8206d4b5615c1c8bc5cbc39ac27fb4a27f5ae7", "wurm": "3b7fbaf580d3c7e2a729a6f3d133737d8167f7b5", "wurm_art": "5e609079d1e91699a627b5d938d1fffa4a31ac07"},
"dependencies": {"apps": "pa53467b904293b28", "choano": "p36c2bd12ffeea1c8", "daochi_client": "p6af0b5bd9fd0cd31", "entity": "p300040f426184cc0", "game2d": "pbebe1f485bbc1a48", "inbe": "p183b01bccc6424e7", "kryon": "p2a656232910109dd", "kss": "p415d809184a859cd", "mingcute": "pe1027b9d16704793", "shovey": "p352b02504698188c", "wurm": "pe22548296a8e67a7", "wurm_art": "pef8c9ab30363ef38"},
"name": "Arcade"
},
"toolchain": {
"commit": "0e91eb43bd665f02db86eb9b9cdd875b5436a066",
"ref": "0e91eb43bd665f02db86eb9b9cdd875b5436a066",
"commit": "93af347a2a7af4a5a6a88906dbf7808189438b9b",
"ref": "93af347a2a7af4a5a6a88906dbf7808189438b9b",
"url": "https://github.com/ziranlang/ziran.git"
}
}
+10 -10
View File
@@ -7,7 +7,7 @@ bridge_modules = ["app"]
[toolchain]
git = "https://github.com/ziranlang/ziran.git"
ref = "0e91eb43bd665f02db86eb9b9cdd875b5436a066"
ref = "93af347a2a7af4a5a6a88906dbf7808189438b9b"
[install]
bin = "arcade"
@@ -29,17 +29,17 @@ abis = "arm64-v8a,x86_64"
[dependencies.kryon]
git = "https://github.com/kryonlabs/kryon.git"
ref = "b5ac5d1a303326009012d68016c1d8859b6b3a13"
ref = "f7ff3e546657a0f90de16802fc9fc4a700412481"
[dependencies.apps]
git = "https://github.com/waozixyz/apps.git"
# Use the shared controller reviewed with the supported collection host.
ref = "cd72a242f8cdfd3ec3fc839fc11d9e7d7fc3b8fc"
ref = "5157b63b703981c1e637c78c71b4c475d9699932"
# Shovey's editions and editor are available as separate downloads.
[dependencies.shovey]
git = "https://github.com/waozixyz/shovey.git"
ref = "6a8206d4b5615c1c8bc5cbc39ac27fb4a27f5ae7"
ref = "4204ef694f54aff644ac6627e74a9fb9bcc6b643"
# Compatibility tooling runs Inner Breeze's host checks; releases check its publisher pins.
[dependencies.inbe]
@@ -48,7 +48,7 @@ ref = "master"
[dependencies.entity]
git = "https://github.com/waozixyz/entity.git"
ref = "2c56268db0b270ad53e51af9cae5dc46876a65d9"
ref = "43701aaf0da1e114df7793bf9876a044b96572e1"
[dependencies.mingcute]
git = "https://github.com/kryonlabs/mingcute.git"
@@ -56,20 +56,20 @@ ref = "master"
[dependencies.wurm]
git = "https://github.com/waozixyz/wurm.git"
ref = "3b7fbaf580d3c7e2a729a6f3d133737d8167f7b5"
ref = "a9e6431c8c4d688e9395f7f68d30a6ee726528f9"
[dependencies.game2d]
git = "https://github.com/kryonlabs/game2d.git"
ref = "8b5a989dea686250078da2d209fde1cd2946fc77"
ref = "42db0b20e0fd431f254ea8a06e553accda7d2e84"
[dependencies.choano]
git = "https://github.com/waozixyz/choano.git"
ref = "eada9baf35b45a7ebea4fb93728403dcca34cb41"
ref = "6a29dfde2742a5081d477bebefcddf3a733383c5"
# Library art can advance independently of the tested game payload.
[dependencies.wurm_art]
git = "https://github.com/waozixyz/wurm.git"
ref = "5e609079d1e91699a627b5d938d1fffa4a31ac07"
ref = "2fa52f64eb0c29e8351b437176e896b938ece8e8"
source = true
[dependencies.daochi_client]
@@ -78,4 +78,4 @@ ref = "970d5e44b1702158cb16469892da6ff50f142427"
[dependencies.kss]
git = "https://github.com/kryonlabs/kss.git"
ref = "e3536e6d056961d2ba7fa5f18af81f75c80e8f62"
ref = "d208dc030fe068ff8a40ed49444536736b4b45d6"