Verify methods-only oschema path — full scaffold + SDK + OpenRPC stack works without rootobjects #131
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#131
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?
Goal
Verify the entire hero_rpc service scaffolding + end-to-end OpenRPC stack works for oschemas that declare only
serviceblocks, no[rootobject]types. This is the prerequisite for the legacy-service migration (see meta hero_skills#262 closeout and the sister issue in this repo).Why
Today, every example in
examples/(recipe_server,walkthrough_demo,petstore_*,hero_food) and every test fixture has at least one rootobject. There is no canary exercising the methods-only path.A methods-only oschema is the natural shape for services like
hero_indexer,hero_aibroker,hero_browser, etc. — which expose API surface but do not own storage. The migration of those services to oschema-driven codegen is gated on this path being verified end-to-end.What I observe from the code (audit)
The bones are there but untested end-to-end:
crates/generator/src/schemas/oschema.rs):serviceblocks are first-class top-level constructs, parallel to type definitions. No rootobject required.crates/generator/src/build/emit/rust_rpc2.rs:281): walks rootobjects and services independently. With zero rootobjects it emits service methods only.crates/generator/src/rust/rust_rpc.rs:130):if root_objects.is_empty() { return Ok(output); }— CRUD trait short-circuits cleanly. Service-method handlers come from a separate pass.crates/generator/src/schemas/openrpc.rs): both CRUD and service-block methods merged into the spec.crates/generator/src/build/scaffold.rs:1787): test crate handles empty rootobjects (no[[test]]entries). Admin + web crates iterate&[RootObjectInfo]— with zero, emit empty index pages (degenerate but not fatal).Likely failure modes (to be confirmed)
lab infocheckmay not).examplessubcrate emission (still not generated per meta #262) — may be missing for the methods-only path too.crates/generator/src/generate/e2e.rs:129) — guarded onservices.is_empty()but may emit a degenerate<svc>_e2e.rsthat fails to link.Acceptance criteria
examples/methods_only/workspace underhero_rpc/examples/with an.oschemadeclaring only aserviceblock (suggestion: aHello { greet(name: str) -> str; echo(message: str) -> str }style toy service). No rootobjects.cargo build --workspaceclean on the new example.cargo test --workspaceruns and passes (at minimum: a hand-written E2E test callinggreet(...)end-to-end through the SDK trait).examples/methods_onlyand diffs the output against a committed snapshot.Out of scope
hero_indexer, etc.) — that lands in the sister migration issue.Links
Closed by hero_rpc#134 (squash sha
2b2aeb6). The methods-only oschema path is verified end-to-end —hero_service's greeter (methods-only) + extended catalog service-block methods exercise codegen + SDK + OpenRPC + E2E test emission cleanly. Forge auto-close didn't trigger; flipping manually.