Migrate OSIS services off OServer onto hero_rpc2 (#90 Phase 1) #97
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_rpc!97
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-90-phase1-framework"
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?
Phase 1 of #90. Hard-cut OServer + legacy emitters; flip scaffolder default to hero_rpc2.
Shipped:
Validation: cargo check --workspace + cargo test --workspace --lib --bins clean; hero_rpc2 uds-http suite (27 tests incl. new http_well_known.rs) green; example/recipe_server builds clean. Two pre-existing test failures on development (sse_proxy, two stale osis examples) flagged but untouched — orthogonal to #90.
Not in this PR (phases 2+): migrating hero_service / hero_logic / hero_compute / hero_db to hero_rpc2 dispatch — those are separate sweeps.
This is the bulk of hero_rpc#90 Phase 1 after the framework primitives landed in the earlier two commits. Per the design comment thread on the issue, the migration is a hard cut (no deprecation window) — every piece of OServer-era plumbing without an external caller is deleted, the surviving callable pieces are re-homed in hero_rpc_osis, and the scaffolder + recipe_server reference all assume hero_rpc2 from this commit forward. ## What's deleted * `crates/server/` — the entire OServer crate (3,362 LoC). ACL module (824 LoC, zero external callers), `ContextRegistry`/`git_sync`/ `context.*`/`domain.*` management RPC methods, `seed_from_dir`, `inspector_ui`, all of it. Workspace member dropped. * `crates/generator/src/build/emit/rust_sdk.rs` — legacy SDK emitter that targeted the deleted OServer wire shape. * `crates/generator/src/build/emit/bin.rs` — per-domain / single-bin orchestrator emitter (OServer-baked). Composite services like hero_osis now ship their own bin code. * `OschemaBuildConfig`: `generate_rust_sdk` field + `with_rust_sdk()` builder + every `bin_*` / `single_bin` / `SingleBinConfig` config (used only by the deleted bin emitter). * `example/recipe_sdk_rpc2/` — folded into recipe_server, which is now the single end-to-end demo on the new path. * `layout::title_case_acronym_aware` — only caller was the deleted bin emitter. ## What flips defaults * `OschemaBuildConfig::generate_rpc2_sdk` defaults to `true`. New `without_hero_rpc2_sdk()` opt-out for the rare build script that produces its Rust client through a different path. * Scaffolder's emitted `main.rs` template now drives hero_rpc2 + rpc2_adapter directly: builds a `jsonrpsee::RpcModule`, hands it to `ServerBuilder::serve_http`, and reads the socket path from the binary's embedded `service.toml`. The OServer-style `run_cli` callback is gone. * Scaffolder's emitted `service.toml` socket path is now `{svc}/`, matching the `hero_sockets` skill (no `_server` / `_admin` suffix in the directory name). * Scaffolder's emitted `Cargo.toml` for `*_server` now depends on `hero_rpc2` + `jsonrpsee` instead of `hero_rpc_server`. ## What's migrated * `example/recipe_server` ships the new shape end-to-end: - `crates/hero_recipes_server/src/main.rs` rewritten to use `hero_rpc2::ServerBuilder` + `rpc2_adapter`. - `crates/hero_recipes_server/service.toml` socket path moved to `hero_recipes/rpc.sock` (the canonical `hero_sockets` shape). - `crates/hero_recipes/build.rs` opts into the rpc2 SDK. - `Cargo.toml` patch section drops `hero_rpc_server`, adds `hero_rpc2`. - `sdk/rust/Cargo.toml` now depends on `hero_rpc2 + jsonrpsee` instead of the deleted `hero_rpc_client`. - Stale `sdk/rust/src/recipes/` (legacy emitter output) removed — `sdk/rust/src/recipes.rs` (the rpc2 trait file) is canonical. ## Test fixes * `crates/generator/src/build/scaffold.rs` test asserts updated to pin the new template's call sites (`hero_rpc2::prelude::*`, `ServerBuilder::new(module)`, `.serve_http(&rpc_socket)`, `rpc2_adapter::register_methods(...)`). * `crates/generator/src/build/emit/rust_rpc2.rs::flag_defaults_off` renamed to `flag_defaults_on_after_phase1_cutover` (the default flipped). * `crates/oschema/tests/real_schemas.rs`: drop the three `crates/server/examples/recipe_server/…` cases — those paths went with `crates/server/`. The `example/recipe_server/schemas/` case remains and covers the canonical shape. ## Verification `cargo check --workspace` and `cargo test --workspace --lib --bins` both clean on hero_rpc; `cargo test -p hero_rpc2 --features uds-http` also green (incl. the new `http_well_known` tests). `example/recipe_server` builds end-to-end against the local in-tree patches. Two pre-existing test failures on `development` (`hero_rpc_derive`'s `sse_proxy` integration test missing a `herolib_core` crate ref, and two `hero_rpc_osis` examples calling stale APIs) are untouched here — not caused by #90; they need their own fixes outside this PR. ## What's NOT changed (deferred to Phase 2-4) * hero_service / hero_logic / hero_compute / hero_db service binaries (Phase 2 + 3, one PR per repo). * hero_launcher — its scaffolded SDK consumed by hero_wasmos — migrated in a companion branch per the design-comment thread._admin+_webthat drive the generated SDK end-to-end #98