feat(services): add service_books.nu #81
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_skills!81
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_service_books"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds
tools/modules/services/service_books.nu, a lifecycle module for thehero_booksservice (server + UI) withinstall | start | stop | statussubcommands. Mirrors the two-binary pattern fromservice_os.nuwith three hero_books-specific adaptations.Related
Changes
tools/modules/services/service_books.nu— new module (~370 lines). Registershero_books_serverandhero_books_uias hero_proc actions plus thehero_booksservice. Surfaces both Unix sockets and thehttp+unix://…/ui.sock/URL in the start summary.tools/modules/services/mod.nu— addexport use service_books.nu.--rootis optional on every command; user-level is the default.Hero_books-specific adaptations vs. service_os
--workspacecargo pass. hero_books is a hybridworkspace + root [package]layout, so plaincargo build --release --manifest-path Cargo.tomlonly builds the roothero_bookscrate + its direct deps (hero_books_lib,hero_books_docusaurus), missinghero_books_server,hero_books_ui,hero_books_admin.installrunscargo build --release --workspacefirst;svc_cargo_installthen runs as an incremental no-op and copies all 5 binaries. hero_proc and hero_os are pure virtual workspaces (no root package) so their modules don't need this.HERO_BOOKS_DATA=<hero_home>/var/books,HERO_EMBEDDER_URL=unix://<sock_base>/hero_embedder/rpc.sock, both computed fromsvc_home $root/svc_sock_base $root. Matches the binary's compiled-in defaults; the TOML's__HERO_VAR__/ hardcoded/root/...placeholders are for a different templating path. Documented inline as a reusable convention for future services.servesubcommand.hero_books_server/hero_books_uihave aservesubcommand they must be invoked with, otherwise they print help and exit, which hero_proc interprets as a crash.script: $"($bin) serve"in both action specs.svx_check_embedderpreflight. Replacesservice_os's WASM-assets preflight. Warns (does NOT fail) when the hero_embedder socket is absent — the server runs in degraded mode without it (no vector search / semantic Q&A) and retries on next RPC once embedder comes up, so no hero_books restart is needed after the fact.Test Results
End-to-end smoke test on the Hetzner box from a clean state. Every assertion passed.
service_proc start --roothealthyservice_books install --rootproduced all 5 binariesservice_books start --reset --rootwith embedder preflight warningrpc.sockandui.socklive unix sockets--unix-socket)service_books status --rootreturnsstate: running, restarts: 0--reset) prints "already running"HERO_BOOKS_DATAandHERO_EMBEDDER_URLcorrectly set on registered server actionstate: runningheldservice_books stop --rootstops and unregistersservice 'hero_books' not foundFull per-step output is on issue #80.
Issues caught during testing (all fixed)
servesubcommand — initial run triggered 6 failed restarts +state: failed. Fix:script: $"($bin) serve"in both action specs._server/_ui/_adminafter plain cargo build — hybrid workspace layout. Fix: explicit--workspacepass.Follow-up (not part of this PR)
RUSTC_WRAPPER/SCCACHE_*env in the test wrapper. Belongs in its own issue alongside theservice_proc.nu:270bug already tracked at #79.