Upgrade to hero_service template codegen pattern (HeroLifecycle + new OschemaBuildConfig) #44
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?
Context
From the #41 §3 assessment.
hero_logic is already on the OSchema codegen path — but the older version of it. The upgraded path (used by
hero_service@518448cand the post-#55 hero_rpc) brings:OschemaBuildConfigfields (sdk_dir,client_crate_dir,server_crate_dir,server_types_crate,sdk_types_crate,with_wasm()).HeroLifecycle + OServer::run_cliclosure pattern (replaces today'sOServerConfig::new + server.run().await).LogicRpcClient/rpc_client.rs).with_wasm()adds WASM-compatible type variants.Full breakdown in the §3 comment.
What does NOT migrate
Domain code (
engine/,seed.rs+seed_flows/,tracing_layer.rs,services/), admin templates + routes.rs, CLI clap tree, 21 hand-writtenlogicservice.*methods. The migration is purely the codegen layer + bootstrap pattern.Quirks to preserve
python_sourcefield has an optionalb64:prefix encoding.hero_logic_sdk::decode_python_sourcemust stay as a hand-written helper — codegen won't infer it.Cost estimate
~1–2 days of focused work (per §3 phase breakdown):
HeroLifecycle::run_cli: 2–4hhero_logictypes crate: 4–8hadmin/src/rpc_client.rs, switch to typed wrappers: 2–4hPrerequisites
Do this AFTER the §2 audit cleanup (B1/B2/B7/B10 — bundled in hero_logic#43) lands. Migration PR stays purely about the codegen, not mixed with naming/CI/lint cleanups.
Already unblocked from the hero_rpc side: tier-3 of META #262 (hero_rpc#54/55/56) landed.
Out of scope (this issue)
The hero_rpc2
#[rpc(server, client)]trait-macro vendoring. That's a separate follow-up after this lands.Acceptance
build.rsuses the newOschemaBuildConfigshapeHeroLifecycle + OServer::run_clihero_logictypes crate consumed by_server+_sdkadmin/src/rpc_client.rsdeleted; admin uses typed SDK wrappers throughoutpython_sourceb64-prefix helper preservedlab infocheckclean; full smoke + admin click-through passMigration shipped in PR #46. All acceptance criteria green:
build.rsuses the newOschemaBuildConfigshape (sdk_dir, client_crate_dir, server_crate_dir, server_types_crate, sdk_types_crate, with_wasm, with_python_sdk, with_rhai)HeroLifecycle + OServer::run_clihero_logic_typescrate consumed by both_serverand_sdkadmin/src/rpc_client.rsdeleted; admin uses typed SDK wrappers throughout (typedlogic_service_*calls + anAppState::rpc_callhelper routing raw calls through the typed SDK transport)sdk/python_source::decode_python_sourceb64-prefix helper preserved as a hand-written file the SDK builder auto-discovers across regenscargo build --workspaceclean;lab infocheck: 3 crate(s) clean, 0 with issues, 0 findingsThree small hero_rpc generator follow-ups identified that would eliminate the build.rs post-process hack used here — see PR #46 description.