Skip to content

Releases

0.5.0

Choose a tag to compare

@dmccoystephenson dmccoystephenson released this 20 Nov 08:30
2bb6938

0.5.0

Upgrading from v0.4.2 needs no code or save changes. Existing games keep working, and saves made by v0.4.2 list and load as before. The release adds optional location pictures across the web front-ends and a small "← Arcade" link for games hosted on arcade. It also fixes a path-traversal bug in tak.web.serve: before this fix, a /web/../… URL could read any file under the served root. If you serve a Pyodide build with tak.web.serve, upgrade. A few inputs that used to slip through are now refused: non-finite numbers from promptForNumber, True/False in formatHour, and ids or keys with a trailing newline.

Changes

Pictures

  • BaseUserInterface.setPicture(key, alt) sets a picture that stays on every following screen until it is changed or cleared with None; picture() reads it back. Alt text is required, and keys are limited to [a-z0-9_-] (PICTURE_KEY_PATTERN). The console shows no picture, so a game that calls setPicture still plays as text. (#48, #63)
  • The server-backed web front-end serves pictures/<key>.png at /picture/<key>, with a cache header. The directory can be set with the new picturesDir argument on createUserInterface and WebUserInterface. Each screen carries only {key, alt}. (#48)
  • Under Pyodide, the Worker sends each picture's bytes to the page once, before the first screen that names it. TakBoot.start accepts a picturesDir setting. With an older game-worker.js the game plays on without pictures. (#48)

Arcade

  • On a top-level page on an arcade host, both the Pyodide and console runtimes add an "← Arcade" link back to the game's cabinet in the hall (hall.js, configurable with config.hallUrl). Nothing is loaded or drawn on any other host or inside a frame. (#54)
  • tak.arcade ids and run tags with a trailing newline are now rejected, matching arcade.js. (#61)

Web serving

  • tak.web.serve keeps every /web/ request inside web/, so .. paths now return 404, and HEAD follows the same routes as GET. (#64)
  • The server-backed page ignores a query string, so /?utm_source=… still reaches the game. (#69)
  • The Pyodide bridge ignores stray JSON on the input ring that is not an object. (#61)

Input and formatting

  • promptForNumber returns None for nan, infinity and overflowing input such as 1e999 on every front-end; the shared parsing is exposed as tak.ui.base.parseNumber. (#71)
  • formatHour(True) and formatHour(False) now raise ValueError instead of formatting as 1 AM and 12 AM. (#73)
  • The console header prints its chips on one line separated by |, wrapping only between chips when the terminal is too narrow. (#44)

Saves and progression

  • Only directories named exactly slot_N count as save slots. A zero-padded or non-ASCII-digit name is ignored instead of being listed as a slot it isn't, or crashing the save menu. (#70)
  • delete_save_slot returns False when the filesystem refuses the deletion, instead of raising. Browser storage is still flushed, and the save menu reports the failure. (#69)
  • A schema file that is not valid JSON now raises a json.JSONDecodeError that names the file. (#77)
  • Progression accepts a generator or other one-shot iterable of unlocks without ending up empty. (#75)

Version

v0.4.2 → 0.5.0 — MINOR. Mechanical floor from comparing the package's public surface and save paths: MINOR.
Judgment: The new capabilities (the optional sticky setPicture/picture contract, the /picture/ route and picturesDir, parseNumber, and the "← Arcade" hall link) are all additive. The behaviour changes are bug fixes inside existing contracts, not incompatible ones: promptForNumber refuses nan/infinity, formatHour refuses bools, arcade ids reject a trailing newline, delete_save_slot returns False instead of raising, and the schema JSONDecodeError keeps its type. Saves written by v0.4.2 always use canonical slot_N names, so they list and load unchanged; only a hand-made slot_01-style directory is no longer listed. Nothing a consumer would break on is outside what the mechanical check saw, so the floor of minor stands.

  • minor: public function/method added: tak.ui.base:BaseUserInterface.picture
  • minor: public function/method added: tak.ui.base:BaseUserInterface.setPicture
  • minor: public name added: tak.ui.base:PICTURE_KEY_PATTERN
  • minor: public function/method added: tak.ui.base:parseNumber
  • minor: public function/method added: tak.ui.pyodide:SharedArrayBufferBridge.postPicture
  • minor: public name added: tak.ui.web:DEFAULT_PICTURES_DIR
  • minor: public name added: tak.ui.web:PICTURE_ROUTE
  • minor: public function/method added: tak.ui.web:WebUserInterface.pictureBytes
  • minor: tak.ui.factory:createUserInterface(uiType, currentPrompt, header=…, title=…, tagline=…, tip=…, envPrefix=…, host=…, port=…) → (uiType, currentPrompt, header=…, title=…, tagline=…, tip=…, envPrefix=…, host=…, port=…, picturesDir=…): extended compatibly
  • minor: tak.ui.web:WebUserInterface.init(self, currentPrompt, header=…, title=…, tagline=…, tip=…, envPrefix=…, host=…, port=…, start_server=…, endedScreenTimeoutSeconds=…) → (self, currentPrompt, header=…, title=…, tagline=…, tip=…, envPrefix=…, host=…, port=…, start_server=…, endedScreenTimeoutSeconds=…, picturesDir=…): extended compatibly
  • minor: save path changed: src/tak/saves/manager.py
  • minor: save path changed: src/tak/saves/schema.py

Verification

Verified before publication; this tag points at the exact commit that was verified.

  • tests gate run: the library's own suite at this commit — Python 3.8: 383 passed in 36.87s; Python 3.12: 383 passed in 34.99s (8 assertions passed).
  • save-compatibility gate run: saves written by v0.4.2 and the curated fixture were read by this release twice with every file byte-identical, and a new save was added beside them without touching them (18 assertions passed).
  • consumers gate run: Tidewater (236 passed in 1.15s), Overwinter (199 passed in 1.28s), FishE (1148 passed in 65.24s (0:01:05)) — each one's own test suite, green on its current pin — passed with this release (12 assertions passed).

Install: pip install "tak @ git+https://github.com/Stephenson-Software/tak@v0.5.0". What the checks cover: python-release-gates.


drafted by Claude on behalf of Daniel Stephenson

0.4.2

Choose a tag to compare

@dmccoystephenson dmccoystephenson released this 12 Oct 01:56
0dbf6b4

0.4.2

Upgrading from v0.4.1 needs no changes. This release only reformats the source. The public API, the generated HTML pages and the save format are the same as in v0.4.1.

Changes

Maintenance

  • Reformatted the source and tests with black. Behaviour is unchanged (#34).

Version

v0.4.1 → 0.4.2 — PATCH. Mechanical floor from comparing the package's public surface and save paths: PATCH.
Judgment: PR #34 is the only change since v0.4.1. It reformats code with black: it re-wraps the page() signature and a few long expressions in src/tak/web/console.py, and it re-wraps string concatenations and lists in the tests. The parameter names, order and defaults of page(), its error messages and its HTML output are all unchanged. Save handling is also unchanged. Nothing changes behaviour or the documented interface, so the release stays at the patch floor.

  • no public-surface or save-path difference observed

Verification

Verified before publication; this tag points at the exact commit that was verified.

  • tests gate run: the library's own suite at this commit — Python 3.8: 247 passed in 50.85s; Python 3.12: 247 passed in 49.20s (8 assertions passed).
  • save-compatibility gate run: saves written by v0.4.1 and the curated fixture were read by this release twice with every file byte-identical, and a new save was added beside them without touching them (18 assertions passed).
  • consumers gate run: Tidewater (145 passed in 1.44s), Overwinter (94 passed in 1.47s), FishE (980 passed in 60.36s (0:01:00)) — each one's own test suite, green on its current pin — passed with this release (12 assertions passed).

Install: pip install "tak @ git+https://github.com/Stephenson-Software/tak@v0.4.2". What the checks cover: python-release-gates.


drafted by Claude on behalf of Daniel Stephenson

0.4.1

Choose a tag to compare

@dmccoystephenson dmccoystephenson released this 09 Oct 01:13
68b062b

0.4.1

Upgrading from v0.4.0 changes nothing for your project. The library's runtime behaviour, public API, browser assets and save format are the same as in v0.4.0, so you can move your pin without changing any code or saves.

Changes

  • Web asset packaging: New tests check that every browser asset (console.js, console.css, console-worker.js, saves.js, arcade.js and cloud.js as well as client.js, client.css, boot.js and game-worker.js) is listed as required, served under /tak/ with the cross-origin isolation headers, and included in the Pyodide bundle. A missing asset in a future release will now fail the test suite. (No pull request number was recorded for this change.)

Version

v0.4.0 → 0.4.1 — PATCH. Mechanical floor from comparing the package's public surface and save paths: PATCH.
Judgment: The only source changes since v0.4.0 are in tests/web/test_serve_and_bundle.py and the version strings in pyproject.toml and src/tak/init.py. The new tests check that every browser asset in src/tak/web/assets is listed, served under /tak/ and included in the bundle. Runtime code, the public API and save handling are unchanged. Neither breaking changes nor new capabilities justify going above the patch floor.

  • no public-surface or save-path difference observed

Verification

Verified before publication; this tag points at the exact commit that was verified.

  • tests gate run: the library's own suite at this commit — Python 3.8: 247 passed in 43.61s; Python 3.12: 247 passed in 45.44s (8 assertions passed).
  • save-compatibility gate run: saves written by v0.4.0 and the curated fixture were read by this release twice with every file byte-identical, and a new save was added beside them without touching them (18 assertions passed).
  • consumers gate run: Tidewater (145 passed in 1.43s), Overwinter (69 passed in 1.42s), FishE (965 passed in 60.24s (0:01:00)) — each one's own test suite, green on its current pin — passed with this release (12 assertions passed).

Install: pip install "tak @ git+https://github.com/Stephenson-Software/tak@v0.4.1". What the checks cover: python-release-gates.


drafted by Claude on behalf of Daniel Stephenson

0.4.0

Choose a tag to compare

@dmccoystephenson dmccoystephenson released this 07 Oct 03:46
3c8ccf8

0.4.0

Upgrading from v0.3.0 needs no code changes, and existing saves load unchanged. Browser builds now get a Saves control below the game, where players can download their saves as a file or load them from one. Several save-safety fixes are included, so a session can no longer delete or overwrite saves it didn't write. Games can now report scores and achievements to arcade, and on arcade they can opt in to cloud saves. Small console programs can run in the browser without being rewritten.

Changes

Save safety

  • In browser builds, a sync only writes files and deletes the ones this session saw the game remove. It no longer clears the whole stored save directory, so saves from another tab, or saves this session never loaded, are kept. A sync that can't read every file sends nothing (#22).
  • SaveFileManager.get_next_available_slot() checks the disk and never offers a slot whose directory still holds files, even if list_save_files() doesn't show that slot. If the save directory exists but can't be read, it returns None, not 1. The new SaveFileManager.slot_holds_files(n) exposes the same check (#22).
  • list_save_files() no longer returns an empty list when one slot can't be read. That slot is listed with unreadable metadata, and the other slots still appear (#22).
  • chooseSlot leaves out "Create New Save" when the proposed slot is occupied, instead of refusing it after the player picks it. This fixes a loop introduced in #22, and test stand-ins like MagicMock managers still get the option (#23).
  • If saves can't be read from IndexedDB at startup, the session no longer syncs. Earlier saves stay untouched, and the player sees a notice that this session's progress won't be kept (#18).

Browser saves and cloud backup

  • A Saves control lets players download a game's saves as a file and load them back, in both browser runtimes (#20). Its link colour is now readable on the dark background (#26).
  • Opt-in cloud saves on arcade (cloudSaves: true in the boot config) via /tak/cloud.js. Backups trail local saves and are never newest-wins: a save changed on two devices is kept twice, and a deletion is never pushed to another device (#24).
  • cloud.js accepts a freeName hook, so a game whose save units aren't slot_N can choose where the kept copy of a conflict goes (#25).

Arcade scores and achievements

  • New tak.arcade module with submitScore(board, value, run=None) and unlock(achievementId). Both are fire-and-forget, never raise, and do nothing outside a Pyodide build on arcade, so games can call them unconditionally (#21).

Browser runtime

  • The Pyodide worker brings its own blocking time.sleep. Previously, games died with "SuspendError" at the first wait for input under Safari (#19).
  • New tak.web.console.page() builds a page that runs an unmodified input()/print() program in the browser, keeping the files it writes in IndexedDB. It needs the /tak/console.* assets and must be served with COOP/COEP headers.

Version

v0.3.0 → 0.4.0 — MINOR. Mechanical floor from comparing the package's public surface and save paths: MINOR.
Judgment: Every change adds a capability or makes an existing behaviour safer: tak.arcade, the console runtime page, save download/load, opt-in cloud saves, and stricter rules for what counts as a free save slot. Saves written by v0.3.0 load the same way, and no default changes meaning. The one contract change is small. get_next_available_slot() now skips a slot whose directory still holds files, and it returns None when the save directory can't be read, not only when all slots are full. That is a data-loss fix rather than a break, so I kept the floor. The diffs for saves.js and console.js were cut off. saves.js is loaded on every Pyodide game page, so its behaviour is unverified here.

  • minor: public module added: tak.arcade
  • minor: public name added: tak.arcade:ID_PATTERN
  • minor: public name added: tak.arcade:RUN_PATTERN
  • minor: public function/method added: tak.arcade:submitScore
  • minor: public function/method added: tak.arcade:unlock
  • minor: public function/method added: tak.saves.manager:SaveFileManager.slot_holds_files
  • minor: public module added: tak.web.console
  • minor: public name added: tak.web.console:DEFAULT_BUNDLE_URL
  • minor: public function/method added: tak.web.console:page
  • minor: save path changed: src/tak/saves/manager.py
  • minor: save path changed: src/tak/saves/menu.py

Verification

Verified before publication; this tag points at the exact commit that was verified.

  • tests gate run: the library's own suite at this commit — Python 3.8: 236 passed in 42.80s; Python 3.12: 236 passed in 42.54s (8 assertions passed).
  • save-compatibility gate run: saves written by v0.3.0 and the curated fixture were read by this release twice with every file byte-identical, and a new save was added beside them without touching them (18 assertions passed).
  • consumers gate run: Tidewater (145 passed in 1.73s), Overwinter (67 passed in 1.69s), FishE (965 passed in 60.67s (0:01:00)) — each one's own test suite, green on its current pin — passed with this release (12 assertions passed).

Install: pip install "tak @ git+https://github.com/Stephenson-Software/tak@v0.4.0". What the checks cover: python-release-gates.


drafted by Claude on behalf of Daniel Stephenson

0.3.0

Choose a tag to compare

@dmccoystephenson dmccoystephenson released this 02 Oct 03:33
053552f

0.3.0

Upgrading from v0.2.0 needs no code changes, and existing saves load exactly as before. Two error messages now also say what to do about the error, and bundle builds now warn when an extraFiles entry is missing. The original wording is still at the start of each changed error message, so checks that use startswith or in on it keep working.

Changes

Clearer errors

  • SaveFileManager.get_save_path() called before a slot is selected still raises ValueError starting with "No save slot selected". The message now also names the requested file and tells you to call select_save_slot(n) first or to open the game with tak.saves.chooseSlot() (#8, #11).
  • createUserInterface() with an unsupported type still raises ValueError starting with "Unsupported UI type: ". The message now also lists every accepted tak.ui.UIType member, which helps when a caller passes the enum's value (e.g. "console") or misspells a name (#8).

Web bundles

  • tak.web.bundle.build() still skips extraFiles entries that don't exist. It now prints a warning to stderr for each one, naming the entry and the root directory, so a mistyped path shows up at build time (#12).

Version

v0.2.0 → 0.3.0 — MINOR. Mechanical floor from comparing the package's public surface and save paths: MINOR.
Judgment: None of the changes break consumers. Save paths, slot layout and the format of save files are unchanged. The flagged change in saves/manager.py only rewrites the ValueError text, and the new text still opens with "No save slot selected". The createUserInterface error still opens with "Unsupported UI type: ". Only a caller that compares the whole message for exact equality would notice, and these strings are not a documented contract. bundle.build now writes a stderr warning for each missing extraFiles entry, which is new user-visible behaviour, so the release stays at the minor floor.

  • minor: save path changed: src/tak/saves/manager.py

Verification

Verified before publication; this tag points at the exact commit that was verified.

  • tests gate run: the library's own suite at this commit — Python 3.8: 150 passed in 11.51s; Python 3.12: 150 passed in 11.52s (8 assertions passed).
  • save-compatibility gate run: saves written by v0.2.0 and the curated fixture were read by this release twice with every file byte-identical, and a new save was added beside them without touching them (18 assertions passed).
  • consumers gate run: Tidewater (106 passed in 0.55s), Overwinter (45 passed in 0.74s), FishE (923 passed in 51.49s) — each one's own test suite, green on its current pin — passed with this release (12 assertions passed).

Install: pip install "tak @ git+https://github.com/Stephenson-Software/tak@v0.3.0". What the checks cover: python-release-gates.


drafted by Claude on behalf of Daniel Stephenson