Upgrade example/recipe_server to end-to-end demo of new pattern #57

Open
opened 2026-05-18 12:37:10 +00:00 by timur · 2 comments
Owner

Goal

The example/recipe_server/ is the in-tree reference for hero_rpc users. Today it predates the current standards and won't pass lab infocheck. Upgrade it to be the end-to-end demo of the new scaffold-then-generate flow.

Scope

After the scaffold (#scaffold-full-service-repo) and codegen-alignment (#codegen-alignment) issues land, regenerate example/recipe_server/ from scratch using:

hero_rpc scaffold recipes --schema schemas/recipes/recipes.oschema --out example/recipe_server

Result should include:

  • Workspace with hero_recipes_server, hero_recipes_sdk, hero_recipes_admin, hero_recipes_examples crates.
  • service.toml at each binary crate root (generated, not hand-edited).
  • build.rs per binary reduced to ≤5 lines.
  • Generated SDK actually used by hero_recipes_examples (no hand-rolled client).
  • _admin binary serving the framework default screens at admin.sock + a recipes-specific page.
  • Pre-filled RecipeServiceTrait impl demonstrating both a CRUD-only method and a custom business-logic method.
  • README walking through: 1) what was scaffolded, 2) what the user edits (the trait impl), 3) what cargo build regenerates, 4) lab service recipes --start to run it.

Stretch — AI-driven narrative

Document (and ideally script) the flow:

  1. Agent reads the scaffold skill (#hero_skills issue) for context.
  2. Agent calls hero_rpc scaffold with the user's name + schema.
  3. Agent fills in the preserved trait stubs based on a higher-level task description.
  4. Agent runs cargo build (which triggers codegen) and lab infocheck until clean.

This is the example that makes hero_rpc tangible for both humans and agents — referenced by the new context skill.

Acceptance

  • cd example/recipe_server && cargo build && lab infocheck all succeed cleanly.
  • lab service recipes --start works and curl --unix-socket .../rpc.sock /health returns ok.
  • README documents the AI-driven workflow with copy-pasteable commands.
  • petstore_server / petstore_client examples are either deleted (if redundant) or kept with a note explaining when each pattern applies.

Depends on

  • #scaffold-full-service-repo
  • #codegen-alignment
  • #generator-build-rs-modularization
  • hero_website_framework issues (for the _admin crate to wire cleanly)
## Goal The `example/recipe_server/` is the in-tree reference for hero_rpc users. Today it predates the current standards and won't pass `lab infocheck`. Upgrade it to be the **end-to-end demo** of the new scaffold-then-generate flow. ## Scope After the scaffold (#scaffold-full-service-repo) and codegen-alignment (#codegen-alignment) issues land, regenerate `example/recipe_server/` from scratch using: ``` hero_rpc scaffold recipes --schema schemas/recipes/recipes.oschema --out example/recipe_server ``` Result should include: - Workspace with `hero_recipes_server`, `hero_recipes_sdk`, `hero_recipes_admin`, `hero_recipes_examples` crates. - `service.toml` at each binary crate root (generated, not hand-edited). - `build.rs` per binary reduced to ≤5 lines. - Generated SDK actually used by `hero_recipes_examples` (no hand-rolled client). - `_admin` binary serving the framework default screens at `admin.sock` + a recipes-specific page. - Pre-filled `RecipeServiceTrait` impl demonstrating both a CRUD-only method and a custom business-logic method. - README walking through: 1) what was scaffolded, 2) what the user edits (the trait impl), 3) what `cargo build` regenerates, 4) `lab service recipes --start` to run it. ## Stretch — AI-driven narrative Document (and ideally script) the flow: 1. Agent reads the scaffold skill (#hero_skills issue) for context. 2. Agent calls `hero_rpc scaffold` with the user's name + schema. 3. Agent fills in the preserved trait stubs based on a higher-level task description. 4. Agent runs `cargo build` (which triggers codegen) and `lab infocheck` until clean. This is the example that makes hero_rpc tangible for both humans and agents — referenced by the new context skill. ## Acceptance - `cd example/recipe_server && cargo build && lab infocheck` all succeed cleanly. - `lab service recipes --start` works and `curl --unix-socket .../rpc.sock /health` returns ok. - README documents the AI-driven workflow with copy-pasteable commands. - `petstore_server` / `petstore_client` examples are either deleted (if redundant) or kept with a note explaining when each pattern applies. ## Depends on - #scaffold-full-service-repo - #codegen-alignment - #generator-build-rs-modularization - hero_website_framework issues (for the `_admin` crate to wire cleanly)
Author
Owner

Parent / context tracker: hero_skills#262 — read it before starting work on this issue. Locked decisions, reference materials, and execution order live there. Iterate via comments here; consolidation passes on the body only after feedback settles.

Parent / context tracker: [hero_skills#262](https://forge.ourworld.tf/lhumina_code/hero_skills/issues/262) — read it before starting work on this issue. Locked decisions, reference materials, and execution order live there. Iterate via comments here; consolidation passes on the body only after feedback settles.
Author
Owner

State refresh

Pulled latest. example/recipe_server/build.rs is unchanged (still 42 lines, hand-rolled rustfmt pass, hand-listed output paths). Upgrade work in this issue is still entirely pending.

Still depends on #54, #55, #56 landing first.

## State refresh Pulled latest. `example/recipe_server/build.rs` is unchanged (still 42 lines, hand-rolled rustfmt pass, hand-listed output paths). Upgrade work in this issue is still entirely pending. Still depends on [#54](https://forge.ourworld.tf/lhumina_code/hero_rpc/issues/54), [#55](https://forge.ourworld.tf/lhumina_code/hero_rpc/issues/55), [#56](https://forge.ourworld.tf/lhumina_code/hero_rpc/issues/56) landing first.
Sign in to join this conversation.
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#57
No description provided.