Compare commits

..
Author SHA1 Message Date
waozi 2e98b878a6 Release Arcade catalog 0.7.118 with the latest game releases 2026-11-02 04:43:13 +00:00
waozi 3007fa8ed2 Bound each separately loaded Arcade payload and use locked game packages 2026-11-02 01:28:27 -03:00
waozi 1063591d2f Keep qualified game UI imports in the Kryon namespace 2026-11-02 00:53:23 -03:00
waozi 6f6d13cbfa Accept the explicit node permission in the browser smoke test 2026-11-01 23:55:21 -03:00
waozi d5eb9ff080 Update shared sign-in and disambiguate the KSS build dependency 2026-11-01 23:40:30 -03:00
waozi 5a386646b9 Pin Entity sign-in and Android profile fixes 2026-11-01 23:08:01 -03:00
waozi b4cb5815c6 Adopt reviewed shared profile dependencies and lossless game packaging 2026-11-01 22:47:56 -03:00
waozi 22bbe66f7d Pass the KSS package to game bundles so Choano 0.1.5 and later build 2026-11-01 21:57:17 -03:00
waozi 8bef62f896 Offer the signed-in account to other Waozi apps on Android 2026-11-01 20:46:39 -03:00
waozi 02eb8248d8 Build liboqs with ML-KEM for device links 2026-11-01 20:03:27 -03:00
waozi 9bae15b7ce Build Arcade on Ziran 972dc244 so Breeze hosts reading ZX 26 open it
Toolchain b8d0ac17 wrote and read only ZX 27, which the Breeze host on
Ziran c8c6c96c refuses ("unsupported ZX version"). 972dc244 writes ZX 26
except for add-ons composing library modules (Shovey Editor) and reads both.
The rebuilt Apps controller differs only by that header: trust cc913d86.

The Android catalog check and tests accept both versions, and the
collection UI test answers consent before waiting for the library and
expects the declared titles shown since 755e0ae.
2026-10-31 12:23:56 -03:00
waozi 2975dd3f60 Keep release version validation independent of image build tools 2026-10-31 03:51:15 -03:00
waozi d44f1eee22 Load the signed Arcade library and previews with connection consent 2026-10-31 03:50:03 -03:00
waozi c2fd3a8921 Separate Arcade catalog and native host releases 2026-10-31 01:29:55 -03:00
waozi 51d002410a Prepare locked dependencies before publishing verified Android APKs 2026-10-31 00:19:28 -03:00
waozi 84225f873f Use the build dependency mode when verifying Android assets 2026-10-31 00:06:55 -03:00
47 changed files with 1882 additions and 259 deletions

No files matched your search

