Each crate's service.toml duplicates all 4 binary declarations (should be one-binary-per-file, per hero_collab) #47

Closed
opened 2026-06-08 10:38:25 +00:00 by sameh-farouk · 0 comments
Member

Summary

All four hero_livekit crates ship a service.toml that redundantly declares all four binaries (hero_livekit_server, hero_livekit_admin, lk-backend, hero_do_hero_livekit), instead of each crate declaring only its own binary. The four files are near-duplicates and have already drifted.

Evidence

crates/{hero_livekit_server,hero_livekit_admin,hero_livekit_backend,hero_livekit_rhai}/service.toml each contain the same four [[binaries]] blocks. They differ only in:

  • the [service] crate = "..." line, and
  • hero_livekit_admin/service.toml carries a [[dependencies]] block the other three lack.

Each binary embeds its own crate's copy via SERVICE_TOML (include_str!) and validate_service_toml(SERVICE_TOML) in main.rs. lab registers per binary and looks up that binary's entry in its own crate's file — so the other three copies of each binary's entry are never read for it. They are dead, drift-prone duplication.

Canonical pattern (hero_collab)

hero_collab declares one binary per service.toml, co-located with the crate that builds it:

hero_collab_server/service.toml  → [[binaries]] hero_collab_server (server)
hero_collab_admin/service.toml   → [[binaries]] hero_collab_web   (admin) + [[dependencies]]
hero_collab/service.toml         → [[binaries]] hero_collab       (cli)  + [[dependencies]]

Why it matters

  • Drift already present: lk-backend [[binaries.tcp]] port = 8080 in all four files, but DEFAULT_BACKEND_PORT = 8081 in code (rpc.rs:27); the [[dependencies]] exists only in the admin copy.
  • Fix-location ambiguity: the #41 lk-backend kind change is only authoritative in hero_livekit_backend/service.toml (the copy embedded in the lk-backend binary). The three other copies would still say kind = "server", misleading any reader.
  • --info self-description is wrong: every binary prints all four binaries as if it owned them.

Fix

Make each crate's service.toml declare only its own binary (plus that binary's own sockets/tcp/env/[[dependencies]]), mirroring hero_collab. This is also the precondition that makes #41 (set lk-backend install-only) and #46 (admin dep) edit exactly one authoritative file each.

  • hero_livekit#41 (lk-backend kind — authoritative file becomes unambiguous after this)
  • hero_livekit#46 (admin dependency)
  • hero_proc#135 / hero_skills#308 (service.toml as single source of truth)
## Summary All four hero_livekit crates ship a `service.toml` that redundantly declares **all four binaries** (`hero_livekit_server`, `hero_livekit_admin`, `lk-backend`, `hero_do_hero_livekit`), instead of each crate declaring **only its own** binary. The four files are near-duplicates and have already drifted. ## Evidence `crates/{hero_livekit_server,hero_livekit_admin,hero_livekit_backend,hero_livekit_rhai}/service.toml` each contain the same four `[[binaries]]` blocks. They differ only in: - the `[service] crate = "..."` line, and - `hero_livekit_admin/service.toml` carries a `[[dependencies]]` block the other three lack. Each binary embeds **its own crate's** copy via `SERVICE_TOML` (`include_str!`) and `validate_service_toml(SERVICE_TOML)` in `main.rs`. lab registers per binary and looks up that binary's entry **in its own crate's file** — so the other three copies of each binary's entry are never read for it. They are dead, drift-prone duplication. ## Canonical pattern (hero_collab) hero_collab declares **one binary per `service.toml`**, co-located with the crate that builds it: ``` hero_collab_server/service.toml → [[binaries]] hero_collab_server (server) hero_collab_admin/service.toml → [[binaries]] hero_collab_web (admin) + [[dependencies]] hero_collab/service.toml → [[binaries]] hero_collab (cli) + [[dependencies]] ``` ## Why it matters - **Drift already present:** `lk-backend` `[[binaries.tcp]] port = 8080` in all four files, but `DEFAULT_BACKEND_PORT = 8081` in code (`rpc.rs:27`); the `[[dependencies]]` exists only in the admin copy. - **Fix-location ambiguity:** the #41 `lk-backend` `kind` change is only authoritative in `hero_livekit_backend/service.toml` (the copy embedded in the `lk-backend` binary). The three other copies would still say `kind = "server"`, misleading any reader. - **`--info` self-description is wrong:** every binary prints all four binaries as if it owned them. ## Fix Make each crate's `service.toml` declare **only its own binary** (plus that binary's own sockets/tcp/env/`[[dependencies]]`), mirroring hero_collab. This is also the precondition that makes #41 (set `lk-backend` install-only) and #46 (admin dep) edit exactly one authoritative file each. ## Related - hero_livekit#41 (lk-backend kind — authoritative file becomes unambiguous after this) - hero_livekit#46 (admin dependency) - hero_proc#135 / hero_skills#308 (service.toml as single source of truth)
Sign in to join this conversation.
No labels
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_livekit#47
No description provided.