Run Vega's LCARS clock using the standalone Token TV flake #308

Merged
nimmo merged 10 commits from feat/vega-token-tv-lcars into main 2026-10-10 19:37:22 +01:00
Owner

Vega serves real Codex, Gemini and Opencode Go usage to the physical clock with the approved LCARS face and continuous gauges. The application now comes from the standalone Token TV flake: nimmo/token-tv.nix#2. This MR keeps only the Vega adapter, package installation, pinned input, update-policy classification, fleet wiring check and documentation. The nixos-config addition is reduced from 853 to 191 lines; application patches, assets, packaging and generic service lifecycle are maintained externally.

The native service uses Vega's existing provider logins, binds to Nebula only, backs up /var/lib/token-tv and registers for failure monitoring. Missing clock configuration skips startup; malformed configuration reports a failure, with persistent failures bounded to three starts within five minutes. Stock SmallTV-Ultra is supported alongside SD Pro; existing album files are preserved and original album settings retained. The clock shows at most three provider rows, prioritising Codex, Gemini and Opencode Go before Claude and Grok.

Validation:

  • The standalone flake check and its Forgejo CI pass: https://git.nimmog.uk/nimmo/token-tv.nix/actions/runs/1/jobs/0.
  • The package derivation is exactly unchanged, retaining all 75 package tests. The generic module check includes eight actual generated configuration-guard cases.
  • The fleet nix flake check, permanent token-tv-config gate and full Vega build pass on the refreshed main base. Root inputs are fully classified; Token TV updates cover all four AI-runtime hosts.
  • Generated Vega service settings match the pre-extraction implementation on the same base: exact ExecStart/ExecCondition, provider PATH, HOME, user/group, state permissions, monitoring and restart limits. Only dependency-list ordering differs.

Vega canary evidence: the native service had a successful live canary at d35d9c1. All three providers returned current readings, an automatic refresh completed, and the clock frame matched the render exactly. The user confirmed the physical display and completed persistent activation; their activation helper's no-op follow-up passed. The current package includes later tested provider-error/configuration/restart fixes that have not been live activated. No reboot test is claimed. Extraction does not activate anything or release Vega's rollout hold.

token-tv.nix MR #2 is merged. This input follows that repository's main branch and is locked to 8c60c1801fb4280f2459e35a91889bb711e388af. Automated review 48 of current head 957ac09 is Ready to merge with no blocking, important or advisory findings; review run1184 and CI test run1185 pass. The remaining Attic jobs are intentionally skipped for pull requests. The user authorized merging both changes after checks pass; activation and Vega's rollout hold remain unchanged.

No one-shot setup scripts, real usage snapshots or authentication data are included.

Closes #266. Hardware/recovery follow-up: #267. Milestone: Vega Token TV Clock.

Vega serves real Codex, Gemini and Opencode Go usage to the physical clock with the approved LCARS face and continuous gauges. The application now comes from the standalone Token TV flake: https://git.nimmog.uk/nimmo/token-tv.nix/pulls/2. This MR keeps only the Vega adapter, package installation, pinned input, update-policy classification, fleet wiring check and documentation. The nixos-config addition is reduced from 853 to 191 lines; application patches, assets, packaging and generic service lifecycle are maintained externally. The native service uses Vega's existing provider logins, binds to Nebula only, backs up /var/lib/token-tv and registers for failure monitoring. Missing clock configuration skips startup; malformed configuration reports a failure, with persistent failures bounded to three starts within five minutes. Stock SmallTV-Ultra is supported alongside SD Pro; existing album files are preserved and original album settings retained. The clock shows at most three provider rows, prioritising Codex, Gemini and Opencode Go before Claude and Grok. Validation: - The standalone flake check and its Forgejo CI pass: https://git.nimmog.uk/nimmo/token-tv.nix/actions/runs/1/jobs/0. - The package derivation is exactly unchanged, retaining all 75 package tests. The generic module check includes eight actual generated configuration-guard cases. - The fleet nix flake check, permanent token-tv-config gate and full Vega build pass on the refreshed main base. Root inputs are fully classified; Token TV updates cover all four AI-runtime hosts. - Generated Vega service settings match the pre-extraction implementation on the same base: exact ExecStart/ExecCondition, provider PATH, HOME, user/group, state permissions, monitoring and restart limits. Only dependency-list ordering differs. Vega canary evidence: the native service had a successful live canary at d35d9c1. All three providers returned current readings, an automatic refresh completed, and the clock frame matched the render exactly. The user confirmed the physical display and completed persistent activation; their activation helper's no-op follow-up passed. The current package includes later tested provider-error/configuration/restart fixes that have not been live activated. No reboot test is claimed. Extraction does not activate anything or release Vega's rollout hold. token-tv.nix MR #2 is merged. This input follows that repository's main branch and is locked to 8c60c1801fb4280f2459e35a91889bb711e388af. Automated review 48 of current head 957ac09 is Ready to merge with no blocking, important or advisory findings; review run1184 and CI test run1185 pass. The remaining Attic jobs are intentionally skipped for pull requests. The user authorized merging both changes after checks pass; activation and Vega's rollout hold remain unchanged. No one-shot setup scripts, real usage snapshots or authentication data are included. Closes #266. Hardware/recovery follow-up: #267. Milestone: Vega Token TV Clock.
feat(token-tv): connect SmallTV Ultra with continuous LCARS gauges
Some checks failed
AI pull-request review / review (pull_request) Successful in 5m21s
Build and Push Attic Cache / test (pull_request) Has been cancelled
Build and Push Attic Cache / build (pull_request) Has been cancelled
Build and Push Attic Cache / remediate (pull_request) Has been cancelled
Build and Push Attic Cache / notify-remediation (pull_request) Has been cancelled
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been cancelled
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been cancelled
d35d9c163d
clankbot left a comment

Automated code review

Reviewed commit: d35d9c163dd6a141e8f93e9922f4319594892f8a

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

The Token TV wiring is internally consistent at the Nix level: modules/services/token-tv.nix follows the established Vega/Nebula service pattern (nebula@mesh + sys-subsystem-net-devices-nebula.mesh.device ordering, networking.firewall.interfaces."nebula.mesh".allowedTCPPorts, listenAddress defaulting to config.nixosConfig.nebula.overlayIp, User = primaryUser/Group = "users" as in modules/services/forgejo-runner.nix), it is opt-in and enabled only in hosts/vega/default.nix, the flake package and the ai-runtime home-package entry match, and the ConditionPathExists + ExecCondition pair implements the README's 'missing config or clock address skips startup' behaviour. The two patch files are self-consistent with the README text about device_api = "ultra", the OpenCode Go key lookup, and the Antigravity /usage path. One concrete defect is visible in the supplied patch text (the LCARS renderer's fixed three-colour palette and three-row geometry versus the widened five-provider account list), and one documented repository convention (Vega native services self-registering with the failure monitor) is not followed by the new module.

Blocking findings

None.

Important findings

  • LCARS renderer indexes a three-colour palette and a three-row layout against an unbounded account list (packages/token-tv/local-providers-lcars.patch:284; medium confidence)
    The new token_tv/lcars.py added by this patch does colors = ['#b6bfff', '#ec6c83', '#ffc3af'] and then for i, row in enumerate(overview_rows(snapshot)): y = 34 + i * 65; color = colors[i], with no bound on i. The same patch widens the accepted provider set (if account.get("provider") not in ("claude", "codex", "grok", "agy", "opencode") in sources.py, PROVIDERS = ('claude', 'codex', 'grok', 'agy', 'opencode') in display.py) and adds no account-count limit in the visible part of load_config. The only supplied LCARS test, test_lcars_fits_clock_and_distinguishes_old_and_missing, builds a snapshot with a single account (snapshot(100, [('codex_a', ...)])). Vega's service is configured with display_style = 'lcars' (the patched cli.py defaults and the README both select LCARS) and Restart = "on-failure".
    Impact: A fourth account in ~/.config/token-tv/config.json makes colors[i] raise IndexError inside render_lcars, so the Vega service crashes and restarts every 10 seconds instead of publishing a frame; the row geometry (y = 34 + i * 65, boxes to y + 61) also leaves the 240px face from the fourth row onward. This is a silent runtime failure on the host rather than a configuration error caught at eval or build time (doCheck only exercises one account).
    Suggested fix: Bound the rendering: index the palette modulo its length (or derive a per-provider colour from PROVIDER_INK/themes.py) and cap or paginate the rows drawn so the layout stays inside the 240px face; alternatively reject more than three accounts in load_config so the limit is explicit, and add a multi-account case to the LCARS test.

Suggestions

  • New native Vega service does not self-register with the service failure monitor (modules/services/token-tv.nix:57; medium confidence)
    hosts/vega/default.nix documents the repository convention: "Most native services register themselves from within their own modules via services.serviceFailureMonitor.services ... Only services that do not self-register are listed here", and its explicit list (paseo, forgejo-mcp, docker-paseo-relay, docker-paseo-webui, atticd, forgejo-runner-vega) does not contain token-tv. Comparable Vega service modules do self-register, e.g. modules/services/kiwifs.nix:196, modules/services/navidrome-mcp.nix:124, modules/services/sabnzbd.nix:280. The new modules/services/token-tv.nix contains no services.serviceFailureMonitor.services entry.
    Impact: A genuine start-up failure of token-tv.service (for example the LCARS render error above, or an auth-expired provider raising after device_url is set) would be visible only in journalctl, not through the ntfy alerting that every other watched Vega native service gets.
    Suggested fix: If intended, add services.serviceFailureMonitor.services = lib.mkAfter [ "token-tv" ]; to the module (mirroring kiwifs.nix/navidrome-mcp.nix, ideally gated by a monitorFailures option) so the service follows the documented per-module registration convention; otherwise state deliberately why the clock dashboard is excluded.

Tests and validation

  • No configured deterministic checks.

Questions

  • The patch adds a module-level from token_tv.lcars import render_lcars to themes.py while lcars.py does a top-level from token_tv.display import overview_rows, account_label, and tests/test_local_support.py imports token_tv.display first. Can you confirm token_tv.display does not import token_tv.themes at module level in the pinned upstream source (not present in this checkout)? Otherwise that import order would hit a partially initialised module.
  • Is more than three accounts intended to be renderable? The README and the LCARS palette both describe exactly three providers (Codex, Gemini, OpenCode Go), while the patched provider lists still accept claude and grok.
  • Should token-tv.service be added to the failure-monitor list, or is it intentionally excluded because it is expected to be inert until device_url is configured?

Review limitations

  • The upstream token_tv sources are fetched by fetchFromGitHub at rev afc60163... and are not present in the checkout, so overview_rows, reading, face, exe, FILES, PhotoDisplay.request and the module-level import graph of display.py could not be inspected; findings about them rely only on the supplied patch text.
  • No Nix evaluation, build, package test, or command execution was performed; flake-check, the doCheck unittest run, and activation results are asserted only by the diff and README text, not observed here.
  • No access to the live Vega host, the physical SmallTV clock, Forgejo CI results, or issues #266/#267; the change's runtime behaviour on the clock and the pending CI status could not be verified.
  • The two binary assets (packages/token-tv/assets/agy-pixel.png, packages/token-tv/assets/opencode-pixel.png) appear in the diff only as binary placeholders, so their content and their correspondence to the new web_assets.py entries could not be verified.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • modules/profiles/ai-runtime.nix: reviewed — included in a context-limited batch
  • modules/services/token-tv.nix: reviewed — included in a context-limited batch
  • packages/token-tv/assets/agy-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/assets/opencode-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/default.nix: reviewed — included in a context-limited batch
  • packages/token-tv/local-providers-lcars.patch: reviewed — included in a context-limited batch
  • packages/token-tv/smalltv-ultra.patch: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 3
  • Previous automated review: none found
  • Findings: 2
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `d35d9c163dd6a141e8f93e9922f4319594892f8a` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment The Token TV wiring is internally consistent at the Nix level: `modules/services/token-tv.nix` follows the established Vega/Nebula service pattern (`nebula@mesh` + `sys-subsystem-net-devices-nebula.mesh.device` ordering, `networking.firewall.interfaces."nebula.mesh".allowedTCPPorts`, `listenAddress` defaulting to `config.nixosConfig.nebula.overlayIp`, `User = primaryUser`/`Group = "users"` as in `modules/services/forgejo-runner.nix`), it is opt-in and enabled only in `hosts/vega/default.nix`, the flake package and the `ai-runtime` home-package entry match, and the `ConditionPathExists` + `ExecCondition` pair implements the README's 'missing config or clock address skips startup' behaviour. The two patch files are self-consistent with the README text about `device_api = "ultra"`, the OpenCode Go key lookup, and the Antigravity `/usage` path. One concrete defect is visible in the supplied patch text (the LCARS renderer's fixed three-colour palette and three-row geometry versus the widened five-provider account list), and one documented repository convention (Vega native services self-registering with the failure monitor) is not followed by the new module. ### Blocking findings None. ### Important findings - **LCARS renderer indexes a three-colour palette and a three-row layout against an unbounded account list** (packages/token-tv/local-providers-lcars.patch:284; medium confidence) The new `token_tv/lcars.py` added by this patch does `colors = ['#b6bfff', '#ec6c83', '#ffc3af']` and then `for i, row in enumerate(overview_rows(snapshot)): y = 34 + i * 65; color = colors[i]`, with no bound on `i`. The same patch widens the accepted provider set (`if account.get("provider") not in ("claude", "codex", "grok", "agy", "opencode")` in `sources.py`, `PROVIDERS = ('claude', 'codex', 'grok', 'agy', 'opencode')` in `display.py`) and adds no account-count limit in the visible part of `load_config`. The only supplied LCARS test, `test_lcars_fits_clock_and_distinguishes_old_and_missing`, builds a snapshot with a single account (`snapshot(100, [('codex_a', ...)])`). Vega's service is configured with `display_style = 'lcars'` (the patched `cli.py` defaults and the README both select LCARS) and `Restart = "on-failure"`. Impact: A fourth account in `~/.config/token-tv/config.json` makes `colors[i]` raise IndexError inside `render_lcars`, so the Vega service crashes and restarts every 10 seconds instead of publishing a frame; the row geometry (`y = 34 + i * 65`, boxes to `y + 61`) also leaves the 240px face from the fourth row onward. This is a silent runtime failure on the host rather than a configuration error caught at eval or build time (`doCheck` only exercises one account). Suggested fix: Bound the rendering: index the palette modulo its length (or derive a per-provider colour from `PROVIDER_INK`/`themes.py`) and cap or paginate the rows drawn so the layout stays inside the 240px face; alternatively reject more than three accounts in `load_config` so the limit is explicit, and add a multi-account case to the LCARS test. ### Suggestions - **New native Vega service does not self-register with the service failure monitor** (modules/services/token-tv.nix:57; medium confidence) `hosts/vega/default.nix` documents the repository convention: "Most native services register themselves from within their own modules via services.serviceFailureMonitor.services ... Only services that do not self-register are listed here", and its explicit list (`paseo`, `forgejo-mcp`, `docker-paseo-relay`, `docker-paseo-webui`, `atticd`, `forgejo-runner-vega`) does not contain `token-tv`. Comparable Vega service modules do self-register, e.g. `modules/services/kiwifs.nix:196`, `modules/services/navidrome-mcp.nix:124`, `modules/services/sabnzbd.nix:280`. The new `modules/services/token-tv.nix` contains no `services.serviceFailureMonitor.services` entry. Impact: A genuine start-up failure of `token-tv.service` (for example the LCARS render error above, or an auth-expired provider raising after `device_url` is set) would be visible only in journalctl, not through the ntfy alerting that every other watched Vega native service gets. Suggested fix: If intended, add `services.serviceFailureMonitor.services = lib.mkAfter [ "token-tv" ];` to the module (mirroring `kiwifs.nix`/`navidrome-mcp.nix`, ideally gated by a `monitorFailures` option) so the service follows the documented per-module registration convention; otherwise state deliberately why the clock dashboard is excluded. ### Tests and validation - No configured deterministic checks. ### Questions - The patch adds a module-level `from token_tv.lcars import render_lcars` to `themes.py` while `lcars.py` does a top-level `from token_tv.display import overview_rows, account_label`, and `tests/test_local_support.py` imports `token_tv.display` first. Can you confirm `token_tv.display` does not import `token_tv.themes` at module level in the pinned upstream source (not present in this checkout)? Otherwise that import order would hit a partially initialised module. - Is more than three accounts intended to be renderable? The README and the LCARS palette both describe exactly three providers (Codex, Gemini, OpenCode Go), while the patched provider lists still accept `claude` and `grok`. - Should `token-tv.service` be added to the failure-monitor list, or is it intentionally excluded because it is expected to be inert until `device_url` is configured? ### Review limitations - The upstream `token_tv` sources are fetched by `fetchFromGitHub` at rev `afc60163...` and are not present in the checkout, so `overview_rows`, `reading`, `face`, `exe`, `FILES`, `PhotoDisplay.request` and the module-level import graph of `display.py` could not be inspected; findings about them rely only on the supplied patch text. - No Nix evaluation, build, package test, or command execution was performed; `flake-check`, the `doCheck` unittest run, and activation results are asserted only by the diff and README text, not observed here. - No access to the live Vega host, the physical SmallTV clock, Forgejo CI results, or issues #266/#267; the change's runtime behaviour on the clock and the pending CI status could not be verified. - The two binary assets (`packages/token-tv/assets/agy-pixel.png`, `packages/token-tv/assets/opencode-pixel.png`) appear in the diff only as binary placeholders, so their content and their correspondence to the new `web_assets.py` entries could not be verified. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `modules/profiles/ai-runtime.nix`: **reviewed** — included in a context-limited batch - `modules/services/token-tv.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/agy-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/opencode-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/default.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/local-providers-lcars.patch`: **reviewed** — included in a context-limited batch - `packages/token-tv/smalltv-ultra.patch`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md - Commits considered: 3 - Previous automated review: none found - Findings: 2 </details>
fix(token-tv): monitor failures and verify multi-provider row limits
Some checks failed
AI pull-request review / review (pull_request) Successful in 7m1s
Build and Push Attic Cache / test (pull_request) Has been cancelled
Build and Push Attic Cache / build (pull_request) Has been cancelled
Build and Push Attic Cache / remediate (pull_request) Has been cancelled
Build and Push Attic Cache / notify-remediation (pull_request) Has been cancelled
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been cancelled
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been cancelled
e2e318998b
Author
Owner

