[META] Migrate legacy openrpc_client! services to oschema-driven codegen — final closeout of hero_skills#262 #132
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_rpc#132
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?
Goal
Final closeout of hero_skills#262. The meta decision is locked: oschema is the single source of truth for SDK generation across the Hero ecosystem. Several core services predate that decision and still hand-write
openrpc.json+ use theopenrpc_client!proc-macro for client derivation. This issue tracks migrating each of them to oschema-driven codegen.Audit — current state
Across
lhumina_codecore services, as of 2026-05-22:Six services need migration, in suggested order:
hero_indexer→hero_books(finish) →hero_db→hero_code→hero_browser→hero_aibroker.hero_indexeris first because (a) it is the smallest API surface, (b) the recent hero_rpc#127 / hero_rpc#130 work has us deep in its consumer-side surface, and (c) doing it first proves the methods-only path (#131 here) ahead of the larger surfaces.Why this matters — concrete example
The
OsisIndexerbug introduced by hero_rpc#127 (sync facade over an asyncopenrpc_client!-generated client, panicked inside#[tokio::test]) is exactly the class of mistake that would have been impossible if hero_indexer were on oschema codegen. The consumer (hero_rpc) would have been written against a generated async client from the same generator that emits the consumer's async handlers, and the architectural footgun would not have existed.What "migrated" means per service
For each target service (using
hero_indexeras the template):schemas/<domain>/<domain>.oschemafiles declaring the existing API surface asserviceblocks. Forhero_indexer: one schema per RPC domain (db,doc,index,search,server).crates/<svc>_sdk/src/lib.rs'sopenrpc_client!(...)invocation with the oschema build script (fn main() { hero_rpc_osis_generator::build()?; }). Result:<svc>_sdknow contains generated trait + client + types from the same source the server consumes.openrpc.json— it becomes a generator output, not input.hero_indexerbecause hero_rpc itself consumes it viaOsisIndexer).<domain>_e2e.rsfiles exercise the SDK end-to-end. Hand-written integration tests stay alongside.Prerequisites
hero_indexer(and most of the legacy services) have nothing to anchor the generator on. #131 lands a canary example and shakes out any latent codegen bugs in the rootobject-free path.Deliverables
lab infocheckextension that warns when a first-party service usesopenrpc_client!directly (escape hatch retained for talking to foreign OpenRPC services we do not control).hero_skills/skills/oschema/oschema.mdandhero_skills/skills/hero/service/*should make clear oschema is the only path for first-party services.Out of scope
openrpc_client!proc-macro itself — it stays as the foreign-server escape hatch.hero_biz,hero_foundry) — different category, not part of this migration.OsisIndexerasync fix (hero_rpc#130) — orthogonal; the migration retires the underlying problem class.Links
First sub-issue filed: hero_indexer characterization tests
lhumina_code/hero_indexer#29 is now the gating
issue for hero_indexer's leg of this META. It locks the current
wire-path behavior (17 methods across Server / Db / Schema / Doc /
Index / Search) down as cargo + nu + persistence goldens, against
both
origin/development(baseline) AND the in-flight Phase Bbranch tip
2179a51. Phase C (server-side oschema adoption) isblocked on this issue's suite passing — that's the migration
contract.
The migration agent has been told to push
2179a51as a draft PRwith a BLOCKED tag and stand down. A fresh sub-agent will pick up
the characterization issue. Once green on both branches, Phase C
unblocks and the remaining five services (each their own
characterization-then-migrate sub-issue, same shape) follow.