oschema: consolidate 10 per-domain dispatchers into one rpc.sock #166
No reviewers
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_aibroker!166
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_oschema_migration"
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?
Closes #165 and #167.
Summary
Migrate
hero_aibroker_serverfrom 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 oneherolib_macros::openrpc_server!invocation reading.oschemaschemas.Test plan
lab build --bin hero_aibroker_server --install— VICTORY--info --jsonreports 3 sockets (was 13):rpc.sock,rest.sock,web_v1.sockls ~/hero/var/sockets/hero_aibroker/shows exactly those 3 sockets, no per-domain subdirscargo test -p hero_aibroker_test— 67/67 pass against--fake{stream_id, stream}handle and/api/chat/events?stream_id=<id>emitsai.chat.delta+ai.chat.donecargo buildclean (SDK, admin UI, app, test crate)rest.sock) — unchanged- 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.