Align OSIS CRUD codegen to hero_lib 979c1781: drop _new, _set upsert with full object, no <Type>Input #155
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_blueprint#155
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?
Summary
Kristof simplified OSIS CRUD/OpenRPC generation in hero_lib commit
979c1781(crates/oschema/src/oschema/openrpc.rs). hero_blueprint's OSIS generator still emits the old shape and must be aligned. Confirmed againstorigin/development.The new shape (hero_lib
oschema/openrpc.rs, post-979c1781)Per
[rootobject], CRUD methods are now:_get,_set,_delete,_list,_list_full,_exists,_find—_newis GONE._setis the single write entry point (upsert) —openrpc.rs:543. Itsdataparam is "A full{ty}object — the same schema{wire}_getreturns. Leavesidempty/absent to create (server mints it); set it to a server-issuedsidto update." Returns the SmartID. (Quote: "there is no separatenew".)dataparam and the_getresult both reference the full object schema (ref_full). There is no separate<Type>Input/ObjectInputschema anymore (the old "Input shape … without server-managed base fields sid/created_at/updated_at" component is removed)._(e.g.user_set,user_get) — notuser.set.What hero_blueprint still does (old shape — to change)
crates/generator/src/:rust/rust_osis.rs— emits_new(data: <Type>Input)and_set(sid, data: <Type>Input) -> bool; RPC handlers_rpc_new/_rpc_set(sid,data).rust/rust_struct.rs— emits the separate<Type>Inputstruct (~943) +From<&Type> for <Type>Input.schemas/openrpc.rs— emits the_newmethod spec + separate input schema.derive/openrpc_client.rs— SDK hasnew+<Type>NewInputflattening.Change list
_neweverywhere (generator methods, RPC handlers, OpenRPC spec, SDK)._set→ upsert taking the full object (<Type>, withsid): empty/absentsid⇒ create (mint sid), presentsid⇒ update. Returns SmartID (string). Remove the(sid, Input)two-param form.<Type>Inputstruct + its schema;_set/_getuse the full object schema. Storage layer already strips/stampssid/created_at/updated_aton create.openrpc_client!): dropnew;set(obj: <Type>).server/rpc.rsstubs, admin create-forms (call_setwith empty sid, not_new), and tests asserting the old surface.Intersection with recent OSIS work (mostly orthogonal)
The async
.awaitonDBTypedcall sites, the hero_db storage migration, the[index]→@indexschema migration, and per-domain serving are unaffected by the method/struct-shape change — except the_newhandler is removed and the_sethandler now takes the full object (sid-aware create-or-update), so the create path inrust_osis.rs's emitted handlers + theFrom<&Type> for Inputconversion go away.Bigger picture
This is the codegen-shape half of converging OSIS onto hero_lib's model; the serving half is #154. Ideally hero_blueprint's OSIS CRUD generation reuses hero_lib's
oschema/openrpc.rsshape rather than maintaining a parallel emitter.References
979c1781;crates/oschema/src/oschema/openrpc.rs:520-640(CRUD emit),:164(set input check).crates/generator/src/rust/rust_osis.rs,rust/rust_struct.rs,schemas/openrpc.rs,derive/openrpc_client.rs.feature/osis-hero-db-storage; hero_blueprintfeature/osis-hero-db-storage+feature/osis-multidomain-serve.Filed with context from the hero_osis re-architecture (Claude).
Align (and confirm) OSIS CRUD / OpenRPC input-struct codegen with Kristof's simplified shapeto Align OSIS CRUD codegen to hero_lib 979c1781: drop _new, _set upsert with full object, no <Type>InputPicking this up (together with the paired issue — same OSIS handler regeneration). Working branches: hero_blueprint
feature/osis-multidomain-serve(rebased target) + hero_osisfeature/osis-hero-db-storage.Exploring the exact target first: how a storage-backed OSIS handler plugs into hero_lib
openrpc_server!(<Domain>Apitrait + per-domain router) andserve_rpc_domains. Will post the concrete execution plan here next, then implement in chunks with a comment per chunk so this issue stays a complete record.Execution plan + the gating type-ownership decision are journaled on #154 — same regeneration pass covers this issue's
_set-upsert/no-_new/single-schema change (it falls out of adopting hero_libopenrpc_server!). Will journal CRUD-shape specifics here as that chunk lands.