Review follow-up in e2e3189:

  • The row-overflow finding is a false positive against the pinned upstream source. token_tv/display.py:47 defines overview_rows() and returns rows[:3] at line 61, so render_lcars() never receives a fourth row. Added a regression case with all five providers and a second Codex account; it checks the actual overview selection, 240×240 JPEG size/upload limit, and identical rendering to the selected three-account overview. Additional accounts remain in the dashboard snapshot.
  • The missing failure-monitor registration was valid and is fixed. The module now self-registers token-tv with lib.mkAfter, gated by a default-enabled nixosConfig.tokenTv.monitorFailures option. Nix evaluation confirms one registration on Vega.
  • Import order is safe: the pinned display.py has no module-level themes import. render_page() imports RENDERERS inside the function at line 245. The real package builds and imports successfully.

Validation: all 70 package tests pass; nix flake check passes; the complete updated Vega system builds. The LCARS renderer source is byte-for-byte identical to the successful d35d9c1 canary. The canary covered the native running service, live provider readings, scheduled refresh and exact clock image delivery; the new monitoring registration has been build/evaluation-validated and awaits deployment with the reviewed change. No reboot test is claimed.

Review follow-up in e2e3189: - The row-overflow finding is a false positive against the pinned upstream source. `token_tv/display.py:47` defines `overview_rows()` and returns `rows[:3]` at line 61, so `render_lcars()` never receives a fourth row. Added a regression case with all five providers and a second Codex account; it checks the actual overview selection, 240×240 JPEG size/upload limit, and identical rendering to the selected three-account overview. Additional accounts remain in the dashboard snapshot. - The missing failure-monitor registration was valid and is fixed. The module now self-registers `token-tv` with `lib.mkAfter`, gated by a default-enabled `nixosConfig.tokenTv.monitorFailures` option. Nix evaluation confirms one registration on Vega. - Import order is safe: the pinned `display.py` has no module-level `themes` import. `render_page()` imports `RENDERERS` inside the function at line 245. The real package builds and imports successfully. Validation: all 70 package tests pass; nix flake check passes; the complete updated Vega system builds. The LCARS renderer source is byte-for-byte identical to the successful d35d9c1 canary. The canary covered the native running service, live provider readings, scheduled refresh and exact clock image delivery; the new monitoring registration has been build/evaluation-validated and awaits deployment with the reviewed change. No reboot test is claimed.
clankbot left a comment

Automated code review

Reviewed commit: e2e318998b32d8c71b672f1f5dde6ed09e7a6d11

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

Reviewed the Vega Token TV clock MR: the new modules/services/token-tv.nix service module, the locally patched packages/token-tv Python package (rev-pinned upstream plus local-providers-lcars.patch and smalltv-ultra.patch and two PNG assets), the flake package entry, the Vega host enabling the service, README documentation, and the shared modules/profiles/ai-runtime.nix additions. Cross-checked in the checkout: the flake's service-failure-monitor-coverage check (scripts/check-service-failure-monitor.nix) is satisfied because the token-tv unit carries a description and serviceConfig; port 8787 collides with no other declared nebula.mesh port; the networking.firewall.interfaces."nebula.mesh" idiom and the bindsTo/wants/after Nebula device-unit pattern match modules/services/kiwifs.nix; sops.secrets."opencode-go-api-key" is declared in modules/profiles/ai-runtime.nix (owner = primary user, mode 0400), which the patched code reads at /run/secrets/opencode-go-api-key; the device_api key added to sources.py load_config matches the photo_display(...) selection in live.py; and the new tests/test_ultra.py and tests/test_local_support.py expectations are self-consistent with the patch hunks (e.g. i_i=5&autoplay=0 ordering, remaining_fraction 0.71 → 29%). One concrete defect is reported: the unit's path list passes the llm-agents package store roots, not their bin directories, while the patched code resolves provider CLIs by bare-name PATH lookup.

Blocking findings

None.

Important findings

  • Service PATH lists package store roots instead of bin directories, so bare-name provider CLI lookups cannot resolve (modules/services/token-tv.nix:82; medium confidence)
    The unit sets path = [ clients.codex clients.antigravity-cli ]; with clients = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}; NixOS uses these entries verbatim as the service's PATH, so PATH becomes the two package store roots. This repository always resolves those same packages one level down: modules/profiles/ai-agents.nix uses ${codexCli}/bin/codex and ${antigravityCli}/bin/agy, and modules/profiles/ai-runtime.nix uses ${opencodePackage}/bin/opencode. The supplied local-providers-lcars.patch resolves provider CLIs by PATH lookup at runtime: token_tv/cli.py adds return 'yes' if shutil.which('agy') else 'no', token_tv/sources.py adds cmd = exe("agy"); if not shutil.which(cmd): raise SourceError("cli_unavailable") and return "active" if shutil.which(exe("agy")) else None, and token_tv/connect.py adds return [exe("agy")] / return [exe("opencode"), "providers"]. The opencode CLI is not listed in path at all.
    Impact: With PATH set to the store roots (which contain no executables directly), the bare-name shutil.which('agy') availability check returns None, so the Gemini row would be reported as unsupported/cli_unavailable and the OpenCode providers command in connect.py would not resolve when the dashboard runs from the systemd unit — even though the same CLIs work from an interactive shell where the home-manager wrappers are on PATH. The failure is silent in the rendered frame (a missing/unknown row), so the failure monitor would not alert.
    Suggested fix: Expose the executable directories, e.g. path = lib.makeBinPath [ clients.codex clients.antigravity-cli ]; (or explicit ${clients.codex}/bin / ${clients.antigravity-cli}/bin entries), and add the opencode package's bin directory if connect.py's exe("opencode") path is exercised; then re-run the live canary through the service (not an interactive shell) and confirm the Gemini and OpenCode rows are populated.

Suggestions

None.

Tests and validation

  • No configured deterministic checks.

Questions

  • Are exe() and normalize_* in the upstream token_tv sources (not present in this checkout) resolving provider CLIs to absolute paths, or returning bare names resolved through PATH? The answer determines how much of the reported PATH defect surfaces as a missing Gemini row versus a failed subprocess call.
  • Should /var/lib/token-tv (which holds display-original.json, the clock's saved album settings read by live.py's --restore-display path) be added to nixosConfig.backup.dataPaths, as modules/services/kiwifs.nix and modules/services/jellyfin.nix do for state-holding services, or is losing that restore record acceptable given the README's manual-restore wording?

Review limitations

  • The upstream token_tv Python sources are not in the checkout; only the two supplied .patch hunks were reviewed, so the definitions of exe(), overview_rows, reading, window, snapshot, face, PhotoDisplay.request and the pre-existing ASSETS/RENDERERS entries were not inspected. The postPatch copy of the PNG assets into token_tv/assets/ therefore could not be confirmed against an existing upstream assets directory.
  • No Nix evaluation, build, or test deployment was run here; the reported nix flake check, package test suite, canary, and activation results are taken from the MR text as untrusted evidence, and the exact NixOS expansion of systemd.services.<n>.path was not verified against nixpkgs in this environment.
  • Physical-clock behaviour (SmallTV-Ultra firmware responses, /doUpload?dir=/image/, /set semantics, rendered-frame match) cannot be verified from supplied material; only the mocked expectations in tests/test_ultra.py were read.
  • No access to the live Vega host, its systemd state, /var/lib/token-tv, or the user's ~/.config/token-tv/config.json; the device_url/device_api values that drive the Ultra path are not in the repository.
  • The binary assets packages/token-tv/assets/agy-pixel.png and opencode-pixel.png were not inspected for content or licensing, while packages/token-tv/default.nix declares meta.license = lib.licenses.mit.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • modules/profiles/ai-runtime.nix: reviewed — included in a context-limited batch
  • modules/services/token-tv.nix: reviewed — included in a context-limited batch
  • packages/token-tv/assets/agy-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/assets/opencode-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/default.nix: reviewed — included in a context-limited batch
  • packages/token-tv/local-providers-lcars.patch: reviewed — included in a context-limited batch
  • packages/token-tv/smalltv-ultra.patch: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 4
  • Previous automated review: none found
  • Findings: 1
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `e2e318998b32d8c71b672f1f5dde6ed09e7a6d11` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment Reviewed the Vega Token TV clock MR: the new `modules/services/token-tv.nix` service module, the locally patched `packages/token-tv` Python package (rev-pinned upstream plus `local-providers-lcars.patch` and `smalltv-ultra.patch` and two PNG assets), the flake package entry, the Vega host enabling the service, README documentation, and the shared `modules/profiles/ai-runtime.nix` additions. Cross-checked in the checkout: the flake's `service-failure-monitor-coverage` check (`scripts/check-service-failure-monitor.nix`) is satisfied because the `token-tv` unit carries a `description` and `serviceConfig`; port 8787 collides with no other declared `nebula.mesh` port; the `networking.firewall.interfaces."nebula.mesh"` idiom and the `bindsTo`/`wants`/`after` Nebula device-unit pattern match `modules/services/kiwifs.nix`; `sops.secrets."opencode-go-api-key"` is declared in `modules/profiles/ai-runtime.nix` (owner = primary user, mode 0400), which the patched code reads at `/run/secrets/opencode-go-api-key`; the `device_api` key added to `sources.py load_config` matches the `photo_display(...)` selection in `live.py`; and the new `tests/test_ultra.py` and `tests/test_local_support.py` expectations are self-consistent with the patch hunks (e.g. `i_i=5&autoplay=0` ordering, `remaining_fraction` 0.71 → 29%). One concrete defect is reported: the unit's `path` list passes the llm-agents package store roots, not their `bin` directories, while the patched code resolves provider CLIs by bare-name PATH lookup. ### Blocking findings None. ### Important findings - **Service PATH lists package store roots instead of bin directories, so bare-name provider CLI lookups cannot resolve** (modules/services/token-tv.nix:82; medium confidence) The unit sets `path = [ clients.codex clients.antigravity-cli ];` with `clients = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}`; NixOS uses these entries verbatim as the service's PATH, so PATH becomes the two package store roots. This repository always resolves those same packages one level down: `modules/profiles/ai-agents.nix` uses `${codexCli}/bin/codex` and `${antigravityCli}/bin/agy`, and `modules/profiles/ai-runtime.nix` uses `${opencodePackage}/bin/opencode`. The supplied `local-providers-lcars.patch` resolves provider CLIs by PATH lookup at runtime: `token_tv/cli.py` adds `return 'yes' if shutil.which('agy') else 'no'`, `token_tv/sources.py` adds `cmd = exe("agy"); if not shutil.which(cmd): raise SourceError("cli_unavailable")` and `return "active" if shutil.which(exe("agy")) else None`, and `token_tv/connect.py` adds `return [exe("agy")]` / `return [exe("opencode"), "providers"]`. The `opencode` CLI is not listed in `path` at all. Impact: With `PATH` set to the store roots (which contain no executables directly), the bare-name `shutil.which('agy')` availability check returns None, so the Gemini row would be reported as unsupported/`cli_unavailable` and the OpenCode `providers` command in `connect.py` would not resolve when the dashboard runs from the systemd unit — even though the same CLIs work from an interactive shell where the home-manager wrappers are on PATH. The failure is silent in the rendered frame (a missing/unknown row), so the failure monitor would not alert. Suggested fix: Expose the executable directories, e.g. `path = lib.makeBinPath [ clients.codex clients.antigravity-cli ];` (or explicit `${clients.codex}/bin` / `${clients.antigravity-cli}/bin` entries), and add the `opencode` package's bin directory if `connect.py`'s `exe("opencode")` path is exercised; then re-run the live canary through the service (not an interactive shell) and confirm the Gemini and OpenCode rows are populated. ### Suggestions None. ### Tests and validation - No configured deterministic checks. ### Questions - Are `exe()` and `normalize_*` in the upstream `token_tv` sources (not present in this checkout) resolving provider CLIs to absolute paths, or returning bare names resolved through `PATH`? The answer determines how much of the reported PATH defect surfaces as a missing Gemini row versus a failed subprocess call. - Should `/var/lib/token-tv` (which holds `display-original.json`, the clock's saved album settings read by `live.py`'s `--restore-display` path) be added to `nixosConfig.backup.dataPaths`, as `modules/services/kiwifs.nix` and `modules/services/jellyfin.nix` do for state-holding services, or is losing that restore record acceptable given the README's manual-restore wording? ### Review limitations - The upstream `token_tv` Python sources are not in the checkout; only the two supplied `.patch` hunks were reviewed, so the definitions of `exe()`, `overview_rows`, `reading`, `window`, `snapshot`, `face`, `PhotoDisplay.request` and the pre-existing `ASSETS`/`RENDERERS` entries were not inspected. The `postPatch` copy of the PNG assets into `token_tv/assets/` therefore could not be confirmed against an existing upstream `assets` directory. - No Nix evaluation, build, or test deployment was run here; the reported `nix flake check`, package test suite, canary, and activation results are taken from the MR text as untrusted evidence, and the exact NixOS expansion of `systemd.services.<n>.path` was not verified against nixpkgs in this environment. - Physical-clock behaviour (SmallTV-Ultra firmware responses, `/doUpload?dir=/image/`, `/set` semantics, rendered-frame match) cannot be verified from supplied material; only the mocked expectations in `tests/test_ultra.py` were read. - No access to the live Vega host, its systemd state, `/var/lib/token-tv`, or the user's `~/.config/token-tv/config.json`; the `device_url`/`device_api` values that drive the Ultra path are not in the repository. - The binary assets `packages/token-tv/assets/agy-pixel.png` and `opencode-pixel.png` were not inspected for content or licensing, while `packages/token-tv/default.nix` declares `meta.license = lib.licenses.mit`. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `modules/profiles/ai-runtime.nix`: **reviewed** — included in a context-limited batch - `modules/services/token-tv.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/agy-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/opencode-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/default.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/local-providers-lcars.patch`: **reviewed** — included in a context-limited batch - `packages/token-tv/smalltv-ultra.patch`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md - Commits considered: 4 - Previous automated review: none found - Findings: 1 </details>
fix(token-tv): include saved clock settings in service backups
Some checks failed
Build and Push Attic Cache / pin-lifecycle (pull_request) Blocked by required conditions
AI pull-request review / review (pull_request) Successful in 6m47s
Build and Push Attic Cache / test (pull_request) Has been cancelled
Build and Push Attic Cache / build (pull_request) Has been cancelled
Build and Push Attic Cache / remediate (pull_request) Has been cancelled
Build and Push Attic Cache / notify-remediation (pull_request) Has been cancelled
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been cancelled
17c2d782a4
Author
Owner

