hero_livekit ships no service.toml — hero_proc cannot supervise, Conferences island breaks #39
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_livekit#39
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Bug
The Conferences island in Hero OS fails to load with:
Root cause:
hero_livekitships noservice.tomlfiles. Neithercrates/hero_livekit_servernorcrates/hero_livekit_adminhas the canonical manifest, sohero_proccannot register or supervise either binary. Therpc.sockis never created, and the Conferences island (which connects to that socket) sees no daemon.Symptoms observed locally:
find hero_livekit -name service.tomlreturns nothing.hero_proc service listdoes not includehero_livekit.~/hero/var/sockets/hero_livekit/only contains a leftoveradmin.sock; norpc.sock.hero_livekit_admin --infoprocess is left hanging (likely a previouslab --startattempt that couldn't register without a manifest).Reference:
hero_bookshascrates/hero_books_server/service.toml,hero_books_admin/service.toml, etc. — the same shapehero_livekitneeds.Fix
Add canonical
service.tomlfiles following thehero_service_infoskill:crates/hero_livekit_server/service.toml[service]name="hero_livekit", repo="lhumina_code/hero_livekit", crate="hero_livekit_server", category="user" (or "core" if treated as core).[[binaries]]name="hero_livekit_server", kind="server".[[binaries.sockets]]type="rpc", path="hero_livekit/rpc.sock", protocol="openrpc", openrpc=true.[[dependencies]]onhero_proc_server.crates/hero_livekit_admin/service.toml[service]crate="hero_livekit_admin".[[binaries]]name="hero_livekit_admin", kind="admin".[[binaries.sockets]]type="admin", path="hero_livekit/admin.sock", protocol="http", webui=true.[[dependencies]]onhero_livekit_server.build.rs(herolib_core::base::embed_service_toml) so each binary serves them via--info.cd hero_livekit && lab --startthen registers both,hero_proc service listshowshero_livekit, and~/hero/var/sockets/hero_livekit/rpc.sockappears.Acceptance
crates/hero_livekit_server/service.tomlexists and validates viahero_livekit_server --info.crates/hero_livekit_admin/service.tomlexists and validates viahero_livekit_admin --info.hero_proc service listshowshero_livekitrunning afterlab --start.~/hero/var/sockets/hero_livekit/rpc.sockis bound while the server is up.Notes
hero_livekitis genuinely offline (out of scope for this issue — track separately if desired).Implementation Spec for Issue #39
Objective
Add canonical
service.tomlmanifests and wireherolib_core::baseinto bothhero_livekit_serverandhero_livekit_adminsohero_proccan register and supervise them. This restores creation of~/hero/var/sockets/hero_livekit/rpc.sockat server startup, unblocks the Hero OS Conferences island, and makes--info/lab infochecksucceed on the repo. The fix follows the contract documented in thehero_service_infoandherolib_baseskills.Requirements
crates/hero_livekit_server,crates/hero_livekit_admin) must shipservice.tomlat the crate root and embed it at compile time viainclude_str!("../service.toml").main.rsmust callherolib_core::base::validate_service_toml(SERVICE_TOML)andherolib_core::base::handle_info_flag(SERVICE_TOML)as the very first two lines insidemain(), before any other logic. This is what eliminates thehero_livekit_admin --infozombie symptom.[[binaries.sockets]]paths must match what the binaries actually bind today:hero_livekit/rpc.sockfor the server andhero_livekit/admin.sockfor the admin (seecrates/hero_livekit_sdk/src/lib.rs:75-81).service.name = "hero_livekit"(no_server/_adminsuffix);service.crateis the actual crate name;service.version = "0.1.0"(matches workspace[workspace.package].version).herolib_core = { workspace = true }must be a direct dependency of both binary crates'Cargo.toml. It already exists in workspace deps but is not pulled into either binary crate today.crates/hero_livekit_server/build.rsis exclusively forOschemaBuildercodegen and does not need changes — embedding is viainclude_str!inmain.rsper the canonical pattern.lab infocheckmust exit 0 with0 crate(s) with issues, andhero_proc service listmust listhero_livekitafterlab --start.Files to Modify/Create
crates/hero_livekit_server/service.toml— Create. Manifest for the JSON-RPC server binary; declares onerpcsocket athero_livekit/rpc.sockwithprotocol = "openrpc",openrpc = true, depends onhero_proc_server.crates/hero_livekit_server/Cargo.toml— Modify. Addherolib_core = { workspace = true }to[dependencies].crates/hero_livekit_server/src/main.rs— Modify. Addconst SERVICE_TOML: &str = include_str!("../service.toml");at module scope, and insertherolib_core::base::validate_service_toml(SERVICE_TOML);thenherolib_core::base::handle_info_flag(SERVICE_TOML);as the first two statements insideasync fn main().crates/hero_livekit_server/build.rs— No change.crates/hero_livekit_admin/service.toml— Create. Manifest for the admin dashboard binary; declares oneadminsocket athero_livekit/admin.sockwithprotocol = "http",webui = true, depends onhero_livekit_server.crates/hero_livekit_admin/Cargo.toml— Modify. Addherolib_core = { workspace = true }to[dependencies].crates/hero_livekit_admin/src/main.rs— Modify. Sameconst+ two-linemain()prelude as the server.Implementation Plan
Step 1: Create
crates/hero_livekit_server/service.tomlFiles:
crates/hero_livekit_server/service.tomlhero_os/crates/hero_os_server/service.toml. Required content:[service]:name = "hero_livekit",repo = "lhumina_code/hero_livekit",crate = "hero_livekit_server",display = "Hero LiveKit Server",description = "LiveKit SFU orchestrator — rooms, participants, tokens, exposed as a JSON-RPC 2.0 service over a Unix socket.",category = "core",version = "0.1.0".[[binaries]]:name = "hero_livekit_server",kind = "server",desc = "JSON-RPC 2.0 daemon for the LiveKit SFU orchestrator; exposes room/participant/token management.".[[binaries.sockets]]:type = "rpc",path = "hero_livekit/rpc.sock",protocol = "openrpc",openrpc = true,sse = false,rest = false,webui = false.[[dependencies]]:repo = "lhumina_code/hero_proc",crate = "hero_proc_server",bin = "hero_proc_server".[[env]]entries:HERO_SOCKET_DIR,HOME,RUST_LOG.Dependencies: none
Step 2: Wire
service.tomlintocrates/hero_livekit_server/src/main.rsFiles:
crates/hero_livekit_server/src/main.rs,crates/hero_livekit_server/Cargo.tomlherolib_core = { workspace = true }to[dependencies]inCargo.toml.const SERVICE_TOML: &str = include_str!("../service.toml");at module scope (above existing imports, ~line 7).async fn main(), make these the first two statements (beforeHeroLifecycle::new(...)):service_socket_path(),HeroLifecycle, or the OServer wiring.Dependencies: Step 1
Step 3: Create
crates/hero_livekit_admin/service.tomlFiles:
crates/hero_livekit_admin/service.tomlhero_os/crates/hero_os_admin/service.toml. Required content:[service]:name = "hero_livekit",repo = "lhumina_code/hero_livekit",crate = "hero_livekit_admin",display = "Hero LiveKit Admin",description = "Admin dashboard for the hero_livekit SFU orchestrator — service status, rooms, and join links.",category = "core",version = "0.1.0".[[binaries]]:name = "hero_livekit_admin",kind = "admin",desc = "HTTP admin dashboard for hero_livekit; serves Bootstrap UI and proxies to hero_livekit_server over rpc.sock.".[[binaries.sockets]]:type = "admin",path = "hero_livekit/admin.sock",protocol = "http",openrpc = false,sse = false,rest = false,webui = true.[[dependencies]]:repo = "lhumina_code/hero_livekit",crate = "hero_livekit_server",bin = "hero_livekit_server".[[env]]entries:HERO_SOCKET_DIR,RUST_LOG. The whitelist code useshero_proc_sdk'sADMIN_SECRETSsecret (not an env var) so it is not listed.Dependencies: none
Step 4: Wire
service.tomlintocrates/hero_livekit_admin/src/main.rsFiles:
crates/hero_livekit_admin/src/main.rs,crates/hero_livekit_admin/Cargo.tomlherolib_core = { workspace = true }to[dependencies].const SERVICE_TOML: &str = include_str!("../service.toml");after themoddeclarations (~line 5).async fn main(), make these the first two statements (beforeserver::run().await):hero_livekit_admin --infobooting Axum) goes away becausehandle_info_flagexits beforeserver::run().await.Dependencies: Step 3
Step 5: Validate locally
Files: none (validation only)
hero_livekit_admin --infozombie process and remove~/hero/var/sockets/hero_livekit/admin.sock.cargo build -p hero_livekit_server -p hero_livekit_admin.lab infocheckfrom the repo root — expect0 crate(s) with issuesfor the two binaries in scope (see Notes for other crates).~/hero/bin/hero_livekit_server --info --jsonand~/hero/bin/hero_livekit_admin --info --json— each must exit 0 within 15 s and emit valid JSON.lab --startthenhero_proc service list—hero_livekitmust appear with the server bound to~/hero/var/sockets/hero_livekit/rpc.sock.Dependencies: Steps 1-4
Acceptance Criteria
hero_livekit_server --inforeturns valid JSON with sockets=[rpc.sock], openrpc=true.hero_livekit_admin --inforeturns valid JSON with sockets=[admin.sock], webui=true.cd hero_livekit && lab --startthenhero_proc service listlistshero_livekitrunning.~/hero/var/sockets/hero_livekit/rpc.sockexists while the server is up.hero_livekit_admin --inforeturns within 15 s and exits 0 (no zombie / noadmin.sockleft behind).Notes
hero_livekit_backend,hero_livekit_rhai, andhero_livekit_examples. Conferences only needs the server + admin to be canonical, so this PR is scoped to those two.lab infocheckwalks every binary crate and will still flag the other three until they get their own manifests — those should land as a follow-up rather than blocking this fix.include_str!("../service.toml")inmain.rs, notbuild.rs— matcheshero_os_server,hero_os_admin,hero_proc_server,hero_proc_admin(none has abuild.rs).service.name = "hero_livekit", consistent withcrates/hero_livekit_sdk/src/lib.rs:67-69.hero_livekit_server's[[dependencies]]only listshero_proc_server; addinghero_router_serveris optional and not required for the Conferences fix.Implementation Summary
Files Created
crates/hero_livekit_server/service.toml— canonical manifest, declareshero_livekit/rpc.sock(type=rpc,protocol=openrpc,openrpc=true), depends onhero_proc_server, listsHERO_SOCKET_DIR/HOME/RUST_LOG.crates/hero_livekit_admin/service.toml— canonical manifest, declareshero_livekit/admin.sock(type=admin,protocol=http,webui=true), depends onhero_livekit_server, listsHERO_SOCKET_DIR/RUST_LOG.Files Modified
crates/hero_livekit_server/Cargo.toml— addedherolib_core = { workspace = true }to[dependencies].crates/hero_livekit_server/src/main.rs— addedconst SERVICE_TOML: &str = include_str!("../service.toml");at module scope;validate_service_toml+handle_info_flagare now the first two statements inasync fn main(), beforeHeroLifecycle::newand the tokio task spawn. Doc comment notes why placement is critical (avoid spawning tasks / binding sockets that would be abandoned by the--infoexit).crates/hero_livekit_admin/Cargo.toml— addedherolib_core = { workspace = true }.crates/hero_livekit_admin/src/main.rs— sameconst SERVICE_TOML+ two-statement prelude beforeserver::run().await, matching the canonical pattern fromhero_books_server/hero_os_admin.No changes to
build.rs(the server's existingbuild.rsis OSchema codegen only; admin has none).Test Results
cargo check -p hero_livekit_server -p hero_livekit_admin— clean (9.04s).hero_livekit_server --infoandhero_livekit_admin --info— both exit 0 emitting their embedded manifest; no zombie process, no leftoveradmin.sock(the previouslab --startzombie symptom is resolved byhandle_info_flagexiting beforeserver::run().await).hero_livekit_serverstarted directly — binds~/hero/var/sockets/hero_livekit/rpc.sock; banner reportstype: server,openrpc: yes, matching the manifest exactly.hero_livekit_adminstarted directly — binds~/hero/var/sockets/hero_livekit/admin.sock; manifest matches the SDK'sui_socket_path().Socket 'rpc.sock' not found for 'hero_livekit' — daemon not running) is gone. The island now hits the next legitimate gate:binaries not installed — call install first, which is a separate concern (theLiveKitService.installRPC downloadslivekit-serverfrom GitHub and copies the locallk-backendinto~/hero/bin) and unrelated to the manifest fix.Acceptance Criteria
hero_livekit_server --inforeturns valid manifest withsockets=[hero_livekit/rpc.sock],openrpc=true.hero_livekit_admin --inforeturns valid manifest withsockets=[hero_livekit/admin.sock],webui=true.~/hero/var/sockets/hero_livekit/rpc.sockexists while the server is up; same foradmin.sock.hero_livekit_admin --infoexits cleanly; no zombie / no leftover socket.Notes
hero_livekit_server+hero_livekit_adminas agreed.hero_livekit_backend,hero_livekit_rhai,hero_livekit_examplesand any futurehero_do_*binaries still need their own manifests — track as a follow-up issue.lab service hero_livekit --startorchestration path is unrelated to this issue but is currently broken on the local dev box: a newerlabbuild expectsPATH_ROOT/PATH_BUILD/PATH_VARenv vars and a$PATH_BUILD/var/sockets/...layout while the runninghero_proc_serveris on the older~/hero/var/sockets/...layout. That belongs in a separate environment-migration ticket.Landed on
developmentas5cdf40a:5cdf40a