Regenerate per-domain openrpc.json from .oschema during cargo build #41
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#41
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?
Audit results (downscoped)
Verified the proposed pattern already works end-to-end:
OschemaBuilder::generate()(called from a service crate'sbuild.rs) writes the per-domainopenrpc.jsonviaGenerator::generate_domain_files(crates/generator/src/generate.rs:404-411).cargo:rerun-if-changed=...is emitted for the schemas dir + each.oschemafile (crates/generator/src/build/build.rs:926, 931).touch crates/hero_logic/schemas/logic/logic.oschema && cargo build -p hero_logicregeneratessrc/logic/core/openrpc.json.include_str!then captures the new content on the next compile.So the infrastructure for build-time regen is already in place. The issue was misdiagnosed as "missing feature" — it's "incomplete adoption."
Audit of consumer crates
.oschema?build.rs?.oschemaUpdated scope
build.rsto hero_whiteboard (per-repo PR).build.rsto hero_fossil (per-repo PR).hero_osis_guideskill so new services pick it up by default..oschema, they need to restart the running service forrpc.discoverto advertise the new methods. The build.rs ensures the binary embeds the right spec, butcargo buildalone does not redeploy a running service. Worth a one-liner in the skill.What this issue is NOT
rpc.discover).Closing the original "needs major work" framing — refiling as the four checkboxes above. Will pick up the two backfill PRs immediately.
Audit results (downscoped)
Verified the proposed pattern already works end-to-end:
OschemaBuilder::generate()(called from a service crate'sbuild.rs) writes the per-domainopenrpc.jsonviaGenerator::generate_domain_files(crates/generator/src/generate.rs:404-411).cargo:rerun-if-changed=...is emitted for the schemas dir + each.oschemafile (crates/generator/src/build/build.rs:926, 931).touch crates/hero_logic/schemas/logic/logic.oschema && cargo build -p hero_logicregeneratessrc/logic/core/openrpc.json.include_str!then captures the new content on the next compile.So the infrastructure for build-time regen is already in place. The issue was misdiagnosed as "missing feature" — it's "incomplete adoption."
Audit of consumer crates
.oschema?build.rs?.oschemaUpdated scope
build.rsto hero_whiteboard (per-repo PR).build.rsto hero_fossil (per-repo PR).hero_osis_guideskill so new services pick it up by default..oschema, they need to restart the running service forrpc.discoverto advertise the new methods. The build.rs ensures the binary embeds the right spec, butcargo buildalone does not redeploy a running service. Worth a one-liner in the skill.What this issue is NOT
rpc.discover).Closing the original "needs major work" framing — refiling as the four checkboxes above. Will pick up the two backfill PRs immediately.
Closing — full audit results above. Net work delta:
OschemaBuilder::generate()and is wired correctly.build.rs.build.rs(hero_whiteboard, hero_fossil) don't use the OSIS-server pattern — they have hand-writtenopenrpc.jsonfiles. That's a different drift class (hand-written vs schema-derived) and out of scope here.hero_osis_guideskill so the next person debugging stalerpc.discoverreaches the right answer faster.hero_rpc#40's per-request recompute stays in place — it's microseconds of cost and provides defense-in-depth against future cache-coherence regressions. Not worth a revert.
No follow-up PRs needed.