Assessment of review 39 and follow-up in 17c2d78:

The PATH finding is a false positive. NixOS's nixos/lib/systemd-lib.nix constructs the service PATH with ${makeBinPath config.path}:${makeSearchPathOutput "bin" "sbin" config.path}; systemd.services.<name>.path takes package entries and is not passed verbatim. The live native canary's systemctl show token-tv.service -p Environment confirms both Codex and Antigravity /bin directories in PATH. Follow-up /snapshot verification through that running native service shows CODEX, Gemini, and Opencode Go all ok, with LCARS delivery ok. Replacing the package list with a string from lib.makeBinPath would misuse this NixOS option.

The pinned upstream exe(name) returns shutil.which(name) or name. Codex and Antigravity therefore correctly resolve using the generated service PATH. opencode_payload() reads the existing credential and performs the usage HTTP request directly; the daemon never calls the interactive connect.py login helper, so OpenCode CLI is not a runtime requirement for the unit. Added explanatory comments beside the service package list.

The question about protecting the original album restore record was appropriate: registered /var/lib/token-tv in nixosConfig.backup.dataPaths, following existing service modules. The README documents the backup integration. Evaluation confirms the state path appears exactly once. Nix flake check and the complete updated Vega system build pass. Python code is unchanged and its previously validated 70 tests still apply. Backup and failure-monitor additions await deployment; the existing canary remains healthy.

Assessment of review 39 and follow-up in 17c2d78: The PATH finding is a false positive. NixOS's `nixos/lib/systemd-lib.nix` constructs the service PATH with `${makeBinPath config.path}:${makeSearchPathOutput "bin" "sbin" config.path}`; `systemd.services.<name>.path` takes package entries and is not passed verbatim. The live native canary's `systemctl show token-tv.service -p Environment` confirms both Codex and Antigravity `/bin` directories in PATH. Follow-up `/snapshot` verification through that running native service shows CODEX, Gemini, and Opencode Go all `ok`, with LCARS delivery `ok`. Replacing the package list with a string from `lib.makeBinPath` would misuse this NixOS option. The pinned upstream `exe(name)` returns `shutil.which(name) or name`. Codex and Antigravity therefore correctly resolve using the generated service PATH. `opencode_payload()` reads the existing credential and performs the usage HTTP request directly; the daemon never calls the interactive `connect.py` login helper, so OpenCode CLI is not a runtime requirement for the unit. Added explanatory comments beside the service package list. The question about protecting the original album restore record was appropriate: registered `/var/lib/token-tv` in `nixosConfig.backup.dataPaths`, following existing service modules. The README documents the backup integration. Evaluation confirms the state path appears exactly once. Nix flake check and the complete updated Vega system build pass. Python code is unchanged and its previously validated 70 tests still apply. Backup and failure-monitor additions await deployment; the existing canary remains healthy.
clankbot left a comment

Automated code review

Reviewed commit: 17c2d782a4c0bbfd7d72977191c7f60b4b84b2a2

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

The Vega Token TV module, the flake package, the two source patches, and the README additions follow the repository's established conventions: the module self-registers in services.serviceFailureMonitor (so hosts/vega/default.nix correctly adds only enable and no duplicate monitor entry), the nebula@mesh.service / sys-subsystem-net-devices-nebula.mesh.device ordering and networking.firewall.interfaces."nebula.mesh".allowedTCPPorts match modules/services/kiwifs.nix and modules/services/bookstack-mcp.nix, nixosConfig.backup.dataPaths = lib.mkAfter [ ... ] matches the pattern used by ytdl-sub, freshrss and navidrome, config.nixosConfig.nebula.overlayIp is a real option (modules/networking/nebula.nix:103) and vega sets nixosConfig.nebula.enable = true, and /run/secrets/opencode-go-api-key is provisioned by modules/profiles/ai-runtime.nix (owner = primary user, mode 0400), which vega imports through profiles/ai-desktop.nix, so the unit's User = user can read it. scripts/check-service-failure-monitor.nix ownership assertion is satisfied because the unit carries a description and serviceConfig. One evidence-backed defect remains: the ExecCondition guard exits 1 for the documented 'clock address not yet configured' state, which systemd treats as a failed start (only exit 77 skips cleanly), so the default failure monitor alerts and Restart = on-failure re-loops instead of skipping quietly.

Blocking findings

None.

Important findings

  • ExecCondition exits 1 for the unconfigured clock, so token-tv enters the failed state and the default failure monitor alerts instead of skipping (modules/services/token-tv.nix:98; high confidence)
    modules/services/token-tv.nix:97 comments # Exit 1 skips startup without marking the service failed. and line 98 sets ExecCondition = "${clockConfigured} ...", where the generated script (lines 15-20) ends with sys.exit(0 if settings.get("device_url") else 1). The same module registers the unit for alerting by default: services.serviceFailureMonitor.services = lib.mkIf cfg.monitorFailures (lib.mkAfter [ "token-tv" ]) with monitorFailures defaulting to true (line 22), and modules/services/service-failure-monitor.nix:41 turns every watched name into unitConfig.OnFailure = [ "ntfy-service-failure@%n.service" ]. The unit also sets Restart = "on-failure" (line 100). README.md adds the user-facing claim 'A missing config or clock address skips startup, so preparing the service before the clock arrives does not start polling or serving a dashboard.' Per systemd.service(5), a non-zero ExecCondition exit skips the rest of the startup but leaves the unit in the failed state; only the special exit code 77 skips without failure. The unit-level ConditionPathExists = cfg.configFile (line 82) does cover the missing-file case cleanly, so only the device_url-unset case is wrong.
    Impact: In the documented pre-arrival state (config file present, device_url unset), token-tv.service goes to failed rather than a clean skip: the ntfy failure alert fires, Restart = on-failure with RestartSec = 10 re-attempts and re-alerts repeatedly, and systemctl/host health tooling (including the beszel 'failed services' checks referenced in AGENTS.md) reports a permanently failing service on Vega. This contradicts both the in-code comment and the README wording, and the PR evidence states no reboot/live test was performed, so it would first surface on Vega's next boot.
    Suggested fix: Use systemd's documented skip code for the unconfigured case, e.g. end the guard script with sys.exit(0 if settings.get("device_url") else 77) (or exit 77 directly), and correct the comment at line 97 to say exit 77 skips startup without a failed state; keep ConditionPathExists for the missing-file case. Alternatively gate the unit on a marker file so no ExecCondition exit path can fail.

Suggestions

None.

Tests and validation

  • No configured deterministic checks.

Questions

  • Does /var/lib/token-tv exist when backrest first plans a snapshot for Vega? nixosConfig.backup.dataPaths = lib.mkAfter [ "/var/lib/token-tv" ] (line 63) is contributed whenever cfg.enable is set, but the directory is created only by StateDirectory = "token-tv" at unit start, and unitConfig.ConditionPathExists = cfg.configFile (line 82) prevents unit setup while the user config file is absent. If restic is handed a non-existent include path, the first backup run after this change could error or skip silently.
  • The patches call exe("agy") and exe("opencode") (token_tv/connect.py hunk at +24, token_tv/sources.py agy_payload), and the unit's path list (lines 86-89) supplies only clients.codex and clients.antigravity-cli. Is exe a generic resolver rather than a provider-keyed mapping that the patch should have extended, and is the opencode CLI intentionally absent from the service PATH (the comment at line 84 says OpenCode usage uses the HTTP API only)?
  • Is upstream click6067-ship-it/token-tv at rev afc60163d17e76ba71f4a7a5184be6dd4fb6baf8 MIT-licensed? packages/token-tv/default.nix:44 asserts license = lib.licenses.mit, but no upstream licence file is present in the supplied material.