+40 -17
View File
@@ -1,16 +1,14 @@
name: Android
# Arcade's own Android APKs, with the whole library for offline play, for an
# Arcade release (node-arcade-VERSION). Game updates starts this on the new
# release's tag; started by hand on master, it fills in the APKs of the
# release master is at. Three signed editions are attached: arcade-VERSION.apk
# and arcade-VERSION-fdroid.apk hold no Google library, arcade-VERSION-gplay.apk
# is the only one with Play Billing.
# Native host releases have their own VERSION and arcade-VERSION release.
# Catalog/game publication never starts this workflow. All three signed
# editions are verified before this workflow creates the native release tag.
# Existing node-arcade-VERSION releases and their APK URLs remain unchanged.
on:
workflow_dispatch:
inputs:
version:
description: Arcade release version; empty uses VERSION at the chosen ref
description: Native host release version; empty uses VERSION at the chosen ref
required: false
type: string
@@ -32,6 +30,8 @@ jobs:
shovey: ${{ steps.release.outputs.shovey }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Check version and release boundaries
run: python3 tests/catalog_versions_test.py
- name: Find the release and its locked dependencies
id: release
env:
@@ -44,13 +44,14 @@ jobs:
echo "::error::$GITHUB_REF is at Arcade $version, not $REQUESTED"
exit 1
fi
# The APKs carry exactly the release's catalog and games.
gh release view "node-arcade-$version" --json name > /dev/null
assets=$(gh release view "node-arcade-$version" --json assets --jq '.assets[].name')
due=false
for name in "arcade-$version.apk" "arcade-$version-fdroid.apk" "arcade-$version-gplay.apk"; do
printf '%s\n' "$assets" | grep -qxF "$name" || due=true
done
# A new native release needs no matching node catalog release.
due=true
if assets=$(gh release view "arcade-$version" --json assets --jq '.assets[].name'); then
due=false
for name in "arcade-$version.apk" "arcade-$version-fdroid.apk" "arcade-$version-gplay.apk"; do
printf '%s\n' "$assets" | grep -qxF "$name" || due=true
done
fi
if [ "$due" = false ]; then
echo "::notice title=Android::Arcade $version already has its APKs"
fi
@@ -169,12 +170,23 @@ jobs:
timeout-minutes: 15
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: ziranlang/ziran
ref: ${{ needs.release.outputs.toolchain }}
path: ziranlang/ziran
- name: Prepare the locked asset verifier dependencies
run: |
make -j2 -C ziranlang/ziran
echo "$GITHUB_WORKSPACE/ziranlang/ziran/build/bin" >> "$GITHUB_PATH"
printf '[overrides]\nziran = "ziranlang/ziran"\n' > ziran.local.toml
ziranlang/ziran/build/bin/ziran fetch
- uses: actions/download-artifact@v4
with:
pattern: arcade-android-*
path: build/downloads
merge-multiple: true
- name: Check and attach the APKs to the release
- name: Verify all editions and publish the native host release
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ needs.release.outputs.version }}
@@ -185,5 +197,16 @@ jobs:
python3 scripts/android-release.py verify "build/downloads/arcade-$VERSION$suffix.apk" \
--edition "$edition" --version "$VERSION"
done
gh release upload "node-arcade-$VERSION" "build/downloads/arcade-$VERSION.apk" \
"build/downloads/arcade-$VERSION-fdroid.apk" "build/downloads/arcade-$VERSION-gplay.apk" --clobber
tag="arcade-$VERSION"
if gh release view "$tag" >/dev/null 2>&1; then
# Retry only the same verified source, preserving past release URLs.
target=$(gh api "repos/$GITHUB_REPOSITORY/commits/$tag" --jq '.sha')
test "$target" = "$GITHUB_SHA"
gh release upload "$tag" "build/downloads/arcade-$VERSION.apk" \
"build/downloads/arcade-$VERSION-fdroid.apk" "build/downloads/arcade-$VERSION-gplay.apk" --clobber
else
gh release create "$tag" "build/downloads/arcade-$VERSION.apk" \
"build/downloads/arcade-$VERSION-fdroid.apk" "build/downloads/arcade-$VERSION-gplay.apk" \
--target "$GITHUB_SHA" --title "Arcade $VERSION" \
--notes 'Native Arcade for Android: normal, F-Droid and Google Play editions. Games and library updates arrive separately.'
fi
+10 -15
View File
@@ -2,8 +2,8 @@ name: Game updates
# Arcade follows its games by itself. When a game package (Shovey, Apfelwurm)
# publishes a GitHub release, this pins Arcade to that release, adds the
# game's notes to Arcade's changelog, builds and checks the collection,
# commits the new Arcade version and attaches its catalog and game archive to
# game's notes to Arcade's catalog changelog, builds and checks the collection,
# commits the new catalog version and attaches its catalog and game archive to
# the node-arcade-VERSION release. Inner Breeze's node follower then signs
# that release and publishes it to Waozi's node, where Arcade downloads games.
# A game's release workflow starts this at once; the timer is the fallback,
@@ -33,7 +33,9 @@ jobs:
with:
path: waozixyz/arcade
- name: Check release following
run: python3 tests/game_updates_test.py
run: |
python3 tests/game_updates_test.py
python3 tests/catalog_versions_test.py
- name: Find newer game releases
id: updates
env:
@@ -93,10 +95,10 @@ jobs:
if: steps.updates.outputs.changed == 'true'
run: |
python3 scripts/follow-game-releases.py changelog --ziran ../../ziranlang/ziran/build/bin/ziran
sh update_version.sh
sh update_version.sh --catalog
python3 scripts/follow-game-releases.py art
echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"
head -12 CHANGELOG.md
echo "version=$(cat catalog/VERSION)" >> "$GITHUB_OUTPUT"
head -12 catalog/CHANGELOG.md
- name: Build and check the collection
if: steps.updates.outputs.changed == 'true'
run: |
@@ -112,8 +114,8 @@ jobs:
run: |
git config user.name Waozi
git config user.email [email protected]
git add ziran.toml ziran.lock CHANGELOG.md VERSION apps/versions.json assets/arcade/library
git commit -q -m "Release Arcade $VERSION with the latest game releases"
git add ziran.toml ziran.lock catalog/CHANGELOG.md catalog/VERSION apps/versions.json assets/arcade/library
git commit -q -m "Release Arcade catalog $VERSION with the latest game releases"
git push origin HEAD:master
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Attach the checked catalog and game archive
@@ -128,13 +130,6 @@ jobs:
--target "$SHA" --title "Arcade $VERSION" \
--notes 'Arcade downloads the selected game separately and preserves earned progress.'
echo "Arcade $VERSION is ready for the node: sha256 $(sha256sum build/node-apps/arcade.zx | cut -d' ' -f1)"
# Arcade's own APKs build from the release's tag and join its release.
- name: Start the Android build
if: steps.updates.outputs.changed == 'true'
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.release.outputs.version }}
run: gh workflow run android.yml -R "$GITHUB_REPOSITORY" --ref "node-arcade-$VERSION" -f version="$VERSION"
# Breeze's node follower signs this release and publishes it to the
# node now, not at its next timer. RELEASE_FOLLOW_TOKEN may only start
# workflows in Arcade and Breeze; the follower takes no input and
+3 -3
View File
@@ -27,6 +27,8 @@ jobs:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
path: waozixyz/arcade
- name: Check version and release boundaries
run: python3 tests/catalog_versions_test.py
- name: Read the fixed dependency revisions
id: dependencies
env:
@@ -93,7 +95,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
set -eu
version=$(cat VERSION)
version=$(cat catalog/VERSION)
tag="node-arcade-$version"
if gh release view "$tag" >/dev/null 2>&1; then
mkdir -p build/prior-node-release
@@ -105,6 +107,4 @@ jobs:
gh release create "$tag" build/node-apps/arcade.zx build/node-apps/arcade.games.tar build/games/wurm.zx \
--target "$GITHUB_SHA" --title "Arcade $version" \
--notes 'Arcade downloads the selected game separately and preserves earned progress.'
# Arcade's own APKs build from the release's tag and join its release.
gh workflow run android.yml -R "$GITHUB_REPOSITORY" --ref "$tag" -f version="$version"
fi
+1 -3
View File
@@ -71,8 +71,6 @@ jobs:
# Its game archive holds the library art the site serves itself.
gh release download "$tag" --repo waozixyz/arcade --pattern arcade.zx \
--pattern arcade.games.tar --dir build/published
# The Apps library that release packs, by the digest its own commit trusts.
git show "$tag:apps-controller.sha256" > build/published/apps-controller.sha256
echo "version=${tag#node-arcade-}" >> "$GITHUB_OUTPUT"
- name: Build the browser edition
run: |
@@ -80,7 +78,7 @@ jobs:
python3 scripts/build-entity.py
python3 scripts/build-apps.py --output build/apps-ui
python3 scripts/build-web.py --bundle build/published/arcade.zx \
--controller-sha256 "$(cat build/published/apps-controller.sha256)" \
--controller-sha256 "$(cat apps-controller.sha256)" \
--version '${{ steps.published.outputs.version }}'
rm -f build/web-site/runtime.html
- name: Wait for the published games the browser will download
+13
View File
@@ -1,5 +1,18 @@
# Arcade changelog
## [Unreleased]
- 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
- Ask before connecting to the node for Arcade's signed app library and compressed previews, with an offline choice and a connection control.
- Refresh library membership and game versions independently of the APK, keeping downloaded apps and saved progress available offline.
- Recover library thumbnails after failed requests and keep the native host release version separate from catalog releases.
## 0.7.116
- Android Arcade downloads games and library thumbnails on demand instead of bundling the entire game library; installed games remain playable offline with saved progress.
+3
View File
@@ -54,6 +54,9 @@ run: all
./build/arcade
test: all
python3 tests/game_module_paths_test.py
python3 tests/game_resource_packing_test.py
python3 tests/game_translation_keys_test.py
python3 tests/android_catalog_test.py
python3 tests/android_jni_contract_test.py
python3 tests/game_updates_test.py
+21 -8
View File
@@ -15,7 +15,7 @@ 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 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 34. 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.
@@ -46,17 +46,19 @@ review are not implemented.
## Shared Apps library
Arcade embeds the shared `apps.zx` controller and artwork in a verified
catalog. The catalog fixes the digest of every separately downloaded game. Each game package lists its apps in its own `apps.json`:
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. 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, logo, caption and action. `games.json`
names the game packages, and Arcade's own `apps.json` its own apps. Arcade
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. The local player does not offer node updates or OS
actions it
cannot perform. Inbe supplies its own account and package policy.
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).
An optional `artwork` mapping in `games.json` names a locked source-only
@@ -153,8 +155,19 @@ The release key is `backup/android-signing/arcade-release.p12` (ignored) and
the GitHub secrets `ARCADE_ANDROID_KEYSTORE` and
`ARCADE_ANDROID_KEYSTORE_PASSWORD`; `packaging/android/certificate.pem` is its
public certificate. The Android workflow attaches `arcade-VERSION.apk`,
`arcade-VERSION-fdroid.apk` and `arcade-VERSION-gplay.apk` to each
`node-arcade-VERSION` release; Game updates starts it for every new release.
`arcade-VERSION-fdroid.apk` and `arcade-VERSION-gplay.apk` to a native
`arcade-VERSION` release after verifying all three editions. Existing APKs
on older `node-arcade-VERSION` releases keep their original URLs.
The native host uses root `CHANGELOG.md` and `VERSION`; synchronize a native
release with `sh update_version.sh`. The signed game catalog uses
`catalog/CHANGELOG.md` and `catalog/VERSION`; synchronize its release with
`sh update_version.sh --catalog`. Both use numeric changelog entries and keep
each game's own version ledger. Catalog publication keeps the existing
`node-arcade-VERSION` tags and never starts Android builds. Game updates
advance the catalog only, leaving pending native changes for the next host
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`. `scripts/build-games.py` generates the catalog and bundles
+1 -1
View File
@@ -1 +1 @@
0.7.116
0.7.117
+1 -1
View File
@@ -1 +1 @@
600060d7a040bf558e110ccf991ebfc9eb2810042f503a111c7d7f20c20f1b17
4bed077eacf6879f44fd581d59cfff20b15a813cfbe6c4eecd16535693b99329
+8 -8
View File
@@ -13,8 +13,8 @@
"choano": {
"id": "xyz.waozi.choano",
"title": "Choano",
"version": "0.1.3",
"sequence": 2,
"version": "0.1.8",
"sequence": 3,
"host_api": 41
},
"shovey": {
@@ -34,22 +34,22 @@
"arcade": {
"id": "inbe.arcade",
"title": "Arcade",
"version": "0.7.116",
"sequence": 195,
"version": "0.7.118",
"sequence": 197,
"host_api": 41
},
"wurm": {
"id": "xyz.waozi.wurm",
"title": "Apfelwurm",
"version": "0.2.27",
"sequence": 22,
"version": "0.2.28",
"sequence": 23,
"host_api": 41
},
"wurm-editor": {
"id": "xyz.waozi.wurm-editor",
"title": "Apfelwurm Editor",
"version": "0.1.0",
"sequence": 1,
"version": "0.1.1",
"sequence": 2,
"host_api": 41
}
}
+21
View File
@@ -0,0 +1,21 @@
# Arcade catalog changelog
## 0.7.118
- Apfelwurm 0.2.28: The editor title painting includes the Apfelwurm Editor logo in portrait and landscape.
- Choano 0.1.8: Keep the Fish HUD clear of the misleading Avoid indicator and introduce the sea with a little fish guide and speech bubbles.
- Choano 0.1.8: Wear a better-fitted ribbon or crown, with three optional Dew decorations: a pearl, a flower, and a wizard hat.
- Choano 0.1.8: Choose decorations by tapping their Shop cards, with clear locks and Dew purchase confirmation.
- Choano 0.1.8: Sign in through the shared Profile in native editions and restore Dew decorations with the same account.
- Choano 0.1.8: Meet a slimmer shark whose fins flash red on contact.
- Choano 0.1.8: Keep Shop and Settings navigation separate and preserve each icon’s original colors.
- Choano 0.1.8: Fit Profile and Downloads beside the title icons on narrow screens.
## 0.7.117
- Game and library updates arrive separately from native Arcade app updates.
- Publish the verified game modules and compressed previews with the aligned shared host dependencies.
## 0.7.116
- Continue the existing signed Arcade catalog and game library release history.
+1
View File
@@ -0,0 +1 @@
0.7.118
+3
View File
@@ -103,3 +103,6 @@ tasks.register('prepareEntity', Exec) {
commandLine 'python3', 'scripts/build-entity.py'
}
tasks.named('preBuild').configure { dependsOn 'prepareEntity' }
// "Continue as @name" between waozi apps, in every edition.
apply from: new File(kryonDir, 'templates/android-account-handoff.gradle')
+1 -1
View File
@@ -95,7 +95,7 @@ if(NOT MONOCYPHER_DIR)
endif()
set(OQS_BUILD_ONLY_LIB ON CACHE BOOL "" FORCE)
set(OQS_USE_OPENSSL OFF CACHE BOOL "" FORCE)
set(OQS_MINIMAL_BUILD "SIG_ml_dsa_44" CACHE STRING "" FORCE)
set(OQS_MINIMAL_BUILD "SIG_ml_dsa_44;KEM_ml_kem_768" CACHE STRING "" FORCE)
set(OQS_DIST_BUILD OFF CACHE BOOL "" FORCE)
set(OQS_OPT_TARGET generic CACHE STRING "" FORCE)
foreach(feature ADX AES AVX AVX2 AVX512 AVX512BW AVX512DQ AVX512F BMI1 BMI2 FMA PCLMULQDQ POPCNT SSE SSE2 SSE3 VPCLMULQDQ)
+1
View File
@@ -0,0 +1 @@
196
+6
View File
@@ -0,0 +1,6 @@
{
"origin": "https://api.waozi.xyz",
"app_id": "inbe.arcade",
"key_id": "inbe-2026-10",
"public_key": "d9a549043c0ac91a5197d85053a815c831d342a1082143c2bd1ffd43e1e6f145"
}
+5 -2
View File
@@ -73,7 +73,10 @@ def verify(apk, version, tools, edition='direct'):
verify_launcher(apk, tools, names)
metadata = json.loads(archive.read('assets/arcade.json'))
payload = archive.read('assets/arcade.zx')
assert metadata['id'] == 'inbe.arcade' and metadata['version'] == version
assert metadata['id'] == 'inbe.arcade', 'Embedded catalog identity differs'
catalog_version = (ROOT / 'catalog/VERSION').read_text().strip()
assert re.fullmatch(r'\d+\.\d+\.\d+', catalog_version), 'A numeric catalog version is required'
assert metadata['version'] == catalog_version, 'Embedded catalog version differs from its source'
assert metadata['sha256'] == hashlib.sha256(payload).hexdigest(), 'Embedded collection differs from its receipt'
from android_catalog import verify_assets
verify_assets({name.removeprefix('assets/'): archive.read(name)
@@ -85,7 +88,7 @@ def verify(apk, version, tools, edition='direct'):
apk_digest = hashlib.file_digest(source, 'sha256').hexdigest()
return dict(version=version, version_code=int(package[2]), package=package[1], abis=abis, edition=edition,
sha256=apk_digest, certificate_sha256=expected,
payload_sha256=metadata['sha256'], games=[child['id'] for child in metadata['children']],
catalog_version=metadata['version'], payload_sha256=metadata['sha256'], games=[child['id'] for child in metadata['children']],
bytes=apk.stat().st_size)
+6 -2
View File
@@ -6,6 +6,7 @@ import struct
import subprocess
from functools import lru_cache
from pathlib import Path
from node_config import node_source
ROOT = Path(__file__).resolve().parents[1]
ESSENTIALS = {'arcade.zx', 'arcade.json', 'apps.zx', 'entity.zx', 'kryon-font.ttf'}
@@ -13,8 +14,9 @@ ESSENTIALS = {'arcade.zx', 'arcade.json', 'apps.zx', 'entity.zx', 'kryon-font.tt
@lru_cache(maxsize=1)
def profile_asset_hashes():
flags = [] if (ROOT / 'ziran.local.toml').is_file() else ['--locked']
package = Path(subprocess.check_output(
[str(ROOT / 'scripts/ziran.sh'), 'pkg', 'path', 'entity', '--locked'],
[str(ROOT / 'scripts/ziran.sh'), 'pkg', 'path', 'entity', *flags],
cwd=ROOT, text=True).strip())
paths = json.loads((package / 'asset-groups.json').read_text())['profile']
result = {}
@@ -43,7 +45,8 @@ def bundle_assets(payload, limit):
return struct.unpack('<I', take(4))[0]
def text():
return take(number())
assert take(8) == b'ZX\0\0\x1b\0\0\0', 'Unsupported catalog bundle'
# ZX 26 and 27 share this layout; 27 only marks composed library modules.
assert take(8) in (b'ZX\0\0\x1a\0\0\0', b'ZX\0\0\x1b\0\0\0'), 'Unsupported catalog bundle'
text(); text()
for _ in range(number()):
text(); text()
@@ -77,6 +80,7 @@ def verify_assets(assets, essentials=True, edition='direct'):
assert set(assets) == expected, 'Unexpected or missing Android asset: ' + str(set(assets) ^ expected)
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'
assert hashlib.sha256(assets['arcade.zx']).hexdigest() == metadata['sha256']
trusted = (ROOT / 'apps-controller.sha256').read_text().strip()
assert hashlib.sha256(assets['apps.zx']).hexdigest() == metadata['apps_sha256'] == trusted
+11 -3
View File
@@ -5,13 +5,20 @@ import argparse
import hashlib
import json
import os
import re
from pathlib import Path
import shutil
import subprocess
from PIL import Image
ROOT = Path(__file__).resolve().parents[1]
def native_release():
version = (ROOT / 'VERSION').read_text().strip()
code = int((ROOT / 'packaging/android/version-code').read_text().strip())
if not re.fullmatch(r'(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)', version) or not 0 < code <= 2100000000:
raise ValueError('Invalid native Android version or versionCode')
return dict(version=version, sequence=code)
def package(name):
return Path(subprocess.check_output([str(ROOT / 'scripts/ziran.sh'), 'pkg', 'path', name], cwd=ROOT, text=True).strip())
@@ -23,6 +30,7 @@ def ziran_bundle(*arguments):
def launcher_icon(source, resources):
"""Density variants are mechanical packaging of the original logo."""
from PIL import Image
icon = Image.open(source).convert('RGBA')
if resources.exists():
shutil.rmtree(resources)
@@ -36,7 +44,7 @@ def stage_arcade():
collection = ROOT / 'build/collection'
receipt = json.loads((collection / 'receipt.json').read_text())
release = json.loads((ROOT / 'apps/versions.json').read_text())['node_apps']['arcade']
if receipt['version'] != release['version'] or receipt['version'] != (ROOT / 'VERSION').read_text().strip():
if receipt['version'] != release['version'] or receipt['version'] != (ROOT / 'catalog/VERSION').read_text().strip():
raise ValueError('The Arcade version changed; rebuild the collection first')
controller = (collection / 'assets/apps/apps.zx').read_bytes()
if hashlib.sha256(controller).hexdigest() != receipt['apps_sha256']:
@@ -58,7 +66,7 @@ def stage_arcade():
launcher_icon(ROOT / 'site/android-launcher-512.png', ROOT / 'build/android-res')
# Only Arcade gets this adaptive icon; standalone Shovey keeps its art.
shutil.copytree(ROOT / 'packaging/android/icon-res', ROOT / 'build/android-res', dirs_exist_ok=True)
return release
return native_release()
def stage_shovey():
"""Shovey's standalone collection from Arcade's staging. Returns its release."""
+85 -24
View File
@@ -10,17 +10,64 @@ import re
import shutil
import subprocess
import tarfile
import tempfile
from game_packages import declared_packages
from node_config import node_source
ROOT = Path(__file__).resolve().parents[1]
MAX_PAYLOAD_BYTES = 64 * 1024 * 1024
MAX_GAMES = 16
def payload_limit(size, label):
if size > MAX_PAYLOAD_BYTES:
raise ValueError(f"{label} exceeds the host's payload limit")
def catalog_bytes(catalog):
return (json.dumps(catalog, indent=2) + "\n").encode()
def child_paths(child):
return [child["bundle"], child["preview"], *(
value for key, value in child.get("cover", {}).items()
if key in ("portrait", "landscape", "logo"))]
def package_catalog(package, children):
return dict(schema=1, id=package["id"], title=package["title"],
harness="assets/apps/apps.zx", children=children)
def bundle(command, root, source, entry, assets, target, env):
"""Check the complete ZX (including code/index overhead) before promotion."""
work = root / "work"
subprocess.run(["git", "check-ignore", "-q", "work/"], cwd=root, check=True)
work.mkdir(exist_ok=True)
with tempfile.TemporaryDirectory(prefix="collection-bundle-", dir=work) as directory:
candidate = Path(directory) / target.name
subprocess.run([*command, "--root", str(root / "src"), "--entry", entry,
"--asset-dir", "assets=" + str(assets), "-o", str(candidate),
str(root / "src" / source)], cwd=root, env=env, check=True)
payload_limit(candidate.stat().st_size, target.name)
target.parent.mkdir(parents=True, exist_ok=True)
candidate.replace(target)
def digest(path):
return hashlib.sha256(path.read_bytes()).hexdigest()
def catalog_version(root):
"""The node receipt must name the synchronized catalog release."""
version = (root / "catalog/VERSION").read_text().strip()
component = json.loads((root / "apps/versions.json").read_text())["node_apps"]["arcade"]
if (not re.fullmatch(r"\d+\.\d+\.\d+", version)
or component["id"] != "inbe.arcade" or component["version"] != version):
raise ValueError("Catalog version differs from its signed release ledger; run update_version.sh --catalog")
return version
def library_art(root, name, key, source):
"""Arcade's committed library thumbnail (scripts/library-art.py), as
(bytes, suffix): a PNG, or a JPEG for opaque cover art. Never pack a copy
@@ -41,18 +88,20 @@ def stage(root, controller, expected_controller_digest, output):
catalog and each game package with the IDs of its packed apps."""
if not re.fullmatch(r"[0-9a-f]{64}", expected_controller_digest):
raise ValueError("An exact trusted Apps controller SHA-256 is required")
payload_limit(controller.stat().st_size, "Apps controller")
controller_bytes = controller.read_bytes()
controller_digest = hashlib.sha256(controller_bytes).hexdigest()
if controller_digest != expected_controller_digest:
raise ValueError(f"Apps controller differs from the trusted SHA-256: {controller_digest} != {expected_controller_digest}")
packages = declared_packages(root)
payload_limit(len(controller_bytes), "Apps controller")
lock_flags = () if (root / "ziran.local.toml").is_file() else ("--locked",)
packages = declared_packages(root, lock_flags=lock_flags)
arcade = packages[0]
if not 1 <= sum(len(package["apps"]) for package in packages) <= MAX_GAMES:
raise ValueError("Arcade needs 1 to 16 games")
ledger = json.loads((root / "apps/versions.json").read_text())["node_apps"]
children, copies, identities = [], [], set()
collection_ids = {package["id"] for package in packages}
total = len(controller_bytes)
for package in packages:
package["children"] = []
for app in package["apps"]:
@@ -77,12 +126,13 @@ def stage(root, controller, expected_controller_digest, output):
preview = root / "build/games" / (name + "-preview.png")
# The game build embeds this exact legacy descriptor. Its verified
# name binds node/2's legacy handshake to the stable signed app ID.
payload_limit(bundle.stat().st_size, f"Game {name}")
bundle_bytes, preview_bytes = bundle.read_bytes(), preview.read_bytes()
if not bundle_bytes or not preview_bytes:
raise ValueError("Game bundles and previews must be built first")
payload_limit(len(bundle_bytes), f"Game {name}")
preview_bytes, preview_suffix = library_art(root, name, "preview",
(app["art_source"] / game["preview"]).read_bytes())
total += len(bundle_bytes) + len(preview_bytes)
child = dict(
id=identifier, title=game["title"],
bundle=f"assets/arcade/games/{name}.zx", protocol="node/2",
@@ -117,16 +167,31 @@ def stage(root, controller, expected_controller_digest, output):
destination = Path("arcade/covers") / f"{name}-{key}{suffix}"
packed_cover[key] = "assets/" + destination.as_posix()
copies.append((contents, destination))
total += len(contents)
child["cover"] = packed_cover
children.append(child)
package["children"].append(identifier)
copies += [(bundle_bytes, Path("arcade/games") / (name + ".zx")),
(preview_bytes, Path("arcade/previews") / (name + preview_suffix))]
if total > MAX_PAYLOAD_BYTES:
raise ValueError("Arcade collection exceeds the host's payload limit")
catalog = dict(schema=1, id=arcade["id"], title=arcade["title"],
harness="assets/apps/apps.zx", presentation={"mode": "covers"}, children=children)
sidebar = (root / "assets/arcade/sidebar.shape").read_bytes()
# The stage is a source for several independently loaded roots, not one
# root containing the whole library. Bound their input bytes separately;
# bundle() also checks the final compiled sizes, including ZX overhead.
payloads = {"assets/" + path.as_posix(): data for data, path in copies}
art_paths = {path for child in children for path in child_paths(child)[1:]}
payload_limit(sum(len(payloads[path]) for path in art_paths), "Library art")
payload_limit(len(catalog_bytes(catalog)) + len(sidebar), "Arcade catalog")
for package in packages[1:]:
if not (root / "src" / f"{package['name']}_collection.zi").is_file():
continue
leaves = [child for child in children if child["id"] in package["children"]]
if not leaves:
raise ValueError(f"{package['name']} declares no enabled apps")
paths = {path for child in leaves for path in child_paths(child)}
size = (len(controller_bytes) + len(catalog_bytes(package_catalog(package, leaves)))
+ sum(len(payloads[path]) for path in paths))
payload_limit(size, f"Standalone {package['name']}")
# This stable directory contains disposable build output only. Clear it
# after all inputs validate so removed registrations cannot linger.
if output.exists():
@@ -134,14 +199,14 @@ def stage(root, controller, expected_controller_digest, output):
assets = output / "assets"
(assets / "apps").mkdir(parents=True)
(assets / "apps/apps.zx").write_bytes(controller_bytes)
(assets / "apps/catalog.json").write_text(json.dumps(catalog, indent=2) + "\n")
(assets / "apps/catalog.json").write_bytes(catalog_bytes(catalog))
for contents, relative in copies:
destination = assets / relative
destination.parent.mkdir(parents=True, exist_ok=True)
destination.write_bytes(contents)
# Inbe draws Arcade's launcher icon from assets/arcade/sidebar.shape.
(assets / "arcade").mkdir(exist_ok=True)
(assets / "arcade/sidebar.shape").write_bytes((root / "assets/arcade/sidebar.shape").read_bytes())
(assets / "arcade/sidebar.shape").write_bytes(sidebar)
return catalog, packages[1:]
@@ -159,6 +224,7 @@ def stage_downloads(catalog, source, output, games, art):
data = (source / child["bundle"]).read_bytes()
if hashlib.sha256(data).hexdigest() != child["sha256"]:
raise ValueError("Game differs from the collection's declared digest")
payload_limit(len(data), f"Game {child['id']}")
payloads[child["sha256"]] = data
for directory in (output, games, art):
if directory.exists():
@@ -183,6 +249,7 @@ def stage_downloads(catalog, source, output, games, art):
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")
digest = hashlib.sha256(data).hexdigest()
(games / (digest + ".zx")).write_bytes(data)
path = output / "assets/apps/catalog.json"
@@ -210,14 +277,11 @@ def main():
parser.add_argument("--apps-bundle", type=Path, required=True)
parser.add_argument("--apps-sha256", required=True)
args = parser.parse_args()
version = catalog_version(ROOT)
output = ROOT / "build/collection"
catalog, packages = stage(ROOT, args.apps_bundle, args.apps_sha256, output)
command = [args.ziran, "bundle", "--project", *(["--locked"] if args.locked else [])]
env = os.environ.copy()
def bundle(source, entry, assets, target):
subprocess.run([*command, "--root", str(ROOT / "src"), "--entry", entry,
"--asset-dir", "assets=" + str(assets), "-o", str(target),
str(ROOT / "src" / source)], cwd=ROOT, env=env, check=True)
# A game package with a standalone player (src/NAME_collection.zi) also
# gets its own collection of exactly the leaves Arcade packs, with their
@@ -235,18 +299,15 @@ def main():
assets = standalone / "assets"
(assets / "apps").mkdir(parents=True)
shutil.copyfile(output / "assets/apps/apps.zx", assets / "apps/apps.zx")
standalone_catalog = dict(schema=1, id=package["id"], title=package["title"],
harness="assets/apps/apps.zx", children=children)
(assets / "apps/catalog.json").write_text(json.dumps(standalone_catalog, indent=2) + "\n")
standalone_catalog = package_catalog(package, children)
(assets / "apps/catalog.json").write_bytes(catalog_bytes(standalone_catalog))
for child in children:
resources = [child[field] for field in ("bundle", "preview")]
resources += [value for field, value in child.get("cover", {}).items()
if field in ("portrait", "landscape", "logo")]
for relative in resources:
for relative in child_paths(child):
destination = standalone / relative
destination.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(output / relative, destination)
bundle(f"{name}_collection.zi", f"{name}_collection:Main", assets, ROOT / f"build/{name}.zx")
bundle(command, ROOT, f"{name}_collection.zi", f"{name}_collection:Main",
assets, ROOT / f"build/{name}.zx", env)
metadata = dict(id=package["id"], version=children[0]["version"],
sha256=digest(ROOT / f"build/{name}.zx"), apps_sha256=args.apps_sha256,
children=children, source_mode="project")
@@ -259,17 +320,17 @@ def main():
game_downloads = node_apps / "arcade.games"
art_assets = node_apps / "arcade-art"
stage_downloads(catalog, output, catalog_assets, game_downloads, art_assets)
bundle("art.zi", "art:Main", art_assets / "assets", node_apps / "arcade-art.zx")
bundle(command, ROOT, "art.zi", "art:Main", art_assets / "assets", node_apps / "arcade-art.zx", env)
art = add_art(catalog_assets, game_downloads, node_apps / "arcade-art.zx")
archive_downloads(game_downloads, node_apps / "arcade.games.tar")
bundle("collection.zi", "collection:Main", catalog_assets / "assets", node_apps / "arcade.zx")
bundle(command, ROOT, "collection.zi", "collection:Main", catalog_assets / "assets", node_apps / "arcade.zx", env)
shutil.copyfile(node_apps / "arcade.zx", ROOT / "build/arcade.zx")
# The desktop host supplies its controller from beside the collection.
shutil.copyfile(args.apps_bundle, ROOT / "build/apps.zx")
receipt = dict(id=catalog["id"], version=(ROOT / "VERSION").read_text().strip(),
receipt = dict(id=catalog["id"], version=version,
sha256=digest(ROOT / "build/arcade.zx"),
apps_sha256=args.apps_sha256, children=catalog["children"], art=art,
source_mode="project")
source_mode="project", node=node_source(ROOT))
(output / "receipt.json").write_text(json.dumps(receipt, indent=2) + "\n")
(ROOT / "build/arcade.json").write_text(json.dumps(receipt, indent=2) + "\n")
node_receipt = receipt | {"sha256": digest(node_apps / "arcade.zx")}
+1 -1
View File
@@ -54,7 +54,7 @@ def main():
subprocess.run(['cmake', '-S', str(oqs_source), '-B', str(oqs),
'-DCMAKE_BUILD_TYPE=MinSizeRel', '-DBUILD_SHARED_LIBS=OFF',
'-DOQS_BUILD_ONLY_LIB=ON', '-DOQS_USE_OPENSSL=OFF', '-DOQS_DIST_BUILD=OFF',
'-DOQS_OPT_TARGET=generic', '-DOQS_MINIMAL_BUILD=SIG_ml_dsa_44'], check=True)
'-DOQS_OPT_TARGET=generic', '-DOQS_MINIMAL_BUILD=SIG_ml_dsa_44;KEM_ml_kem_768'], check=True)
subprocess.run(['cmake', '--build', str(oqs), '--target', 'oqs', '-j2'], check=True)
temporary = output.with_suffix('.new')
output.parent.mkdir(parents=True, exist_ok=True)
+8 -5
View File
@@ -7,7 +7,8 @@ import shutil
import subprocess
from pathlib import Path
from game_packages import declared_apps
from game_resources import dependency_order, share_resources
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]
@@ -44,8 +45,10 @@ def build(ziran, lock_flags):
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("DaochiClient")
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}
@@ -110,6 +113,7 @@ def build(ziran, lock_flags):
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)
@@ -138,9 +142,7 @@ def build(ziran, lock_flags):
# 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),
"--module-path", str(kryon / "src/ui"),
"--module-path", "kryon=" + str(kryon / "src/ui"),
"--module-path", "kryon=" + str(kryon / "src/backend"),
*kryon_module_paths(source, descriptor, kryon),
"--module-path", "game2d=" + str(game2d / "src"),
"--module-path", "std=" + str(toolchain / "std"),
"--module-path", str(toolchain / "std"),
@@ -149,6 +151,7 @@ def build(ziran, lock_flags):
"--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']
+2 -1
View File
@@ -218,10 +218,11 @@ def main():
args.controller_sha256 = receipt['apps_sha256']
args.version = receipt['version']
else:
from node_config import node_source
bundle = args.bundle.resolve()
receipt = dict(id='inbe.arcade', version=args.version,
sha256=hashlib.sha256(bundle.read_bytes()).hexdigest(),
apps_sha256=args.controller_sha256)
apps_sha256=args.controller_sha256, node=node_source(ROOT))
# The host reads the receipt into a 4 KiB buffer.
text = json.dumps(receipt, separators=(',', ':')) if args.shovey else json.dumps(receipt, indent=2) + '\n'
if len(text.encode()) >= 4096:
+1 -1
View File
@@ -119,7 +119,7 @@ def main():
oqs = BUILD / 'oqs/lib/liboqs.a'
if not built(oqs, oqs_source):
cmake(oqs_source, BUILD / 'oqs', tools, '-DCMAKE_BUILD_TYPE=MinSizeRel', '-DOQS_BUILD_ONLY_LIB=ON',
'-DOQS_USE_OPENSSL=OFF', '-DOQS_DIST_BUILD=OFF', '-DOQS_OPT_TARGET=generic', '-DOQS_MINIMAL_BUILD=SIG_ml_dsa_44')
'-DOQS_USE_OPENSSL=OFF', '-DOQS_DIST_BUILD=OFF', '-DOQS_OPT_TARGET=generic', '-DOQS_MINIMAL_BUILD=SIG_ml_dsa_44;KEM_ml_kem_768')
subprocess.run(['cmake', '--build', str(BUILD / 'oqs'), '--target', 'oqs', '-j4'], check=True)
record(oqs, oqs_source)
+10 -3
View File
@@ -9,6 +9,15 @@ from game_packages import declared_apps
ROOT = Path(__file__).resolve().parents[1]
def translation_keys(code, prefix):
# Package imports and integer fields read from server JSON are not labels.
# Strip only those argument occurrences: the same key used by the UI must
# still have a translation.
code = re.sub(r'^\s*#import\s+"[^"\n]*"', '', code, flags=re.M)
code = re.sub(r'\bShopInteger\s*\(\s*[^,\n]+,\s*"[^"\n]*"', '', code)
return set(re.findall(r'"(' + re.escape(prefix) + r'[a-z0-9_]+)"', code))
def check(ziran, lock_flags):
standard = json.loads((ROOT / 'standards/game-v1.json').read_text())
ledger = json.loads((ROOT / 'apps/versions.json').read_text())
@@ -33,9 +42,7 @@ def check(ziran, lock_flags):
assert component['sequence'] > 0
required = set()
for file in manifest.parent.glob('*.zi'):
# Module names in #import lines share the prefix but are not text keys.
code = re.sub(r'^\s*#import\s+"[^"\n]*"', '', file.read_text(), flags=re.M)
required.update(re.findall(r'"(' + re.escape(game['locale_prefix']) + r'[a-z0-9_]+)"', code))
required.update(translation_keys(file.read_text(), game['locale_prefix']))
locales = {}
for file in (source / game['locales']).glob('*.txt'):
text = file.read_text()
+5 -5
View File
@@ -7,7 +7,7 @@ game and its transitive dependencies. New game imports must reach the lock;
unrelated packages and the compiler stay pinned. The updates are recorded in
build/game-updates.json.
`changelog` adds an Arcade release entry naming each updated game with the
`changelog` adds an Arcade catalog release entry naming each updated game with the
notes of its newest release, for update_version.sh to synchronize.
`art` remakes the library's small copies of game art (scripts/library-art.py)
@@ -127,12 +127,12 @@ def changelog(ziran):
version, notes = newest_notes(manifest.with_name('CHANGELOG.md'))
title = declaration['title']
lines += [f'- {title} {version}: {note}' for note in notes] or [f'- {title} {version}.']
path = ROOT / 'CHANGELOG.md'
path = ROOT / 'catalog/CHANGELOG.md'
text = path.read_text()
current = re.search(r'^## (\d+)\.(\d+)\.(\d+)\s*$', text, re.M)
if current is None:
raise SystemExit('CHANGELOG.md needs a numeric release entry')
# Arcade's own changes wait under Unreleased; this release ships them.
raise SystemExit('catalog/CHANGELOG.md needs a numeric release entry')
# Pending catalog changes ship with the next catalog release.
pending = re.search(r'^## \[Unreleased\]\s*$', text[:current.start()], re.M)
if pending is not None:
lines = [line for line in text[pending.end():current.start()].splitlines() if line.startswith('- ')] + lines
@@ -141,7 +141,7 @@ def changelog(ziran):
version = f'{current[1]}.{current[2]}.{int(current[3]) + 1}'
entry = f'## {version}\n\n' + '\n'.join(lines) + '\n\n'
path.write_text(text[:current.start()] + entry + text[current.start():])
print(f'Arcade {version}')
print(f'Arcade catalog {version}')
def art():
+41
View File
@@ -0,0 +1,41 @@
"""Select Kryon namespaces from a game's own source imports."""
import re
from pathlib import Path
_TOKENS = re.compile(r'//[^\n]*|/\*.*?\*/|"(?:\\.|[^"\\])*"|#import\b|\S', re.DOTALL)
def _imports(text):
previous = None
for match in _TOKENS.finditer(text):
token = match.group()
if token.startswith(('//', '/*')):
continue
if previous == '#import' and token.startswith('"'):
yield token[1:-1]
previous = token
def _module_names(root):
return ({path.stem for path in root.glob('*.zi')} |
{path.parent.name for path in root.glob('*/module.zi')})
def kryon_module_paths(source: Path, descriptor: dict, kryon: Path) -> list[str]:
"""Keep qualified UI imports scoped unless game code needs short imports.
Registering the UI directory both plain and named makes Ziran load Kryon
into the application's flat namespace. Only direct imports of UI modules
the application does not own justify that legacy mode.
"""
ui = kryon / 'src/ui'
roots = {source / 'src' if (source / 'src').is_dir() else source,
(source / descriptor['source']).parent}
owned = set().union(*(_module_names(root) for root in roots))
shared = _module_names(ui) - owned
needs_plain = any(name in shared for root in roots for path in root.rglob('*.zi')
for name in _imports(path.read_text()))
paths = [str(ui)] if needs_plain else []
paths += ['kryon=' + str(ui), 'kryon=' + str(kryon / 'src/backend')]
return [flag for path in paths for flag in ('--module-path', path)]
+33
View File
@@ -1,5 +1,8 @@
"""Pack additions once; signed collection links bind shared game resources."""
import hashlib
import io
import json
from PIL import Image
from pathlib import Path
import shutil
@@ -83,3 +86,33 @@ def share_resources(app, apps, resources, staged):
if len(links) > 16:
raise ValueError('Too many shared resource links')
return dict(dependencies=requirements, resources=links)
def pack_opaque_pngs(resources):
"""Drop redundant alpha bytes without changing any decoded pixel.
Prepared copies receive the same encoding before dependency comparison.
Metadata-bearing images stay untouched so their color interpretation is
preserved; transparent images keep their alpha channel.
"""
changed = set()
for path in resources.rglob('*.png'):
with Image.open(path) as image:
if image.mode != 'RGBA' or image.info or image.getextrema()[3] != (255, 255):
continue
packed = io.BytesIO()
image.convert('RGB').save(packed, format='PNG', optimize=True)
if packed.tell() < path.stat().st_size:
path.write_bytes(packed.getbuffer())
changed.add(path)
# Art inventories describe the staged bytes, including lossless encoding.
for manifest in resources.rglob('art.json'):
inventory = json.loads(manifest.read_text())
updated = False
for item in inventory.get('files', []):
asset = manifest.parent / item['path']
if asset in changed and 'sha256' in item:
item['sha256'] = hashlib.sha256(asset.read_bytes()).hexdigest()
updated = True
if updated:
manifest.write_text(json.dumps(inventory, indent=2) + '\n')
+17
View File
@@ -0,0 +1,17 @@
"""The native host's reviewed public node publisher binding."""
import json
import re
def node_source(root):
source = json.loads((root / 'packaging/node.json').read_text())
if (set(source) != {'origin', 'app_id', 'key_id', 'public_key'}
or source['origin'] != 'https://api.waozi.xyz'
or source['app_id'] != 'inbe.arcade'
or not re.fullmatch(r'[a-z0-9][a-z0-9.-]{0,62}', source['key_id'])
or not re.fullmatch(r'[a-f0-9]{64}', source['public_key'])):
raise ValueError('Invalid reviewed node publisher binding')
sequence = json.loads((root / 'apps/versions.json').read_text())['node_apps']['arcade']['sequence']
if type(sequence) is not int or not 1 <= sequence <= 2147483647:
raise ValueError('Invalid catalog release floor')
return source | {'minimum_sequence': sequence}
+2
View File
@@ -1,5 +1,6 @@
#import "android_device"
#import "android_jni"
Handoff :: #import "entity/account_handoff";
#import "android_picker"
#import "c_string"
@@ -23,6 +24,7 @@ JNI_OnLoad :: (vm: *JniVm, reserved: *void) -> s32 {
unused reserved
version := AndroidJniOnLoad(vm, "xyz/waozi/arcade/ArcadeActivity")
if version != JniVersion { return version }
Handoff.AccountHandoffJniOnLoad(vm)
env: *JniEnv
if vm.functions.GetEnv(vm, *env, JniVersion) != 0 || env == null { return -1 }
class_name: [64]u8
+29 -2
View File
@@ -28,6 +28,10 @@ collection_package_files: *AppFiles;
// Packages the platform already holds, read-only and verified like a
// download: the website's own copy of the library art. "" for none.
collection_package_folder: string;
// Set by the host's origin-specific connection choice. Cached bytes do not
// need a connection; no new transfer is permitted while it is off.
collection_package_allowed: bool;
collection_package_origin: string;
package_c :: #system_library "c";
PackageFree :: (memory: *void) #foreign package_c "free";
CollectionDownloadsOpen :: (files: *AppFiles) { collection_package_files = files }
@@ -120,11 +124,12 @@ CollectionFetch :: (context: *void, account: string, parent: *AppNode,
if operation != APPS_INSTALL { return false }
// Cached installs and removals use the host's ordinary saved state.
if package.bytes != "" { return false }
if !collection_package_allowed { reply.status = APPS_REJECTED; return true }
if package.transfer.status != .Downloading {
FileDownloadRelease(*package.transfer)
package.failed = false
base := EnvironmentText("ARCADE_PACKAGE_ORIGIN")
if base == "" { base = "https://api.waozi.xyz" }
base := collection_package_origin
if base == "" { return false }
url: Vec(u8)
BuilderPrint(*url, "%/api/v2/packages/inbe.arcade/%.zx", base, TextUntilNul(package.digest[:]))
address := BuilderFinish(url)
@@ -136,6 +141,28 @@ CollectionFetch :: (context: *void, account: string, parent: *AppNode,
return true
}
CollectionDownloadsBusy :: () -> bool {
package := collection_packages
while package != null {
if package.transfer.status == .Downloading { return true }
package = package.next
}
return false
}
CollectionDownloadsAllow :: (allowed: bool) {
collection_package_allowed = allowed
if allowed { return }
package := collection_packages
while package != null {
if package.transfer.status == .Downloading {
FileDownloadRelease(*package.transfer)
package.failed = true
}
package = package.next
}
}
CollectionDownloadsPump :: () {
package := collection_packages
while package != null {
+213 -1
View File
@@ -53,6 +53,9 @@ Codec :: #import "apps/node_codec";
#import "kryon/image_raster"
#import "kryon/loading_indicator"
#import, file "collection_loading.zi";
#import "apps/connection"
#import "apps/remote_catalog"
Labels :: #import "apps/words";
#import "shovey/shovey_theme"
ProfileIcon :: #import "mingcute/mingcute_regular_user_4";
DewIcon :: #import "mingcute/mingcute_filled_drop";
@@ -499,6 +502,12 @@ CollectionOpen :: (bundle: string, digest: string, harness_digest: string,
opened := AppFilesOpen(*collection_resources, collection_resource_root)
if !opened { Report("Arcade: cannot open the private resources folder"); return false }
CollectionDownloadsOpen(*collection_resources)
return CollectionStart(bundle, digest, harness_digest, locale, packed)
}
// Replacing a verified catalog reuses the host services and per-game saves.
CollectionStart :: (bundle: string, digest: string, harness_digest: string,
locale: string, packed: bool) -> bool {
platform := AppPlatform.{.allows = CollectionAllows, .call = CollectionCall,
.widgets = CollectionWidgets, .save = CollectionSave, .state = CollectionState,
.effect = CollectionEffect, .host_api = GAME_HOST_API,
@@ -555,7 +564,23 @@ CollectionOpenBytes :: (bytes: string, metadata: string, data: string) -> bool {
locale := EnvironmentText("LANG")
language := ifx locale.count >= 2 then locale[:2] else "en"
packed := AppsReadText(metadata, 0, "games", games[:]) && TextUntilNul(games[:]) == "packed"
return CollectionOpen(bytes, TextUntilNul(digest[:]), TextUntilNul(harness[:]), data, language, packed)
selected := bytes
selected_digest := TextUntilNul(digest[:])
if !packed {
if !CollectionNodeOpen(metadata, data, bytes, selected_digest, TextUntilNul(harness[:]), language) { return false }
if collection_node.ready {
selected = collection_node.bytes
selected_digest = TextUntilNul(collection_node.release.artifacts[0].sha256[:])
}
}
opened := CollectionOpen(selected, selected_digest, TextUntilNul(harness[:]), data, language, packed)
if !opened && !packed && collection_node_remote {
collection_node_remote = false
collection_node.failed = true
opened = CollectionStart(collection_seed, TextUntilNul(collection_seed_digest[:]),
TextUntilNul(collection_harness_digest[:]), language, false)
}
return opened
}
// The standalone player needs only Shovey's own payload and metadata. Its
@@ -613,6 +638,7 @@ CollectionCollect :: () {
if entity_ready { EntityPump() }
PublicationsReadPump()
AppHostCollect(*collection_host)
CollectionNodePump()
for path: collection_frame_paths { AppFileFree(path) }
while collection_frame_paths.count > 0 { unused VecPop(collection_frame_paths) }
collection_widget_node = null
@@ -622,6 +648,7 @@ CollectionClose :: () -> bool {
if !EntityClose() { return false }
if collection_ready && !AppHostStop(*collection_host) { return false }
collection_ready = false
CollectionNodeClose()
collection_loading = .{}
CollectionDownloadsClose()
CollectionCollect()
@@ -761,6 +788,7 @@ CollectionUpdatesQuestion :: (session: Session, viewport: Rectangle) {
CollectionFrame :: (session: Session, viewport: Rectangle, key: s32, modifiers: s32) -> bool {
collection_toolbar_visible = true
defer { CollectionToolbar(session, viewport) }
if CollectionNodeScreen(session, viewport) { collection_toolbar_visible = false; return true }
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 }
@@ -778,6 +806,7 @@ CollectionFrame :: (session: Session, viewport: Rectangle, key: s32, modifiers:
asking := runtime.node.collection && !collection_host.platform.presentation.cover_grid && CollectionUpdates() == 2
if asking { key = 0 }
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}
@@ -836,6 +865,7 @@ CollectionFrame :: (session: Session, viewport: Rectangle, key: s32, modifiers:
}
} else if runtime.node.collection {
collection_loading = .{}
CollectionNodeToolbar(session, viewport)
}
if asking {
unused WidgetPaletteUse(session, ifx entity_shovey then ShoveyPalette() else AppCoversPalette())
@@ -886,3 +916,185 @@ CollectionToolbar :: (session: Session, viewport: Rectangle) {
c :: #system_library "c";
CollectionFree :: (memory: *void) #foreign c "free";
// The native host composes the shared Apps connection and signed catalog.
// Replacing a root uses the same services and saved-game namespaces.
collection_node: AppRemoteCatalog;
collection_node_files: AppFiles;
collection_node_root: string;
collection_node_choice: s32;
collection_node_notice: bool;
collection_node_initial: bool;
collection_node_apply: bool;
collection_node_remote: bool;
collection_seed: string;
collection_seed_digest: [65]u8;
collection_harness_digest: [65]u8;
collection_node_locale: [16]u8;
collection_signature :: #system_library "c";
CollectionCheckSignature :: (signature: *u8, public_key: *u8, message: *u8,
length: usize) -> s32 #foreign collection_signature "crypto_ed25519_check";
CollectionVerifyRelease :: (signature: *u8, public_key: *u8, message: *u8,
length: usize) -> bool { return CollectionCheckSignature(signature, public_key, message, length) == 0 }
CollectionNodeOpen :: (metadata: string, data: string, seed: string,
digest: string, harness: string, locale: string) -> bool {
source: AppRemoteSource
source.oldest_host_api = 1
source.host_api = GAME_HOST_API
source.module_api = 2
at := FieldAt(metadata, 0, "node")
if at < 0 || !AppRemoteSourceRead(metadata, at, *source) || TextUntilNul(source.app_id[:]) != "inbe.arcade" { return false }
// Private loopback fixtures can exercise the real transport. A production
// environment variable cannot silently redirect a publisher's requests.
test_origin := EnvironmentText("ARCADE_PACKAGE_ORIGIN")
if test_origin.count > 17 && test_origin[:17] == "http://127.0.0.1:" && AppRemoteOriginValid(test_origin) {
unused CopyCString(test_origin, source.origin[:])
}
collection_node_root = Join(data, "node")
if !AppFilesOpen(*collection_node_files, collection_node_root) { return false }
if !AppRemoteCatalogOpen(*collection_node, source, *collection_node_files, CollectionVerifyRelease) { return false }
collection_seed = AppRemoteCopy(seed)
unused CopyCString(digest, collection_seed_digest[:])
unused CopyCString(harness, collection_harness_digest[:])
unused CopyCString(locale, collection_node_locale[:])
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
if allowed { unused AppRemoteCatalogRefresh(*collection_node) }
return true
}
CollectionNodeChoose :: (choice: s32) -> bool {
if !AppConnectionRemember(*collection_node_files, collection_package_origin, choice) { return false }
collection_node_choice = choice
collection_node_notice = false
allowed := choice == APP_CONNECTION_ALLOWED
CollectionDownloadsAllow(allowed)
AppRemoteCatalogAllow(*collection_node, allowed)
if allowed {
collection_node_initial = !collection_node_remote
collection_node_apply = true
unused AppRemoteCatalogRefresh(*collection_node)
}
return true
}
CollectionNodeActivate :: () -> bool {
if !collection_node.changed || CollectionDownloadsBusy() { return false }
runtime := AppHostActiveRuntime(*collection_host)
if runtime == null || !runtime.node.collection { return false }
if !AppHostStop(*collection_host) { return false }
collection_ready = false
{
bytes := collection_node.bytes
digest := TextUntilNul(collection_node.release.artifacts[0].sha256[:])
collection_ready = CollectionStart(bytes, digest, TextUntilNul(collection_harness_digest[:]),
TextUntilNul(collection_node_locale[:]), false)
}
if collection_ready {
collection_node_remote = true
AppRemoteCatalogCollect(*collection_node)
} else {
// Keep the former library and every game's separate save namespace.
if collection_node.previous_bytes != "" {
unused AppRemoteCatalogRestore(*collection_node)
} else {
unused AppFileWrite(*collection_node_files, "current.json", "")
collection_node_remote = false
collection_node.changed = false
collection_node.failed = true
}
old_bytes := ifx collection_node_remote then collection_node.bytes else collection_seed
old_digest := ifx collection_node_remote then TextUntilNul(collection_node.release.artifacts[0].sha256[:]) else TextUntilNul(collection_seed_digest[:])
collection_ready = CollectionStart(old_bytes, old_digest, TextUntilNul(collection_harness_digest[:]),
TextUntilNul(collection_node_locale[:]), false)
}
collection_loading = .{}
return collection_ready
}
CollectionNodePump :: () {
if collection_node.files == null { return }
AppRemoteCatalogPump(*collection_node)
if collection_node_apply && collection_node.stage == 0 {
if collection_node.changed && !CollectionNodeActivate() { return }
collection_node_apply = false
collection_node_initial = false
}
}
// Returns true when the notice/loading screen owns this frame's input.
CollectionNodeScreen :: (session: Session, viewport: Rectangle) -> bool {
if collection_node.files == null { return false }
if collection_node_notice {
choice := AppConnectionNotice(session, viewport, TextUntilNul(collection_node_locale[:]),
collection_package_origin, cast(u64)49500)
if choice != APP_CONNECTION_UNDECIDED { unused CollectionNodeChoose(choice) }
return true
}
if collection_node_initial && collection_node.stage != 0 {
Box(session, BoxProps.{.key = cast(u64)49510, .bounds = viewport, .fill = Color.{17, 18, 35, 255}})
Text(session, TextProps.{.key = cast(u64)49511, .text = Labels.AppsLabel(TextUntilNul(collection_node_locale[:]), "loading_library"),
.font = 20, .bounds = Rectangle.{viewport.x + 24.0, viewport.y + viewport.height / 2.0, viewport.width - 48.0, 64.0}})
if Button(session, ButtonProps.{.key = cast(u64)49512, .id = 49512,
.label = Labels.AppsLabel(TextUntilNul(collection_node_locale[:]), "stay_offline"),
.bounds = Rectangle.{viewport.x + 24.0, viewport.y + viewport.height / 2.0 + 72.0, viewport.width - 48.0, 44.0},
.tone = ButtonTone.ButtonToneNeutral, .emphasis = ButtonEmphasis.ButtonEmphasisSoft}) != 0 {
unused CollectionNodeChoose(APP_CONNECTION_OFFLINE)
}
return true
}
return false
}
CollectionNodeToolbar :: (session: Session, viewport: Rectangle) {
if collection_node.files == null { return }
unused WidgetPaletteUse(session, AppCoversPalette())
defer { unused WidgetPaletteRestore(session) }
Box(session, BoxProps.{.key = cast(u64)49519,
.bounds = Rectangle.{viewport.x, viewport.y, viewport.width, 88.0},
.fill = Color.{17, 18, 35, 255}})
locale := TextUntilNul(collection_node_locale[:])
allowed := collection_node_choice == APP_CONNECTION_ALLOWED
status := ifx !allowed then "offline_library" else ifx collection_node.stage != 0 then "loading_library" else ifx collection_node.failed then "library_unavailable" else "saved_library"
width := ifx viewport.width - 180.0 < 320.0 then viewport.width - 180.0 else 320.0
if Button(session, ButtonProps.{.key = cast(u64)49520, .id = 49520,
.label = Labels.AppsLabel(locale, ifx allowed then "refresh_library" else "connect_node"),
.bounds = Rectangle.{viewport.x + 8.0, viewport.y + 6.0, width, 44.0},
.tone = ButtonTone.ButtonToneNeutral, .emphasis = ButtonEmphasis.ButtonEmphasisSoft}) != 0 {
if !allowed { collection_node_notice = true }
else if collection_node.changed { collection_node_apply = true }
else { collection_node_apply = true; unused AppRemoteCatalogRefresh(*collection_node) }
}
// A separate connection control keeps revocation available after consent.
if Button(session, ButtonProps.{.key = cast(u64)49521, .id = 49521,
.label = Labels.AppsLabel(locale, "node_connection"),
.bounds = Rectangle.{viewport.x + viewport.width - 170.0, viewport.y + 52.0, 158.0, 28.0},
.tone = ButtonTone.ButtonToneNeutral, .emphasis = ButtonEmphasis.ButtonEmphasisSoft}) != 0 {
collection_node_notice = true
}
Text(session, TextProps.{.key = cast(u64)49522, .text = Labels.AppsLabel(locale, status), .font = 12, .wrap = TextWrap.TextWrapAuto,
.bounds = Rectangle.{viewport.x + 16.0, viewport.y + 58.0, viewport.width - 196.0, 26.0}})
}
CollectionNodeClose :: () {
CollectionDownloadsAllow(false)
AppFileFree(collection_package_origin)
collection_package_origin = ""
AppRemoteCatalogClose(*collection_node)
AppFilesClose(*collection_node_files)
AppFileFree(collection_node_root)
AppFileFree(collection_seed)
collection_node_root = ""
collection_seed = ""
collection_node_notice = false
collection_node_initial = false
collection_node_apply = false
collection_node_remote = false
}
+42 -4
View File
@@ -6,11 +6,37 @@ import sys
import struct
import hashlib
import unittest
from unittest.mock import patch
import tempfile
import zipfile
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / 'scripts'))
from android_catalog import verify_assets
import android_catalog
class ProfileAssetResolutionTests(unittest.TestCase):
def test_dependency_resolution_matches_build_mode(self):
(ROOT / 'work').mkdir(exist_ok=True)
with tempfile.TemporaryDirectory(dir=ROOT / 'work') as temporary:
root = Path(temporary)
package = root / 'entity'
package.mkdir()
(package / 'asset-groups.json').write_text('{"profile": []}')
try:
for local in (False, True):
if local:
(root / 'ziran.local.toml').write_text('[overrides]\n')
android_catalog.profile_asset_hashes.cache_clear()
with self.subTest(local=local), patch.object(android_catalog, 'ROOT', root), \
patch.object(android_catalog.subprocess, 'check_output', return_value=str(package)) as resolve:
self.assertEqual(android_catalog.profile_asset_hashes(), {})
resolve.assert_called_once_with(
[str(root / 'scripts/ziran.sh'), 'pkg', 'path', 'entity',
*([] if local else ['--locked'])], cwd=root, text=True)
finally:
android_catalog.profile_asset_hashes.cache_clear()
class AndroidCatalogTests(unittest.TestCase):
@@ -29,6 +55,14 @@ class AndroidCatalogTests(unittest.TestCase):
def test_standard_catalog(self):
verify_assets(self.assets)
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)):
metadata = json.loads(self.assets['arcade.json'])
metadata['node'][key] = value
with self.subTest(field=key), self.assertRaisesRegex(AssertionError, 'publisher binding'):
verify_assets(self.assets | {'arcade.json': json.dumps(metadata).encode()})
def test_reject_game_or_thumbnail_beside_catalog(self):
for name in ('games/shovey.zx', 'covers/shovey.png'):
with self.subTest(name=name), self.assertRaises(AssertionError):
@@ -43,14 +77,18 @@ class AndroidCatalogTests(unittest.TestCase):
return struct.pack('<I', n)
def text(data):
return number(len(data)) + data
# Structurally valid ZX with a catalog and an extra embedded asset.
for path in (b'assets/arcade/games/test.zx', b'assets/arcade/covers/test.png'):
payload = b'ZX\0\0\x1b\0\0\0' + text(b'') * 2 + number(0) * 4
# Structurally valid ZX with a catalog and an extra embedded asset,
# in both bundle versions the toolchain writes (26 plain, 27 composed).
cases = [(version, path) for version in (26, 27)
for path in (b'assets/arcade/games/test.zx', b'assets/arcade/covers/test.png')]
for version, path in cases:
payload = b'ZX\0\0' + number(version) + text(b'') * 2 + number(0) * 4
payload += number(2) + text(b'assets/apps/catalog.json') + text(b'{}')
payload += text(path) + text(b'payload')
metadata = json.loads(self.assets['arcade.json'])
metadata['sha256'] = hashlib.sha256(payload).hexdigest()
with self.subTest(path=path), self.assertRaisesRegex(AssertionError, 'Game payload or art'):
with self.subTest(version=version, path=path), \
self.assertRaisesRegex(AssertionError, 'Game payload or art'):
verify_assets(self.assets | {'arcade.zx': payload, 'arcade.json': json.dumps(metadata).encode()})
def test_reject_game_art_nested_in_entity(self):
+8
View File
@@ -116,6 +116,14 @@ with tempfile.TemporaryDirectory(prefix='host-', dir=output) as temporary, packa
# 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='Node connection', role='button')
driver.press(label='Node connection', role='button')
driver.wait(label='Stay offline', role='button')
driver.press(label='Stay offline', role='button')
driver.wait(label='Shovey', role='button')
saved = record.read_bytes()
for name in ('shovey', 'shovey-editor', 'wurm'):
entry = entries[name]
+281
View File
@@ -0,0 +1,281 @@
"""Catalog releases advance independently; native APK verification stays strict."""
import hashlib
import importlib.util
import json
from pathlib import Path
import shutil
import struct
import subprocess
import sys
import tempfile
import unittest
from unittest.mock import patch
import zipfile
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / 'scripts'))
import android_catalog
def load(name, script):
spec = importlib.util.spec_from_file_location(name, ROOT / 'scripts' / script)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module
builder = load('collection_versions', 'build-collection.py')
release = load('android_release_versions', 'android-release.py')
native_builder = load('android_native_versions', 'build-android.py')
class Fixture(unittest.TestCase):
def setUp(self):
work = ROOT / 'work'
work.mkdir(exist_ok=True)
temporary = tempfile.TemporaryDirectory(prefix='catalog-versions-', dir=work)
self.addCleanup(temporary.cleanup)
self.root = Path(temporary.name)
for directory in ('scripts', 'apps', 'catalog'):
(self.root / directory).mkdir()
(self.root / 'packaging').mkdir()
shutil.copyfile(ROOT / 'packaging/node.json', self.root / 'packaging/node.json')
class SynchronizerTests(Fixture):
def setUp(self):
super().setUp()
shutil.copyfile(ROOT / 'update_version.sh', self.root / 'update_version.sh')
(self.root / 'scripts/game_packages.py').write_text(
"from pathlib import Path\n"
"def declared_apps(root):\n"
" return [dict(descriptor=dict(name='game', id='inbe.game', title='Game', host_api=41),\n"
" manifest=Path('apps/catalog.json'))]\n")
(self.root / 'CHANGELOG.md').write_text('## [Unreleased]\n\n- Later host.\n\n## 0.7.117\n')
(self.root / 'VERSION').write_text('0.7.116\n')
(self.root / 'packaging/android').mkdir(parents=True)
(self.root / 'packaging/android/version-code').write_text('195\n')
(self.root / 'catalog/CHANGELOG.md').write_text('## 0.7.118\n\n- New games.\n')
(self.root / 'catalog/VERSION').write_text('0.7.116\n')
(self.root / 'packaging').mkdir(exist_ok=True)
shutil.copyfile(ROOT / 'packaging/node.json', self.root / 'packaging/node.json')
(self.root / 'apps/CHANGELOG.md').write_text('## [1.0.0] - 2026-10-31\n')
self.original = {'node_apps': {
'arcade': {'id': 'inbe.arcade', 'version': '0.7.116', 'sequence': 120},
'game': {'id': 'inbe.game', 'version': '1.0.0', 'sequence': 7}}}
self.write_ledger(self.original)
def write_ledger(self, value):
(self.root / 'apps/versions.json').write_text(json.dumps(value))
def sync(self, *args, success=True):
result = subprocess.run(['sh', str(self.root / 'update_version.sh'), *args],
capture_output=True, text=True)
self.assertEqual(result.returncode == 0, success, result.stdout + result.stderr)
return json.loads((self.root / 'apps/versions.json').read_text())['node_apps']
def test_catalog_release_never_bumps_host_and_is_idempotent(self):
ledger = self.sync('--catalog')
self.assertEqual((self.root / 'VERSION').read_text(), '0.7.116\n')
self.assertEqual((self.root / 'packaging/android/version-code').read_text(), '195\n')
self.assertEqual((self.root / 'catalog/VERSION').read_text(), '0.7.118\n')
self.assertEqual((ledger['arcade']['version'], ledger['arcade']['sequence']), ('0.7.118', 121))
self.assertEqual(ledger['game'], self.original['node_apps']['game'])
self.assertEqual(self.sync('--catalog'), ledger)
def test_host_release_never_advances_catalog_sequence(self):
(self.root / 'catalog/CHANGELOG.md').write_text('## 0.7.116\n')
ledger = self.sync()
self.assertEqual((self.root / 'VERSION').read_text(), '0.7.117\n')
self.assertEqual((self.root / 'packaging/android/version-code').read_text(), '196\n')
self.assertEqual(ledger, self.original['node_apps'])
self.assertEqual(builder.catalog_version(self.root), '0.7.116')
self.assertEqual(self.sync(), ledger)
self.assertEqual((self.root / 'packaging/android/version-code').read_text(), '196\n')
def test_native_apk_identity_ignores_catalog_sequence(self):
with patch.object(native_builder, 'ROOT', self.root):
self.assertEqual(native_builder.native_release(), {'version': '0.7.116', 'sequence': 195})
self.sync('--catalog')
with patch.object(native_builder, 'ROOT', self.root):
self.assertEqual(native_builder.native_release(), {'version': '0.7.116', 'sequence': 195})
def test_invalid_native_code_preserves_all_versions(self):
(self.root / 'packaging/android/version-code').write_text('0\n')
self.sync(success=False)
self.assertEqual((self.root / 'VERSION').read_text(), '0.7.116\n')
self.assertEqual((self.root / 'catalog/VERSION').read_text(), '0.7.116\n')
self.assertEqual(json.loads((self.root / 'apps/versions.json').read_text()), self.original)
def test_catalog_release_updates_game_ledger_from_its_own_changelog(self):
(self.root / 'apps/CHANGELOG.md').write_text('## [1.0.1] - 2026-10-31\n')
ledger = self.sync('--catalog')
self.assertEqual((ledger['game']['version'], ledger['game']['sequence']), ('1.0.1', 8))
def test_catalog_version_cannot_go_back_and_failure_preserves_files(self):
(self.root / 'catalog/CHANGELOG.md').write_text('## 0.7.115\n')
ledger = self.sync('--catalog', success=False)
self.assertEqual(ledger, self.original['node_apps'])
self.assertEqual((self.root / 'VERSION').read_text(), '0.7.116\n')
self.assertEqual((self.root / 'catalog/VERSION').read_text(), '0.7.116\n')
def test_collection_rejects_stale_catalog_ledger(self):
(self.root / 'catalog/VERSION').write_text('0.7.118\n')
with self.assertRaisesRegex(ValueError, 'signed release ledger'):
builder.catalog_version(self.root)
def test_unknown_switch_does_not_change_versions(self):
self.sync('--wrong', success=False)
self.assertEqual((self.root / 'VERSION').read_text(), '0.7.116\n')
def bundle(assets):
def number(value):
return struct.pack('<I', value)
def text(value):
return number(len(value)) + value
return (b'ZX\0\0\x1b\0\0\0' + text(b'') * 2 + number(0) * 4 + number(len(assets))
+ b''.join(text(name.encode()) + text(value) for name, value in assets.items()))
class AndroidVerifierTests(Fixture):
def setUp(self):
super().setUp()
(self.root / 'CHANGELOG.md').write_text('## 0.7.117\n')
(self.root / 'catalog/VERSION').write_text('0.7.116\n')
controller = bundle({})
self.controller_digest = hashlib.sha256(controller).hexdigest()
(self.root / 'apps-controller.sha256').write_text(self.controller_digest)
catalog = {'children': [], 'art': {'sha256': 'a' * 64, 'bytes': 123},
'harness': 'assets/apps/apps.zx'}
payload = bundle({'assets/apps/catalog.json': json.dumps(catalog).encode(),
'assets/arcade/sidebar.shape': b'shape'})
self.metadata = {'id': 'inbe.arcade', 'version': '0.7.116',
'sha256': hashlib.sha256(payload).hexdigest(),
'apps_sha256': self.controller_digest, 'children': [], 'art': catalog['art']}
ledger = {'node_apps': {'arcade': {'sequence': 195}}}
(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/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'}
self.badging = ("package: name='xyz.waozi.arcade' versionCode='121' versionName='0.7.117'\n"
"application-label:'Arcade'\napplication: label='Arcade' icon='res/icon.png'\n")
self.signer = hashlib.sha256(b'certificate').hexdigest()
def verify(self, edition='direct'):
apk = self.root / 'fixture.apk'
with zipfile.ZipFile(apk, 'w') as output:
for name, data in self.assets.items():
output.writestr(name, data)
output.writestr('assets/arcade.json', json.dumps(self.metadata))
def command(args, **kwargs):
if args[0] == 'openssl':
return b'certificate'
if 'apksigner' in args[0]:
return 'Number of signers: 1\nSigner #1 certificate SHA-256 digest: ' + self.signer + '\n'
self.assertIn('badging', args)
return self.badging
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(release, 'verify_launcher'), \
patch.object(release.subprocess, 'check_output', side_effect=command), \
patch.object(release.subprocess, 'run'):
return release.verify(apk, '0.7.117', self.root / 'tools', edition)
def test_host_and_embedded_catalog_versions_may_differ(self):
for edition in ('direct', 'fdroid'):
result = self.verify(edition)
self.assertEqual((result['version'], result['catalog_version']), ('0.7.117', '0.7.116'))
def test_wrong_native_identity_or_version_rejected(self):
for old, new in (('xyz.waozi.arcade', 'xyz.waozi.other'), ('0.7.117', '0.7.116')):
original = self.badging
self.badging = original.replace(old, new)
with self.assertRaisesRegex(AssertionError, 'APK identity or version'):
self.verify()
self.badging = original
def test_wrong_catalog_identity_or_source_version_rejected(self):
for key, value in (('id', 'inbe.other'), ('version', '0.7.117')):
original = self.metadata[key]
self.metadata[key] = value
with self.assertRaisesRegex(AssertionError, 'catalog (identity|version)'):
self.verify()
self.metadata[key] = original
def test_payload_hash_stays_required(self):
self.assets['assets/arcade.zx'] += b'changed'
with self.assertRaisesRegex(AssertionError, 'differs from its receipt'):
self.verify()
def test_controller_digest_stays_required(self):
self.assets['assets/apps.zx'] += b'changed'
with self.assertRaises(AssertionError):
self.verify()
def test_extra_assets_and_oversized_catalog_rejected(self):
self.assets['assets/game.zx'] = b'game'
with self.assertRaisesRegex(AssertionError, 'Unexpected or missing'):
self.verify()
del self.assets['assets/game.zx']
self.assets['assets/arcade.zx'] = b'x' * (256 * 1024 + 1)
self.metadata['sha256'] = hashlib.sha256(self.assets['assets/arcade.zx']).hexdigest()
with self.assertRaisesRegex(AssertionError, 'asset policy budget'):
self.verify()
def test_google_edition_gates_stay_required(self):
self.badging += "uses-permission: name='com.android.vending.BILLING'\n"
with self.assertRaisesRegex(AssertionError, 'Only the Google Play edition'):
self.verify()
self.assets['assets/dexopt/baseline.prof'] = b'profile'
self.assets['assets/dexopt/baseline.profm'] = b'metadata'
with self.assertRaisesRegex(AssertionError, 'Only the Google Play edition'):
self.verify('gplay')
self.assets['classes.dex'] = b'Lorg/kryonlabs/play/PlayBilling; Lcom/android/billingclient/'
self.assertEqual(self.verify('gplay')['edition'], 'gplay')
self.badging = self.badging.split('uses-permission:')[0]
del self.assets['assets/dexopt/baseline.prof']
del self.assets['assets/dexopt/baseline.profm']
with self.assertRaisesRegex(AssertionError, 'Only the Google Play edition'):
self.verify()
def test_signer_and_native_architectures_stay_required(self):
self.signer = '0' * 64
with self.assertRaisesRegex(AssertionError, 'APK signer differs'):
self.verify()
self.signer = hashlib.sha256(b'certificate').hexdigest()
del self.assets['lib/armeabi-v7a/libmain.so']
with self.assertRaisesRegex(AssertionError, 'Both supported ARM architectures'):
self.verify()
class WorkflowTests(unittest.TestCase):
def test_catalog_publication_never_dispatches_android(self):
for name in ('game-updates.yml', 'node-release.yml'):
text = (ROOT / '.github/workflows' / name).read_text()
self.assertNotIn('gh workflow run android.yml', text)
self.assertNotIn('cat VERSION', text)
self.assertIn('cat catalog/VERSION', text)
follower = (ROOT / '.github/workflows/game-updates.yml').read_text()
self.assertIn('sh update_version.sh --catalog', follower)
self.assertNotIn('ziran.lock CHANGELOG.md VERSION', follower)
def test_native_release_is_created_after_all_editions_verify(self):
text = (ROOT / '.github/workflows/android.yml').read_text()
publish = text[text.index(' publish:'):]
self.assertIn('edition: [direct, fdroid, gplay]', text)
self.assertIn('needs: [release, build]', publish)
self.assertIn('for edition in direct fdroid gplay', publish)
self.assertLess(publish.index('scripts/android-release.py verify'), publish.index('gh release create'))
self.assertIn('tag="arcade-$VERSION"', publish)
self.assertIn('--target "$GITHUB_SHA"', publish)
self.assertNotIn('"node-arcade-', text)
self.assertIn("expect-google: 'true'", text)
if __name__ == '__main__':
unittest.main()
+1 -1
View File
@@ -60,7 +60,7 @@ def main():
"-DCMAKE_BUILD_TYPE=MinSizeRel", "-DBUILD_SHARED_LIBS=OFF",
"-DOQS_BUILD_ONLY_LIB=ON", "-DOQS_USE_OPENSSL=OFF",
"-DOQS_DIST_BUILD=OFF", "-DOQS_OPT_TARGET=generic",
"-DOQS_MINIMAL_BUILD=SIG_ml_dsa_44")
"-DOQS_MINIMAL_BUILD=SIG_ml_dsa_44;KEM_ml_kem_768")
run("cmake", "--build", str(oqs), "--target", "oqs", "--", "-j1")
libraries = subprocess.check_output(
["pkg-config", "--libs", "sdl2", "cairo", "freetype2", "fontconfig",
+174 -7
View File
@@ -3,11 +3,14 @@ import hashlib
import importlib.util
import io
import json
import os
from pathlib import Path
import shlex
import shutil
import subprocess
import tempfile
import unittest
from unittest.mock import patch
import sys
import tarfile
from PIL import Image
@@ -28,7 +31,7 @@ spec.loader.exec_module(published_games)
def bundle_asset_paths(path):
"""Read the actual bundle index without loading its images or executing it."""
with published_games.Reader(path) as reader:
if reader.take(8) != b"ZX\0\0\x1b\0\0\0":
if reader.take(8) not in (b"ZX\0\0\x1a\0\0\0", b"ZX\0\0\x1b\0\0\0"):
raise ValueError("Unsupported game bundle")
reader.text()
reader.text()
@@ -66,9 +69,15 @@ class CollectionTests(unittest.TestCase):
self.assertTrue(path in assets, "Choano runtime image missing from its bundle: " + path)
def setUp(self):
self.directory = tempfile.TemporaryDirectory(prefix="collection-", dir=ROOT / "build")
subprocess.run(["git", "check-ignore", "-q", "work/"], cwd=ROOT, check=True)
(ROOT / "work").mkdir(exist_ok=True)
self.directory = tempfile.TemporaryDirectory(prefix="collection-", dir=ROOT / "work")
self.addCleanup(self.directory.cleanup)
self.root = Path(self.directory.name)
self.lock_flags = ("--locked",)
if (ROOT / "ziran.local.toml").is_file():
(self.root / "ziran.local.toml").touch()
self.lock_flags = ()
(self.root / "apps").mkdir()
for name in ("games.json", "apps.json", "apps/versions.json"):
shutil.copyfile(ROOT / name, self.root / name)
@@ -86,6 +95,9 @@ class CollectionTests(unittest.TestCase):
(self.root / "assets/arcade").mkdir(parents=True)
shutil.copyfile(ROOT / "assets/arcade/sidebar.shape", self.root / "assets/arcade/sidebar.shape")
shutil.copytree(ROOT / "assets/arcade/library", self.root / "assets/arcade/library")
(self.root / "src").mkdir()
for source in (ROOT / "src").glob("*_collection.zi"):
shutil.copyfile(source, self.root / "src" / source.name)
# Only a native VM identity gate can trust a controller. This fixture
# tests packing and its exact-content requirement, not that handshake.
self.controller = self.root / "controller.zx"
@@ -96,8 +108,135 @@ class CollectionTests(unittest.TestCase):
def stage(self):
return builder.stage(self.root, self.controller, self.controller_digest, self.output)[0]
def staged_bytes(self):
return {str(path.relative_to(self.output)): builder.digest(path)
for path in self.output.rglob("*") if path.is_file()}
def small_payloads(self):
# Real on-disk input sizes, bounded independently of production limits.
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 (".png", ".jpg"):
path.write_bytes(b"art fixture".ljust(128, b"\0"))
def test_separately_loaded_games_can_exceed_one_root_limit_together(self):
# 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(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"))
builder.stage_downloads(catalog, self.output, small, games, art)
for child in catalog["children"]:
packed = games / (child["sha256"] + ".zx")
self.assertEqual(builder.digest(packed), child["sha256"])
self.assertEqual(packed.stat().st_size, child["bytes"])
self.assertLessEqual(packed.stat().st_size, 64 * 1024 * 1024)
def test_oversized_single_payload_preserves_previous_stage(self):
self.stage()
previous = self.staged_bytes()
largest = max(path.stat().st_size for path in (self.root / "build/games").glob("*.zx"))
with patch.object(builder, "MAX_PAYLOAD_BYTES", largest - 1):
with self.assertRaisesRegex(ValueError, "Game .* exceeds.*payload limit"):
self.stage()
self.assertEqual(self.staged_bytes(), previous)
with patch.object(builder, "MAX_PAYLOAD_BYTES", self.controller.stat().st_size - 1):
with self.assertRaisesRegex(ValueError, "Apps controller exceeds.*payload limit"):
self.stage()
self.assertEqual(self.staged_bytes(), previous)
def test_oversized_standalone_group_preserves_previous_stage(self):
self.stage()
previous = self.staged_bytes()
self.small_payloads()
# Each game is 32 KiB; the offline Shovey pair exceeds 48 KiB before
# even counting its controller, catalog and art. Other roots fit.
with patch.object(builder, "MAX_PAYLOAD_BYTES", 48 * 1024):
with self.assertRaisesRegex(ValueError, "Standalone shovey exceeds.*payload limit"):
self.stage()
self.assertEqual(self.staged_bytes(), previous)
def test_oversized_art_and_catalog_preserve_previous_stage(self):
self.stage()
previous = self.staged_bytes()
self.small_payloads()
for path in (self.root / "build/games").glob("*.zx"):
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 (".png", ".jpg")]
for path in pictures:
path.write_bytes(b"x" * 8192)
with patch.object(builder, "MAX_PAYLOAD_BYTES", 48 * 1024):
with self.assertRaisesRegex(ValueError, "Library art exceeds.*payload limit"):
self.stage()
self.assertEqual(self.staged_bytes(), previous)
for path in pictures:
path.write_bytes(b"art")
catalog_size = (self.output / "assets/apps/catalog.json").stat().st_size
with patch.object(builder, "MAX_PAYLOAD_BYTES", catalog_size - 1):
with self.assertRaisesRegex(ValueError, "Arcade catalog exceeds.*payload limit"):
self.stage()
self.assertEqual(self.staged_bytes(), previous)
def test_compiled_limit_includes_zx_overhead_and_preserves_previous_bundle(self):
assets = self.root / "bundle-assets"
assets.mkdir()
(assets / "fixture").write_bytes(b"asset fixture")
target = self.root / "art.zx"
command = [os.environ.get("ZIRAN", str(ROOT / "scripts/ziran.sh")),
"bundle", "--project", *self.lock_flags]
def compile_art():
builder.bundle(command, ROOT, "art.zi", "art:Main", assets, target, None)
compile_art()
previous = target.read_bytes()
self.assertGreater(len(previous), (assets / "fixture").stat().st_size)
with patch.object(builder, "MAX_PAYLOAD_BYTES", len(previous)):
compile_art()
self.assertEqual(target.read_bytes(), previous)
with patch.object(builder, "MAX_PAYLOAD_BYTES", len(previous) - 1):
with self.assertRaisesRegex(ValueError, "art.zx exceeds.*payload limit"):
compile_art()
self.assertEqual(target.read_bytes(), previous)
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:]}
for package in packages[1:]:
if package["name"] in artwork:
sources[artwork[package["name"]]] = package["apps"][0]["art_source"]
log = self.root / "resolver-args"
# Capture real subprocess arguments while resolving the same selected
# source directories, including the deliberately unlocked local case.
lines = ["#!/bin/sh", f"printf '%s\\n' \"$*\" >> {shlex.quote(str(log))}",
'case "$3" in']
lines += [f"{shlex.quote(name)}) printf '%s\\n' {shlex.quote(str(path))} ;;"
for name, path in sources.items()]
lines += ["*) exit 1 ;;", "esac"]
(self.root / "scripts/ziran.sh").write_text("\n".join(lines) + "\n")
local = self.root / "ziran.local.toml"
for override in (False, True):
with self.subTest(local_override=override):
if override:
local.touch()
else:
local.unlink(missing_ok=True)
log.unlink(missing_ok=True)
self.stage()
calls = [line.split() for line in log.read_text().splitlines()]
self.assertEqual({call[2] for call in calls}, set(sources))
for call in calls:
self.assertEqual(call, ["pkg", "path", call[2]] + ([] if override else ["--locked"]))
def assert_children_match_declarations(self, catalog, packages, payload_root):
declarations = builder.declared_packages(self.root)
declarations = builder.declared_packages(self.root, lock_flags=self.lock_flags)
ledger = json.loads((self.root / "apps/versions.json").read_text())["node_apps"]
expected_children = []
for app in (app for package in declarations for app in package["apps"] if app["enabled"]):
@@ -240,7 +379,7 @@ class CollectionTests(unittest.TestCase):
self.assertEqual(wurm_package["children"], ["xyz.waozi.wurm", "xyz.waozi.wurm-editor"])
children = {child["id"]: child for child in catalog["children"]}
self.assertEqual(children["xyz.waozi.choano"]["title"], "Choano")
self.assertEqual(children["xyz.waozi.choano"]["version"], "0.1.3")
self.assertEqual(children["xyz.waozi.choano"]["version"], pinned_ledger["choano"]["version"])
self.assertEqual(children["xyz.waozi.choano"]["expected_id"], "choano")
self.assertEqual(children["xyz.waozi.wurm"]["version"], wurm_version)
self.assertEqual(children["xyz.waozi.wurm-editor"]["version"], "0.1.0")
@@ -265,16 +404,44 @@ class CollectionTests(unittest.TestCase):
self.stage()
def test_artwork_input_changes_no_game_payload_or_version(self):
packages = builder.declared_packages(self.root)
packages = builder.declared_packages(self.root, lock_flags=self.lock_flags)
# Released code/art aliases may resolve to the same package revision.
# Give the artwork its own fixture source so this still exercises an
# independent override, retaining the exact reviewed artwork bytes.
art_source = self.root / 'fixture-art'
wurm = next(package for package in packages if package['name'] == 'wurm')
for app in wurm['apps']:
paths = [app['descriptor']['preview']]
paths += [value for key, value in (app['cover'] or {}).items()
if key in ('portrait', 'landscape', 'logo')]
for relative in paths:
destination = art_source / relative
destination.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(app['art_source'] / relative, destination)
alias = json.loads((self.root / 'games.json').read_text())['artwork']['wurm']
(self.root / 'scripts/ziran.sh').write_text(
'#!/bin/sh\n'
f'if [ "$1" = pkg ] && [ "$2" = path ] && [ "$3" = {shlex.quote(alias)} ]; then\n'
f' printf \'%s\\n\' {shlex.quote(str(art_source))}\n'
' exit 0\n'
'fi\n'
f'cd {shlex.quote(str(ROOT))} && exec ./scripts/ziran.sh "$@"\n')
packages = builder.declared_packages(self.root, lock_flags=self.lock_flags)
game = next(app for package in packages for app in package['apps']
if app['descriptor']['name'] == 'wurm-editor')
self.assertNotEqual(game['source'], game['art_source'])
self.assertEqual(hashlib.sha256((game['art_source'] / game['cover']['portrait']).read_bytes()).hexdigest(),
'07ff2ff0142c262cdcba3643bbc4d7d3d71643b7f9f4e678a910fee2bfd3eba1')
ledger_path = self.root / 'apps/versions.json'
ledger = ledger_path.read_bytes()
version = json.loads(ledger)['node_apps']['wurm-editor']['version']
game_digest = builder.digest(self.root / 'build/games/wurm-editor.zx')
catalog = self.stage()
child = next(item for item in catalog['children'] if item['expected_id'] == 'wurm-editor')
self.assertEqual(child['version'], '0.1.0')
self.assertEqual(child['sha256'], builder.digest(self.root / 'build/games/wurm-editor.zx'))
self.assertEqual(child['version'], version)
self.assertEqual(child['sha256'], game_digest)
self.assertEqual(builder.digest(self.root / 'build/games/wurm-editor.zx'), game_digest)
self.assertEqual(ledger_path.read_bytes(), ledger)
def test_artwork_override_must_name_a_registered_game(self):
path = self.root / 'games.json'
+11 -3
View File
@@ -18,7 +18,15 @@ from PIL import Image
LEVEL_UPDATES = 'Download new levels when they come out?'
def answer_library_question(driver):
"""Keep the test's bundled levels when the library asks about updates."""
"""Consent to the loopback library, keeping bundled game levels."""
deadline = time.monotonic() + 60
while time.monotonic() < deadline:
if driver.find(label='Connect', role='button', visible=True):
driver.press(label='Connect', role='button')
break
if driver.find(label='Shovey', role='button', visible=True):
break
driver.wait_idle(frames=3)
driver.wait(label='Shovey', role='button', timeout=60)
if driver.find(label=LEVEL_UPDATES, role='text'):
driver.press(label='Not now', role='button')
@@ -151,7 +159,7 @@ def main():
assert not driver.find(label='Play', role='button')
assert not driver.find(label='Open', role='button')
for label in ('Shovey', 'Shovey Editor', 'Apfelwurm'):
assert not driver.find(label=label, role='text'), 'Title artwork must not repeat its name underneath'
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, 200)
covers = [node for node in driver.find(role='image', visible=True)
@@ -211,7 +219,7 @@ def main():
return value[:start], state[:32]
with application(profile, "grid") as child:
driver.wait(label="Shovey", role="button")
# A fresh profile asks for consent before it shows the library.
answer_library_question(driver)
window = subprocess.check_output(['xdotool', 'search', '--onlyvisible', '--pid', str(child.pid)], text=True).splitlines()[0]
subprocess.run(['xdotool', 'windowsize', window, '480', '820'], check=True)
+152
View File
@@ -0,0 +1,152 @@
#!/usr/bin/env python3
"""Game imports select scoped Kryon paths; real bundles cover theme collisions."""
import os
from pathlib import Path
import subprocess
import sys
import tempfile
import unittest
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / 'scripts'))
from game_module_paths import kryon_module_paths
class SourceFixture(unittest.TestCase):
def setUp(self):
scratch = ROOT / 'work/game-module-path-tests'
subprocess.run(['git', 'check-ignore', '-q', str(scratch)], cwd=ROOT, check=True)
scratch.mkdir(parents=True, exist_ok=True)
self.folder = tempfile.TemporaryDirectory(dir=scratch)
self.addCleanup(self.folder.cleanup)
self.root = Path(self.folder.name)
self.source = self.root / 'game'
self.ui = self.root / 'kryon/src/ui'
self.ui.mkdir(parents=True)
for name in ('scroll', 'theme', 'geometry'):
(self.ui / (name + '.zi')).touch()
def write(self, path, text=''):
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(text)
def paths(self, entry='src/app.zi'):
return kryon_module_paths(self.source, {'source': entry}, self.root / 'kryon')
class ModulePathsTest(SourceFixture):
def test_qualified_imports_and_owned_theme_stay_scoped(self):
self.write(self.source / 'src/app.zi', '#import "theme"\n#import "kryon/scroll"')
self.write(self.source / 'src/theme.zi')
self.assertEqual(self.paths(), ['--module-path', 'kryon=' + str(self.ui),
'--module-path', 'kryon=' + str(self.ui.parent / 'backend')])
def test_short_import_in_nested_source_needs_plain_path(self):
self.write(self.source / 'src/app.zi', '#import "theme"')
self.write(self.source / 'src/theme.zi')
self.write(self.source / 'src/views/game.zi', 'Geometry :: #import /* reason */ "geometry";')
self.assertEqual(self.paths()[:2], ['--module-path', str(self.ui)])
def test_entry_outside_src_and_package_without_src(self):
self.write(self.source / 'src/host.zi')
self.write(self.source / 'apps/chess/view.zi', '#import "geometry"')
self.assertEqual(self.paths('apps/chess/view.zi')[:2], ['--module-path', str(self.ui)])
self.write(self.source / 'view.zi', '#import "scroll"')
(self.source / 'src/host.zi').unlink()
(self.source / 'src').rmdir()
self.assertEqual(self.paths('view.zi')[:2], ['--module-path', str(self.ui)])
def test_only_owned_root_names_shadow_shared_modules(self):
self.write(self.source / 'src/app.zi', '#import "geometry"')
self.write(self.source / 'src/nested/geometry.zi')
self.assertIn(str(self.ui), self.paths())
self.write(self.source / 'src/geometry/module.zi')
self.assertNotIn(str(self.ui), self.paths())
def test_comments_strings_file_imports_and_other_packages_do_not_flatten(self):
self.write(self.source / 'src/app.zi', '''
// #import "scroll"
/* #import "geometry" */
Text :: "#import \\"scroll\\""
#import, file "scroll.zi";
#import "other/geometry"
#import "not_a_ui_module"
''')
self.assertNotIn(str(self.ui), self.paths())
class BundleTest(SourceFixture):
@classmethod
def setUpClass(cls):
wrapper = str(ROOT / 'scripts/ziran.sh')
flags = [] if (ROOT / 'ziran.local.toml').exists() else ['--locked']
def package(name):
return Path(subprocess.check_output([wrapper, 'pkg', 'path', name, *flags], cwd=ROOT, text=True).strip())
cls.toolchain = Path(os.environ['ZIRAN_SOURCE']) if 'ZIRAN_SOURCE' in os.environ else package('ziran')
cls.kryon = Path(os.environ['KRYON_SOURCE']) if 'KRYON_SOURCE' in os.environ else package('kryon')
cls.compiler = os.environ.get('ZIRAN', str(cls.toolchain / 'build/bin/ziran'))
def compiler_run(self, *args):
env = os.environ.copy()
for key in ('DISPLAY', 'WAYLAND_DISPLAY', 'XAUTHORITY', 'DBUS_SESSION_BUS_ADDRESS'):
env.pop(key, None)
return subprocess.run([self.compiler, *map(str, args)],
cwd=ROOT, env=env, text=True, capture_output=True, timeout=180)
def bundle(self, imports, local_theme=False, old_paths=False):
entry = self.source / 'src/guest.zi'
self.write(entry, imports + '''
using ButtonState;
#program_export
Answer :: () -> s32 {
thumb := ScrollFace(StyleKindScrollThumb(), 0, false,
cast(s32)ButtonStateNormal, 10.0)
''' + (' if AppTheme.LocalTheme() != cast(u32)0xaabbccdd { return 1 }\n' if local_theme else '') + '''
if thumb.value.background != cast(u32)0x889faaff { return 2 }
return 42
}
''')
if local_theme:
self.write(entry.with_name('theme.zi'), '''
#program_export
LocalTheme :: () -> u32 { return cast(u32)0xaabbccdd }
''')
paths = kryon_module_paths(self.source, {'source': 'src/guest.zi'}, self.kryon)
if old_paths:
paths = ['--module-path', str(self.kryon / 'src/ui'), *paths]
output = self.root / 'guest.zx'
result = self.compiler_run('bundle', '--root', entry.parent, *paths,
'--module-path', self.toolchain / 'std',
'--entry', 'guest:Answer', '-o', output, entry)
return result, output
def test_scoped_bundle_preserves_app_theme_and_kryon_palette(self):
imports = '''AppTheme :: #import "theme";
#import "kryon/scroll"
#import "kryon/style_sheet"
#import "kryon/control_props"
'''
old, _ = self.bundle(imports, local_theme=True, old_paths=True)
self.assertNotEqual(old.returncode, 0, old.stdout)
self.assertIn('LightBorderStrong', old.stderr + old.stdout)
result, output = self.bundle(imports, local_theme=True)
self.assertEqual(result.returncode, 0, (result.stderr + result.stdout)[-8000:])
run = self.compiler_run('run', output)
self.assertEqual(run.returncode, 0, run.stderr)
self.assertEqual(run.stdout.strip(), '42')
def test_legacy_short_import_bundle_keeps_shared_path(self):
result, output = self.bundle('''#import "scroll"
#import "style_sheet"
#import "control_props"
''')
self.assertEqual(result.returncode, 0, (result.stderr + result.stdout)[-8000:])
run = self.compiler_run('run', output)
self.assertEqual(run.returncode, 0, run.stderr)
self.assertEqual(run.stdout.strip(), '42')
if __name__ == '__main__':
unittest.main()
+55
View File
@@ -0,0 +1,55 @@
#!/usr/bin/env python3
"""Lossless resource packing keeps color, transparency and dependency copies."""
import hashlib
import json
import random
import sys
import tempfile
import unittest
from pathlib import Path
from PIL import Image, PngImagePlugin
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'scripts'))
from game_resources import pack_opaque_pngs
class PackingTest(unittest.TestCase):
def test_only_redundant_alpha_is_removed(self):
scratch = Path(__file__).resolve().parents[1] / 'work/resource-packing-tests'
scratch.mkdir(parents=True, exist_ok=True, mode=0o700)
with tempfile.TemporaryDirectory(dir=scratch) as folder:
root = Path(folder)
rng = random.Random(1)
image = Image.new('RGBA', (64, 64))
image.putdata([(rng.randrange(256), rng.randrange(256), rng.randrange(256), 255)
for _ in range(64 * 64)])
opaque = root / 'opaque.png'
image.save(opaque, compress_level=0)
inventory = root / 'art.json'
inventory.write_text(json.dumps({'files': [{'path': 'opaque.png', 'sha256': hashlib.sha256(opaque.read_bytes()).hexdigest()}]}))
expected = image.tobytes()
old_size = opaque.stat().st_size
transparent = root / 'transparent.png'
image.putpixel((0, 0), (1, 2, 3, 127))
image.save(transparent)
before_transparent = transparent.read_bytes()
tagged = root / 'tagged.png'
info = PngImagePlugin.PngInfo()
info.add_text('source', 'fixture')
image.putpixel((0, 0), (1, 2, 3, 255))
image.save(tagged, pnginfo=info)
before_tagged = tagged.read_bytes()
pack_opaque_pngs(root)
self.assertLess(opaque.stat().st_size, old_size)
with Image.open(opaque) as actual:
self.assertEqual(actual.convert('RGBA').tobytes(), expected)
self.assertEqual(json.loads(inventory.read_text())['files'][0]['sha256'], hashlib.sha256(opaque.read_bytes()).hexdigest())
self.assertEqual(transparent.read_bytes(), before_transparent)
self.assertEqual(tagged.read_bytes(), before_tagged)
once = opaque.read_bytes()
pack_opaque_pngs(root)
self.assertEqual(opaque.read_bytes(), once)
if __name__ == '__main__':
unittest.main()
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env python3
"""Data fields must not suppress translation validation for actual labels."""
import importlib.util
from pathlib import Path
import sys
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)
code = '\n'.join([
'#import "shovey_data"',
'owned := ShopInteger(reply, "shovey_owned", 7)',
'coins := ShopInteger(reply, "shovey_coins", 1000)',
'Text(Label("shovey_title"))',
])
assert checker.translation_keys(code, 'shovey_') == {'shovey_title'}
assert checker.translation_keys(code + '\nText(Label("shovey_owned"))', 'shovey_') == {'shovey_title', 'shovey_owned'}
assert checker.translation_keys('Label("shovey_missing_translation")', 'shovey_') == {'shovey_missing_translation'}
print('JSON fields excluded; actual labels still require translations')
+5 -2
View File
@@ -111,14 +111,17 @@ class GameUpdates(unittest.TestCase):
game.mkdir()
(game / 'apps.json').write_text(json.dumps({'title': 'Apfelwurm', 'apps': [{'manifest': 'catalog.json'}]}))
(game / 'CHANGELOG.md').write_text('## [Unreleased]\n\n- Later.\n\n## [0.2.1] - 2026-10-29\n\n- Faster.\n')
(root / 'CHANGELOG.md').write_text('# Arcade changelog\n\n## [Unreleased]\n\n- Keyboard first.\n\n'
(root / 'catalog').mkdir()
(root / 'CHANGELOG.md').write_text('## 9.0.0\n\n- Host changes stay here.\n')
(root / 'catalog/CHANGELOG.md').write_text('# Arcade changelog\n\n## [Unreleased]\n\n- Keyboard first.\n\n'
'## 0.7.1\n\n- Older.\n')
updates = root / 'updates.json'
updates.write_text(json.dumps([{'name': 'wurm'}]))
with patch.object(follower, 'ROOT', root), patch.object(follower, 'UPDATES', updates), \
patch.object(follower.subprocess, 'check_output', return_value=str(game) + '\n'):
follower.changelog('ziran')
self.assertEqual((root / 'CHANGELOG.md').read_text(),
self.assertEqual((root / 'CHANGELOG.md').read_text(), '## 9.0.0\n\n- Host changes stay here.\n')
self.assertEqual((root / 'catalog/CHANGELOG.md').read_text(),
'# Arcade changelog\n\n## 0.7.2\n\n- Keyboard first.\n'
'- Apfelwurm 0.2.1: Faster.\n\n## 0.7.1\n\n- Older.\n')
+272
View File
@@ -0,0 +1,272 @@
"""Private host test: consent, signed node membership, art and offline cache."""
import argparse
import contextlib
import hashlib
import http.server
import io
import json
import os
from pathlib import Path
import shutil
import struct
import subprocess
import sys
import tempfile
import threading
from PIL import Image
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
ROOT = Path(__file__).resolve().parents[1]
def capture_window(child, path):
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, timeout=10)) == child.pid
subprocess.run(['import', '-window', window, str(path)], check=True, timeout=10)
return path
def live_library(binary, driver, work):
"""Use a disposable profile against the real public node; download no game."""
import time
from android_catalog import catalog_assets
with tempfile.TemporaryDirectory(dir=work) as temporary:
profile = Path(temporary)
log_path = work / 'live-node.log'
with log_path.open('w') as log:
child = subprocess.Popen([str(binary.resolve())], cwd=ROOT,
env=os.environ | driver.environment() | {'ARCADE_DATA': str(profile),
'ENTITY_DATA': str(profile / 'entity'), 'LANG': 'en_US.UTF-8'},
stdout=log, stderr=subprocess.STDOUT)
driver.attach(child, log_path)
try:
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'
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())
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:
driver.wait_idle(frames=5)
assert art.stat().st_size == catalog['art']['bytes']
with art.open('rb') as stream:
assert hashlib.file_digest(stream, 'sha256').hexdigest() == catalog['art']['sha256']
driver.wait_idle(frames=40)
card = driver.wait(label='Shovey', role='button')
with Image.open(capture_window(child, work / 'live-node-library.png')) as image:
crop = image.crop((card['x'], card['y'], card['x'] + card['width'], card['y'] + card['height']))
assert len(crop.convert('RGB').getcolors(1000000) or []) > 500
cached = {path.stem for path in (profile / 'resources/downloads').glob('*.zx')}
assert cached == {catalog['art']['sha256']}, 'No game payload may download during library browsing'
print('Live node signed catalog and verified thumbnail pixels passed:', metadata['version'])
finally:
if child.poll() is None:
child.terminate()
child.wait(timeout=10)
def with_catalog(payload, catalog):
"""Keep the real root program and replace only its fixture catalog asset."""
assert len(payload) <= 262144
source = io.BytesIO(payload)
def number():
return struct.unpack('<I', source.read(4))[0]
def text():
return source.read(number())
assert source.read(8) in (b'ZX\0\0\x1a\0\0\0', b'ZX\0\0\x1b\0\0\0')
text(); text()
for _ in range(number()):
text(); text()
for _ in range(number()):
for _ in range(7):
text()
source.read(8); text(); source.read(4)
for _ in range(number()):
text(); text(); text()
source.read(number())
prefix = payload[:source.tell()]
assets = {text(): text() for _ in range(number())}
assert not source.read(1)
assets[b'assets/apps/catalog.json'] = json.dumps(catalog).encode()
def packed(value):
return struct.pack('<I', len(value)) + value
return prefix + struct.pack('<I', len(assets)) + b''.join(
packed(name) + packed(value) for name, value in assets.items())
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('--apps-source', type=Path, required=True)
parser.add_argument('--live', action='store_true', help='Verify the real public node using a disposable profile')
args = parser.parse_args()
assert int(os.environ['DISPLAY'].split(':')[-1].split('.')[0]) >= 400
assert os.environ['YUE_DESKTOP_RECOVERY'] == '0'
subprocess.run(['git', 'check-ignore', 'work/node-library-ui/data'], cwd=ROOT, check=True)
sys.path[:0] = [str(args.inbe_source / 'tests'), str(args.apps_source / 'tests'), str(ROOT / 'scripts')]
from ui_driver import UiDriver
from remote_catalog_test import descriptor
from android_catalog import catalog_assets
work = ROOT / 'work/node-library-ui'
work.mkdir(parents=True, exist_ok=True)
driver = UiDriver(work / 'driver')
if args.live:
live_library(args.binary, driver, work)
return
key = Ed25519PrivateKey.generate()
seed = (ROOT / 'build/arcade.zx').read_bytes()
catalog = catalog_assets(seed)
entry = next(child for child in catalog['children'] if child['expected_id'] == 'shovey')
first_entry = dict(entry, title='Node Shovey')
if 'cover' in entry:
first_entry['cover'] = dict(entry['cover'], caption='Node Shovey')
first = dict(catalog, children=[first_entry])
payloads = [with_catalog(seed, first), with_catalog(seed, catalog)]
digests = [hashlib.sha256(data).hexdigest() for data in payloads]
state = {'revision': 0, 'requests': []}
class Handler(http.server.BaseHTTPRequestHandler):
def log_message(self, *args):
pass
def do_GET(self):
state['requests'].append(self.path)
relative = self.path.removeprefix('/api/v2/packages/inbe.arcade/')
if relative.startswith('latest?'):
index = state['revision']
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:
package = ROOT / 'build/node-apps/arcade.games' / relative
if not package.is_file():
self.send_error(404)
return
data = package.read_bytes()
self.send_response(200)
self.send_header('Content-Length', str(len(data)))
self.end_headers()
self.wfile.write(data)
server = http.server.ThreadingHTTPServer(('127.0.0.1', 0), Handler)
thread = threading.Thread(target=server.serve_forever)
thread.start()
origin = f'http://127.0.0.1:{server.server_port}'
try:
with tempfile.TemporaryDirectory(dir=work) as temporary:
folder = Path(temporary)
app = folder / 'app'
app.mkdir()
shutil.copy2(args.binary, app / 'arcade')
for name in ('arcade.zx', 'apps.zx', 'entity.zx'):
shutil.copyfile(ROOT / 'build' / name, app / name)
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())
(app / 'arcade.json').write_text(json.dumps(receipt))
profile = folder / 'data'
save = profile / 'games/inbe.chess/records/computer'
save.parent.mkdir(parents=True)
save.write_bytes(b'prior saved game')
@contextlib.contextmanager
def application(name):
log_path = work / (name + '.log')
with log_path.open('w') as log:
child = subprocess.Popen([str(app / 'arcade')], cwd=app,
env=os.environ | driver.environment() | {'ARCADE_DATA': str(profile),
'ENTITY_DATA': str(profile / 'entity'), 'LANG': 'en_US.UTF-8'},
stdout=log, stderr=subprocess.STDOUT)
driver.attach(child, log_path)
try:
yield child
finally:
if child.poll() is None:
child.terminate()
child.wait(timeout=10)
def capture(child, name):
return capture_window(child, work / (name + '.png'))
def resize(child, width, height):
window = subprocess.check_output(['xdotool', 'search', '--onlyvisible', '--pid', str(child.pid)],
text=True, timeout=10).splitlines()[0]
subprocess.run(['xdotool', 'windowsize', window, str(width), str(height)], check=True, timeout=10)
# The previous tree may already be stable while X11's resize
# 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()) != width:
assert time.monotonic() < deadline, 'The host did not accept the new viewport'
time.sleep(0.05)
driver.wait_idle(frames=20)
with application('consent-refresh') as child:
driver.wait(label='Connect', role='button')
driver.wait_idle(frames=20)
assert not state['requests'], 'No node traffic before consent'
capture(child, 'consent')
resize(child, 360, 740)
capture(child, 'phone-consent')
resize(child, 1000, 820)
driver.press(label='Stay offline', role='button')
driver.wait(label='Shovey', role='button')
driver.wait_idle(frames=20)
assert not state['requests'], 'Offline choice must prevent preview downloads'
driver.press(label='Node connection', 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['y'] >= 88, 'The library must leave room for its connection controls'
with Image.open(capture(child, 'node-library')) as image:
crop = image.crop((card['x'], card['y'], card['x'] + card['width'], card['y'] + card['height']))
assert len(crop.convert('RGB').getcolors(1000000) or []) > 500, 'The preview must paint actual image pixels'
game_hashes = {entry['sha256'] for entry in catalog['children']}
assert not any(any(digest in path for digest in game_hashes) for path in state['requests']), 'No game payload before Download'
state['revision'] = 1
driver.press(label='Refresh library', role='button')
driver.wait(label='Choano', role='button', timeout=60)
driver.wait(label='Apfelwurm Editor', role='button')
driver.wait_idle(frames=20)
capture(child, 'refreshed-library')
resize(child, 360, 740)
capture(child, 'phone-library')
resize(child, 1000, 820)
assert save.read_bytes() == b'prior saved game'
driver.press(label='Node connection', role='button')
driver.wait(label='Stay offline', role='button')
driver.press(label='Stay offline', role='button')
driver.wait(label='Choano', role='button')
driver.wait_idle(frames=10)
count = len(state['requests'])
driver.wait_idle(frames=40)
assert len(state['requests']) == count, 'Revocation must stop node traffic'
with application('cached-offline'):
driver.wait(label='Choano', role='button', timeout=60)
driver.wait(label='Apfelwurm Editor', role='button')
driver.wait_idle(frames=40)
assert len(state['requests']) == count, 'Saved offline choice and signed catalog must survive restart'
assert save.read_bytes() == b'prior saved game'
finally:
server.shutdown()
server.server_close()
thread.join()
print('Arcade node consent, signed membership refresh, preview rendering, game download consent and offline restart passed')
if __name__ == '__main__':
main()
+7
View File
@@ -240,6 +240,13 @@ try {
};
const libraryFetched = async () => evaluate(`performance.getEntriesByType('resource').map(entry => entry.name)
.filter(name => /\\/library\\//.test(new URL(name).pathname) || name.includes(${JSON.stringify(library?.art || '-')}))`);
// This private page chooses the public node connection explicitly. A
// returning visit reuses its saved origin-specific answer.
const initial = await waitButton(['Connect', 'Allow', 'Shovey']);
if (initial.label === 'Connect') await click(initial);
const permission = initial.label === 'Connect' ? await waitButton(['Allow', 'Shovey']) : initial;
if (permission.label === 'Allow') await click(permission);
await waitButton('Shovey');
if (library) {
// The first visit draws every cover from the small copies alone.
const colours = await coversDrawn();
+33 -7
View File
@@ -1,17 +1,39 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")"
python3 - <<'PY'
python3 - "$@" <<'PY'
from pathlib import Path
import re
import json
import sys
sys.path.insert(0, 'scripts')
from game_packages import declared_apps
version = re.search(r'^## (\d+\.\d+\.\d+)\s*$', Path('CHANGELOG.md').read_text(), re.M)
if version is None:
raise SystemExit('CHANGELOG.md needs a numeric release entry')
Path('VERSION').write_text(version[1] + '\n')
if sys.argv[1:] not in ([], ['--catalog']):
raise SystemExit('Usage: update_version.sh [--catalog]')
catalog_only = sys.argv[1:] == ['--catalog']
def release(path):
entry = re.search(r'^## (\d+\.\d+\.\d+)\s*$', path.read_text(), re.M)
if entry is None:
raise SystemExit(f'{path} needs a numeric release entry')
return entry[1]
catalog_version = release(Path('catalog/CHANGELOG.md'))
host_version = None if catalog_only else release(Path('CHANGELOG.md'))
host_code = None
host_code_path = Path('packaging/android/version-code')
if not catalog_only:
host_code = int(host_code_path.read_text().strip())
if not 0 < host_code <= 2100000000:
raise SystemExit('Invalid native Android versionCode')
previous = Path('VERSION').read_text().strip()
if previous != host_version:
if tuple(map(int, host_version.split('.'))) <= tuple(map(int, previous.split('.'))):
raise SystemExit('Native host version must increase')
host_code += 1
if host_code > 2100000000:
raise SystemExit('Native Android versionCode is exhausted')
# Validate all versions before writing either version source or the ledger.
ledger_path = Path('apps/versions.json')
if ledger_path.exists():
ledger = json.loads(ledger_path.read_text())
@@ -30,9 +52,9 @@ if ledger_path.exists():
ledger['node_apps'][game['name']] = dict(
id=game['id'], title=game['title'], version=entry[1], sequence=1, host_api=game['host_api'])
for name, component in ledger['node_apps'].items():
# Arcade itself is released at the version of the root changelog.
# The signed catalog has its own release history, independent of the host.
if name == 'arcade':
current = version[1]
current = catalog_version
else:
entry = re.search(r'^## \[(\d+\.\d+\.\d+)\] - \d{4}-\d{2}-\d{2}$',
changelogs[name].read_text(), re.M)
@@ -47,4 +69,8 @@ if ledger_path.exists():
component['version'] = current
component['sequence'] += 1
ledger_path.write_text(json.dumps(ledger, indent=2) + '\n')
Path('catalog/VERSION').write_text(catalog_version + '\n')
if not catalog_only:
Path('VERSION').write_text(host_version + '\n')
host_code_path.write_text(str(host_code) + '\n')
PY
+202 -121
View File
@@ -2,13 +2,13 @@
"format": 1,
"packages": [
{
"commit": "b31299434c785d0f2bd82f36b5bfd2fd36ba1216",
"commit": "907e90ddd4c78f02e0d49e90384e4197f7dcdf26",
"dependencies": {},
"id": "p09fa77e94b0dfc6c",
"name": "rini",
"ref": "main",
"id": "p002f6ed23e3a3576",
"name": "monocypher",
"ref": "master",
"source": true,
"url": "https://github.com/raysan5/rini.git"
"url": "https://github.com/LoupVaillant/Monocypher.git"
},
{
"commit": "2944b2e668e735438d8ce24e47a39be3f5c36af5",
@@ -20,25 +20,16 @@
},
{
"commit": "d74348c2e288ac55740461f7e106cda365b4db4a",
"dependencies": {"apps": "p9928fc15e7b93288", "crypto": "pc23fbf455e97614d", "curl": "p1ca0e8d3c19dbe4c", "daochi_client": "p89503086b39ba0fb", "entity": "p18beca948f69fa8d", "game2d": "pf2f54c7603f6e861", "kryon": "pe5e9983467e15f53", "kss": "p1b13dda539ed2a39", "liboqs": "pf9af593c157b8edf", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "practices": "p9079dde0fcc11248", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "sqlite": "p1d80baafaa5fa18a"},
"dependencies": {"apps": "pdea1492d0d16298f", "crypto": "pc23fbf455e97614d", "curl": "p8da229d15597ab5c", "daochi_client": "p89503086b39ba0fb", "entity": "p53f5eefa1f190fe5", "game2d": "pf2f54c7603f6e861", "kryon": "p1f27ccd7e2463271", "kss": "p1b13dda539ed2a39", "liboqs": "p60ff905f3a963886", "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"},
"id": "p183b01bccc6424e7",
"name": "Inbe",
"ref": "master",
"url": "https://github.com/waozixyz/inbe.git"
},
{
"commit": "2bcf6678635bd19e130654f7e962a9fc9bf3c0e1",
"dependencies": {"curl": "p1ca0e8d3c19dbe4c", "daochi_client": "p89503086b39ba0fb", "kryon": "pe5e9983467e15f53", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096", "zlib": "p1dff88558141400b"},
"dependency_refs": {"curl": "19b299005fbe2d895f4ad525cfdae62a2220c3ea", "daochi_client": "master", "kryon": "master", "monocypher": "master", "qrcode": "master", "zlib": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf"},
"id": "p18beca948f69fa8d",
"name": "Entity",
"ref": "master",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "1cb9df183089a77c8a16448a556186f30b261a98",
"dependencies": {"kryon": "pe5e9983467e15f53"},
"dependencies": {"kryon": "p1f27ccd7e2463271"},
"dependency_refs": {"kryon": "master"},
"id": "p1b13dda539ed2a39",
"name": "Kss",
@@ -46,27 +37,108 @@
"url": "https://github.com/kryonlabs/kss.git"
},
{
"commit": "da1a7f9b7ed54abaa2ac7c08ecfaaa3b09b842fd",
"dependencies": {"apps": "p9928fc15e7b93288", "curl": "p1ca0e8d3c19dbe4c", "entity": "p18beca948f69fa8d", "kryon": "pe5e9983467e15f53", "mingcute": "pe1027b9d16704793"},
"dependency_refs": {"apps": "master", "curl": "19b299005fbe2d895f4ad525cfdae62a2220c3ea", "entity": "master", "kryon": "master", "mingcute": "master"},
"id": "p1b5832789c5a5053",
"commit": "3152a6e501bcc6ed05e9ec2e8ce1f4eb59cc74a2",
"dependencies": {"libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f"},
"dependency_refs": {"libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e"},
"id": "p1f27ccd7e2463271",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "2fa52f64eb0c29e8351b437176e896b938ece8e8",
"dependencies": {},
"id": "p276ae0189cfc10bc",
"name": "wurm_art",
"ref": "2fa52f64eb0c29e8351b437176e896b938ece8e8",
"source": true,
"url": "https://github.com/waozixyz/wurm.git"
},
{
"commit": "4204ef694f54aff644ac6627e74a9fb9bcc6b643",
"dependencies": {"apps": "pdea1492d0d16298f", "entity": "p53f5eefa1f190fe5", "kryon": "pcd450c600194cee7", "mingcute": "pe1027b9d16704793"},
"dependency_refs": {"apps": "master", "entity": "master", "kryon": "e373b8a7f8821256b86de12dd5ee05a32d373e87", "mingcute": "master"},
"id": "p352b02504698188c",
"name": "Shovey",
"ref": "da1a7f9b7ed54abaa2ac7c08ecfaaa3b09b842fd",
"ref": "4204ef694f54aff644ac6627e74a9fb9bcc6b643",
"url": "https://github.com/waozixyz/shovey.git"
},
{
"commit": "19b299005fbe2d895f4ad525cfdae62a2220c3ea",
"commit": "6a29dfde2742a5081d477bebefcddf3a733383c5",
"dependencies": {"apps": "p9b5024e78127fbee", "entity": "pca086a043cf8d1f9", "game2d": "p9d83dc63fcae6cd0", "kryon": "pfa65f8437b3d3740", "kss": "paedcd9d605ed94a1", "mingcute": "pe1027b9d16704793"},
"dependency_refs": {"apps": "5d1541025b33a4b19c6ec73bea19dc314e0ef5cb", "entity": "b8f959234e41a597bde5c3d8508e9c3052897349", "game2d": "fd4541da5ba2b4da9d0489f20ac463c6e6576253", "kryon": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68", "kss": "7b125ad80a1398bd122f9c8e2017ebdb66b9e141", "mingcute": "master"},
"id": "p36c2bd12ffeea1c8",
"name": "Choano",
"ref": "6a29dfde2742a5081d477bebefcddf3a733383c5",
"url": "https://github.com/waozixyz/choano.git"
},
{
"commit": "1844042d1ca751e62e61df7617dba19c98588339",
"dependencies": {},
"id": "p1ca0e8d3c19dbe4c",
"name": "curl",
"id": "p3b3c785a0e17e605",
"name": "libwebp",
"ref": "1844042d1ca751e62e61df7617dba19c98588339",
"source": true,
"url": "https://github.com/webmproject/libwebp.git"
},
{
"commit": "925ceb810d9b6e3b2fcb3e95adb3dd9c35ecb41f",
"dependencies": {"curl": "p8da229d15597ab5c", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pb9d1c52c45ad3f51", "monocypher": "p002f6ed23e3a3576", "oqs": "p7098ac9cd92f7e5f", "qrcode": "p0dfa70137405b096", "zlib": "p82dbc05081cd4d96"},
"dependency_refs": {"curl": "19b299005fbe2d895f4ad525cfdae62a2220c3ea", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "bd34ddbe3b169f3fdec1a93cea1aba9fc3c62bbf", "monocypher": "master", "oqs": "master", "qrcode": "master", "zlib": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf"},
"id": "p53f5eefa1f190fe5",
"name": "Entity",
"ref": "master",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "619888d404e7d7e441921702c41a5838a8981408",
"dependencies": {},
"id": "p60ff905f3a963886",
"name": "liboqs",
"ref": "main",
"source": true,
"url": "https://github.com/open-quantum-safe/liboqs.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": "p60ff905f3a963886"},
"dependency_refs": {"liboqs": "main"},
"id": "p7098ac9cd92f7e5f",
"name": "Oqs",
"ref": "master",
"url": "https://github.com/ziranlang/oqs.git"
},
{
"commit": "8b81994303400255ddb0ee2da49044dbaef4397f",
"dependencies": {},
"id": "p71f489a3ce887de0",
"name": "practices",
"ref": "master",
"source": true,
"url": "https://github.com/curl/curl.git"
"url": "https://github.com/waozixyz/practices.git"
},
{
"commit": "f39508361f79a10a57643e97b613b34e434b9834",
"dependencies": {"crypto": "pc23fbf455e97614d", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pcd450c600194cee7"},
"dependency_refs": {"crypto": "master", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "e373b8a7f8821256b86de12dd5ee05a32d373e87"},
"id": "p7c0e095f496911cc",
"name": "Apps",
"ref": "f39508361f79a10a57643e97b613b34e434b9834",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "5d1ee888094efc63d1fb25a58af93478b103d441",
"dependencies": {},
"id": "p1d80baafaa5fa18a",
"id": "p810dc0509cd1b75d",
"name": "sqlite",
"ref": "master",
"source": true,
@@ -75,48 +147,12 @@
{
"commit": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf",
"dependencies": {},
"id": "p1dff88558141400b",
"id": "p82dbc05081cd4d96",
"name": "zlib",
"ref": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf",
"source": true,
"url": "https://github.com/madler/zlib.git"
},
{
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"dependencies": {},
"id": "p5a77c9c35110e925",
"name": "raylib",
"ref": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"source": true,
"url": "https://github.com/raysan5/raylib.git"
},
{
"commit": "94095a939e5fa5dee1d4d9af3a9af0e9a1cb630a",
"dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "pe5e9983467e15f53"},
"dependency_refs": {"crypto": "master", "kryon": "master"},
"id": "p6a59d2d6364debd6",
"name": "Apps",
"ref": "94095a939e5fa5dee1d4d9af3a9af0e9a1cb630a",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "22d2ddbdc236796953c905a05a2cebf5ab1b4ff3",
"dependencies": {"liboqs": "pf9af593c157b8edf"},
"dependency_refs": {"liboqs": "main"},
"id": "p7098ac9cd92f7e5f",
"name": "Oqs",
"ref": "master",
"url": "https://github.com/ziranlang/oqs.git"
},
{
"commit": "f5f0a19a5dc6c14a49adb3cd63ea79a60f6ba77b",
"dependencies": {},
"id": "p809b4d31a48625a3",
"name": "monocypher",
"ref": "master",
"source": true,
"url": "https://github.com/LoupVaillant/Monocypher.git"
},
{
"commit": "256fe6ff049d48a25dfe2a8b0db7ad84477fd282",
"dependencies": {"crypto": "pc23fbf455e97614d", "oqs": "p7098ac9cd92f7e5f"},
@@ -127,26 +163,53 @@
"url": "https://github.com/ziranlang/daochi-client.git"
},
{
"commit": "8b81994303400255ddb0ee2da49044dbaef4397f",
"commit": "19b299005fbe2d895f4ad525cfdae62a2220c3ea",
"dependencies": {},
"id": "p9079dde0fcc11248",
"name": "practices",
"id": "p8da229d15597ab5c",
"name": "curl",
"ref": "master",
"source": true,
"url": "https://github.com/waozixyz/practices.git"
"url": "https://github.com/curl/curl.git"
},
{
"commit": "5b67236a8e355e67ce4f8cc0389b9ce3805b874b",
"dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "pe5e9983467e15f53"},
"dependency_refs": {"crypto": "master", "kryon": "master"},
"id": "p9928fc15e7b93288",
"commit": "b31299434c785d0f2bd82f36b5bfd2fd36ba1216",
"dependencies": {},
"id": "p8ea355e8cb04093e",
"name": "rini",
"ref": "main",
"source": true,
"url": "https://github.com/raysan5/rini.git"
},
{
"commit": "908884c669ec05421373f3077d4bf5517af21bcd",
"dependencies": {"curl": "p8da229d15597ab5c", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pcd450c600194cee7", "monocypher": "p002f6ed23e3a3576", "oqs": "p7098ac9cd92f7e5f", "qrcode": "p0dfa70137405b096", "zlib": "p82dbc05081cd4d96"},
"dependency_refs": {"curl": "19b299005fbe2d895f4ad525cfdae62a2220c3ea", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "e373b8a7f8821256b86de12dd5ee05a32d373e87", "monocypher": "master", "oqs": "master", "qrcode": "master", "zlib": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf"},
"id": "p9711cd0a40465e97",
"name": "Entity",
"ref": "908884c669ec05421373f3077d4bf5517af21bcd",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "5d1541025b33a4b19c6ec73bea19dc314e0ef5cb",
"dependencies": {"crypto": "pc23fbf455e97614d", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pfa65f8437b3d3740"},
"dependency_refs": {"crypto": "master", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68"},
"id": "p9b5024e78127fbee",
"name": "Apps",
"ref": "master",
"ref": "5d1541025b33a4b19c6ec73bea19dc314e0ef5cb",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "fd4541da5ba2b4da9d0489f20ac463c6e6576253",
"dependencies": {"kryon": "pfa65f8437b3d3740"},
"dependency_refs": {"kryon": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68"},
"id": "p9d83dc63fcae6cd0",
"name": "Game2D",
"ref": "fd4541da5ba2b4da9d0489f20ac463c6e6576253",
"url": "https://github.com/kryonlabs/game2d.git"
},
{
"commit": "3f888653b6b97010163d824c4cc72476be3214f3",
"dependencies": {"kryon": "pe5e9983467e15f53"},
"dependencies": {"kryon": "p1f27ccd7e2463271"},
"dependency_refs": {"kryon": "master"},
"id": "pab5377a2950368a2",
"name": "plot",
@@ -154,31 +217,22 @@
"url": "https://github.com/kryonlabs/plot.git"
},
{
"commit": "99d9ad777325e9dfc15cd8610056948819dc1f07",
"dependencies": {"apps": "p9928fc15e7b93288", "crypto": "pc23fbf455e97614d", "entity": "p18beca948f69fa8d", "kryon": "pe5e9983467e15f53", "mingcute": "pe1027b9d16704793"},
"dependency_refs": {"apps": "master", "crypto": "master", "entity": "master", "kryon": "master", "mingcute": "master"},
"id": "pb4256918f4b7855d",
"name": "Apfelwurm",
"ref": "99d9ad777325e9dfc15cd8610056948819dc1f07",
"url": "https://github.com/waozixyz/wurm.git"
"commit": "7b125ad80a1398bd122f9c8e2017ebdb66b9e141",
"dependencies": {"kryon": "pfa65f8437b3d3740"},
"dependency_refs": {"kryon": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68"},
"id": "paedcd9d605ed94a1",
"name": "Kss",
"ref": "7b125ad80a1398bd122f9c8e2017ebdb66b9e141",
"url": "https://github.com/kryonlabs/kss.git"
},
{
"commit": "78a79e8bf19d72f6afd1a941bc410b75d08854a3",
"dependencies": {"curl": "p1ca0e8d3c19dbe4c", "daochi_client": "p89503086b39ba0fb", "kryon": "pe5e9983467e15f53", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096", "zlib": "p1dff88558141400b"},
"dependency_refs": {"curl": "19b299005fbe2d895f4ad525cfdae62a2220c3ea", "daochi_client": "master", "kryon": "master", "monocypher": "master", "qrcode": "master", "zlib": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf"},
"id": "pb4bafadac4ab4c11",
"name": "Entity",
"ref": "78a79e8bf19d72f6afd1a941bc410b75d08854a3",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "528618898db605b0f2960759d49871cde2209086",
"dependencies": {"apps": "p9928fc15e7b93288", "entity": "p18beca948f69fa8d", "game2d": "pf2f54c7603f6e861", "kryon": "pe5e9983467e15f53", "mingcute": "pe1027b9d16704793"},
"dependency_refs": {"apps": "master", "entity": "master", "game2d": "master", "kryon": "master", "mingcute": "master"},
"id": "pba7b4d6a4dcf84ae",
"name": "Choano",
"ref": "528618898db605b0f2960759d49871cde2209086",
"url": "https://github.com/waozixyz/choano.git"
"commit": "bd34ddbe3b169f3fdec1a93cea1aba9fc3c62bbf",
"dependencies": {"libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f"},
"dependency_refs": {"libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e"},
"id": "pb9d1c52c45ad3f51",
"name": "kryon",
"ref": "bd34ddbe3b169f3fdec1a93cea1aba9fc3c62bbf",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "944826f70779a6b6cd53f6b06a75b36f4d8a2558",
@@ -188,6 +242,42 @@
"ref": "master",
"url": "https://github.com/ziranlang/crypto.git"
},
{
"commit": "b8f959234e41a597bde5c3d8508e9c3052897349",
"dependencies": {"curl": "p8da229d15597ab5c", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pfa65f8437b3d3740", "monocypher": "p002f6ed23e3a3576", "qrcode": "p0dfa70137405b096", "zlib": "p82dbc05081cd4d96"},
"dependency_refs": {"curl": "19b299005fbe2d895f4ad525cfdae62a2220c3ea", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68", "monocypher": "master", "qrcode": "master", "zlib": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf"},
"id": "pca086a043cf8d1f9",
"name": "Entity",
"ref": "b8f959234e41a597bde5c3d8508e9c3052897349",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"dependencies": {},
"id": "pcc7aa76725f2fb2f",
"name": "raylib",
"ref": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"source": true,
"url": "https://github.com/raysan5/raylib.git"
},
{
"commit": "e373b8a7f8821256b86de12dd5ee05a32d373e87",
"dependencies": {"raylib": "pcc7aa76725f2fb2f"},
"dependency_refs": {"raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e"},
"id": "pcd450c600194cee7",
"name": "kryon",
"ref": "e373b8a7f8821256b86de12dd5ee05a32d373e87",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "0dd054932180a8e8cda4550af7030b527ee3c285",
"dependencies": {"crypto": "pc23fbf455e97614d", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "pb9d1c52c45ad3f51"},
"dependency_refs": {"crypto": "master", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "bd34ddbe3b169f3fdec1a93cea1aba9fc3c62bbf"},
"id": "pdea1492d0d16298f",
"name": "Apps",
"ref": "master",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "9cc6872f75447c3a24c16764f9829d0f58751cb0",
"dependencies": {},
@@ -196,18 +286,9 @@
"ref": "master",
"url": "https://github.com/kryonlabs/mingcute.git"
},
{
"commit": "ee9d204548295e6c6900939ba1120efe44659e79",
"dependencies": {"raylib": "p5a77c9c35110e925"},
"dependency_refs": {"raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e"},
"id": "pe5e9983467e15f53",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "d32e4b606ece83e8869c954f66c334f44f7b4838",
"dependencies": {"kryon": "pe5e9983467e15f53"},
"dependencies": {"kryon": "p1f27ccd7e2463271"},
"dependency_refs": {"kryon": "master"},
"id": "pe878ed78ee9f8300",
"name": "Game2D",
@@ -216,16 +297,16 @@
},
{
"commit": "2fa52f64eb0c29e8351b437176e896b938ece8e8",
"dependencies": {},
"dependencies": {"apps": "pdea1492d0d16298f", "crypto": "pc23fbf455e97614d", "entity": "p53f5eefa1f190fe5", "kryon": "p1f27ccd7e2463271", "mingcute": "pe1027b9d16704793"},
"dependency_refs": {"apps": "master", "crypto": "master", "entity": "master", "kryon": "master", "mingcute": "master"},
"id": "pef8c9ab30363ef38",
"name": "wurm_art",
"name": "Apfelwurm",
"ref": "2fa52f64eb0c29e8351b437176e896b938ece8e8",
"source": true,
"url": "https://github.com/waozixyz/wurm.git"
},
{
"commit": "cee04692f3461dcb098833472f071c434980debb",
"dependencies": {"kryon": "pe5e9983467e15f53"},
"dependencies": {"kryon": "p1f27ccd7e2463271"},
"dependency_refs": {"kryon": "master"},
"id": "pf2f54c7603f6e861",
"name": "Game2D",
@@ -233,23 +314,23 @@
"url": "https://github.com/kryonlabs/game2d.git"
},
{
"commit": "e77d81dab791c13bf1c4e5d9a7160c403be9bbe0",
"dependencies": {},
"id": "pf9af593c157b8edf",
"name": "liboqs",
"ref": "main",
"source": true,
"url": "https://github.com/open-quantum-safe/liboqs.git"
"commit": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68",
"dependencies": {"raylib": "pcc7aa76725f2fb2f"},
"dependency_refs": {"raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e"},
"id": "pfa65f8437b3d3740",
"name": "kryon",
"ref": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68",
"url": "https://github.com/kryonlabs/kryon.git"
}
],
"root": {
"dependencies": {"apps": "p6a59d2d6364debd6", "choano": "pba7b4d6a4dcf84ae", "entity": "pb4bafadac4ab4c11", "game2d": "pe878ed78ee9f8300", "inbe": "p183b01bccc6424e7", "kryon": "pe5e9983467e15f53", "mingcute": "pe1027b9d16704793", "shovey": "p1b5832789c5a5053", "wurm": "pb4256918f4b7855d", "wurm_art": "pef8c9ab30363ef38"},
"dependency_refs": {"apps": "94095a939e5fa5dee1d4d9af3a9af0e9a1cb630a", "choano": "528618898db605b0f2960759d49871cde2209086", "entity": "78a79e8bf19d72f6afd1a941bc410b75d08854a3", "game2d": "d32e4b606ece83e8869c954f66c334f44f7b4838", "inbe": "master", "kryon": "master", "mingcute": "master", "shovey": "da1a7f9b7ed54abaa2ac7c08ecfaaa3b09b842fd", "wurm": "99d9ad777325e9dfc15cd8610056948819dc1f07", "wurm_art": "2fa52f64eb0c29e8351b437176e896b938ece8e8"},
"dependencies": {"apps": "p7c0e095f496911cc", "choano": "p36c2bd12ffeea1c8", "daochi_client": "p6af0b5bd9fd0cd31", "entity": "p9711cd0a40465e97", "game2d": "pe878ed78ee9f8300", "inbe": "p183b01bccc6424e7", "kryon": "pcd450c600194cee7", "kss": "p1b13dda539ed2a39", "mingcute": "pe1027b9d16704793", "shovey": "p352b02504698188c", "wurm": "pef8c9ab30363ef38", "wurm_art": "p276ae0189cfc10bc"},
"dependency_refs": {"apps": "f39508361f79a10a57643e97b613b34e434b9834", "choano": "6a29dfde2742a5081d477bebefcddf3a733383c5", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "entity": "908884c669ec05421373f3077d4bf5517af21bcd", "game2d": "d32e4b606ece83e8869c954f66c334f44f7b4838", "inbe": "master", "kryon": "e373b8a7f8821256b86de12dd5ee05a32d373e87", "kss": "1cb9df183089a77c8a16448a556186f30b261a98", "mingcute": "master", "shovey": "4204ef694f54aff644ac6627e74a9fb9bcc6b643", "wurm": "2fa52f64eb0c29e8351b437176e896b938ece8e8", "wurm_art": "2fa52f64eb0c29e8351b437176e896b938ece8e8"},
"name": "Arcade"
},
"toolchain": {
"commit": "3f6234e9a181cdad20fac4fad1d1afb1b8ccf054",
"ref": "3f6234e9a181cdad20fac4fad1d1afb1b8ccf054",
"commit": "c47f927ca316a0494dff4f2389de3333bc8e08b4",
"ref": "c47f927ca316a0494dff4f2389de3333bc8e08b4",
"url": "https://github.com/ziranlang/ziran.git"
}
}
+15 -7
View File
@@ -7,7 +7,7 @@ bridge_modules = ["app"]
[toolchain]
git = "https://github.com/ziranlang/ziran.git"
ref = "3f6234e9a181cdad20fac4fad1d1afb1b8ccf054"
ref = "c47f927ca316a0494dff4f2389de3333bc8e08b4"
[install]
bin = "arcade"
@@ -29,17 +29,17 @@ abis = "arm64-v8a,x86_64"
[dependencies.kryon]
git = "https://github.com/kryonlabs/kryon.git"
ref = "master"
ref = "e373b8a7f8821256b86de12dd5ee05a32d373e87"
[dependencies.apps]
git = "https://github.com/waozixyz/apps.git"
# Use the shared controller reviewed with the supported collection host.
ref = "94095a939e5fa5dee1d4d9af3a9af0e9a1cb630a"
ref = "f39508361f79a10a57643e97b613b34e434b9834"
# Shovey's editions and editor are available as separate downloads.
[dependencies.shovey]
git = "https://github.com/waozixyz/shovey.git"
ref = "da1a7f9b7ed54abaa2ac7c08ecfaaa3b09b842fd"
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 = "78a79e8bf19d72f6afd1a941bc410b75d08854a3"
ref = "908884c669ec05421373f3077d4bf5517af21bcd"
[dependencies.mingcute]
git = "https://github.com/kryonlabs/mingcute.git"
@@ -56,7 +56,7 @@ ref = "master"
[dependencies.wurm]
git = "https://github.com/waozixyz/wurm.git"
ref = "99d9ad777325e9dfc15cd8610056948819dc1f07"
ref = "2fa52f64eb0c29e8351b437176e896b938ece8e8"
[dependencies.game2d]
git = "https://github.com/kryonlabs/game2d.git"
@@ -64,10 +64,18 @@ ref = "d32e4b606ece83e8869c954f66c334f44f7b4838"
[dependencies.choano]
git = "https://github.com/waozixyz/choano.git"
ref = "528618898db605b0f2960759d49871cde2209086"
ref = "6a29dfde2742a5081d477bebefcddf3a733383c5"
# Library art can advance independently of the tested game payload.
[dependencies.wurm_art]
git = "https://github.com/waozixyz/wurm.git"
ref = "2fa52f64eb0c29e8351b437176e896b938ece8e8"
source = true
[dependencies.daochi_client]
git = "https://github.com/ziranlang/daochi-client.git"
ref = "970d5e44b1702158cb16469892da6ff50f142427"
[dependencies.kss]
git = "https://github.com/kryonlabs/kss.git"
ref = "1cb9df183089a77c8a16448a556186f30b261a98"