hero_rpc#129: re-scaffold against new generator (examples/, benches/, serial_test) #13

Merged
timur merged 1 commit from issue-129-rescaffold into development 2026-05-25 10:47:52 +00:00
Owner

Summary

Re-scaffold of hero_service against the hero_rpc#129 generator. Picks up the three default-on emissions the new scaffolder ships:

  • examples/ workspace member with 01_connect.rs (SDK demo)
  • benches/ workspace member with commented-out criterion skeleton
  • tests/Cargo.toml [dev-dependencies] serial_test = "3"

Must merge last — depends on hero_rpc PR #139 (scaffolder additions) and hero_skills PR #302 (--example / --bench / dual-home --test verbs).

Acceptance evidence

$ PATH_ROOT=$HOME/hero lab service hero_service --example
lab service hero_service --example: available examples
  01_connect                (examples/)
$ cargo check --workspace --all-targets
   Compiling hero_service_examples ...
   Compiling hero_service_benches ...
    Finished `dev` profile [unoptimized + debuginfo] target(s)

(14 pre-existing async-trait warnings in hero_service_server are unrelated — introduced by hero_rpc#138 and tracked separately.)

Diff stat

 Cargo.lock                                |  62 +++ (criterion + transitives)
 Cargo.toml                                |   2 +  (examples, benches members)
 tests/Cargo.toml                          |   7 +  (serial_test dev-dep)
 examples/Cargo.toml                       |  21 + (new workspace member)
 examples/01_connect.rs                    |  29 + (SDK demo)
 examples/src/lib.rs                       |   3 + (wrapper)
 benches/Cargo.toml                        |  29 + (new workspace member)
 benches/example_bench.rs                  |  27 + (commented-out skeleton)
 benches/src/lib.rs                        |   8 + (`pub use <name>_tests::*;`)

Zero changes under crates/hero_service*, sdk/*, schemas/, data/, or tests/src/lib.rs — those files are scaffolder-managed and contributors' edits are preserved on re-scaffold.

Decisions taken without confirmation

  1. The example imports hero_service_sdk::bench::BenchClient and calls BenchClient::indexed_multi_list — the first rootobject the generator discovers when iterating (domain_alphabetical, snake_alphabetical). bench comes alphabetically before catalog; indexed_multi is alphabetically first inside bench. If a more interesting demo is wanted, the file is preserve-once — edit it once and the scaffolder won't overwrite.

  2. tests/Cargo.toml got a hand-edit for [dev-dependencies] serial_test = "3" because the existing file is preserve-once. The block landed between [dependencies] and the first [[test]], so the build-time sync_tests_cargo_toml rewriter (which cuts from the first [[test]] line onward) preserves it.

  3. The workspace Cargo.toml got "examples" and "benches" appended explicitly rather than via a scaffolder-managed regen. Same preserve-once rationale — and the explicit edit is small enough that teaching the scaffolder to merge workspace members on rerun is out of scope.

Test plan

  • cargo check --workspace --all-targets — green
  • cargo check -p hero_service_examples — green
  • cargo check -p hero_service_benches — green
  • lab service hero_service --example lists 01_connect
  • lab service hero_service --example 01_connect end-to-end (requires installed hero_service_server binary; deferred — same dispatch shape verified by hero_skills PR's unit tests + the listing case above)
  • lab service hero_service --test 5 layers green (no regression vs hero_rpc#124) — deferred to post-merge full CI run

Closes part of hero_rpc#129 (Phase 4).

## Summary Re-scaffold of hero_service against the hero_rpc#129 generator. Picks up the three default-on emissions the new scaffolder ships: - `examples/` workspace member with `01_connect.rs` (SDK demo) - `benches/` workspace member with commented-out criterion skeleton - `tests/Cargo.toml` `[dev-dependencies] serial_test = "3"` Must merge **last** — depends on hero_rpc PR #139 (scaffolder additions) and hero_skills PR #302 (`--example` / `--bench` / dual-home `--test` verbs). ## Acceptance evidence ``` $ PATH_ROOT=$HOME/hero lab service hero_service --example lab service hero_service --example: available examples 01_connect (examples/) ``` ``` $ cargo check --workspace --all-targets Compiling hero_service_examples ... Compiling hero_service_benches ... Finished `dev` profile [unoptimized + debuginfo] target(s) ``` (14 pre-existing async-trait warnings in `hero_service_server` are unrelated — introduced by hero_rpc#138 and tracked separately.) ## Diff stat ``` Cargo.lock | 62 +++ (criterion + transitives) Cargo.toml | 2 + (examples, benches members) tests/Cargo.toml | 7 + (serial_test dev-dep) examples/Cargo.toml | 21 + (new workspace member) examples/01_connect.rs | 29 + (SDK demo) examples/src/lib.rs | 3 + (wrapper) benches/Cargo.toml | 29 + (new workspace member) benches/example_bench.rs | 27 + (commented-out skeleton) benches/src/lib.rs | 8 + (`pub use <name>_tests::*;`) ``` Zero changes under `crates/hero_service*`, `sdk/*`, `schemas/`, `data/`, or `tests/src/lib.rs` — those files are scaffolder-managed and contributors' edits are preserved on re-scaffold. ## Decisions taken without confirmation 1. **The example imports `hero_service_sdk::bench::BenchClient` and calls `BenchClient::indexed_multi_list`** — the first rootobject the generator discovers when iterating `(domain_alphabetical, snake_alphabetical)`. `bench` comes alphabetically before `catalog`; `indexed_multi` is alphabetically first inside `bench`. If a more interesting demo is wanted, the file is preserve-once — edit it once and the scaffolder won't overwrite. 2. **`tests/Cargo.toml` got a hand-edit** for `[dev-dependencies] serial_test = "3"` because the existing file is preserve-once. The block landed between `[dependencies]` and the first `[[test]]`, so the build-time `sync_tests_cargo_toml` rewriter (which cuts from the first `[[test]]` line onward) preserves it. 3. **The workspace `Cargo.toml` got `"examples"` and `"benches"` appended explicitly** rather than via a scaffolder-managed regen. Same preserve-once rationale — and the explicit edit is small enough that teaching the scaffolder to merge workspace members on rerun is out of scope. ## Test plan - [x] `cargo check --workspace --all-targets` — green - [x] `cargo check -p hero_service_examples` — green - [x] `cargo check -p hero_service_benches` — green - [x] `lab service hero_service --example` lists `01_connect` - [ ] `lab service hero_service --example 01_connect` end-to-end (requires installed `hero_service_server` binary; deferred — same dispatch shape verified by hero_skills PR's unit tests + the listing case above) - [ ] `lab service hero_service --test` 5 layers green (no regression vs hero_rpc#124) — deferred to post-merge full CI run Closes part of hero_rpc#129 (Phase 4).
Re-scaffold of hero_service against the hero_rpc#129 generator. Picks
up three new pieces that the scaffolder now emits by default:

  examples/                workspace member `hero_service_examples`
    Cargo.toml             [[example]] 01_connect path = "01_connect.rs"
    src/lib.rs             wrapper crate (no shared code)
    01_connect.rs          ~30-line SDK demo — connects via
                           HERO_TEST_SOCKET, calls indexed_multi_list
                           on the first discovered rootobject

  benches/                 workspace member `hero_service_benches`
    Cargo.toml             [[bench]] template (commented out)
    src/lib.rs             pub use hero_service_tests::*
    example_bench.rs       commented-out criterion skeleton

  tests/Cargo.toml         + [dev-dependencies] serial_test = "3"

Plus the matching workspace member list edit (`Cargo.toml` adds
`"examples"` and `"benches"`) — preserve-once meant the existing
workspace Cargo.toml wasn't rewritten by the scaffold rerun.

Acceptance evidence
-------------------

  $ PATH_ROOT=$HOME/hero lab service hero_service --example
  lab service hero_service --example: available examples
    01_connect                (examples/)

  $ cargo check --workspace --all-targets
  Finished `dev` profile [unoptimized + debuginfo] target(s) in 26.10s

(The pre-existing 14 warnings in hero_service_server are unrelated
to this re-scaffold — they're async-trait migrations introduced by
hero_rpc#138 and tracked separately.)

The hero_skills PR landing alongside this one adds the `--example` /
`--bench` / dual-home `--test` dispatch; this PR just consumes the
default-on shapes the generator now emits. No code in
`crates/hero_service*`, `sdk/*`, or `tests/src/lib.rs` was touched —
those files are scaffolder-managed and contributors' edits are
preserved on re-scaffold.

Decisions taken without confirmation
------------------------------------

1. The example imports `hero_service_sdk::bench::BenchClient` and
   calls `BenchClient::indexed_multi_list` — the first rootobject
   the generator discovers when iterating
   `(domain, snake_lex_sort)`. Catalog comes alphabetically after
   `bench`; `indexed_multi` is the alphabetically-first rootobject
   inside `bench`. If anyone wants a more interesting demo
   (`service_definition_list_full` over the catalog domain, say),
   the file is preserve-once — edit it once and the scaffolder won't
   overwrite.

2. `tests/Cargo.toml` got a hand-edit for `[dev-dependencies]
   serial_test = "3"` because the existing file is preserve-once.
   For brand-new services scaffolded after this PR, the generator
   emits the dev-dep automatically. The `[dev-dependencies]` block
   landed between `[dependencies]` and the first `[[test]]` so the
   build-time `sync_tests_cargo_toml` rewriter (which cuts from the
   first `[[test]]` line onward) keeps it untouched.

3. The workspace `Cargo.toml` got `"examples"` and `"benches"`
   appended explicitly rather than via a scaffolder-managed
   regeneration of the workspace manifest. Same preserve-once
   rationale — and the explicit edit is small enough that the
   alternative (teaching the scaffolder to "merge" workspace
   members on rerun) is out of scope for this PR.
timur merged commit 3b45c768b8 into development 2026-05-25 10:47:52 +00:00
Sign in to join this conversation.
No reviewers
No labels
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_service!13
No description provided.