feat(services): add service_whiteboard.nu #83

Merged
mahmoud merged 1 commit from development_service_whiteboard into development 2026-04-19 19:13:56 +00:00
Owner

Summary

Adds tools/modules/services/service_whiteboard.nu, a lifecycle module for the hero_whiteboard service (server + UI) with install | start | stop | status subcommands. Near-identical copy of service_os.nu, confirming the minimal two-binary / virtual-workspace / no-preflight template is reusable.

Changes

  • tools/modules/services/service_whiteboard.nu — new module (~270 lines). Registers hero_whiteboard_server and hero_whiteboard_ui as hero_proc actions plus the hero_whiteboard service. Surfaces both Unix sockets and the http+unix://…/ui.sock/ URL in the start summary.
  • tools/modules/services/mod.nu — add export use service_whiteboard.nu.

--root is optional on every command; user-level is the default.

Why this is the simplest cycle so far

Zero books-specific adaptations. Zero os-specific adaptations. Just:

  • Virtual workspace (no --workspace pass like books).
  • No serve subcommand (confirmed via main.rsmain calls serve() directly). Books remains the only outlier.
  • No HERO_*_DATA / socket-url placeholders to resolve.
  • No dependency preflight (empty depends_on, no external asset dir).

The only substantive diff vs. service_os.nu is removal of svx_check_assets (and its call in start).

Test Results

End-to-end smoke test on the Hetzner box. Every service_whiteboard assertion passed.

# Assertion Result
1a–1c hero_proc-down error paths for status / stop / start PASS
2a service_proc start --root healthy PASS
2b service_whiteboard install --root produced 3 binaries PASS
2c service_whiteboard start --reset --root registers + starts PASS
2d–2e Both rpc.sock and ui.sock live unix sockets PASS
2f–2g Both sockets accept HTTP PASS
2h status returns {name: hero_whiteboard, state: running, restarts: 0} PASS
2i Idempotent start (no --reset) prints "already running" PASS
2j 15 s observation — no new restarts, state held running PASS
2k stop cleanly unregisters PASS
2m Post-stop status returns expected service 'hero_whiteboard' not found PASS

Full per-step output on issue #82.

Non-blocking observation

Socket files (rpc.sock, ui.sock) remained on disk as stale zero-byte inodes after stop — hero_whiteboard's binaries don't unlink their Unix-socket path on SIGTERM (unlike hero_os_server / hero_books_server, which do). Harmless: hero_proc unregistered cleanly (confirmed by the post-stop status error), and kill_other.socket in the action specs unlinks the stale files on the next start. Worth a separate follow-up issue against lhumina_code/hero_whiteboard to add a SIGTERM handler; out of scope here.

## Summary Adds `tools/modules/services/service_whiteboard.nu`, a lifecycle module for the `hero_whiteboard` service (server + UI) with `install | start | stop | status` subcommands. Near-identical copy of `service_os.nu`, confirming the minimal two-binary / virtual-workspace / no-preflight template is reusable. ## Related - Closes #82 - Part of #75 ## Changes - `tools/modules/services/service_whiteboard.nu` — new module (~270 lines). Registers `hero_whiteboard_server` and `hero_whiteboard_ui` as hero_proc actions plus the `hero_whiteboard` service. Surfaces both Unix sockets and the `http+unix://…/ui.sock/` URL in the start summary. - `tools/modules/services/mod.nu` — add `export use service_whiteboard.nu`. `--root` is optional on every command; user-level is the default. ### Why this is the simplest cycle so far Zero books-specific adaptations. Zero os-specific adaptations. Just: - Virtual workspace (no `--workspace` pass like books). - No `serve` subcommand (confirmed via `main.rs` — `main` calls `serve()` directly). Books remains the only outlier. - No `HERO_*_DATA` / socket-url placeholders to resolve. - No dependency preflight (empty `depends_on`, no external asset dir). The only substantive diff vs. `service_os.nu` is removal of `svx_check_assets` (and its call in `start`). ## Test Results End-to-end smoke test on the Hetzner box. Every `service_whiteboard` assertion passed. | # | Assertion | Result | |---|---|---| | 1a–1c | hero_proc-down error paths for status / stop / start | PASS | | 2a | `service_proc start --root` healthy | PASS | | 2b | `service_whiteboard install --root` produced 3 binaries | PASS | | 2c | `service_whiteboard start --reset --root` registers + starts | PASS | | 2d–2e | Both `rpc.sock` and `ui.sock` live unix sockets | PASS | | 2f–2g | Both sockets accept HTTP | PASS | | 2h | `status` returns `{name: hero_whiteboard, state: running, restarts: 0}` | PASS | | 2i | Idempotent `start` (no `--reset`) prints "already running" | PASS | | 2j | 15 s observation — no new restarts, state held running | PASS | | 2k | `stop` cleanly unregisters | PASS | | 2m | Post-stop `status` returns expected `service 'hero_whiteboard' not found` | PASS | Full per-step output on issue #82. ### Non-blocking observation Socket files (`rpc.sock`, `ui.sock`) remained on disk as stale zero-byte inodes after `stop` — hero_whiteboard's binaries don't unlink their Unix-socket path on SIGTERM (unlike `hero_os_server` / `hero_books_server`, which do). Harmless: hero_proc unregistered cleanly (confirmed by the post-stop `status` error), and `kill_other.socket` in the action specs unlinks the stale files on the next `start`. Worth a separate follow-up issue against `lhumina_code/hero_whiteboard` to add a SIGTERM handler; out of scope here.
Add a service_whiteboard module that provides install | start | stop | status
lifecycle commands for hero_whiteboard (hero_whiteboard_server +
hero_whiteboard_ui) through hero_proc.

Near-identical copy of service_os.nu: virtual workspace so plain cargo
build covers all members, no `serve` subcommand, no env placeholders,
no dependency preflight. Only delta vs. service_os is the removal of
the WASM asset preflight — hero_whiteboard has no external asset dir.

#82
#75
mahmoud merged commit fc6a38ba61 into development 2026-04-19 19:13:56 +00:00
mahmoud deleted branch development_service_whiteboard 2026-04-19 19:14:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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
lhumina_code/hero_skills!83
No description provided.