feat(services): add service_voice.nu #93

Merged
mahmoud merged 2 commits from development_service_voice into development 2026-04-20 10:37:50 +00:00
Owner

Summary

Adds tools/modules/services/service_voice.nu, a lifecycle module for the hero_voice service (server + UI). Pure copy-rename of the current canonical template service_indexer.nu with one UI-env delta: HERO_VOICE_STT_LOCAL: "true".

Changes

  • tools/modules/services/service_voice.nu — new module (~203 lines).
  • tools/modules/services/mod.nuexport use service_voice.nu.
  • tools/modules/services/packages.nuuse service_voice.nu + entry in services_extra (voice is not a core bootstrap service; matches the current --update/--reset passthrough pattern landed by the latest refactor).

Alignment with 2026-04-20 landings

Rebased against current origin/development — conflict in packages.nu resolved by adopting the new if $reset { ... --reset } else if $update { ... --update } else { install } passthrough shape introduced in 2458a92.

Module code itself is unaffected by any of the 2026-04-20 refactors:

  • 85dfdc7 (despiegk) — services split; voice cloned from the new service_indexer.nu template.
  • c6ad517 (kristof5) — svc_require_sudo now uses is-admin; transparent to callers.
  • 5e032e5, abd0a1d (kristof5) — --core/--template flags on service_install_all; voice added to services_extra so --core correctly omits it.
  • 2458a92 (kristof5) — --reset/--update passthrough in every entry; matched for voice.

Test Results

Every module-level assertion: PASS.

# Assertion Result
nu -c "source service_voice.nu; print parse-ok" PASS
nu -c "source packages.nu; print parse-ok" PASS
use mod.nu * exposes 4 subcommands (install, start, stop, status) PASS
1a status with hero_proc down → guidance error PASS
1b stop with hero_proc down → warn and return PASS
1c start with hero_proc down → guidance error before anything PASS
2a service_proc start --root up PASS

