oschema: consolidate 10 per-domain dispatchers into one rpc.sock #166

Merged
rawdaGastan merged 3 commits from development_oschema_migration into development 2026-06-24 13:48:24 +00:00
Member

Closes #165 and #167.

Summary

Migrate hero_aibroker_server from 10 hand-rolled per-domain JSON-RPC dispatchers to a single oschema-driven consolidated socket. Replaces ~5,000 LOC of hand-maintained dispatcher/spec/types glue with one herolib_macros::openrpc_server! invocation reading .oschema schemas.

Test plan

  • lab build --bin hero_aibroker_server --install — VICTORY
  • --info --json reports 3 sockets (was 13): rpc.sock, rest.sock, web_v1.sock
  • ls ~/hero/var/sockets/hero_aibroker/ shows exactly those 3 sockets, no per-domain subdirs
  • cargo test -p hero_aibroker_test — 67/67 pass against --fake
  • Smoke test SSE: streaming chat returns a {stream_id, stream} handle and /api/chat/events?stream_id=<id> emits ai.chat.delta + ai.chat.done
  • Workspace cargo build clean (SDK, admin UI, app, test crate)
  • No regression on the OpenAI-compat REST surface (rest.sock) — unchanged
  • Manual: admin UI loads and serves all 10 domains via the new socket
Closes #165 and #167. ## Summary Migrate `hero_aibroker_server` from 10 hand-rolled per-domain JSON-RPC dispatchers to a single oschema-driven consolidated socket. Replaces ~5,000 LOC of hand-maintained dispatcher/spec/types glue with one `herolib_macros::openrpc_server!` invocation reading `.oschema` schemas. ## Test plan - [ ] `lab build --bin hero_aibroker_server --install` — VICTORY - [ ] `--info --json` reports 3 sockets (was 13): `rpc.sock`, `rest.sock`, `web_v1.sock` - [ ] `ls ~/hero/var/sockets/hero_aibroker/` shows exactly those 3 sockets, no per-domain subdirs - [ ] `cargo test -p hero_aibroker_test` — 67/67 pass against `--fake` - [ ] Smoke test SSE: streaming chat returns a `{stream_id, stream}` handle and `/api/chat/events?stream_id=<id>` emits `ai.chat.delta` + `ai.chat.done` - [ ] Workspace `cargo build` clean (SDK, admin UI, app, test crate) - [ ] No regression on the OpenAI-compat REST surface (`rest.sock`) — unchanged - [ ] Manual: admin UI loads and serves all 10 domains via the new socket
- Replace src/api_openrpc/ (~5,016 LOC) with herolib_macros::openrpc_server!
  reading oschema/<domain>/*.oschema; emit specs to openrpc/openrpc_*.json.
- Implement 10 typed trait impls under src/rpc_impls/ (5,023 LOC).
- Bind one consolidated hero_aibroker/rpc.sock at /api/{domain}/rpc; wire
  SSE via shared Arc<SseBus> + per-domain /api/<dom>/events routes.
- service.toml goes from 13 sockets to 3 (rpc + rest + web).
- Relocate AppState/build_app_state to src/app_state.rs; relocate chat
  translators to src/api_openrouter/translators.rs (REST-only consumer).
- Rename every dotted wire method to bare snake_case under its domain;
  control-plane (health, rpc.discover) becomes macro-provided.
- Regenerate hero_aibroker_sdk from new specs; retarget admin UI + Dioxus
  app + test crate to consolidated socket; all 67 tests pass.
- Delete src/api_openrpc/, src/rpc.rs, specs/*.openrpc.json, plus the
  DOMAIN_SOCKETS const + 10 accept loops from main.rs.
- Memory + video remain wire-only placeholders (method_not_implemented),
  matching pre-existing legacy behavior.
rawdaGastan merged commit 94991f33a9 into development 2026-06-24 13:48:24 +00:00
rawdaGastan deleted branch development_oschema_migration 2026-06-24 13:48:30 +00:00
Sign in to join this conversation.
No reviewers
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_aibroker!166
No description provided.