Review limitations

  • The upstream token-tv sources are not in the checked-out tree; only the two patch files were supplied, so unchanged upstream code (window, reading, overview_rows, face, sample.snapshot, exe, PhotoDisplay.request, the pyproject entry point behind lib.getExe package, and web_assets.py's ROOT) could not be inspected, and the patch hunks carry no context lines so their line offsets could not be verified.
  • No Nix tooling was run: nix flake check, the package's doCheck unittest suite (including the new tests/test_local_support.py and tests/test_ultra.py), the Vega build, and any canary/reboot statements are unverified.
  • No live Vega state was available, so the evaluated nixosConfig.nebula.overlayIp (README's 10.10.0.2), the rendered /run/secrets/opencode-go-api-key, the existence of ~/.config/token-tv/config.json, and Vega's systemd version behaviour for ExecCondition exit codes were not observed.
  • The Python rendering geometry in the new token_tv/lcars.py (PIL rounded_rectangle radii derived from very small gauge widths, font condensing in text()) was not executed; only the assertions in the supplied test files were read.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • modules/profiles/ai-runtime.nix: reviewed — included in a context-limited batch
  • modules/services/token-tv.nix: reviewed — included in a context-limited batch
  • packages/token-tv/assets/agy-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/assets/opencode-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/default.nix: reviewed — included in a context-limited batch
  • packages/token-tv/local-providers-lcars.patch: reviewed — included in a context-limited batch
  • packages/token-tv/smalltv-ultra.patch: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 5
  • Previous automated review: none found
  • Findings: 1
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `17c2d782a4c0bbfd7d72977191c7f60b4b84b2a2` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment The Vega Token TV module, the flake package, the two source patches, and the README additions follow the repository's established conventions: the module self-registers in services.serviceFailureMonitor (so hosts/vega/default.nix correctly adds only `enable` and no duplicate monitor entry), the `nebula@mesh.service` / `sys-subsystem-net-devices-nebula.mesh.device` ordering and `networking.firewall.interfaces."nebula.mesh".allowedTCPPorts` match modules/services/kiwifs.nix and modules/services/bookstack-mcp.nix, `nixosConfig.backup.dataPaths = lib.mkAfter [ ... ]` matches the pattern used by ytdl-sub, freshrss and navidrome, `config.nixosConfig.nebula.overlayIp` is a real option (modules/networking/nebula.nix:103) and vega sets `nixosConfig.nebula.enable = true`, and `/run/secrets/opencode-go-api-key` is provisioned by modules/profiles/ai-runtime.nix (owner = primary user, mode 0400), which vega imports through profiles/ai-desktop.nix, so the unit's `User = user` can read it. `scripts/check-service-failure-monitor.nix` ownership assertion is satisfied because the unit carries a description and serviceConfig. One evidence-backed defect remains: the ExecCondition guard exits 1 for the documented 'clock address not yet configured' state, which systemd treats as a failed start (only exit 77 skips cleanly), so the default failure monitor alerts and `Restart = on-failure` re-loops instead of skipping quietly. ### Blocking findings None. ### Important findings - **ExecCondition exits 1 for the unconfigured clock, so token-tv enters the failed state and the default failure monitor alerts instead of skipping** (modules/services/token-tv.nix:98; high confidence) modules/services/token-tv.nix:97 comments `# Exit 1 skips startup without marking the service failed.` and line 98 sets `ExecCondition = "${clockConfigured} ..."`, where the generated script (lines 15-20) ends with `sys.exit(0 if settings.get("device_url") else 1)`. The same module registers the unit for alerting by default: `services.serviceFailureMonitor.services = lib.mkIf cfg.monitorFailures (lib.mkAfter [ "token-tv" ])` with `monitorFailures` defaulting to true (line 22), and modules/services/service-failure-monitor.nix:41 turns every watched name into `unitConfig.OnFailure = [ "ntfy-service-failure@%n.service" ]`. The unit also sets `Restart = "on-failure"` (line 100). README.md adds the user-facing claim 'A missing config or clock address skips startup, so preparing the service before the clock arrives does not start polling or serving a dashboard.' Per systemd.service(5), a non-zero ExecCondition exit skips the rest of the startup but leaves the unit in the failed state; only the special exit code 77 skips without failure. The unit-level `ConditionPathExists = cfg.configFile` (line 82) does cover the missing-file case cleanly, so only the `device_url`-unset case is wrong. Impact: In the documented pre-arrival state (config file present, `device_url` unset), `token-tv.service` goes to failed rather than a clean skip: the ntfy failure alert fires, `Restart = on-failure` with `RestartSec = 10` re-attempts and re-alerts repeatedly, and `systemctl`/host health tooling (including the beszel 'failed services' checks referenced in AGENTS.md) reports a permanently failing service on Vega. This contradicts both the in-code comment and the README wording, and the PR evidence states no reboot/live test was performed, so it would first surface on Vega's next boot. Suggested fix: Use systemd's documented skip code for the unconfigured case, e.g. end the guard script with `sys.exit(0 if settings.get("device_url") else 77)` (or exit 77 directly), and correct the comment at line 97 to say exit 77 skips startup without a failed state; keep `ConditionPathExists` for the missing-file case. Alternatively gate the unit on a marker file so no ExecCondition exit path can fail. ### Suggestions None. ### Tests and validation - No configured deterministic checks. ### Questions - Does `/var/lib/token-tv` exist when backrest first plans a snapshot for Vega? `nixosConfig.backup.dataPaths = lib.mkAfter [ "/var/lib/token-tv" ]` (line 63) is contributed whenever `cfg.enable` is set, but the directory is created only by `StateDirectory = "token-tv"` at unit start, and `unitConfig.ConditionPathExists = cfg.configFile` (line 82) prevents unit setup while the user config file is absent. If restic is handed a non-existent include path, the first backup run after this change could error or skip silently. - The patches call `exe("agy")` and `exe("opencode")` (token_tv/connect.py hunk at +24, token_tv/sources.py `agy_payload`), and the unit's `path` list (lines 86-89) supplies only `clients.codex` and `clients.antigravity-cli`. Is `exe` a generic resolver rather than a provider-keyed mapping that the patch should have extended, and is the opencode CLI intentionally absent from the service PATH (the comment at line 84 says OpenCode usage uses the HTTP API only)? - Is upstream `click6067-ship-it/token-tv` at rev afc60163d17e76ba71f4a7a5184be6dd4fb6baf8 MIT-licensed? packages/token-tv/default.nix:44 asserts `license = lib.licenses.mit`, but no upstream licence file is present in the supplied material. ### Review limitations - The upstream token-tv sources are not in the checked-out tree; only the two patch files were supplied, so unchanged upstream code (`window`, `reading`, `overview_rows`, `face`, `sample.snapshot`, `exe`, `PhotoDisplay.request`, the pyproject entry point behind `lib.getExe package`, and `web_assets.py`'s `ROOT`) could not be inspected, and the patch hunks carry no context lines so their line offsets could not be verified. - No Nix tooling was run: `nix flake check`, the package's `doCheck` unittest suite (including the new tests/test_local_support.py and tests/test_ultra.py), the Vega build, and any canary/reboot statements are unverified. - No live Vega state was available, so the evaluated `nixosConfig.nebula.overlayIp` (README's `10.10.0.2`), the rendered `/run/secrets/opencode-go-api-key`, the existence of `~/.config/token-tv/config.json`, and Vega's systemd version behaviour for ExecCondition exit codes were not observed. - The Python rendering geometry in the new token_tv/lcars.py (PIL `rounded_rectangle` radii derived from very small gauge widths, font condensing in `text()`) was not executed; only the assertions in the supplied test files were read. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `modules/profiles/ai-runtime.nix`: **reviewed** — included in a context-limited batch - `modules/services/token-tv.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/agy-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/opencode-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/default.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/local-providers-lcars.patch`: **reviewed** — included in a context-limited batch - `packages/token-tv/smalltv-ultra.patch`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md - Commits considered: 5 - Previous automated review: none found - Findings: 1 </details>
Ensure Token TV backup state exists before configured startup
All checks were successful
AI pull-request review / review (pull_request) Successful in 6m8s
Build and Push Attic Cache / test (pull_request) Successful in 1m55s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
7a75c78244
Author
Owner

Assessed the review of 17c2d78 against systemd's primary documentation, the installed package, and Vega.

The Important ExecCondition finding is a false positive. systemd.service documents that exit codes 1 through 254 skip subsequent commands without marking the unit failed; 255 or abnormal termination fails it. Exit 77 is not uniquely special for ExecCondition. Source: https://github.com/systemd/systemd/blob/main/man/systemd.service.xml (ExecCondition section). On Vega's systemd 261.3 an isolated temporary user service with ExecCondition=false (exit 1), Restart=on-failure and RestartSec=1 logged “Skipped due to 'exec-condition'”; it was inactive with zero restarts. The temporary unit was unloaded and the production clock service was not altered. The guard remains exit 1, and its comment now specifies the documented range.

The backup-directory question is valid. Commit 7a75c78 adds a tmpfiles directory rule with the same owner/group and 0700 permissions as StateDirectory, so /var/lib/token-tv exists even when missing configuration prevents service startup. Vega evaluation confirms the rule. nix flake check and the full Vega system build pass; existing upstream stdenv deprecation warnings are unrelated to this module.

Other questions: the pinned package's sources.py defines exe(name) generically as shutil.which(name) or name. Its opencode_payload uses json_get against the usage HTTP endpoint; no OpenCode CLI is required in the daemon PATH. The installed distribution includes licenses/LICENSE containing the MIT License and upstream copyright, confirming the package metadata.

This follow-up changes directory setup and comments only. The previously tested renderer/package and 70 package tests are unchanged. The successful d35d9c1 live canary remains running; review follow-ups have not been activated. No merge, hold release, or reboot test was performed.

Assessed the review of 17c2d78 against systemd's primary documentation, the installed package, and Vega. The Important ExecCondition finding is a false positive. systemd.service documents that exit codes 1 through 254 skip subsequent commands without marking the unit failed; 255 or abnormal termination fails it. Exit 77 is not uniquely special for ExecCondition. Source: https://github.com/systemd/systemd/blob/main/man/systemd.service.xml (ExecCondition section). On Vega's systemd 261.3 an isolated temporary user service with ExecCondition=false (exit 1), Restart=on-failure and RestartSec=1 logged “Skipped due to 'exec-condition'”; it was inactive with zero restarts. The temporary unit was unloaded and the production clock service was not altered. The guard remains exit 1, and its comment now specifies the documented range. The backup-directory question is valid. Commit 7a75c78 adds a tmpfiles directory rule with the same owner/group and 0700 permissions as StateDirectory, so /var/lib/token-tv exists even when missing configuration prevents service startup. Vega evaluation confirms the rule. nix flake check and the full Vega system build pass; existing upstream stdenv deprecation warnings are unrelated to this module. Other questions: the pinned package's sources.py defines exe(name) generically as shutil.which(name) or name. Its opencode_payload uses json_get against the usage HTTP endpoint; no OpenCode CLI is required in the daemon PATH. The installed distribution includes licenses/LICENSE containing the MIT License and upstream copyright, confirming the package metadata. This follow-up changes directory setup and comments only. The previously tested renderer/package and 70 package tests are unchanged. The successful d35d9c1 live canary remains running; review follow-ups have not been activated. No merge, hold release, or reboot test was performed.
clankbot left a comment

Automated code review

Reviewed commit: 7a75c782442d4499d20689dde88bb4e24ca84884

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

The Token TV package, Vega service wiring, flake package, and README additions follow the repository's established Nebula-bound native-service pattern (compare modules/services/kiwifs.nix): the bindsTo/after/wants triple on sys-subsystem-net-devices-nebula.mesh.device, networking.firewall.interfaces."nebula.mesh".allowedTCPPorts, the mkAfter backup dataPaths contribution, and self-registration in services.serviceFailureMonitor.services (token-tv is correctly absent from hosts/vega/default.nix:287, whose comment forbids duplicating per-module entries). The unit PATH entries clients.codex and clients.antigravity-cli match attribute names already used in modules/profiles/ai-agents.nix, which exposes bin/codex and bin/agy, matching the CLI names the patched sources look up (shutil.which('agy'), exe('agy')). The /run/secrets/opencode-go-api-key path the patched sources read is created by modules/profiles/ai-runtime.nix:232 with owner = primaryUser and mode 0400, so the service (User = primaryUser) can read it. README port/address claims (10.10.0.2:8787) match the module defaults and nebula.nix:10/26. Two issues remain: an undocumented, byte-identical duplicate claude wrapper added to the shared ai-runtime profile, and a documented-behaviour gap around the three-row clock-face cap that the new regression test asserts. One smaller operational trap in the ExecCondition probe is worth closing.

Blocking findings

None.

Important findings

  • Undocumented duplicate claude command wrapper added to the shared AI-runtime profile (modules/profiles/ai-runtime.nix:40; high confidence)
    The diff adds claudeForUser = pkgs.writeShellScriptBin "claude" ''set -euo pipefail; exec ${claudeCode}/bin/claude "$@"'' (line 40) and appends it to home-manager.users.${user}.home.packages (line 295). Its body is identical to the pre-existing claudeCodeForUser wrapper at line 36. A repository-wide search for claude across *.nix returns only these five lines in this file, and searches for claude in README.md and docs/ return no matches, so no documentation records the alias; pkgs.claude-code is not in any environment.systemPackages list, so claude is a genuinely new user-facing command rather than a shadow of an existing one. Nothing in the Token TV README paragraphs (README.md:174-199) mentions it. ai-runtime is imported by the AI-desktop profile, so this lands on every AI-client host, not only Vega.
    Impact: A new interactive command is installed on all AI-client hosts by a change set whose stated scope is the Token TV clock; it duplicates the existing claude-code entry point, so the two can drift apart in later edits, and the merged history gives no reason for the alias to exist.
    Suggested fix: Land the claude alias separately with its own justification, or state the reason in the commit/README if it is intentional (e.g. an alias users actually type). If both names must stay, build the launcher body once (a single string variable) and pass it to two writeShellScriptBin calls so the aliases cannot diverge.

Suggestions

  • New regression test asserts a three-row clock-face cap that the README paragraph does not record (README.md:174; medium confidence)
    packages/token-tv/local-providers-lcars.patch adds test_lcars_keeps_five_providers_and_multiple_accounts_within_three_rows, which asserts [row['provider'] for row in overview_rows(data)] == providers[:3] for a six-account snapshot and that the six-account frame equals the three-account frame. packages/token-tv/lcars.py (new file) then indexes a fixed three-element palette over that result: colors = ['#b6bfff', '#ec6c83', '#ffc3af'] ... color = colors[i]. The new README paragraph lists supported providers but never states the cap; it appears only in the PR text.
    Impact: With more than three provider/account entries, rows are silently dropped from the physical clock face (they remain visible in the dashboard), and the three-element palette is the boundary that would raise IndexError if the upstream cap ever changed. Operators reading README.md have no indication that the clock shows at most three accounts.
    Suggested fix: Add one sentence to the new README paragraph, e.g. 'The clock face shows at most three account rows in provider order; remaining accounts are visible only in the dashboard.' No source change is required.

  • ExecCondition probe silently skips startup on a malformed config file (modules/services/token-tv.nix:21; medium confidence)
    The clockConfigured probe (lines 15-22) does settings = json.load(config_file) with no try/except and then sys.exit(0 if settings.get("device_url") else 1). An uncaught exception in that Python script exits 1, and the unit's own comment at line 99 states 'ExecCondition exit codes 1-254 skip startup without marking it failed'. So a hand-edited ~/.config/token-tv/config.json with a JSON syntax error produces the same silent skip as the intended 'no clock configured yet' case; because the unit never fails, services.serviceFailureMonitor.services (line 68) will not alert either. README.md:198 documents only the missing-config case.
    Impact: A typo in the mutable config silently prevents the dashboard and clock publisher from starting, with no failure alert and no journal message distinguishing it from the documented unconfigured state.
    Suggested fix: Catch the parse error in the probe and report it, e.g. wrap json.load in try/except and print a message to stderr before exiting 1, or exit 255 for a malformed file so the unit reports a genuine failure and the failure monitor alerts, keeping exit 1 only for a valid config without device_url.

Tests and validation

  • No configured deterministic checks.

Questions

  • Does the pinned upstream revision afc60163d17e76ba71f4a7a5184be6dd4fb6baf8 already contain a token_tv/assets/ directory? packages/token-tv/default.nix postPatch runs cp ${./assets/agy-pixel.png} token_tv/assets/agy-pixel.png without creating the target directory, so it would fail if upstream has no such directory; the upstream tree is not in this checkout.
  • Is the upstream click6067-ship-it/token-tv source MIT-licensed? packages/token-tv/default.nix declares lib.licenses.mit for the locally patched fork, but the upstream licence is not in the supplied evidence.
  • Is the claude alias intended to be part of this merge request, or did it come from a different workstream? Nothing in the checked-out documentation explains it.

Review limitations

  • No Nix evaluation, nix flake check, build, or test run was performed; the review reads the checked-out sources and the supplied diff only. Reported passing checks and any live canary evidence are taken from the PR text as untrusted.
  • The upstream token-tv Python sources are not in this checkout; overview_rows, window, reading, exe, FILES, render_page, token_tv/sample and the rest of live.py/cli.py are visible only through patch context, so no defects were inferred in unchanged code.
  • inputs.llm-agents is an external flake, so the exact bin layout of packages.<system>.codex and .antigravity-cli was inferred from the usages in modules/profiles/ai-agents.nix (${codexCli}/bin/codex, ${antigravityCli}/bin/agy) rather than verified.
  • No live activation, reboot, or systemctl evidence is available here; runtime behaviour of the physical clock (Ultra firmware responses, album settings, image re-selection) is described only by the supplied unit-test expectations.
  • Circular-import risk between token_tv/themes.py (which adds from token_tv.lcars import render_lcars) and token_tv/lcars.py (which imports token_tv.display at module scope) could not be assessed because the import block of token_tv/display.py was not supplied.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • modules/profiles/ai-runtime.nix: reviewed — included in a context-limited batch
  • modules/services/token-tv.nix: reviewed — included in a context-limited batch
  • packages/token-tv/assets/agy-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/assets/opencode-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/default.nix: reviewed — included in a context-limited batch
  • packages/token-tv/local-providers-lcars.patch: reviewed — included in a context-limited batch
  • packages/token-tv/smalltv-ultra.patch: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 6
  • Previous automated review: none found
  • Findings: 3
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `7a75c782442d4499d20689dde88bb4e24ca84884` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment The Token TV package, Vega service wiring, flake package, and README additions follow the repository's established Nebula-bound native-service pattern (compare modules/services/kiwifs.nix): the bindsTo/after/wants triple on sys-subsystem-net-devices-nebula.mesh.device, networking.firewall.interfaces."nebula.mesh".allowedTCPPorts, the mkAfter backup dataPaths contribution, and self-registration in services.serviceFailureMonitor.services (token-tv is correctly absent from hosts/vega/default.nix:287, whose comment forbids duplicating per-module entries). The unit PATH entries clients.codex and clients.antigravity-cli match attribute names already used in modules/profiles/ai-agents.nix, which exposes bin/codex and bin/agy, matching the CLI names the patched sources look up (shutil.which('agy'), exe('agy')). The /run/secrets/opencode-go-api-key path the patched sources read is created by modules/profiles/ai-runtime.nix:232 with owner = primaryUser and mode 0400, so the service (User = primaryUser) can read it. README port/address claims (10.10.0.2:8787) match the module defaults and nebula.nix:10/26. Two issues remain: an undocumented, byte-identical duplicate `claude` wrapper added to the shared ai-runtime profile, and a documented-behaviour gap around the three-row clock-face cap that the new regression test asserts. One smaller operational trap in the ExecCondition probe is worth closing. ### Blocking findings None. ### Important findings - **Undocumented duplicate `claude` command wrapper added to the shared AI-runtime profile** (modules/profiles/ai-runtime.nix:40; high confidence) The diff adds `claudeForUser = pkgs.writeShellScriptBin "claude" ''set -euo pipefail; exec ${claudeCode}/bin/claude "$@"''` (line 40) and appends it to `home-manager.users.${user}.home.packages` (line 295). Its body is identical to the pre-existing `claudeCodeForUser` wrapper at line 36. A repository-wide search for `claude` across *.nix returns only these five lines in this file, and searches for `claude` in README.md and docs/ return no matches, so no documentation records the alias; `pkgs.claude-code` is not in any environment.systemPackages list, so `claude` is a genuinely new user-facing command rather than a shadow of an existing one. Nothing in the Token TV README paragraphs (README.md:174-199) mentions it. ai-runtime is imported by the AI-desktop profile, so this lands on every AI-client host, not only Vega. Impact: A new interactive command is installed on all AI-client hosts by a change set whose stated scope is the Token TV clock; it duplicates the existing `claude-code` entry point, so the two can drift apart in later edits, and the merged history gives no reason for the alias to exist. Suggested fix: Land the `claude` alias separately with its own justification, or state the reason in the commit/README if it is intentional (e.g. an alias users actually type). If both names must stay, build the launcher body once (a single string variable) and pass it to two `writeShellScriptBin` calls so the aliases cannot diverge. ### Suggestions - **New regression test asserts a three-row clock-face cap that the README paragraph does not record** (README.md:174; medium confidence) `packages/token-tv/local-providers-lcars.patch` adds `test_lcars_keeps_five_providers_and_multiple_accounts_within_three_rows`, which asserts `[row['provider'] for row in overview_rows(data)] == providers[:3]` for a six-account snapshot and that the six-account frame equals the three-account frame. `packages/token-tv/lcars.py` (new file) then indexes a fixed three-element palette over that result: `colors = ['#b6bfff', '#ec6c83', '#ffc3af']` ... `color = colors[i]`. The new README paragraph lists supported providers but never states the cap; it appears only in the PR text. Impact: With more than three provider/account entries, rows are silently dropped from the physical clock face (they remain visible in the dashboard), and the three-element palette is the boundary that would raise IndexError if the upstream cap ever changed. Operators reading README.md have no indication that the clock shows at most three accounts. Suggested fix: Add one sentence to the new README paragraph, e.g. 'The clock face shows at most three account rows in provider order; remaining accounts are visible only in the dashboard.' No source change is required. - **ExecCondition probe silently skips startup on a malformed config file** (modules/services/token-tv.nix:21; medium confidence) The `clockConfigured` probe (lines 15-22) does `settings = json.load(config_file)` with no try/except and then `sys.exit(0 if settings.get("device_url") else 1)`. An uncaught exception in that Python script exits 1, and the unit's own comment at line 99 states 'ExecCondition exit codes 1-254 skip startup without marking it failed'. So a hand-edited `~/.config/token-tv/config.json` with a JSON syntax error produces the same silent skip as the intended 'no clock configured yet' case; because the unit never fails, `services.serviceFailureMonitor.services` (line 68) will not alert either. README.md:198 documents only the missing-config case. Impact: A typo in the mutable config silently prevents the dashboard and clock publisher from starting, with no failure alert and no journal message distinguishing it from the documented unconfigured state. Suggested fix: Catch the parse error in the probe and report it, e.g. wrap `json.load` in try/except and print a message to stderr before exiting 1, or exit 255 for a malformed file so the unit reports a genuine failure and the failure monitor alerts, keeping exit 1 only for a valid config without `device_url`. ### Tests and validation - No configured deterministic checks. ### Questions - Does the pinned upstream revision afc60163d17e76ba71f4a7a5184be6dd4fb6baf8 already contain a `token_tv/assets/` directory? `packages/token-tv/default.nix` postPatch runs `cp ${./assets/agy-pixel.png} token_tv/assets/agy-pixel.png` without creating the target directory, so it would fail if upstream has no such directory; the upstream tree is not in this checkout. - Is the upstream `click6067-ship-it/token-tv` source MIT-licensed? `packages/token-tv/default.nix` declares `lib.licenses.mit` for the locally patched fork, but the upstream licence is not in the supplied evidence. - Is the `claude` alias intended to be part of this merge request, or did it come from a different workstream? Nothing in the checked-out documentation explains it. ### Review limitations - No Nix evaluation, `nix flake check`, build, or test run was performed; the review reads the checked-out sources and the supplied diff only. Reported passing checks and any live canary evidence are taken from the PR text as untrusted. - The upstream token-tv Python sources are not in this checkout; `overview_rows`, `window`, `reading`, `exe`, `FILES`, `render_page`, `token_tv/sample` and the rest of `live.py`/`cli.py` are visible only through patch context, so no defects were inferred in unchanged code. - `inputs.llm-agents` is an external flake, so the exact bin layout of `packages.<system>.codex` and `.antigravity-cli` was inferred from the usages in modules/profiles/ai-agents.nix (`${codexCli}/bin/codex`, `${antigravityCli}/bin/agy`) rather than verified. - No live activation, reboot, or `systemctl` evidence is available here; runtime behaviour of the physical clock (Ultra firmware responses, album settings, image re-selection) is described only by the supplied unit-test expectations. - Circular-import risk between `token_tv/themes.py` (which adds `from token_tv.lcars import render_lcars`) and `token_tv/lcars.py` (which imports `token_tv.display` at module scope) could not be assessed because the import block of `token_tv/display.py` was not supplied. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `modules/profiles/ai-runtime.nix`: **reviewed** — included in a context-limited batch - `modules/services/token-tv.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/agy-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/opencode-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/default.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/local-providers-lcars.patch`: **reviewed** — included in a context-limited batch - `packages/token-tv/smalltv-ultra.patch`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md - Commits considered: 6 - Previous automated review: none found - Findings: 3 </details>
Report invalid Token TV configuration and keep runtime scope focused
All checks were successful
AI pull-request review / review (pull_request) Successful in 23m2s
Build and Push Attic Cache / test (pull_request) Successful in 1m48s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
8a433a2002
Author
Owner

Addressed review 41 in 8a433a2:

  • Removed the extra shared claude wrapper and its home-package entry. It is not needed by the configured Codex, Gemini or Opencode Go providers; the existing claude-code launcher is retained. This avoids adding an unrelated interactive alias across AI-client hosts.
  • Documented the actual upstream clock selection: at most three provider rows, one selected account per provider, with other accounts/providers available in the dashboard. This is a provider overview cap, not simply the first three configured accounts.
  • Fixed the malformed-configuration concern. The generated guard catches read/encoding/JSON errors, rejects non-object JSON, emits a clear journal diagnostic, and exits 255 so systemd marks a genuine startup failure and the configured monitor can alert. Valid configuration without a clock address still exits 1 and skips cleanly.

Validation: all eight focused cases against the actual Nix-generated guard pass (configured, unconfigured, empty address, malformed JSON, array root, null root, invalid encoding, unreadable file). nix flake check and the complete Vega system build pass. The package and LCARS renderer are unchanged, so the previously passing 70 package tests and physical-clock canary remain applicable. Configuration follow-ups are not live-activated.

Upstream questions were checked directly in the pinned fetched source: it already contains token_tv/assets/, and its root LICENSE is the MIT License with upstream copyright. The package successfully builds with the asset copies. No source/packaging correction is needed.

Addressed review 41 in 8a433a2: - Removed the extra shared `claude` wrapper and its home-package entry. It is not needed by the configured Codex, Gemini or Opencode Go providers; the existing `claude-code` launcher is retained. This avoids adding an unrelated interactive alias across AI-client hosts. - Documented the actual upstream clock selection: at most three provider rows, one selected account per provider, with other accounts/providers available in the dashboard. This is a provider overview cap, not simply the first three configured accounts. - Fixed the malformed-configuration concern. The generated guard catches read/encoding/JSON errors, rejects non-object JSON, emits a clear journal diagnostic, and exits 255 so systemd marks a genuine startup failure and the configured monitor can alert. Valid configuration without a clock address still exits 1 and skips cleanly. Validation: all eight focused cases against the actual Nix-generated guard pass (configured, unconfigured, empty address, malformed JSON, array root, null root, invalid encoding, unreadable file). `nix flake check` and the complete Vega system build pass. The package and LCARS renderer are unchanged, so the previously passing 70 package tests and physical-clock canary remain applicable. Configuration follow-ups are not live-activated. Upstream questions were checked directly in the pinned fetched source: it already contains `token_tv/assets/`, and its root `LICENSE` is the MIT License with upstream copyright. The package successfully builds with the asset copies. No source/packaging correction is needed.
clankbot left a comment

Automated code review

Reviewed commit: 8a433a2002a4135a527acc7b2175f949ecd01e42

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

The change adds a Vega-scoped native token-tv.service (modules/services/token-tv.nix), registers the locally patched package in flake.nix:174 and in the shared ai-runtime profile (modules/profiles/ai-runtime.nix:34, :291), enables it only on Vega (hosts/vega/default.nix:54, :72), and documents the LCARS face, the Ultra transport, the three-row clock cap, failure monitoring and state backup in README.md. The Nix wiring matches the established Nebula-service pattern (kiwifs.nix / navidrome-mcp.nix use the same nebula@mesh.service + sys-subsystem-net-devices-nebula.mesh.device ordering, bindsTo, and networking.firewall.interfaces."nebula.mesh".allowedTCPPorts; the backup mkAfter and tmpfiles pattern matches ytdl-sub/karakeep), port 8787 is not used elsewhere, inputs.llm-agents.packages.*.codex and .antigravity-cli exist (modules/profiles/ai-agents.nix:13, :28), /run/secrets/opencode-go-api-key is created world-readable-to-the-user by ai-runtime.nix:228 (owner = user, mode 0400), and the watched unit name is owned by a real service definition, so scripts/check-service-failure-monitor.nix should still pass. The two patch files are internally consistent and correctly ordered (smalltv-ultra.patch's sources.py hunk takes the key_file line added by local-providers-lcars.patch as unchanged context), and the two asset copies match the web_assets.py paths. The upstream token_tv sources are not in the tree, so only patch hunks were readable. One operational hazard in the new unit and one cross-file ordering inconsistency are reported; everything else could not be verified from supplied evidence.

Blocking findings

None.

Important findings

  • A malformed clock configuration puts the unit into an unbounded restart/alert loop (modules/services/token-tv.nix:109; medium confidence)
    The ExecCondition guard exits 255 for unreadable, malformed, or non-object JSON (modules/services/token-tv.nix:26-28), and the comment at line 106 states that only exit codes 1-254 skip startup without a failure, so 255 is the deliberate failure path. The same unit then sets Restart = "on-failure" (line 109) and RestartSec = 10 (line 110), and line 74 registers token-tv in services.serviceFailureMonitor.services, which adds unitConfig.OnFailure = [ "ntfy-service-failure@%n.service" ] (modules/services/service-failure-monitor.nix:57). Nothing in the supplied change bounds that cycle, and cfg.configFile is a mutable, hand-edited file (~/.config/token-tv/config.json, default at line 54).
    Impact: One typo in the mutable config file makes the unit fail permanently: a journal error plus an ntfy failure alert roughly every 10 seconds (about 360 per hour) until someone edits the file, and the failure monitor's own OnFailure stub is re-triggered each cycle. README.md:202 describes this state as reporting 'a startup failure to the journal and failure monitor' (singular), which does not describe the resulting flood.
    Suggested fix: Make the invalid-configuration path self-limiting while keeping it visible: raise RestartSec for this unit, add RestartPreventExitStatus = 255 so the guard's exit code fails once without restarting, or split the two states (unreadable file = hard failure; malformed JSON = diagnostic plus skip). Confirm the chosen behaviour on Vega before activation.

Suggestions

  • Clock row selection keeps the inherited provider order, so the two newly added providers are the ones cut off (packages/token-tv/local-providers-lcars.patch:54; medium confidence)
    display.py appends the new providers to the end of the existing tuple (+PROVIDERS = ('claude', 'codex', 'grok', 'agy', 'opencode'), patch line 54), and the new regression test asserts that with six accounts across all five providers the clock face resolves to providers[:3], i.e. claude, codex, grok (patch line 368). The dashboard side of the same change uses the opposite priority: +const PROVIDERS = ['codex', 'agy', 'opencode', 'claude', 'grok']; (patch line 232). README.md:174 describes the clock as supporting 'Codex, Gemini via Antigravity's /usage, and OpenCode Go's usage endpoint'.
    Impact: On any account list that also contains claude and grok entries, the LCARS face renders claude/codex/grok and never shows Gemini or Opencode Go, while the web dashboard prioritises exactly those two. The two providers this PR adds support for are the ones most likely to be dropped from the physical clock.
    Suggested fix: If the clock face should prioritise the supported providers, order the row selection in the same priority as web/app.js (or expose the row order/limit as a configuration key alongside device_api) rather than relying on the inherited PROVIDERS tuple order; otherwise state in README.md that the three rows follow the account-list order, so the wording is not read as a supported-provider guarantee.

  • No committed flake check covers the new token-tv service wiring (flake.nix:174; medium confidence)
    The tree contains no scripts/check-token-tv* or tests/token-tv* artefact; the only committed token-tv material is the module, the package, the two patches and the two assets. flake.nix already carries this kind of guard for comparable service integrations (checks.x86_64-linux.redview-v2-production-config, checks.x86_64-linux.service-failure-monitor-coverage), and the existing monitor check only proves that a watched name is owned by a real unit (scripts/check-service-failure-monitor.nix:22-27), not that nixosConfig.backup.dataPaths (modules/services/token-tv.nix:69) or the monitorFailures registration (line 74) are still present.
    Impact: A later edit that drops the backup data path or the failure-monitor registration would not be caught by nix flake check or by the Attic-cache CI workflow, even though the same wiring is deterministically gated for other services.
    Suggested fix: If the configuration assertions are worth keeping, commit them as a scripts/check-token-tv-config.nix guard added to checks.x86_64-linux.* beside the existing service guards; otherwise record in the issue that they were one-off evaluations and no durable gate is intended.

Tests and validation

  • No configured deterministic checks.

Questions

  • In the sources.py insertion at new lines ~302-311 (packages/token-tv/local-providers-lcars.patch:134-141), the opencode availability branch uses auth_file = root / "auth.json" with no assignment of root inside the supplied hunk, whereas the parallel cli.py insertion explicitly binds root = Path(home).expanduser() (patch lines 20-21). Please confirm root is bound earlier in that enclosing function; no supplied test exercises that availability path (test_local_support.py imports only opencode_payload and load_config).
  • Does the upstream pyproject at rev afc60163d17e76ba71f4a7a5184be6dd4fb6baf8 define a console entry point named token-tv? lib.getExe package in modules/services/token-tv.nix:108 and the README invocation nix run .#token-tv -- run ... both depend on meta.mainProgram = "token-tv" (packages/token-tv/default.nix:48) resolving to a real bin entry.
  • The Ultra activate() hardcodes theme_list='0,0,1,0,0,0,0,0,0', sw_en=0, theme_interval=10, and theme=3 (packages/token-tv/smalltv-ultra.patch). The class docstring claims the API was 'verified against Ultra-V9.0.54's web UI', but no supplied evidence ties theme=3 to the LCARS face rather than to a firmware index. Can that mapping be cited, or should it be a configuration value?
  • The unit sets ProtectSystem = "full" (modules/services/token-tv.nix:114) together with StateDirectory = "token-tv" and no ReadWritePaths, while other native services in this repo (e.g. modules/services/kiwifs.nix) declare them explicitly. Is there any code path in the upstream package that writes outside /var/lib/token-tv and outside $HOME?
  • The service depends on /run/secrets/opencode-go-api-key, contributed only by modules/profiles/ai-runtime.nix:228 (reached on Vega via profiles/ai-desktop.nix:12). Should the token-tv module assert that this secret is configured, or is the fallback to auth.json and the auth_required SourceError the intended behaviour for hosts that enable the service without the ai-runtime profile?

Review limitations

  • The upstream token_tv Python source (fetched from GitHub at rev afc60163d17e76ba71f4a7a5184be6dd4fb6baf8) is not present in the checked-out tree; only the two patch files were readable. Unchanged upstream functions referenced by the changes - overview_rows, window, reading, face, render_page, PhotoDisplay.request, exe, FILES, and the import headers of cli.py/sources.py/display.py - could not be inspected, so any defect inside them is out of scope.
  • No Nix evaluation, package build, nix flake check, or Python test run was performed here; the canary, validation, and test results are taken from the untrusted review text and were not independently confirmed.
  • No live Vega state was available: no journal output, systemd unit dump, service-data backup listing, or clock image could be inspected, so the ExecCondition/failure-monitor interaction is reasoned from the unit definition only.
  • The two added binary assets (packages/token-tv/assets/agy-pixel.png, packages/token-tv/assets/opencode-pixel.png) were confirmed present by path only; their contents were not inspected, only their names against web_assets.py and postPatch.
  • The web/app.js, token_tv/display.py, and token_tv/sources.py hunks were read only as supplied diff fragments; surrounding unchanged code was not available, so cross-file consistency beyond the shown hunks was not verified.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • modules/profiles/ai-runtime.nix: reviewed — included in a context-limited batch
  • modules/services/token-tv.nix: reviewed — included in a context-limited batch
  • packages/token-tv/assets/agy-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/assets/opencode-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/default.nix: reviewed — included in a context-limited batch
  • packages/token-tv/local-providers-lcars.patch: reviewed — included in a context-limited batch
  • packages/token-tv/smalltv-ultra.patch: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 7
  • Previous automated review: none found
  • Findings: 3
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `8a433a2002a4135a527acc7b2175f949ecd01e42` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment The change adds a Vega-scoped native `token-tv.service` (modules/services/token-tv.nix), registers the locally patched package in flake.nix:174 and in the shared ai-runtime profile (modules/profiles/ai-runtime.nix:34, :291), enables it only on Vega (hosts/vega/default.nix:54, :72), and documents the LCARS face, the Ultra transport, the three-row clock cap, failure monitoring and state backup in README.md. The Nix wiring matches the established Nebula-service pattern (kiwifs.nix / navidrome-mcp.nix use the same `nebula@mesh.service` + `sys-subsystem-net-devices-nebula.mesh.device` ordering, `bindsTo`, and `networking.firewall.interfaces."nebula.mesh".allowedTCPPorts`; the backup `mkAfter` and tmpfiles pattern matches ytdl-sub/karakeep), port 8787 is not used elsewhere, `inputs.llm-agents.packages.*.codex` and `.antigravity-cli` exist (modules/profiles/ai-agents.nix:13, :28), `/run/secrets/opencode-go-api-key` is created world-readable-to-the-user by ai-runtime.nix:228 (owner = user, mode 0400), and the watched unit name is owned by a real service definition, so scripts/check-service-failure-monitor.nix should still pass. The two patch files are internally consistent and correctly ordered (smalltv-ultra.patch's sources.py hunk takes the `key_file` line added by local-providers-lcars.patch as unchanged context), and the two asset copies match the `web_assets.py` paths. The upstream token_tv sources are not in the tree, so only patch hunks were readable. One operational hazard in the new unit and one cross-file ordering inconsistency are reported; everything else could not be verified from supplied evidence. ### Blocking findings None. ### Important findings - **A malformed clock configuration puts the unit into an unbounded restart/alert loop** (modules/services/token-tv.nix:109; medium confidence) The ExecCondition guard exits 255 for unreadable, malformed, or non-object JSON (modules/services/token-tv.nix:26-28), and the comment at line 106 states that only exit codes 1-254 skip startup without a failure, so 255 is the deliberate failure path. The same unit then sets `Restart = "on-failure"` (line 109) and `RestartSec = 10` (line 110), and line 74 registers `token-tv` in `services.serviceFailureMonitor.services`, which adds `unitConfig.OnFailure = [ "ntfy-service-failure@%n.service" ]` (modules/services/service-failure-monitor.nix:57). Nothing in the supplied change bounds that cycle, and `cfg.configFile` is a mutable, hand-edited file (`~/.config/token-tv/config.json`, default at line 54). Impact: One typo in the mutable config file makes the unit fail permanently: a journal error plus an ntfy failure alert roughly every 10 seconds (about 360 per hour) until someone edits the file, and the failure monitor's own OnFailure stub is re-triggered each cycle. README.md:202 describes this state as reporting 'a startup failure to the journal and failure monitor' (singular), which does not describe the resulting flood. Suggested fix: Make the invalid-configuration path self-limiting while keeping it visible: raise `RestartSec` for this unit, add `RestartPreventExitStatus = 255` so the guard's exit code fails once without restarting, or split the two states (unreadable file = hard failure; malformed JSON = diagnostic plus skip). Confirm the chosen behaviour on Vega before activation. ### Suggestions - **Clock row selection keeps the inherited provider order, so the two newly added providers are the ones cut off** (packages/token-tv/local-providers-lcars.patch:54; medium confidence) display.py appends the new providers to the end of the existing tuple (`+PROVIDERS = ('claude', 'codex', 'grok', 'agy', 'opencode')`, patch line 54), and the new regression test asserts that with six accounts across all five providers the clock face resolves to `providers[:3]`, i.e. claude, codex, grok (patch line 368). The dashboard side of the same change uses the opposite priority: `+const PROVIDERS = ['codex', 'agy', 'opencode', 'claude', 'grok'];` (patch line 232). README.md:174 describes the clock as supporting 'Codex, Gemini via Antigravity's /usage, and OpenCode Go's usage endpoint'. Impact: On any account list that also contains claude and grok entries, the LCARS face renders claude/codex/grok and never shows Gemini or Opencode Go, while the web dashboard prioritises exactly those two. The two providers this PR adds support for are the ones most likely to be dropped from the physical clock. Suggested fix: If the clock face should prioritise the supported providers, order the row selection in the same priority as `web/app.js` (or expose the row order/limit as a configuration key alongside `device_api`) rather than relying on the inherited `PROVIDERS` tuple order; otherwise state in README.md that the three rows follow the account-list order, so the wording is not read as a supported-provider guarantee. - **No committed flake check covers the new token-tv service wiring** (flake.nix:174; medium confidence) The tree contains no `scripts/check-token-tv*` or `tests/token-tv*` artefact; the only committed token-tv material is the module, the package, the two patches and the two assets. flake.nix already carries this kind of guard for comparable service integrations (`checks.x86_64-linux.redview-v2-production-config`, `checks.x86_64-linux.service-failure-monitor-coverage`), and the existing monitor check only proves that a watched name is owned by a real unit (scripts/check-service-failure-monitor.nix:22-27), not that `nixosConfig.backup.dataPaths` (modules/services/token-tv.nix:69) or the `monitorFailures` registration (line 74) are still present. Impact: A later edit that drops the backup data path or the failure-monitor registration would not be caught by `nix flake check` or by the Attic-cache CI workflow, even though the same wiring is deterministically gated for other services. Suggested fix: If the configuration assertions are worth keeping, commit them as a `scripts/check-token-tv-config.nix` guard added to `checks.x86_64-linux.*` beside the existing service guards; otherwise record in the issue that they were one-off evaluations and no durable gate is intended. ### Tests and validation - No configured deterministic checks. ### Questions - In the sources.py insertion at new lines ~302-311 (packages/token-tv/local-providers-lcars.patch:134-141), the opencode availability branch uses `auth_file = root / "auth.json"` with no assignment of `root` inside the supplied hunk, whereas the parallel cli.py insertion explicitly binds `root = Path(home).expanduser()` (patch lines 20-21). Please confirm `root` is bound earlier in that enclosing function; no supplied test exercises that availability path (test_local_support.py imports only `opencode_payload` and `load_config`). - Does the upstream pyproject at rev afc60163d17e76ba71f4a7a5184be6dd4fb6baf8 define a console entry point named `token-tv`? `lib.getExe package` in modules/services/token-tv.nix:108 and the README invocation `nix run .#token-tv -- run ...` both depend on `meta.mainProgram = "token-tv"` (packages/token-tv/default.nix:48) resolving to a real bin entry. - The Ultra `activate()` hardcodes `theme_list='0,0,1,0,0,0,0,0,0'`, `sw_en=0`, `theme_interval=10`, and `theme=3` (packages/token-tv/smalltv-ultra.patch). The class docstring claims the API was 'verified against Ultra-V9.0.54's web UI', but no supplied evidence ties `theme=3` to the LCARS face rather than to a firmware index. Can that mapping be cited, or should it be a configuration value? - The unit sets `ProtectSystem = "full"` (modules/services/token-tv.nix:114) together with `StateDirectory = "token-tv"` and no `ReadWritePaths`, while other native services in this repo (e.g. modules/services/kiwifs.nix) declare them explicitly. Is there any code path in the upstream package that writes outside `/var/lib/token-tv` and outside `$HOME`? - The service depends on `/run/secrets/opencode-go-api-key`, contributed only by modules/profiles/ai-runtime.nix:228 (reached on Vega via profiles/ai-desktop.nix:12). Should the token-tv module assert that this secret is configured, or is the fallback to `auth.json` and the `auth_required` SourceError the intended behaviour for hosts that enable the service without the ai-runtime profile? ### Review limitations - The upstream token_tv Python source (fetched from GitHub at rev afc60163d17e76ba71f4a7a5184be6dd4fb6baf8) is not present in the checked-out tree; only the two patch files were readable. Unchanged upstream functions referenced by the changes - `overview_rows`, `window`, `reading`, `face`, `render_page`, `PhotoDisplay.request`, `exe`, `FILES`, and the import headers of cli.py/sources.py/display.py - could not be inspected, so any defect inside them is out of scope. - No Nix evaluation, package build, `nix flake check`, or Python test run was performed here; the canary, validation, and test results are taken from the untrusted review text and were not independently confirmed. - No live Vega state was available: no journal output, systemd unit dump, service-data backup listing, or clock image could be inspected, so the ExecCondition/failure-monitor interaction is reasoned from the unit definition only. - The two added binary assets (packages/token-tv/assets/agy-pixel.png, packages/token-tv/assets/opencode-pixel.png) were confirmed present by path only; their contents were not inspected, only their names against `web_assets.py` and `postPatch`. - The `web/app.js`, `token_tv/display.py`, and `token_tv/sources.py` hunks were read only as supplied diff fragments; surrounding unchanged code was not available, so cross-file consistency beyond the shown hunks was not verified. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `modules/profiles/ai-runtime.nix`: **reviewed** — included in a context-limited batch - `modules/services/token-tv.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/agy-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/opencode-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/default.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/local-providers-lcars.patch`: **reviewed** — included in a context-limited batch - `packages/token-tv/smalltv-ultra.patch`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md - Commits considered: 7 - Previous automated review: none found - Findings: 3 </details>
Bound Token TV restart failures and align clock provider priority
Some checks failed
Build and Push Attic Cache / build (pull_request) Blocked by required conditions
Build and Push Attic Cache / remediate (pull_request) Blocked by required conditions
Build and Push Attic Cache / notify-remediation (pull_request) Blocked by required conditions
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Blocked by required conditions
Build and Push Attic Cache / pin-lifecycle (pull_request) Blocked by required conditions
AI pull-request review / review (pull_request) Successful in 9m18s
Build and Push Attic Cache / test (pull_request) Has been cancelled
653ab7b9dc
Author
Owner

Review 42 assessed and addressed in 653ab7b:

  • The persistent failure loop was valid. An isolated Vega user service with an ExecCondition exit of 255 and Restart=on-failure reproduced repeated restarts. Added unit-level StartLimitIntervalSec=300 and StartLimitBurst=3 while retaining RestartSec=10 and transient recovery. Tested those exact values on Vega: three condition executions, then ActiveState=failed / Result=start-limit-hit; the test service was stopped/reset and the production clock was untouched. README documents repair plus reset-failed/restart. RestartPreventExitStatus is deliberately not used: systemd documents that it applies to the main process, while this error originates in ExecCondition (https://github.com/systemd/systemd/blob/main/man/systemd.service.xml).
  • Aligned clock priority with the web dashboard: Codex, Gemini, Opencode Go, then Claude and Grok. The six-account/five-provider regression now explicitly verifies the supported three-provider selection and frame equivalence to that selected subset. Updated the inherited overview assertion for the intentional Codex-before-Claude order. The actual Vega three-provider order stays the same.
  • Added a permanent token-tv-config flake gate covering Vega-only enablement, single monitoring and backup registrations, monitor opt-out, precreated state directory, restart bounds, config/state paths, and private Nebula address/firewall wiring.

Validation: all 70 package tests pass on the rebuilt package; the new wiring gate builds; nix flake check and the complete Vega system build pass. The renderer itself is unchanged. The bounded failure behaviour was exercised with an isolated Vega user unit; the production canary remains at d35d9c1 and follow-up configuration/package changes await activation.

Questions checked against the pinned source:

  • logged_in_email() binds root = Path(home).expanduser() before the Opencode branch, so auth_file uses a defined variable.
  • Upstream pyproject.toml declares [project.scripts] token-tv = token_tv.cli:main, and the built executable exists.
  • Ultra theme=3 is a firmware display selection, not the LCARS style. LCARS is rendered into the uploaded JPEG. The exact Ultra settings sequence was accepted by the physical stock-firmware clock in the successful canary; the user confirmed the displayed LCARS face. These values belong to that explicit transport adapter, not to a host rendering theme option.
  • The daemon writes persistent snapshots, frames and restore state under the supplied /var/lib/token-tv; provider CLIs may update their existing HOME authentication state. ProtectSystem=full leaves those locations writable. No additional persistent write location was found in the inspected run path.
  • The SOPS key is optional for the reusable module: Opencode's existing auth.json fallback is intentional, and missing provider credentials remain an auth_required reading. Vega already imports the profile that provisions its key. Requiring that secret would unnecessarily prevent other hosts/provider selections from using the module.
Review 42 assessed and addressed in 653ab7b: - The persistent failure loop was valid. An isolated Vega user service with an ExecCondition exit of 255 and Restart=on-failure reproduced repeated restarts. Added unit-level StartLimitIntervalSec=300 and StartLimitBurst=3 while retaining RestartSec=10 and transient recovery. Tested those exact values on Vega: three condition executions, then ActiveState=failed / Result=start-limit-hit; the test service was stopped/reset and the production clock was untouched. README documents repair plus reset-failed/restart. RestartPreventExitStatus is deliberately not used: systemd documents that it applies to the main process, while this error originates in ExecCondition (https://github.com/systemd/systemd/blob/main/man/systemd.service.xml). - Aligned clock priority with the web dashboard: Codex, Gemini, Opencode Go, then Claude and Grok. The six-account/five-provider regression now explicitly verifies the supported three-provider selection and frame equivalence to that selected subset. Updated the inherited overview assertion for the intentional Codex-before-Claude order. The actual Vega three-provider order stays the same. - Added a permanent token-tv-config flake gate covering Vega-only enablement, single monitoring and backup registrations, monitor opt-out, precreated state directory, restart bounds, config/state paths, and private Nebula address/firewall wiring. Validation: all 70 package tests pass on the rebuilt package; the new wiring gate builds; nix flake check and the complete Vega system build pass. The renderer itself is unchanged. The bounded failure behaviour was exercised with an isolated Vega user unit; the production canary remains at d35d9c1 and follow-up configuration/package changes await activation. Questions checked against the pinned source: - logged_in_email() binds root = Path(home).expanduser() before the Opencode branch, so auth_file uses a defined variable. - Upstream pyproject.toml declares [project.scripts] token-tv = token_tv.cli:main, and the built executable exists. - Ultra theme=3 is a firmware display selection, not the LCARS style. LCARS is rendered into the uploaded JPEG. The exact Ultra settings sequence was accepted by the physical stock-firmware clock in the successful canary; the user confirmed the displayed LCARS face. These values belong to that explicit transport adapter, not to a host rendering theme option. - The daemon writes persistent snapshots, frames and restore state under the supplied /var/lib/token-tv; provider CLIs may update their existing HOME authentication state. ProtectSystem=full leaves those locations writable. No additional persistent write location was found in the inspected run path. - The SOPS key is optional for the reusable module: Opencode's existing auth.json fallback is intentional, and missing provider credentials remain an auth_required reading. Vega already imports the profile that provisions its key. Requiring that secret would unnecessarily prevent other hosts/provider selections from using the module.
clankbot left a comment

Automated code review

Reviewed commit: 653ab7b9dcfac39f3abb59d1e399a5558bf76f56

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

Re-validated the initial review against the checked-out repository. The Nix side is consistent with the repository's established patterns: modules/services/token-tv.nix reproduces the exact nebula@mesh.service / sys-subsystem-net-devices-nebula.mesh.device after/wants/bindsTo triple used by services/kiwifs.nix, services/bookstack-mcp.nix and services/forgejo-mcp.nix, the same networking.firewall.interfaces."nebula.mesh".allowedTCPPorts = [ cfg.port ] form, the same nixosConfig.backup.dataPaths = mkAfter [...] + tmpfiles pairing used by kiwifs, the same services.serviceFailureMonitor.services = mkIf cfg.monitorFailures (mkAfter [...]) self-registration, and the same User = primaryUser; Group = "users" pairing used by services/forgejo-runner.nix; port 8787 is not claimed by any other module (grep over the tree shows only this option and the README). inputs.llm-agents.packages.<system>.codex and .antigravity-cli exist in modules/profiles/ai-agents.nix, and ${antigravityCli}/bin/agy confirms the unit's path = [clients.codex clients.antigravity-cli] supplies the agy binary the patched sources.py looks up; /run/secrets/opencode-go-api-key is provisioned by modules/profiles/ai-runtime.nix with owner = primary user, mode 0400, matching the unit's User. hosts/vega/default.nix and modules/profiles/ai-runtime.nix use the correct relative paths (../../packages/token-tv) and flake.nix follows the existing check-registration idiom. Of the two findings in the initial review, only the agy error-masking defect survives: it is demonstrable from the supplied patch text alone. The LCARS radius finding depends on Pillow behaviour that is not present in the checkout (no Pillow source, no vendored copy), so it is dropped as speculative and recorded as a limitation instead.

Blocking findings

None.

Important findings

  • agy provider's auth_required signal is swallowed by the catch-all handler (packages/token-tv/local-providers-lcars.patch:130; high confidence)
    In the new agy_payload body (patch lines 121-135), raise SourceError("auth_required") at line 130 sits inside the try: opened at line 125, and the handler at lines 134-135 is except Exception: / raise SourceError("error"). A SourceError instance is an Exception, so the non-zero-returncode path is caught and re-raised as the generic error. The sibling opencode_payload raises SourceError("auth_required") at patch line 116 outside any try, so it propagates unchanged; agy_payload's cli_unavailable raise at line 124 is also outside the try. The two provider paths therefore report the same condition differently.
    Impact: An expired or missing Gemini login (the normal symptom of a non-zero agy exit) reaches the dashboard and clock as an undifferentiated error instead of auth_required, so the Gemini row loses the actionable re-authenticate signal that the OpenCode Go path preserves. tests/test_local_support.py exercises only normalize_agy on fixture data, so no supplied test covers agy_payload's failure paths.
    Suggested fix: Keep the provider error out of the catch-all: add except SourceError: raise before except Exception: at patch line 134, or move the returncode check and json.loads into an else: clause so only the subprocess call itself is guarded.

Suggestions

None.

Tests and validation

  • No configured deterministic checks.

Questions

  • The smalltv-ultra patch rewrites live.py's import from from token_tv.device import FILES, PhotoDisplay to from token_tv.device import FILES, photo_display, but only two hunks of live.py are supplied. Can you confirm no remaining bare PhotoDisplay name (for example in the restore branch immediately following the shown if args.restore_display: guard) survives in live.py, which would now be an unresolved name?
  • In the sources.py detection hunk (@@ -256,0 +302,10 @@), the OpenCode branch tests auth_file = root / "auth.json", while opencode_payload resolves its fallback as Path(account.get("source_home", "~/.local/share/opencode")).expanduser() / "auth.json". Are root and that expression the same directory, or can detection report opencode-go while the payload path then raises auth_required?
  • The rewritten account_label in token_tv/display.py returns the generic provider name for any alias that is neither PROVIDER nor PROVIDER A/PROVIDER <suffix>, so a user-chosen custom alias is silently replaced. Is discarding custom aliases intended for both the clock face and the dashboard label?

Review limitations

  • The upstream token_tv sources fetched by packages/token-tv/default.nix (GitHub rev afc60163d17e76ba71f4a7a5184be6dd4fb6baf8) are not present in the checkout, so the unchanged code around every patch hunk (live.py, display.py, themes.py, sources.py, device.py, cli.py) could not be inspected; no defect was inferred in that surrounding code.
  • The initial review's second finding (the LCARS gauge radius min(4, (right - 53) / 2) being clamped in unscaled units while box() rounds coordinates and radius separately at scale = 3) was dropped: whether Pillow's rounded_rectangle rejects a radius larger than half the smaller side cannot be established from the supplied material - no Pillow source exists in the checkout (only python3Packages.pillow is referenced in packages/token-tv/default.nix), and no supplied test renders a small non-zero bar. It remains an unverified risk, not a demonstrated defect.
  • No Nix evaluation, build, test run, or command execution was performed; the claims about nix flake check, the Vega build, the package test suite, and the canary activations are taken from the pull-request text, not verified.
  • scripts/check-token-tv-config.nix contains 12 assertions while the pull-request text describes 'Eight focused checks'; the count discrepancy could not be reconciled without running the check.
  • Physical device behaviour is out of reach: the SmallTV-Ultra firmware endpoints (/v.json, /album.json, /filelist, /doUpload, /set), the theme index hardcoded in activate() (theme=3, theme_list='0,0,1,0,0,0,0,0,0'), and the rendered frame were not observable.
  • The runtime behaviour of the patched package under the unit's sandbox settings (ProtectSystem = full, PrivateTmp, NoNewPrivileges, UMask 0077) was not exercised; only the static provisioning of /run/secrets/opencode-go-api-key and of the codex/agy binaries in the unit PATH was verified against modules/profiles/ai-runtime.nix and modules/profiles/ai-agents.nix.
  • The CI workflows were not inspected; the pull-request text states MR test/build CI runs 1178/1179 are pending and no supplied evidence shows their outcome.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • modules/profiles/ai-runtime.nix: reviewed — included in a context-limited batch
  • modules/services/token-tv.nix: reviewed — included in a context-limited batch
  • packages/token-tv/assets/agy-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/assets/opencode-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/default.nix: reviewed — included in a context-limited batch
  • packages/token-tv/local-providers-lcars.patch: reviewed — included in a context-limited batch
  • packages/token-tv/smalltv-ultra.patch: reviewed — included in a context-limited batch
  • scripts/check-token-tv-config.nix: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 8
  • Previous automated review: none found
  • Findings: 1
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `653ab7b9dcfac39f3abb59d1e399a5558bf76f56` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment Re-validated the initial review against the checked-out repository. The Nix side is consistent with the repository's established patterns: modules/services/token-tv.nix reproduces the exact nebula@mesh.service / sys-subsystem-net-devices-nebula.mesh.device after/wants/bindsTo triple used by services/kiwifs.nix, services/bookstack-mcp.nix and services/forgejo-mcp.nix, the same `networking.firewall.interfaces."nebula.mesh".allowedTCPPorts = [ cfg.port ]` form, the same `nixosConfig.backup.dataPaths = mkAfter [...]` + tmpfiles pairing used by kiwifs, the same `services.serviceFailureMonitor.services = mkIf cfg.monitorFailures (mkAfter [...])` self-registration, and the same `User = primaryUser; Group = "users"` pairing used by services/forgejo-runner.nix; port 8787 is not claimed by any other module (grep over the tree shows only this option and the README). `inputs.llm-agents.packages.<system>.codex` and `.antigravity-cli` exist in modules/profiles/ai-agents.nix, and `${antigravityCli}/bin/agy` confirms the unit's `path = [clients.codex clients.antigravity-cli]` supplies the `agy` binary the patched sources.py looks up; /run/secrets/opencode-go-api-key is provisioned by modules/profiles/ai-runtime.nix with owner = primary user, mode 0400, matching the unit's User. hosts/vega/default.nix and modules/profiles/ai-runtime.nix use the correct relative paths (../../packages/token-tv) and flake.nix follows the existing check-registration idiom. Of the two findings in the initial review, only the agy error-masking defect survives: it is demonstrable from the supplied patch text alone. The LCARS radius finding depends on Pillow behaviour that is not present in the checkout (no Pillow source, no vendored copy), so it is dropped as speculative and recorded as a limitation instead. ### Blocking findings None. ### Important findings - **agy provider's auth_required signal is swallowed by the catch-all handler** (packages/token-tv/local-providers-lcars.patch:130; high confidence) In the new agy_payload body (patch lines 121-135), `raise SourceError("auth_required")` at line 130 sits inside the `try:` opened at line 125, and the handler at lines 134-135 is `except Exception:` / `raise SourceError("error")`. A SourceError instance is an Exception, so the non-zero-returncode path is caught and re-raised as the generic `error`. The sibling opencode_payload raises `SourceError("auth_required")` at patch line 116 outside any try, so it propagates unchanged; agy_payload's `cli_unavailable` raise at line 124 is also outside the try. The two provider paths therefore report the same condition differently. Impact: An expired or missing Gemini login (the normal symptom of a non-zero `agy` exit) reaches the dashboard and clock as an undifferentiated error instead of auth_required, so the Gemini row loses the actionable re-authenticate signal that the OpenCode Go path preserves. tests/test_local_support.py exercises only normalize_agy on fixture data, so no supplied test covers agy_payload's failure paths. Suggested fix: Keep the provider error out of the catch-all: add `except SourceError: raise` before `except Exception:` at patch line 134, or move the returncode check and json.loads into an `else:` clause so only the subprocess call itself is guarded. ### Suggestions None. ### Tests and validation - No configured deterministic checks. ### Questions - The smalltv-ultra patch rewrites live.py's import from `from token_tv.device import FILES, PhotoDisplay` to `from token_tv.device import FILES, photo_display`, but only two hunks of live.py are supplied. Can you confirm no remaining bare `PhotoDisplay` name (for example in the restore branch immediately following the shown `if args.restore_display:` guard) survives in live.py, which would now be an unresolved name? - In the sources.py detection hunk (`@@ -256,0 +302,10 @@`), the OpenCode branch tests `auth_file = root / "auth.json"`, while opencode_payload resolves its fallback as `Path(account.get("source_home", "~/.local/share/opencode")).expanduser() / "auth.json"`. Are `root` and that expression the same directory, or can detection report `opencode-go` while the payload path then raises auth_required? - The rewritten `account_label` in token_tv/display.py returns the generic provider name for any alias that is neither `PROVIDER` nor `PROVIDER A`/`PROVIDER <suffix>`, so a user-chosen custom alias is silently replaced. Is discarding custom aliases intended for both the clock face and the dashboard label? ### Review limitations - The upstream token_tv sources fetched by packages/token-tv/default.nix (GitHub rev afc60163d17e76ba71f4a7a5184be6dd4fb6baf8) are not present in the checkout, so the unchanged code around every patch hunk (live.py, display.py, themes.py, sources.py, device.py, cli.py) could not be inspected; no defect was inferred in that surrounding code. - The initial review's second finding (the LCARS gauge radius `min(4, (right - 53) / 2)` being clamped in unscaled units while box() rounds coordinates and radius separately at scale = 3) was dropped: whether Pillow's `rounded_rectangle` rejects a radius larger than half the smaller side cannot be established from the supplied material - no Pillow source exists in the checkout (only `python3Packages.pillow` is referenced in packages/token-tv/default.nix), and no supplied test renders a small non-zero bar. It remains an unverified risk, not a demonstrated defect. - No Nix evaluation, build, test run, or command execution was performed; the claims about `nix flake check`, the Vega build, the package test suite, and the canary activations are taken from the pull-request text, not verified. - scripts/check-token-tv-config.nix contains 12 assertions while the pull-request text describes 'Eight focused checks'; the count discrepancy could not be reconciled without running the check. - Physical device behaviour is out of reach: the SmallTV-Ultra firmware endpoints (/v.json, /album.json, /filelist, /doUpload, /set), the theme index hardcoded in activate() (`theme=3`, `theme_list='0,0,1,0,0,0,0,0,0'`), and the rendered frame were not observable. - The runtime behaviour of the patched package under the unit's sandbox settings (ProtectSystem = full, PrivateTmp, NoNewPrivileges, UMask 0077) was not exercised; only the static provisioning of /run/secrets/opencode-go-api-key and of the codex/agy binaries in the unit PATH was verified against modules/profiles/ai-runtime.nix and modules/profiles/ai-agents.nix. - The CI workflows were not inspected; the pull-request text states MR test/build CI runs 1178/1179 are pending and no supplied evidence shows their outcome. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `modules/profiles/ai-runtime.nix`: **reviewed** — included in a context-limited batch - `modules/services/token-tv.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/agy-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/opencode-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/default.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/local-providers-lcars.patch`: **reviewed** — included in a context-limited batch - `packages/token-tv/smalltv-ultra.patch`: **reviewed** — included in a context-limited batch - `scripts/check-token-tv-config.nix`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md - Commits considered: 8 - Previous automated review: none found - Findings: 1 </details>
Preserve Gemini authentication errors in Token TV readings
Some checks are pending
Build and Push Attic Cache / test (pull_request) Waiting to run
Build and Push Attic Cache / build (pull_request) Blocked by required conditions
Build and Push Attic Cache / remediate (pull_request) Blocked by required conditions
Build and Push Attic Cache / notify-remediation (pull_request) Blocked by required conditions
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Blocked by required conditions
Build and Push Attic Cache / pin-lifecycle (pull_request) Blocked by required conditions
AI pull-request review / review (pull_request) Successful in 15m1s
d4b568a31b
Author
Owner

Review 43's Important finding is valid and fixed in d4b568a. agy_payload now re-raises SourceError before the broad fallback handler, preserving auth_required. Added five regressions for successful JSON, nonzero CLI/auth failure, missing CLI, timeout and malformed output. The auth regression also exercises fetch_account and verifies both status and error_code are auth_required rather than generic error.

Validation: all 75 package tests pass; nix flake check and the complete Vega system build pass. The display renderer and transport are unchanged. Production Vega remains on the successful d35d9c1 canary; this provider fix awaits deployment with the reviewed branch.

Source-backed answers:

  • The actual patched live.py contains no bare PhotoDisplay reference: both normal startup and restore use the device object returned by photo_display(). The restore branch calls device.restore().
  • Automatic discovery passes home to logged_in_email() and writes the same value as account.source_home. Detection's Path(home).expanduser() therefore matches polling's Path(account.source_home).expanduser(). File presence is a discovery hint; payload validation still reports auth_required if the file lacks a usable key.
  • Compact clock headings retain upstream's provider-label policy, with the requested Gemini/Opencode Go names and removal of the default A suffix. Custom aliases are retained in account metadata and remain visible in dashboard account tabs/details; this does not discard their stored values.
  • The eight focused configuration-guard input cases are separate from the twelve assertions in the committed Nix wiring gate. The MR description distinguishes those checks; there is no test-count discrepancy.

No change was made for the withdrawn speculative gauge-radius finding.

Review 43's Important finding is valid and fixed in d4b568a. agy_payload now re-raises SourceError before the broad fallback handler, preserving auth_required. Added five regressions for successful JSON, nonzero CLI/auth failure, missing CLI, timeout and malformed output. The auth regression also exercises fetch_account and verifies both status and error_code are auth_required rather than generic error. Validation: all 75 package tests pass; nix flake check and the complete Vega system build pass. The display renderer and transport are unchanged. Production Vega remains on the successful d35d9c1 canary; this provider fix awaits deployment with the reviewed branch. Source-backed answers: - The actual patched live.py contains no bare PhotoDisplay reference: both normal startup and restore use the device object returned by photo_display(). The restore branch calls device.restore(). - Automatic discovery passes home to logged_in_email() and writes the same value as account.source_home. Detection's Path(home).expanduser() therefore matches polling's Path(account.source_home).expanduser(). File presence is a discovery hint; payload validation still reports auth_required if the file lacks a usable key. - Compact clock headings retain upstream's provider-label policy, with the requested Gemini/Opencode Go names and removal of the default A suffix. Custom aliases are retained in account metadata and remain visible in dashboard account tabs/details; this does not discard their stored values. - The eight focused configuration-guard input cases are separate from the twelve assertions in the committed Nix wiring gate. The MR description distinguishes those checks; there is no test-count discrepancy. No change was made for the withdrawn speculative gauge-radius finding.
clankbot left a comment

Automated code review

Reviewed commit: d4b568a31b25e294a1743f3c76ac0f17e89c0ad4

Verdict: Ready to merge

No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.

Overall assessment

I re-checked the initial review's only finding against the checked-out tree and could not sustain it. nixosConfig is a namespace of individual options declared in modules/common/default-config.nix, and nixosConfig.tokenTv is declared only in modules/services/token-tv.nix, which only hosts/vega/default.nix imports (line 54) — but the guard's predicate uses the Nix or idiom (...tokenTv.enable or false), which catches the attribute-not-found error raised for electra/lena/lyra and yields false, so the filter reduces to ["vega"] and the assert holds. The rest of the change set matches established repository patterns: the unit mirrors modules/services/kiwifs.nix and modules/services/forgejo-mcp.nix (same nebula.mesh firewall scoping, nebula@mesh.service + sys-subsystem-net-devices-nebula.mesh.device ordering), the guard mirrors scripts/check-redview-v2-production.nix (extendModules + assert-then-runCommand wiring in flake.nix), the tmpfiles/backup-dataPaths/failure-monitor strings in scripts/check-token-tv-config.nix match the module text exactly, 8787 does not collide with Vega's other nebula.mesh ports (4533, 5432), and the OpenCode Go key the patched sources.py reads at /run/secrets/opencode-go-api-key is provisioned by modules/profiles/ai-runtime.nix:228 with owner = primaryUser, mode 0400 — readable by this service, which runs as that same user, and the unit already orders after sops-nix.service. The Python patches are self-consistent (device_api validation in sources.load_config matches live.py's photo_display dispatch; UltraPhotoDisplay.upload_path routes PhotoDisplay.upload to /doUpload?dir=/image/ as test_ultra.py expects; account_label's alias handling matches every case in test_local_support.py; the two new PNGs are copied by postPatch into the same paths web_assets.py registers, and pillow is declared as a build dependency for the new lcars renderer).

Blocking findings

None.

Important findings

None.

Suggestions

  • Configuration guard does not pin the ExecCondition skip-vs-failure contract (scripts/check-token-tv-config.nix:24; medium confidence)
    The guard asserts StartLimitIntervalSec/StartLimitBurst, Restart, StateDirectory, ConditionPathExists, the listen address, and the firewall port, but nothing about unit.serviceConfig.ExecCondition or ExecStart, even though modules/services/token-tv.nix:110 documents the contract ('ExecCondition exit codes 1-254 skip startup without marking it failed') and README.md:196-207 documents the observable behaviour ('A missing config or clock address skips startup'; 'Unreadable, malformed, or non-object JSON configuration reports a startup failure to the journal and failure monitor'). The ExecCondition script in modules/services/token-tv.nix:14-25 encodes that split as exit 255 vs exit 1.
    Impact: A later edit that drops the ExecCondition line, swaps the 255/1 exit codes, or changes the ExecStart argv would still pass nix flake check and the token-tv-config check while silently breaking the documented skip-vs-failure behaviour and the failure-monitor opt-in described in README.md.
    Suggested fix: Add asserts alongside the existing unit checks, e.g. assert builtins.match '.*token-tv-clock-configured.*' unit.serviceConfig.ExecCondition != null; and an assert that ExecStart carries --config/--host/--port/--state-dir with the option values, so the guard covers the same contract README.md documents.

Tests and validation

  • No configured deterministic checks.

Questions

  • Can the author confirm that ExecCondition exiting 255 actually puts token-tv into a failed state (and therefore triggers the OnFailure=ntfy-service-failure@%n.service stub that modules/services/service-failure-monitor.nix:80 adds for every watched name)? The README claims malformed configuration is reported to the journal and failure monitor, but the only supplied evidence for that is the module's own comment about exit codes 1-254, and I could not consult systemd documentation or run the unit here.
  • Were packages/token-tv/default.nix's patches and postPatch actually built (doCheck = true runs python -B -m unittest discover -s tests)? The two .patch files carry context-free hunks with absolute line offsets, and postPatch copies into token_tv/assets/, both of which depend on the pinned upstream tree at rev afc60163, which was not supplied to me.

Review limitations

  • I could not run nix flake check, just test, or any repository code, so the guard's evaluation is argued from Nix semantics (the e1 or e2 operator catches the attribute-not-found error raised while evaluating e1) rather than observed output.
  • The upstream token-tv source pinned by packages/token-tv/default.nix was not supplied, so I could not verify that the .patch hunks apply, that sources.py already imports exe, shutil, subprocess, and json_get, or that token_tv/assets/ exists for postPatch to copy into.
  • systemd ExecCondition exit-code semantics, the NixOS path option's expansion of clients.codex/clients.antigravity-cli into the unit PATH, and the availability of the agy and codex CLIs non-interactively under HOME = the primary user's home are not present in the supplied material.
  • Runtime behaviour (live clock rendering, provider CLI auth under ~/.codex and ~/.gemini, physical clock display, the canary results mentioned in the PR text) is taken from the PR text as untrusted evidence and was not independently verified; I made no claim about unchanged upstream code beyond what the supplied patches show.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • modules/profiles/ai-runtime.nix: reviewed — included in a context-limited batch
  • modules/services/token-tv.nix: reviewed — included in a context-limited batch
  • packages/token-tv/assets/agy-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/assets/opencode-pixel.png: reviewed — included in a context-limited batch
  • packages/token-tv/default.nix: reviewed — included in a context-limited batch
  • packages/token-tv/local-providers-lcars.patch: reviewed — included in a context-limited batch
  • packages/token-tv/smalltv-ultra.patch: reviewed — included in a context-limited batch
  • scripts/check-token-tv-config.nix: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 9
  • Previous automated review: none found
  • Findings: 1
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `d4b568a31b25e294a1743f3c76ac0f17e89c0ad4` ## Verdict: Ready to merge No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory. ### Overall assessment I re-checked the initial review's only finding against the checked-out tree and could not sustain it. `nixosConfig` is a namespace of individual options declared in modules/common/default-config.nix, and `nixosConfig.tokenTv` is declared only in modules/services/token-tv.nix, which only hosts/vega/default.nix imports (line 54) — but the guard's predicate uses the Nix `or` idiom (`...tokenTv.enable or false`), which catches the attribute-not-found error raised for electra/lena/lyra and yields false, so the filter reduces to ["vega"] and the assert holds. The rest of the change set matches established repository patterns: the unit mirrors modules/services/kiwifs.nix and modules/services/forgejo-mcp.nix (same nebula.mesh firewall scoping, nebula@mesh.service + sys-subsystem-net-devices-nebula.mesh.device ordering), the guard mirrors scripts/check-redview-v2-production.nix (extendModules + assert-then-runCommand wiring in flake.nix), the tmpfiles/backup-dataPaths/failure-monitor strings in scripts/check-token-tv-config.nix match the module text exactly, 8787 does not collide with Vega's other nebula.mesh ports (4533, 5432), and the OpenCode Go key the patched sources.py reads at /run/secrets/opencode-go-api-key is provisioned by modules/profiles/ai-runtime.nix:228 with owner = primaryUser, mode 0400 — readable by this service, which runs as that same user, and the unit already orders after sops-nix.service. The Python patches are self-consistent (device_api validation in sources.load_config matches live.py's photo_display dispatch; UltraPhotoDisplay.upload_path routes PhotoDisplay.upload to /doUpload?dir=/image/ as test_ultra.py expects; account_label's alias handling matches every case in test_local_support.py; the two new PNGs are copied by postPatch into the same paths web_assets.py registers, and pillow is declared as a build dependency for the new lcars renderer). ### Blocking findings None. ### Important findings None. ### Suggestions - **Configuration guard does not pin the ExecCondition skip-vs-failure contract** (scripts/check-token-tv-config.nix:24; medium confidence) The guard asserts StartLimitIntervalSec/StartLimitBurst, Restart, StateDirectory, ConditionPathExists, the listen address, and the firewall port, but nothing about unit.serviceConfig.ExecCondition or ExecStart, even though modules/services/token-tv.nix:110 documents the contract ('ExecCondition exit codes 1-254 skip startup without marking it failed') and README.md:196-207 documents the observable behaviour ('A missing config or clock address skips startup'; 'Unreadable, malformed, or non-object JSON configuration reports a startup failure to the journal and failure monitor'). The ExecCondition script in modules/services/token-tv.nix:14-25 encodes that split as exit 255 vs exit 1. Impact: A later edit that drops the ExecCondition line, swaps the 255/1 exit codes, or changes the ExecStart argv would still pass `nix flake check` and the token-tv-config check while silently breaking the documented skip-vs-failure behaviour and the failure-monitor opt-in described in README.md. Suggested fix: Add asserts alongside the existing unit checks, e.g. `assert builtins.match '.*token-tv-clock-configured.*' unit.serviceConfig.ExecCondition != null;` and an assert that ExecStart carries --config/--host/--port/--state-dir with the option values, so the guard covers the same contract README.md documents. ### Tests and validation - No configured deterministic checks. ### Questions - Can the author confirm that ExecCondition exiting 255 actually puts token-tv into a failed state (and therefore triggers the OnFailure=ntfy-service-failure@%n.service stub that modules/services/service-failure-monitor.nix:80 adds for every watched name)? The README claims malformed configuration is reported to the journal and failure monitor, but the only supplied evidence for that is the module's own comment about exit codes 1-254, and I could not consult systemd documentation or run the unit here. - Were packages/token-tv/default.nix's `patches` and `postPatch` actually built (doCheck = true runs `python -B -m unittest discover -s tests`)? The two .patch files carry context-free hunks with absolute line offsets, and postPatch copies into `token_tv/assets/`, both of which depend on the pinned upstream tree at rev afc60163, which was not supplied to me. ### Review limitations - I could not run `nix flake check`, `just test`, or any repository code, so the guard's evaluation is argued from Nix semantics (the `e1 or e2` operator catches the attribute-not-found error raised while evaluating e1) rather than observed output. - The upstream token-tv source pinned by packages/token-tv/default.nix was not supplied, so I could not verify that the .patch hunks apply, that sources.py already imports `exe`, `shutil`, `subprocess`, and `json_get`, or that token_tv/assets/ exists for postPatch to copy into. - systemd ExecCondition exit-code semantics, the NixOS `path` option's expansion of clients.codex/clients.antigravity-cli into the unit PATH, and the availability of the `agy` and `codex` CLIs non-interactively under HOME = the primary user's home are not present in the supplied material. - Runtime behaviour (live clock rendering, provider CLI auth under ~/.codex and ~/.gemini, physical clock display, the canary results mentioned in the PR text) is taken from the PR text as untrusted evidence and was not independently verified; I made no claim about unchanged upstream code beyond what the supplied patches show. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `modules/profiles/ai-runtime.nix`: **reviewed** — included in a context-limited batch - `modules/services/token-tv.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/agy-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/assets/opencode-pixel.png`: **reviewed** — included in a context-limited batch - `packages/token-tv/default.nix`: **reviewed** — included in a context-limited batch - `packages/token-tv/local-providers-lcars.patch`: **reviewed** — included in a context-limited batch - `packages/token-tv/smalltv-ultra.patch`: **reviewed** — included in a context-limited batch - `scripts/check-token-tv-config.nix`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md - Commits considered: 9 - Previous automated review: none found - Findings: 1 </details>
Author
Owner

Review 44 is Ready to merge on current head d4b568a, with no blocking or important findings. The authorized review/fix monitoring cycle is now stopped; no merge or rollout-hold release has been performed. CI test/build run1183 remains queued.

Confirming the questions: the package patches and postPatch were built against the pinned upstream tree, and doCheck completed all75 tests successfully. The exact latest Vega system also built. ExecCondition255 failed in the isolated Vega test, and the bounded configuration stopped with failed/start-limit-hit after3 starts. The module registers this real unit with the configured OnFailure monitor; systemd's primary documentation specifies the exit255 failure semantics: https://github.com/systemd/systemd/blob/main/man/systemd.service.xml. These observations and the eight generated-guard input checks are separate from the permanent Nix wiring assertions. The additional command/guard assertion suggestion is advisory; no runtime correction is required by this review.

Review 44 is Ready to merge on current head d4b568a, with no blocking or important findings. The authorized review/fix monitoring cycle is now stopped; no merge or rollout-hold release has been performed. CI test/build run1183 remains queued. Confirming the questions: the package patches and postPatch were built against the pinned upstream tree, and doCheck completed all75 tests successfully. The exact latest Vega system also built. ExecCondition255 failed in the isolated Vega test, and the bounded configuration stopped with failed/start-limit-hit after3 starts. The module registers this real unit with the configured OnFailure monitor; systemd's primary documentation specifies the exit255 failure semantics: https://github.com/systemd/systemd/blob/main/man/systemd.service.xml. These observations and the eight generated-guard input checks are separate from the permanent Nix wiring assertions. The additional command/guard assertion suggestion is advisory; no runtime correction is required by this review.
nimmo force-pushed feat/vega-token-tv-lcars from d4b568a31b
Some checks are pending
Build and Push Attic Cache / test (pull_request) Waiting to run
Build and Push Attic Cache / build (pull_request) Blocked by required conditions
Build and Push Attic Cache / remediate (pull_request) Blocked by required conditions
Build and Push Attic Cache / notify-remediation (pull_request) Blocked by required conditions
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Blocked by required conditions
Build and Push Attic Cache / pin-lifecycle (pull_request) Blocked by required conditions
AI pull-request review / review (pull_request) Successful in 15m1s
to 957ac09bbe
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m55s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 6m9s
2026-10-10 19:12:31 +01:00
Compare
nimmo changed title from Run the LCARS Token TV clock service on Vega to Run Vega's LCARS clock using the standalone Token TV flake 2026-10-10 19:12:48 +01:00
Author
Owner

Extracted the application and generic service into nimmo/token-tv.nix#2, which has passed CI and is now merged under the user's authorization. Current consumer head 957ac09 imports its main branch at locked revision 8c60c18. The package derivation is identical to the previously reviewed implementation; full service-equivalence checks pass before/after extraction, including on the refreshed main base. Both standalone/fleet flake checks, 75 package tests, generated guard/module checks and the final full Vega build pass. Existing native canary evidence remains in the MR description; this did not activate new changes or release Vega's hold. The new input is classified for all AI-runtime hosts. Current-head review/CI must pass before the authorized consumer merge.

Extracted the application and generic service into https://git.nimmog.uk/nimmo/token-tv.nix/pulls/2, which has passed CI and is now merged under the user's authorization. Current consumer head 957ac09 imports its main branch at locked revision 8c60c18. The package derivation is identical to the previously reviewed implementation; full service-equivalence checks pass before/after extraction, including on the refreshed main base. Both standalone/fleet flake checks, 75 package tests, generated guard/module checks and the final full Vega build pass. Existing native canary evidence remains in the MR description; this did not activate new changes or release Vega's hold. The new input is classified for all AI-runtime hosts. Current-head review/CI must pass before the authorized consumer merge.
clankbot left a comment

Automated code review

Reviewed commit: 957ac09bbe925fc811efb02a11c9c4831b213720

Verdict: Ready to merge

No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.

Overall assessment

Checked the supplied diff against the checked-out tree. The wiring is internally consistent: token-tv is added as a root input in flake.nix and to the }@inputs: argument set, so inputs.token-tv is in scope in both modules/profiles/ai-runtime.nix (which already destructures inputs) and modules/services/token-tv.nix; packages.x86_64-linux.token-tv and checks.x86_64-linux.token-tv-config follow the existing redview pattern. The auto-update group lists exactly the four registered hosts (electra, lena, vega, lyra), which matches reality: all four import modules/profiles/ai-desktop.nix, which imports ai-runtime.nix, which now installs tokenTv into home.packages; the README rule 'New root flake inputs must also be classified by real consumers in lib/auto-update-policy.nix' is satisfied. clients.codex and clients.antigravity-cli are real members of the pinned inputs.llm-agents.packages.<system> set (same attributes are read in modules/profiles/ai-agents.nix as .codex and .antigravity-cli). The firewall line, the mkAfter backup path, the lib.mkIf cfg.monitorFailures (lib.mkAfter [...]) monitor entry, and the nebula@mesh.service / sys-subsystem-net-devices-nebula.mesh.device / sops-nix.service ordering match the sibling Vega services (kiwifs.nix, bookstack-mcp.nix, navidrome-mcp.nix, trilium-web.nix) verbatim; port 8787 is not used elsewhere on the mesh, and vega's overlay IP is 10.10.0.2 as the README states. The initial review's only finding is incorrect: config.nixosConfig.tokenTv is neither declared nor defined on electra/lena/lyra (grep shows nixosConfig.tokenTv is declared solely in modules/services/token-tv.nix, imported only by hosts/vega/default.nix), so the lookup raises an attribute-not-found error, which the Nix or operator does catch, yielding false; the guard is total and enabledHosts == [ "vega" ] is satisfiable. No defect demonstrable from the supplied evidence.

Blocking findings

None.

Important findings

None.

Suggestions

None.

Tests and validation

  • No configured deterministic checks.

Questions

None.

Review limitations

  • The token-tv flake itself is not supplied: inputs.token-tv.nixosModules.default, its services.token-tv option set (user, extraPackages, listenAddress, port, configFile), its package, and the ExecStart/ExecCondition, tmpfiles rule, StateDirectory and StartLimit* settings asserted in scripts/check-token-tv-config.nix originate upstream and could not be inspected, so those assertions were not verified against real option names or defaults.
  • No Nix tooling or CI output was supplied; nix flake check, the new checks.x86_64-linux.token-tv-config, and the Vega build were not evaluated, so no assertion failure or type mismatch in the new module/check could be ruled out by evaluation.
  • No live activation or deployment evidence for this head is present in the supplied material; the README's runtime claims (clock behaviour, device_url/device_api firmware notes, journal/failure-monitor reporting, reset-failed recovery) are documentation only and were not exercised.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.lock: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • lib/auto-update-policy.nix: reviewed — included in a context-limited batch
  • modules/profiles/ai-runtime.nix: reviewed — included in a context-limited batch
  • modules/services/token-tv.nix: reviewed — included in a context-limited batch
  • scripts/check-token-tv-config.nix: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 10
  • Previous automated review: none found
  • Findings: 0
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `957ac09bbe925fc811efb02a11c9c4831b213720` ## Verdict: Ready to merge No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory. ### Overall assessment Checked the supplied diff against the checked-out tree. The wiring is internally consistent: `token-tv` is added as a root input in flake.nix and to the `}@inputs:` argument set, so `inputs.token-tv` is in scope in both `modules/profiles/ai-runtime.nix` (which already destructures `inputs`) and `modules/services/token-tv.nix`; `packages.x86_64-linux.token-tv` and `checks.x86_64-linux.token-tv-config` follow the existing redview pattern. The auto-update group lists exactly the four registered hosts (electra, lena, vega, lyra), which matches reality: all four import `modules/profiles/ai-desktop.nix`, which imports `ai-runtime.nix`, which now installs `tokenTv` into `home.packages`; the README rule 'New root flake inputs must also be classified by real consumers in lib/auto-update-policy.nix' is satisfied. `clients.codex` and `clients.antigravity-cli` are real members of the pinned `inputs.llm-agents.packages.<system>` set (same attributes are read in `modules/profiles/ai-agents.nix` as `.codex` and `.antigravity-cli`). The firewall line, the `mkAfter` backup path, the `lib.mkIf cfg.monitorFailures (lib.mkAfter [...])` monitor entry, and the `nebula@mesh.service` / `sys-subsystem-net-devices-nebula.mesh.device` / `sops-nix.service` ordering match the sibling Vega services (`kiwifs.nix`, `bookstack-mcp.nix`, `navidrome-mcp.nix`, `trilium-web.nix`) verbatim; port 8787 is not used elsewhere on the mesh, and vega's overlay IP is 10.10.0.2 as the README states. The initial review's only finding is incorrect: `config.nixosConfig.tokenTv` is neither declared nor defined on electra/lena/lyra (grep shows `nixosConfig.tokenTv` is declared solely in `modules/services/token-tv.nix`, imported only by `hosts/vega/default.nix`), so the lookup raises an attribute-not-found error, which the Nix `or` operator does catch, yielding `false`; the guard is total and `enabledHosts == [ "vega" ]` is satisfiable. No defect demonstrable from the supplied evidence. ### Blocking findings None. ### Important findings None. ### Suggestions None. ### Tests and validation - No configured deterministic checks. ### Questions None. ### Review limitations - The `token-tv` flake itself is not supplied: `inputs.token-tv.nixosModules.default`, its `services.token-tv` option set (`user`, `extraPackages`, `listenAddress`, `port`, `configFile`), its package, and the ExecStart/ExecCondition, tmpfiles rule, StateDirectory and StartLimit* settings asserted in `scripts/check-token-tv-config.nix` originate upstream and could not be inspected, so those assertions were not verified against real option names or defaults. - No Nix tooling or CI output was supplied; `nix flake check`, the new `checks.x86_64-linux.token-tv-config`, and the Vega build were not evaluated, so no assertion failure or type mismatch in the new module/check could be ruled out by evaluation. - No live activation or deployment evidence for this head is present in the supplied material; the README's runtime claims (clock behaviour, `device_url`/`device_api` firmware notes, journal/failure-monitor reporting, reset-failed recovery) are documentation only and were not exercised. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.lock`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `lib/auto-update-policy.nix`: **reviewed** — included in a context-limited batch - `modules/profiles/ai-runtime.nix`: **reviewed** — included in a context-limited batch - `modules/services/token-tv.nix`: **reviewed** — included in a context-limited batch - `scripts/check-token-tv-config.nix`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md - Commits considered: 10 - Previous automated review: none found - Findings: 0 </details>
nimmo merged commit 7bed744ee4 into main 2026-10-10 19:37:22 +01:00
Sign in to join this conversation.
No reviewers
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config!308
No description provided.