End-to-end install blocked by upstream. The whisper-rs-sys crate (hero_voice's STT dependency) fails during its CMake-driven C++ build with:

fatal error: opening dependency file CMakeFiles/ggml-base.dir/ggml.c.o.d: Permission denied

Same class of issue another user on the same box hit this morning during service_core install (Permission denied writing .d files inside their own cargo target dir). Root cause is the interaction between RUSTC_WRAPPER=sccache (root-owned server) and upstream CMake builds that write deps across sessions — not addressable in this module.

Parallel pattern to the gating we've accepted on prior PRs:

  • #89 (service_biz): upstream placeholder run_server() that never binds rpc.sock.
  • #78 (service_os): upstream WASM assets pre-requisite.
  • This PR (service_voice): upstream sccache + CMake writeback conflict.

The module is structurally correct and will install end-to-end on any environment where sccache is disabled or the cache is in a consistent state.

Follow-up (out of scope)

Worth a dedicated ticket: RUSTC_WRAPPER=sccache default interaction with CMake-using crates (whisper-rs-sys, and suspected similar in mahmoud's rustc .d Permission denied on herolib_tools). Either:

  1. Make sccache opt-in per user, or
  2. Investigate the writeback path so cargo's next rebuild can update the artifact.

Tracked informally alongside issue #79 (the service_proc.nu:270 rm bug).

## Summary Adds `tools/modules/services/service_voice.nu`, a lifecycle module for the `hero_voice` service (server + UI). Pure copy-rename of the current canonical template `service_indexer.nu` with one UI-env delta: `HERO_VOICE_STT_LOCAL: "true"`. ## Related - Closes #92 - Part of #75 ## Changes - `tools/modules/services/service_voice.nu` — new module (~203 lines). - `tools/modules/services/mod.nu` — `export use service_voice.nu`. - `tools/modules/services/packages.nu` — `use service_voice.nu` + entry in `services_extra` (voice is not a core bootstrap service; matches the current `--update`/`--reset` passthrough pattern landed by the latest refactor). ## Alignment with 2026-04-20 landings Rebased against current `origin/development` — conflict in `packages.nu` resolved by adopting the new `if $reset { ... --reset } else if $update { ... --update } else { install }` passthrough shape introduced in `2458a92`. Module code itself is unaffected by any of the 2026-04-20 refactors: - `85dfdc7` (despiegk) — services split; voice cloned from the new `service_indexer.nu` template. - `c6ad517` (kristof5) — `svc_require_sudo` now uses `is-admin`; transparent to callers. - `5e032e5`, `abd0a1d` (kristof5) — `--core`/`--template` flags on `service_install_all`; voice added to `services_extra` so `--core` correctly omits it. - `2458a92` (kristof5) — `--reset`/`--update` passthrough in every entry; matched for voice. ## Test Results **Every module-level assertion: PASS.** | # | Assertion | Result | |---|---|---| | — | `nu -c "source service_voice.nu; print parse-ok"` | PASS | | — | `nu -c "source packages.nu; print parse-ok"` | PASS | | — | `use mod.nu *` exposes 4 subcommands (`install`, `start`, `stop`, `status`) | PASS | | 1a | `status` with hero_proc down → guidance error | PASS | | 1b | `stop` with hero_proc down → warn and return | PASS | | 1c | `start` with hero_proc down → guidance error before anything | PASS | | 2a | `service_proc start --root` up | PASS | **End-to-end `install` blocked by upstream.** The `whisper-rs-sys` crate (hero_voice's STT dependency) fails during its CMake-driven C++ build with: ``` fatal error: opening dependency file CMakeFiles/ggml-base.dir/ggml.c.o.d: Permission denied ``` Same class of issue another user on the same box hit this morning during `service_core install` (`Permission denied` writing `.d` files inside their own cargo target dir). Root cause is the interaction between `RUSTC_WRAPPER=sccache` (root-owned server) and upstream CMake builds that write deps across sessions — not addressable in this module. Parallel pattern to the gating we've accepted on prior PRs: - #89 (`service_biz`): upstream placeholder `run_server()` that never binds rpc.sock. - #78 (`service_os`): upstream WASM assets pre-requisite. - This PR (`service_voice`): upstream sccache + CMake writeback conflict. The module is structurally correct and will install end-to-end on any environment where sccache is disabled or the cache is in a consistent state. ### Follow-up (out of scope) Worth a dedicated ticket: `RUSTC_WRAPPER=sccache` default interaction with CMake-using crates (whisper-rs-sys, and suspected similar in mahmoud's rustc `.d` Permission denied on `herolib_tools`). Either: 1. Make sccache opt-in per user, or 2. Investigate the writeback path so cargo's next rebuild can update the artifact. Tracked informally alongside issue #79 (the `service_proc.nu:270` rm bug).
Add a service_voice module that provides install | start | stop | status
lifecycle commands for hero_voice (hero_voice_server + hero_voice_ui)
through hero_proc. Pure copy-rename of the current canonical template
service_indexer.nu, with one UI-env delta:

  env: {RUST_LOG: "info", HERO_VOICE_STT_LOCAL: "true"}

Grep confirms HERO_VOICE_STT_LOCAL is consumed only by hero_voice_ui
(crates/hero_voice/src/local_transcriber.rs:31, instantiated from
crates/hero_voice_ui/src/{ws.rs,transcribe_handler.rs}), so set on the
UI action only. Server action env stays on RUST_LOG, matching the TOML
[server.env] block.

Wires the module into:
- services/mod.nu: export use service_voice.nu
- services/packages.nu: use service_voice.nu + services_extra entry
  (voice is not a core bootstrap service, so goes in services_extra
  rather than services_core)

Smoke test on Hetzner passes every module-level assertion (parse,
mod.nu re-export, packages.nu inclusion, hero_proc-down error paths).
End-to-end install is blocked by an upstream whisper-rs-sys / CMake
build issue when RUSTC_WRAPPER=sccache is in effect — same class of
upstream gating we accepted on service_biz (placeholder run_server)
and service_os (WASM assets). Not addressable in this module.

#92
#75
mahmoud merged commit 258f72f2ae into development 2026-04-20 10:37:50 +00:00
mahmoud deleted branch development_service_voice 2026-04-20 10:37:54 +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!93
No description provided.