diff --git a/docs/superpowers/contracts/app-icon-todo-implementer-2026-11-17.json b/docs/superpowers/contracts/app-icon-todo-implementer-2026-11-17.json new file mode 100644 index 00000000..ba1dc60b --- /dev/null +++ b/docs/superpowers/contracts/app-icon-todo-implementer-2026-11-17.json @@ -0,0 +1,7 @@ +{ + "title": "Launcher icon for todo_implementer", + "objective": "Register com.kuhy.todo_implementer in the shared icon family with a card-check-play glyph and label TodoImpl, keeping every family invariant (negative space at final scale, label width rule, 100% coverage).", + "acceptance_criteria": ["apps.get_app('todo_implementer') returns glyph card-check-play", "glyph gaps at the final fitted scale >= MIN_NEGATIVE_SPACE", "labels test suite passes for TodoImpl"], + "out_of_scope": ["Other apps' icons", "style.py"], + "verifier": "python3 -m pytest -q python_pkg/app_icons/tests" +} diff --git a/docs/superpowers/evidence/app-icon-todo-implementer-2026-11-17.json b/docs/superpowers/evidence/app-icon-todo-implementer-2026-11-17.json new file mode 100644 index 00000000..8ddb3cb8 --- /dev/null +++ b/docs/superpowers/evidence/app-icon-todo-implementer-2026-11-17.json @@ -0,0 +1,22 @@ +{ + "intent": "Give the todoImplementer native Flutter app (com.kuhy.todo_implementer) a launcher icon from the shared family and a launcher label.", + "scope": ["python_pkg/app_icons: new glyph module, registry entry, label, glyph test", "Non-goal: restyling any other app's icon or style.py"], + "changes": [ + "New glyph card-check-play (_glyph_art_board.py): stroked rounded card, stroked tick, filled play arrow", + "Registry entry todo_implementer -> ~/src/todoImplementer/app, linux=True; label TodoImpl" + ], + "verification": [ + { + "command": "python3 -m pytest -q python_pkg/app_icons/tests --cov=python_pkg/app_icons --cov-branch", + "result": "pass", + "evidence": "130 passed; no app_icons source line missing; row gaps at final scale >= MIN_NEGATIVE_SPACE" + }, + { + "command": "python3 -m python_pkg.app_icons preview --app todo_implementer --app todo --app tutor", + "result": "pass", + "evidence": "full, circle-masked and 48dp rows read as a card with tick and play arrow, distinct from todo's checklist" + } + ], + "risks": ["Another session has uncommitted app_icons edits (game_research) in the main checkout: merging may conflict in glyphs.py/_apps_more.py/labels.py"], + "rollback": ["git revert this commit", "rerun the app_icons tests"] +} diff --git a/docs/superpowers/evidence/wg-firewall-allow-workout-poke-2026-10-09.json b/docs/superpowers/evidence/wg-firewall-allow-workout-poke-2026-10-09.json deleted file mode 100644 index 5ebc9a26..00000000 --- a/docs/superpowers/evidence/wg-firewall-allow-workout-poke-2026-10-09.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "intent": "screen-locker's workout poke (phone POSTs a finished workout to tcp/8773) can reach the PC from the home LAN, persisted across firewall re-applies, without exposing the port on WireGuard.", - "scope": [ - "linux_configuration/features/lib/wg_firewall.sh: ALLOW_WORKOUT_POKE renders 'ip saddr ${LAN_SUBNET} tcp dport 8773 accept'; allow_workout_poke()", - "linux_configuration/features/setup_wireguard_ssh.sh: default, save_config, require_root list, allow-workout-poke dispatch", - "linux_configuration/features/lib/wg_sshd.sh: usage line", - "linux_configuration/features/lib/tests/test_wg_firewall.sh: render + apply-path tests", - "Non-goal: no wg0 rule for 8773; off the LAN the poke fails fast and the normal sync credits the workout" - ], - "changes": [ - "New ALLOW_WORKOUT_POKE flag (default false) persisted in .wireguard_ssh.conf like ALLOW_DOT", - "allow-workout-poke subcommand: export flag, save_config, render, verify-then-apply, install verify units" - ], - "verification": [ - { - "command": "bash linux_configuration/features/lib/tests/test_wg_firewall.sh", - "result": "pass", - "evidence": "18 passed, 0 failed: unset/false render no 8773 rule; true renders exactly one, LAN-only; allow_workout_poke saves the flag as true before applying and the applied ruleset carries the rule" - }, - { - "command": "shell_coverage_jail.sh --subject linux_configuration/features/lib/tests/run_all.sh --min 0 --fail-on-case-error", - "result": "pass", - "evidence": "jailed suite exit 0" - }, - { - "command": "sudo setup_wireguard_ssh.sh allow-workout-poke on the host (run by the user)", - "result": "pass", - "evidence": "nft list ruleset shows ip saddr tcp dport 8773 accept in inet filter input" - }, - { - "command": "pre-commit run --files ", - "result": "pass", - "evidence": "all hooks passed" - } - ], - "risks": [ - "Any LAN host can reach tcp/8773; the poke server authenticates requests itself." - ], - "rollback": [ - "git revert this commit, set ALLOW_WORKOUT_POKE=false in .wireguard_ssh.conf and re-run any allow-* to re-render", - "After rollback: setup_wireguard_ssh.sh verify reports no drift and no 8773 rule" - ] -} diff --git a/python_pkg/app_icons/_apps_more.py b/python_pkg/app_icons/_apps_more.py index d06fbb48..668db053 100644 --- a/python_pkg/app_icons/_apps_more.py +++ b/python_pkg/app_icons/_apps_more.py @@ -23,6 +23,16 @@ MORE_APPS: Final[tuple[AppIcon, ...]] = ( # and home_inventory, whose desktop entries use the hicolor set. linux=True, ), + AppIcon( + key="todo_implementer", + repo=_HOME / "src/todoImplementer/app", + accent="#B8862E", + glyph="card-check-play", + icon_name="todo-implementer", + # Desktop is the Flutter web build in a Chrome --app window, so it + # gets the hicolor set like tutor. + linux=True, + ), AppIcon( key="tunedeck", repo=_HOME / "src/tunedeck", diff --git a/python_pkg/app_icons/_glyph_art_board.py b/python_pkg/app_icons/_glyph_art_board.py new file mode 100644 index 00000000..7ed5d6cf --- /dev/null +++ b/python_pkg/app_icons/_glyph_art_board.py @@ -0,0 +1,26 @@ +"""Fourth batch of SVG path fragments, continued from :mod:`_glyph_art_extra`. + +Split off purely to keep every glyph module under the 250-line cap; which file +a glyph lives in carries no meaning. :mod:`glyphs` imports from all of them. +""" + +from __future__ import annotations + +# A board card with a tick and a play arrow -- todo_implementer, the board that +# runs Claude sessions on todo notes: the card is a task, the play arrow starts +# its run, the tick is the task landing. ``checklist`` (todo) already owns the +# tick-rows idea, so the card outline is what tells the two apart. +# +# Geometry (authoring space; the fit shrinks it, tests measure the final gaps): +# card stroked rounded rect x=208..816, y=272..752, corner r=72. +# tick stroked (345,525)->(410,590)->(515,465), left of centre. +# play filled triangle x=615..712, y=430..610, no stroke. +# Centrelines: card->tick 137px (two half strokes), tick->play 100px and +# play->card 104px (one half stroke each), so every gap stays clear of +# MIN_NEGATIVE_SPACE=36 after the ~0.82 fit. +_CARD_CHECK_PLAY = """\ + + + """ diff --git a/python_pkg/app_icons/glyphs.py b/python_pkg/app_icons/glyphs.py index 9df97513..965b2e6d 100644 --- a/python_pkg/app_icons/glyphs.py +++ b/python_pkg/app_icons/glyphs.py @@ -29,6 +29,7 @@ from python_pkg.app_icons._glyph_art import ( _SHIELD_CUTLERY, _STORAGE_BOX, ) +from python_pkg.app_icons._glyph_art_board import _CARD_CHECK_PLAY from python_pkg.app_icons._glyph_art_extra import ( _CAMERA, _HEADPHONES, @@ -68,6 +69,11 @@ GLYPHS: Final[dict[str, Glyph]] = { glyph.name: glyph for glyph in ( Glyph("cloud-down", "Cloud with a download arrow", _CLOUD_DOWN), + Glyph( + "card-check-play", + "Board card with a tick and a filled play arrow", + _CARD_CHECK_PLAY, + ), Glyph("barbell", "Barbell with plates and collars", _BARBELL), Glyph("clock", "Clock face with hands", _CLOCK), Glyph("punch-card", "Time card with punched holes", _PUNCH_CARD), diff --git a/python_pkg/app_icons/labels.py b/python_pkg/app_icons/labels.py index 38e7bd43..566feb7e 100644 --- a/python_pkg/app_icons/labels.py +++ b/python_pkg/app_icons/labels.py @@ -46,6 +46,7 @@ LABELS: Final[dict[str, str]] = { "book_guard_app": "BookGuard", "daily_limits": "DailyLimit", "tutor": "Tutor", + "todo_implementer": "TodoImpl", "tunedeck": "TuneDeck", "sufler": "Sufler", "macro_cam": "MacroCam", diff --git a/python_pkg/app_icons/tests/test_glyph_card_check_play.py b/python_pkg/app_icons/tests/test_glyph_card_check_play.py new file mode 100644 index 00000000..ef8f94bd --- /dev/null +++ b/python_pkg/app_icons/tests/test_glyph_card_check_play.py @@ -0,0 +1,45 @@ +"""Tests for the todo_implementer glyph (board card, tick, play arrow).""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +import numpy as np +from PIL import Image + +from python_pkg.app_icons import apps, fit, glyphs, labels, render, style + +if TYPE_CHECKING: + from pathlib import Path + + +def _row_gaps(y: int, tmp_path: Path) -> list[int]: + """Transparent runs between inked runs along row ``y`` at the final scale.""" + glyph = glyphs.get_glyph("card-check-play") + placement = fit.placement(glyph, "#FFFFFF") + png = tmp_path / "card.png" + svg = render.build_svg(glyph, "#FFFFFF", with_background=False, offset=placement) + render.rasterise(svg, png, style.CANVAS) + with Image.open(png) as image: + alpha = np.asarray(image.convert("RGBA"))[y, :, 3] + edges = np.flatnonzero(np.diff((alpha > 127).astype(np.int8))) + ends, starts = edges[1::2], edges[2::2] + return [int(start - end) for end, start in zip(ends, starts, strict=False)] + + +def test_todo_implementer_uses_it() -> None: + app = apps.get_app("todo_implementer") + assert app.glyph == "card-check-play" + assert app.linux + assert labels.LABELS["todo_implementer"] == "TodoImpl" + + +def test_negative_space_at_final_scale(tmp_path: Path) -> None: + """Card edge -> tick -> play -> card edge across the middle: none merge.""" + best: list[int] = [] + for y in range(int(style.CENTRE) - 80, int(style.CENTRE) + 81, 8): + gaps = _row_gaps(y, tmp_path) + if len(gaps) == 3: + best = gaps + assert min(gaps) >= style.MIN_NEGATIVE_SPACE, (y, gaps) + assert best, "no row crosses card, tick, play and card"