feat(service_os): close lifecycle gaps — start_base/start_full bundles + islands_build with preflight #163
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_skills!163
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/service_os-bundles-and-islands-build"
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?
Closes #162.
What's in this PR
Two commits adding three new commands + one preflight warn to
service_os. Code-only — no behavior changes to existing commands.Commit 1:
feat(service_os): add start_base / start_full bundle commandsBoth take
--reset/--update/--root/--with-core.--with-corechainsservice_core startfirst. Each underlyingservice_X startis idempotent.Commit 2:
feat(service_os): add islands_build with preflight warn for per-island WASMsWraps
cd ~/hero/code0/hero_archipelagos && make install. Also adds a non-fatal warn inservice_os startwhen the islands dir is missing/empty, mirroring the existingsvx_check_assetspattern.Per the issue body,
startdoes NOT auto-chainislands_build— same separation-of-phases the module already uses forinstallvswasm_build. Users compose explicitly:Tested
Validated on a multi_user_add box (kristof4):
service_os start_base --with-corebrings up hero_proc + hero_db + hero_router + hero_code + hero_logic + hero_osis + hero_aibroker + hero_proxy + hero_os ✓service_os islands_buildbuilds 40 islands + installs to~/hero/share/hero_os/islands/; followed by hero_os restart, dock items load via/hero_os/ui/islands/<id>/...✓service_os startwarns cleanly when islands dir is empty, and is silent when it's populated ✓service_os install/wasm_build/start/stop/statusbehavior unchanged ✓Notes
hero_os_uionly registers the/islandsHTTP route if the directory exists at process startup.islands_build --restartcovers the first-install case; subsequent rebuilds don't need a restart.islands_builderrors loudly ifwasm-packis missing (one-shot fix:cargo install wasm-pack) and if the upstreaminstallMakefile target ever disappears.A complete hero_os stack needs hero_proc + hero_router + several companion services running, but until now users had to compose `service_X start` calls by hand. This adds two bundle commands that mirror the existing service_core start pattern but hero_os-centric: service_os start_base — starts hero_os + minimum companions: hero_osis, hero_aibroker, hero_proxy (the services its built-in features actually use: hero_osis_sdk for AI bar / spaces, aibroker for routing, proxy for auth per registry.rs comment) service_os start_full — start_base + every per-island companion service so every dock item routes to a live backend: livekit, collab, voice, books, biz, foundry, indexer, embedder, codescalers, browser Both accept --reset, --update, --root, --with-core (chains service_core start first). Each underlying service_X start is idempotent, so re-running is safe. No auto-chain into start_base/start_full from the existing `start` command — same separation-of-phases the module already uses for wasm_build vs install.Background: a working hero_os UI has TWO WASM artifact phases — the main hero_os_app shell bundle (built via `service_os wasm_build` from the hero_os repo) AND ~30 per-island WASM packages (built via wasm-pack from the hero_archipelagos repo). Without the per-island packages, the desktop shell loads but every dock click 404s at `/islands/<id>/...`. Until now there was no `service_*` wrapper for the per-island phase — users had to know to manually `cd ~/hero/code0/hero_archipelagos && make install`. This adds: service_os islands_build [--root] [--update] [--restart] It wraps the hero_archipelagos `make install` target (which itself runs wasm-pack per island crate + rsyncs pkg/ outputs to $INSTALL_DIR). For --root, INSTALL_DIR is overridden to /root/hero/share/...; otherwise defaults to $HOME-relative. Preflights wasm-pack availability with a clean remediation hint, and bails loudly if the upstream `install` Makefile target ever disappears. Also adds a non-fatal preflight warn in `start`, mirroring the existing svx_check_assets pattern for the public/index.html path: ⚠ per-island WASM bundles not found at ~/hero/share/hero_os/islands Dock items will 404 when clicked (the desktop shell still loads). Build + install them once: service_os islands_build --restart The --restart hint is non-obvious but real: hero_os_ui only registers the /islands HTTP route if the directory exists at process startup. So even after a successful islands_build, the running hero_os_ui won't serve them until it's restarted. Like wasm_build, islands_build is a discrete command — start does NOT auto-chain it. Same separation-of-phases the module already uses for install vs wasm_build.service_codescalers is a per-host admin tool, not a per-user service. Its `start` errors out without `--root`: error: service_codescalers must be started with --root. hero_codescalers is a per-server admin tool. There is ONE instance per host, owned by root, with TCP access gated by ADMIN_SECRETS in root's hero_proc secret store. Per-user instances are not supported. start_full is the per-user "spin up everything" bundle, so calling service_codescalers from it always fails. Removing the call (and the unused module import). Codescalers should be brought up separately by the box admin: `service_codescalers start --root`.Thanks for the careful write-up — the gap you're pointing at is real, and the
svx_check_islandspreflight is a nice add on its own. Before this lands though I'd like to push back on thestart_base/start_fullshape, because I think it overlaps a lot with stuff we already have, and pullsservice_os.nusomewhere it isn't supposed to go.What we already have today
Three layers, on purpose:
Quick demo of just running them on my box right now:
Note
service_coreis doing the check → start → settle → retry-with-reset dance viacore_step. That's the resilience contract we want any "start a stack" command to honour.Where the PR rubs against that
service_X.numodules manage one service. The existing precedent for one service module importing another (service_collab→service_livekit) is a hard runtime data dependency — collab reads livekit'sruntime.jsonfor credentials. Bundling 13 sibling modules intoservice_os.nubecause they happen to back UI islands is a different shape, and it turns a leaf module into a meta-orchestrator.start_fullduplicatesservice_completewith a different list. Todayservice_completecovers proxy/db/os/osis/collab/livekit/biz/aibroker/logic/slides/whiteboard/indexer/foundry/voice/agent.start_fullcovers a different curated set (no db, no slides, no whiteboard, no agent; commit 3 already had to remove codescalers). Two lists in two places will drift — every new island service would need to be added in both.No
core_stepmachinery.start_fullis a flat sequence ofservice_X startwithprintbetween them. No health probe, no settle wait, no reset retry. So it's strictly less robust thanservice_corefor the same kind of work.--with-corefrom a non-core module is a layering inversion.service_core startalready exists for this; chaining it fromservice_os.nuputs core orchestration on a leaf service.islands_buildbelongs to a different repo. It buildslhumina_code/hero_archipelagoswith a separate toolchain (wasm-pack). Natural home is its own module —service_archipelagos.nuorservice_islands.nu— sitting next to the others. Thesvx_check_islandswarn insideservice_os startis fine and can stay.Pull request closed