Delete legacy Rust client emitter + generate_rpc2_sdk toggle (#90 Phase 4) #102

Merged
timur merged 1 commit from issue-90-phase4-cleanup into development 2026-05-20 23:53:09 +00:00
Owner

Closes the #90 migration. With hero_service (PR #5) + hero_logic (PR #47) on hero_rpc2 and the two no-op services confirmed (hero_compute, hero_db never used OServer), the legacy Rust client codegen has zero live consumers.

Deleted

  • crates/generator/src/generate/rust_rpc.rs — legacy osis_client_generated.rs per-domain emitter.
  • crates/generator/src/rust/rust_client.rs — the actual client codegen body it called.
  • Generator::client() / client_only() / client_types_crate() + the generate_client / client_flat / client_external_types fields they set. .all() no longer turns on client emission.
  • OschemaBuildConfig::generate_rpc2_sdk field + with_hero_rpc2_sdk() / without_hero_rpc2_sdk() builder methods — the rpc2 trait SDK is now the only Rust client path.

Verification

  • cargo build --workspace clean.
  • cargo test --workspace --lib --bins: 128 generator + 6 hero_rpc2 + 79 oschema + 66 osis tests all passing.
  • cargo test -p hero_rpc2 --features uds-http,discover --tests: 27 passing (includes http_well_known + from_value round-trip).
  • cargo test -p hero_rpc_osis --features rpc rpc2_adapter: 8 passing.
  • example/recipe_server regenerates clean; only diff vs prior output is a socket-path catch-up (hero_recipes_server/rpc.sockhero_recipes/rpc.sock), matching the canonical hero_sockets shape the service.toml was already declaring — improvement, not regression.

NOT addressed (pre-existing dev-tip bit-rot)

  • 5 of 6 crates/osis/examples/basic/ examples reference removed APIs (Generator import, DBTyped::new_with_index, reqwest). Broken on development before this PR — separate cleanup.
  • crates/derive/tests/sse_proxy.rs missing herolib_core crate dep. Same vintage.
Closes the [#90](https://forge.ourworld.tf/lhumina_code/hero_rpc/issues/90) migration. With hero_service ([PR #5](https://forge.ourworld.tf/lhumina_code/hero_service/pulls/5)) + hero_logic ([PR #47](https://forge.ourworld.tf/lhumina_code/hero_logic/pulls/47)) on hero_rpc2 and the two no-op services confirmed (hero_compute, hero_db never used OServer), the legacy Rust client codegen has zero live consumers. ### Deleted - `crates/generator/src/generate/rust_rpc.rs` — legacy `osis_client_generated.rs` per-domain emitter. - `crates/generator/src/rust/rust_client.rs` — the actual client codegen body it called. - `Generator::client()` / `client_only()` / `client_types_crate()` + the `generate_client` / `client_flat` / `client_external_types` fields they set. `.all()` no longer turns on client emission. - `OschemaBuildConfig::generate_rpc2_sdk` field + `with_hero_rpc2_sdk()` / `without_hero_rpc2_sdk()` builder methods — the rpc2 trait SDK is now the only Rust client path. ### Verification - `cargo build --workspace` clean. - `cargo test --workspace --lib --bins`: 128 generator + 6 hero_rpc2 + 79 oschema + 66 osis tests all passing. - `cargo test -p hero_rpc2 --features uds-http,discover --tests`: 27 passing (includes `http_well_known` + `from_value` round-trip). - `cargo test -p hero_rpc_osis --features rpc rpc2_adapter`: 8 passing. - `example/recipe_server` regenerates clean; only diff vs prior output is a socket-path catch-up (`hero_recipes_server/rpc.sock` → `hero_recipes/rpc.sock`), matching the canonical hero_sockets shape the service.toml was already declaring — improvement, not regression. ### NOT addressed (pre-existing dev-tip bit-rot) - 5 of 6 `crates/osis/examples/basic/` examples reference removed APIs (`Generator` import, `DBTyped::new_with_index`, `reqwest`). Broken on `development` before this PR — separate cleanup. - `crates/derive/tests/sse_proxy.rs` missing `herolib_core` crate dep. Same vintage.
chore(#90 Phase 4): delete legacy Rust client emitter + generate_rpc2_sdk toggle
Some checks failed
Test / test (push) Failing after 1m33s
Test / test (pull_request) Failing after 1m49s
04c423817b
Now that every OSIS service in lhumina_code runs on hero_rpc2 dispatch
(Phases 2 + 3 merged: hero_service PR #5, hero_logic PR #47), the legacy
Rust client codegen has zero live consumers. Drop it.

Deleted:
- crates/generator/src/generate/rust_rpc.rs — emitted the legacy
  `osis_client_generated.rs` + per-domain client `mod.rs`. Only caller
  (build/emit/rust_sdk.rs) went in Phase 1.
- crates/generator/src/rust/rust_client.rs — the actual client codegen
  body that rust_rpc.rs called. Same dead-on-arrival status.
- Generator::client() / client_only() / client_types_crate() builder
  methods, plus the generate_client / client_flat /
  client_external_types fields they set. The `.all()` builder no
  longer turns client emission on (docstring updated to flag the
  shift).
- OschemaBuildConfig::generate_rpc2_sdk field +
  with_hero_rpc2_sdk() / without_hero_rpc2_sdk() builder methods. The
  rpc2 trait SDK is the only Rust client emitter — there's nothing to
  toggle.
- Two unit tests (`flag_defaults_on_after_phase1_cutover`,
  `without_hero_rpc2_sdk_opts_out`) that pinned the dropped toggle.

Updated:
- crates/generator/src/build/builder.rs: unconditional rpc2 SDK emit.
- crates/generator/src/build/emit/rust_rpc2.rs: same — drop the
  feature-gate prelude in `generate_rust_rpc2_sdk`.
- crates/generator/src/rust/mod.rs + generate/mod.rs: drop stale
  module declarations + `generate_rust_client` re-export.
- Module doc comments updated to remove the dropped builder methods
  from examples.
- example/recipe_server/crates/hero_recipes/build.rs: drop the now-
  removed `.with_hero_rpc2_sdk()` call (no-op since Phase 1, gone for
  good now).
- example/recipe_server/docs/{openrpc.json,recipes/openrpc.json}:
  regenerated. The only diff is the socket path
  (`hero_recipes_server/rpc.sock` → `hero_recipes/rpc.sock`), which
  catches up with the canonical hero_sockets layout the service.toml
  was already declaring — improvement, not regression.

Pre-existing dev-tip breakage NOT addressed here:
- crates/osis/examples/basic/{1_generate_code,2_use_models,
  4_custom_rpc_methods, 5_start_server, 6_rpc_test}.rs all reference
  removed APIs (Generator import, DBTyped::new_with_index, reqwest,
  …). Broken on `development` before this PR — separate cleanup.
- crates/derive/tests/sse_proxy.rs missing herolib_core crate dep.
  Same vintage.

Verification:
- cargo build --workspace clean.
- cargo test --workspace --lib --bins: 128 generator tests (was 131
  — the 3 dropped are the toggle tests above), 6 hero_rpc2 unit, 79
  oschema, 66 osis. All passing.
- cargo test -p hero_rpc2 --features uds-http,discover --tests: 27
  passing including http_well_known (from_value, rpc.health,
  /openrpc.json, /health, discovery manifest).
- cargo test -p hero_rpc_osis --features rpc rpc2_adapter: 8 passing
  including the lowercase-wire-name test from PR #100.
- example/recipe_server: cargo check clean against in-tree patches;
  regenerated outputs match (modulo the socket-path improvement noted
  above).
timur force-pushed issue-90-phase4-cleanup from 04c423817b
Some checks failed
Test / test (push) Failing after 1m33s
Test / test (pull_request) Failing after 1m49s
to 12f9c4c5a4
Some checks failed
Test / test (pull_request) Failing after 2m24s
Test / test (push) Failing after 2m26s
2026-05-20 23:53:00 +00:00
Compare
timur merged commit c0c4bb1bfc into development 2026-05-20 23:53:09 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_rpc!102
No description provided.