WIP: OSIS serving → openrpc_server! + serve_rpc_domains (#154/#155) #156
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_blueprint!156
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/osis-multidomain-serve"
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?
OSIS serving → hero_lib
openrpc_server!+serve_rpc_domains(#154 / #155)Migrates OSIS multi-domain serving off the bespoke
HeroOsisServer/rpc2_adapterstack onto Kristof'sopenrpc_server!macro +serve_rpc_domains. Generator-side migration complete; verified at the generator level (lib + 151 unit tests green) and scaffold output validated via a locally-rebuiltlab.What lands
0164e33—OsisObject/DBTypedString-sid storage foundation (39 db tests).8ba3eff— generated wire types +OsisObjectimpl →Option<String>shape.760ed90— generator emits#[async_trait] impl <Stem>Api for Osis<Domain>+impl OsisObject; deleteshandle_rpc/_rpc_*/OsisAppRpcHandler/_new(−1,389 lines, resolves #155).1fad2b7— servermain.rs/Cargo →openrpc_server!+serve_domains.a6f50d7—osis_<domain>/module layout + inherent service methods onOsis<Domain>.⚠️ NOT ready to merge yet — draft for review
The OSIS migration is mid-flight; hold the merge until:
_findquery-lowering is wired (currently returns empty).hero_indexer_sdk'sdb.create(name,schema)violates herolib_derive's one-input rule (needs hero_indexer's own migration);hero_theme301s on fetch.crates/osislegacy serving) + chunk 5 (regenerate hero_osis, 15 domains).Full record + exact remaining steps on #154.
🤖 Generated with Claude Code
generate_server_main_rs now emits the hero_lib serving entry point: - `herolib_derive::openrpc_server!(spec="../<name>/schemas", service_toml= "service.toml", save_openrpc_dir="generated/openrpc")` at the crate root (generates wire types + <Stem>Api trait + per-domain router + serve_domains). - one `#[path="osis_<domain>/mod.rs"] mod osis_<domain>;` per domain — kept out of the macro's crate-root `mod <domain>` namespace to avoid the collision. - `serve_domains(osis_<d>::Osis<D>::create(&format!("{root}/<d>"), 0)?, …)` in sorted-domain (macro parameter) order. Server Cargo.toml: +herolib_derive, +herolib_oschema_server, +async-trait; −hero_rpc2, −jsonrpsee, −herolib_sid. Scaffold main.rs tests updated to assert the new shape. Generator lib + 151 tests green. NOTE WIP: build/emit must still write the generated OSIS impl + contributor rpc under src/osis_<domain>/ to match this main.rs; rust_rpc service model + _find lowering + CRM regen still pending. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Completes the server-side generator migration so the emitted server crate matches the new main.rs (openrpc_server! + serve_domains): - rust_osis.rs: serve_domains takes the handler by value, so drop the Arc/handler/init_handlers machinery — create() returns Self; service-method trait arms delegate to inherent `self.<method>(..)` (no handler back-ref). - rust_rpc.rs (contributor rpc.rs): emit inherent `async fn <method>(&self,..) -> Result<T, RpcError>` stubs on Osis<Domain> (graceful "not yet implemented" Err) + the lifecycle triggers; drop the <Service>Trait/<Service>Handler indirection. Imports use crate::<domain>::* (macro wire types) + super::osis. - generate/rust_server.rs: write osis_<domain>/{osis.rs, rpc.rs (scaffold-once), mod.rs barrel} instead of <domain>/generated/{server,rpc,mod}.rs — the module is named osis_<domain> so it never collides with the macro's crate-root mod <domain>. Drops the super::core path-rewrites + generated/rpc.rs emission. - build/emit/rust_server.rs: server lib.rs no longer declares per-domain modules (the binary's main.rs mounts osis_<domain> via #[path]; the macro owns mod <domain>). Generator lib + 151 tests green. Validated via a locally-rebuilt `lab` (hero_skills, patched to this tree): scaffolding now emits the new main.rs + osis_crm layout. End-to-end CRM build is currently blocked UPSTREAM of OSIS by ecosystem skew — hero_indexer_sdk's `db.create(name, schema)` violates herolib_derive's new one-input rule, and hero_theme 301s on fetch — both outside this generator's scope (tracked on #154). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Closing — superseded. This was the approach-A (String-sid) OSIS serving exploration. We deliberately chose approach B (SmartId / spec-pure wire +
*Store), which is now ondevelopment(emitter synced to the currentopenrpc_server!macro + the hero_db storage backend). The approach-A branch is preserved as tagbackup/osis-multidomain-serve-approachAif ever needed. development is the single source of truth.Pull request closed