fix(jobs): model typed inputs as JSON string (Rule 2) #145
No reviewers
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!145
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_fix_inputs_any"
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?
What
Fixes the lab publish CI build break introduced by #140.
RunSpec.inputsandJobCreate.inputswere modeled as{str: any}, whichopenrpc_client!rejects under openrpc principles Rule 2 (anyis forbidden). Theopenrpc_server!codegen tolerated it, so #140 built/tested locally, butlab(which compiles the SDK's client macro via the git dependency) hard-failed.How
Re-model
inputsas astrholding a JSON object — the same precedent asAction.input_schema, which already carries a JSON document as astr. This keeps the entire §1.5 feature working with zero engine changes:RunSpec.inputs/JobCreate.inputs{str: any}->str(the only twoanyusages in the tree).jobs_impl.rs: parse theinputsJSON string into aserde_json::Valuebeforeapply_inputs(""/ invalid =>Null=> no-op); the templating/HERO_INPUT_*engine is untouched.factory.rs/builders.rs: serialize the builder's typed input map to a JSON string at the wire boundary. The fluent API (.input(k, v)/.inputs(map)) is unchanged.openrpc_jobs.json(bothinputsblocks ->type: string).Verification
hero_proc_sdkcompiles —openrpc_client!accepts the schema (the failing CI gate).development/ #144).basic::jobs_quick::typed_inputs_render_and_envpasses against an isolated daemon:{{var}}/{{nested.path}}render, numbers stay numbers (count=3),HERO_INPUT_NAMEinjected,input_schemaround-trips.Notes
development(#144 cleanup) is merged into this branch.cargo clippy -D warningshas pre-existing failures ondevelopmentin files this PR does not touch (keys.rs,filter.rs,stop.rs,supervisor/mod.rs); out of scope here.Closes #143
- RunSpec.inputs / JobCreate.inputs: {str: any} -> str (JSON object); {str: any} is rejected by openrpc_client! (Rule 2), which broke the lab publish build after #140 - server parses the inputs JSON string into a Value before apply_inputs; "" / invalid => no inputs (engine and no-inputs path unchanged) - sdk serializes the typed input map to a JSON string at the wire boundary; builder API (.input/.inputs) unchanged - regenerate openrpc_jobs.json; mirrors the input_schema precedent (a str carrying a JSON document) - docs + e2e test updated to the JSON-string contract #143