lab publish CI broken: openrpc_client! rejects {str: any} inputs from #140 (Rule 2) #142
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_proc#142
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
After merging #140 (
feat(jobs): restore typed inputs end-to-end) intodevelopment, the lab publish CI fails to build.labdepends onhero_proc_sdkas a git dependency, and the SDK'sopenrpc_client!macro now rejects the schema introduced by #140:This cascades into ~9
E0432unresolved-import errors (HeroProcClient_,JobCreate,RunSpec,Action, etc.) because codegen aborts, and the wholehero_proc_sdklib fails to compile — breaking every downstream consumer (lab, admin, examples).Root cause
#140 modeled per-invocation typed inputs as a free-form map using the
anyvalue type, in two oschema types:crates/hero_proc_server/oschema/jobs/40_run.oschema—RunSpec.inputs: {str: any}crates/hero_proc_server/oschema/jobs/30_job.oschema—JobCreate.inputs: {str: any}{str: any}generatesHashMap<String, serde_json::Value>. Theopenrpc_server!codegen tolerated this, so #140 built and tested green locally against the server, but theopenrpc_client!codegen enforces openrpc principles Rule 2, which forbidsanyentirely (no constructor, no typed accessors, no compile-time check). The enforcement was tightened (seestopgap/openrpc-enforcement-b1), so the client-side build thatlabperforms now hard-fails.Fix
Re-model
inputswithoutany, using the existing in-repo precedent:Action.input_schemais already astrholding a JSON document (a JSON Schema). Modelinputsthe same way — astrholding a JSON object — instead of{str: any}:RunSpec.inputs: str— JSON object string of per-invocation typed values;""= noneJobCreate.inputs: str— JSON object string;""= noneThis preserves all documented §1.5 behavior with zero engine changes: the server parses the string into a
serde_json::Valueand feeds the unchangedapply_inputs/template.rsengine, so{{var}}/{{nested.path}}traversal, natural number/bool rendering, andHERO_INPUT_<UPPER>injection all keep working. The typed SDK builder API (.input(k, v: impl Into<serde_json::Value>)/.inputs(map)) is unchanged — the SDK serializes the map to a JSON string at the wire boundary.Scope of changes
{str: any}->str(the only twoanyusages in the tree).crates/hero_proc_server/openrpc/openrpc_jobs.json.jobs_impl.rs: parsereq.inputs/spec.inputsJSON string ->Value(wasto_value).factory.rs/builders.rs: serialize the builder's input map -> JSON string when constructingRunSpec/JobCreate.inputsas a JSON string literal.Acceptance criteria
hero_proc_sdkcompiles (bothopenrpc_server!andopenrpc_client!codegen pass — no Rule 2 violation).labbuilds against the SDK git dependency (CI publish job green).{{var}}/{{nested.path}}; numbers/bools render naturally; unresolved placeholders stay literal.HERO_INPUT_<UPPER>still injected for non-ai interpreters.input_schemastill persists and round-trips.cargo build+cargo clippy -D warningsclean for the feature crates.Notes
developmentHEAD14ee3eais affected.inputs(map -> JSON string), which is invisible through the SDK builder API.Already mentioned in #143
mahmoud referenced this issue2026-06-08 16:18:22 +00:00