Split hero_osis into per-domain services (one binary, one process, one socket per domain) #22
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_osis#22
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?
Problem
Currently
hero_osis_serverregisters all 17 domains through a single unifiedrpc.sockand a single hero_proc service. This works but treats hero_osis as a monolith — domains can't be restarted, scaled, or feature-gated independently, and they all die together on a panic.Proposal
Match the recipe_server pattern: one binary, one process, one socket per domain.
Each domain becomes a first-class hero_proc service with its own
--start/--stop/ foreground lifecycle.Implementation
Per-domain binaries
crates/hero_osis_server/src/bin/hero_osis_<domain>.rsOServer::run_cli(lifecycle, |s, ctxs, ...| s.register::<OsisDomain>(...).await; s.run().await)[[bin]]declaresrequired-features = ["<domain>"]hero_osis_<domain>→ matches hero_sockets conventionCross-domain wiring (AI → Flow)
aiandflowcargo featuresaidomain on its socketArc<OsisFlow>pointing at the same~/hero/var/osisdb/{ctx}/flow/storage path for in-process workflow lookup (read-only is safe across processes since OSIS storage is on disk and AI never writes flow records)flow.workflow.*write path remains exclusive to the Flow serviceEmbedder special
hero_osis_embedderbinary keeps the ONNX global init at startupCleanup
src/main.rs(or keep behind a--monolithflag for local dev)Out of scope
hero_osis_serverlib into 17 lib crates (would shrink binaries but is huge churn)register-all.shhelper, but per-service--startis the intended UX)Refs
$HERO_SOCKET_DIR/<service_name>/rpc.sockImplemented and merged on
development(commit3b52af0)What landed
Generator (hero_rpc commit
8681589):OschemaBuildConfig::bins(prefix, git_url)builder option that auto-generatessrc/bin/<prefix>_<domain>.rsfor each configured domain.skip_bin(domain)to opt out per-domain (used by hero_osis for embedder + ai).hero_osis:
hero_osis_<domain>for each of ai, base, business, calendar, code, communication, embedder, files, finance, flow, identity, job, ledger, media, network, projects, settings.hero_osis_embedder— ONNX Runtime global init before register.hero_osis_ai— placeholder for cross-process Flow wiring.$HERO_SOCKET_DIR/hero_osis_<domain>/rpc.sock, matching hero_sockets convention.-32601 Method not found.src/main.rsdeleted.E2E harness (
tests/e2e/run.sh):$HERO_SOCKET_DIR.data/seed/tree (foreign-domain TOML auto-skipped)./healthanddomain.listvalidation.user.listworks onidentitysocket, returns-32601onflowsocket.list → exists → getagainst the domain's own socket.Result: 38/38 tests pass.
E2E_INCLUDE_EMBEDDER=1)./healthendpoints OK.Not yet done (follow-ups)
AI → Flow cross-process wiring —
BotService.execute()currently returnsBotQueryError("Flow domain not available"). Requires ahero_rpc_clientfrom the AI service to$HERO_SOCKET_DIR/hero_osis_flow/rpc.sock. TODO comment insrc/bin/hero_osis_ai.rs. Will track separately.hero_proc registration scripting —
--startper-service works. Aregister-all.shor[[hero_proc.services]]manifest would be nice but not required.hero_os#32 —
hero_os_httpproxy needs to learn the new per-domain socket layout. Was waiting on this work; can proceed now.