Migrate hero_proc to the one-socket multi-domain model (domains as /api/{domain}/ paths) #148
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_proc#148
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?
Summary
hero_libhas moved multi-domain services to a one-socket-per-service model (domains as URL path segments), buthero_procis only half-migrated: itsservice.toml, its Askama admin, andlab's hero_proc SDK still expect the old per-domain sockets (hero_proc/rpc_jobs.sock,rpc_logs.sock, …). The result: on latesthero_lib,hero_proc_serverbinds onlyhero_proc/rpc.sock, solab service hero_procfails (socket not found … rpc_jobs.sock) and discovery/admin break.This was misdiagnosed as a regression — it is an intentional architecture change that needs finishing across consumers.
The new model (authoritative)
hero_lifecycle::ServiceManifest::serve_rpc_domains_with_extra(hero_lib/crates/hero_lifecycle/src/manifest.rs:768) is explicit:Everything is served on
<service>/rpc.sock:GET /api/domains.json→ the domain listPOST /api/{domain}/rpc→ JSON-RPC per domainGET /api/{domain}/openrpc.json→ spec per domainGET /heroservice.json,GET /health.jsonThe macros that generate this:
herolib_macros::openrpc_from_oschema!(multi-domain) andopenrpc_server!(single-domain). The model landed via hero_lib dev commits537e2b9b(multi-domain proxy routing),edb04a99(100%-compliant web routes),ee95c88d(dispatch+manifest),277299dc(simplify openrpc_proxy+manifest).What is stale and must be migrated
hero_proc/crates/hero_proc_server/service.toml— still declaresrpc_jobs.sock,rpc_logs.sock,rpc_secrets.sock,rpc_system.sock. Should declare a singlehero_proc/rpc.sock(domains live under/api/{domain}/…on it). Verify the banner/--infomatches whatserve_rpc_domains_with_extraactually binds.lab's hero_proc SDK (hero_skills/crates/lab, viahero_proc_sdk) — the multi-domain client still resolves$HERO_SOCKET_DIR/hero_proc/rpc_<domain>.sock. It must call<service>/rpc.sockwith/api/{domain}/rpc. This is whylab service hero_proc/ status fails.hero_proc's own SDK (hero_proc/crates/hero_proc_sdk) — same per-domain-socket assumption.hero_routerdiscovery — confirm it discovers a multi-domain service via/heroservice.json+/api/domains.jsonand caches each/api/{domain}/openrpc.json(todayrouter.servicesreportsmethods=0, spec=nullfor hero_proc's domains — see the relatedrpc.discoverfixhero_lib@599e2c37, but the durable path isdomains.json).hero_proc_admin— keep it working (Timur wants it as the 1:1 reference for the Dioxus admin). Update its socket/path expectations to the new model rather than removing it.Plan
hero_proc_server/service.tomlto onerpc.sock; confirmserve_domains_withbinds exactly that + serves/api/domains.json+ per-domain routes.hero_proc_sdk+lab's hero_proc client to the<svc>/rpc.sock+/api/{domain}/rpccontract.hero_proc_adminrunning against the new model (reference UI).hero_routerdiscovers + caches per-domain specs viadomains.json.lab service hero_proc --build --startclean;router.servicesshows hero_proc's domain methods > 0.Validation / repro
Note: the older
hero_lib@0b06c634(pre-refactor) + current hero_proc both bind the flatrpc_*.sockand work — that is the old model and is the thing being migrated away from.Related
/api/domains.json): see companion issue inhero_website_framework.rpc.discovermacro fix (single-domain discovery):hero_lib@599e2c37.Filed by Claude (owner-mode work for Timur).
The new one-socket model works end-to-end on the serve + admin side — the gap is purely stale consumers:
hero_proc(singlehero_proc/rpc.sock). It correctly serves/api/domains.json, per-domain/api/<domain>/openrpc.json, and/api/<domain>/rpc.hero_website_framework@5e9724f) consumes it live (domains jobs/logs/secrets/system; 88 jobs methods).rpc.discovermacro fix (hero_lib@599e2c37): each per-domain/api/<domain>/rpcanswersrpc.discoverwith its spec, sohero_routercan introspect over RPC.Still stale / to migrate (this issue):
hero_proc_server/service.tomlstill declaresrpc_jobs.sock/rpc_logs.sock/rpc_secrets.sock/rpc_system.sock.hero_proc_admin+lab's hero_proc SDK still resolverpc_<domain>.sock.lab service hero_procfails its readiness check onrpc_jobs.sock— that is the migration target (keep the Askama admin working as the Dioxus reference).