feat(jobs): restore typed inputs end-to-end #140

Merged
mahmoud merged 2 commits from development_restore_typed_inputs into development 2026-06-08 12:52:18 +00:00
Owner

Restore typed inputs end-to-end (#137)

Root cause

Typed inputs were half-removed in the multi-domain migration. The templating engine (actions/template.rs), HERO_INPUT_* injection, and apply_inputs still lived in the server, and Action.input_schema still persisted — but the multi-domain SDK creates jobs only through run_quick_submit, which never threaded inputs into apply_inputs, and RunSpec had no inputs field. JobCreateInput/inputs existed only in the docs.

Change (oschema-first; all types regenerated, none hand-written)

  • oschema: add an inputs map to RunSpec; add a JobCreate { spec, context, inputs } struct and a job_create(req: JobCreate) -> str method on the Jobs service (the macro generates JobCreateInput/JobCreateOutput). openrpc_jobs.json regenerated.
  • server: run_quick_submit now renders RunSpec.inputs into every action via the existing apply_inputs; job_create creates and submits a one-shot job, applying inputs the same way. Empty inputs short-circuit, so the no-inputs path is byte-for-byte unchanged.
  • sdk: generated JobCreate/JobCreateInput are surfaced; .input()/.inputs() setters added to the job and run builders, plus an .input_schema() setter on ActionBuilder; the fluent job builder now creates via job_create and returns the job sid.
  • docs: api.md typed-inputs section and the header banner reconciled with the restored surface; stale template-engine path fixed.

Behavior (matches §1.5)

{{var}} / {{nested.path}} render in spec.script, every spec.env value, and (for ai) ai_config.{system_prompt,model}; unresolved placeholders stay literal. Non-ai interpreters also get HERO_INPUT_<UPPERCASE_KEY> (strings verbatim, non-strings JSON-serialized). input_schema stays declarative (persisted + exposed, not enforced).

Verification

  • cargo build --workspace clean; cargo clippy --workspace reports zero errors; the feature crates are clean under -D warnings.
  • New live-daemon test basic::jobs_quick::typed_inputs_render_and_env passes against a private isolated daemon: registers a greet action with an input_schema, runs two invocations (alice/3, bob/7), and asserts the rendered script output, HERO_INPUT_NAME in the job env, and input_schema round-trip.
  • The remaining full-suite failures are pre-existing in the integration test crate (which does not compile on development without the StateOutput.value fix included here) and are unrelated to typed inputs; the inputs-adjacent uc40_job_inputs_map passes when run alone.

Closes #137


Update — merged development (#139)

#139 landed on development and overlapped this branch in run_quick_submit.
Merged development in (dbe6356) and resolved:

  • run_quick_submit: kept both behaviours — persist the inline action
    template (__inline:run=<id> tag) before rendering, then apply_inputs
    into the job's spec copy only. So the stored action keeps its
    {{placeholders}} (#139 discovery + cascade-delete) and the job gets the
    rendered values (#140 typed inputs).
  • parallel_jobs_logging.rs: took development's de-noised log loop.
  • jobs_quick.rs: dropped a dead last initializer (unused_assignments,
    keeps clippy -D warnings clean).

Re-verified post-merge against an isolated daemon — all pass:
typed_inputs_render_and_env, run_submit_trivial_inline,
submit_inline_orders_job_sequence, and cleanup_on_success_deletes_inline
(the last confirms #139's inline persist + cascade survived). cargo build clean.

## Restore typed inputs end-to-end (#137) ### Root cause Typed inputs were half-removed in the multi-domain migration. The templating engine (`actions/template.rs`), `HERO_INPUT_*` injection, and `apply_inputs` still lived in the server, and `Action.input_schema` still persisted — but the multi-domain SDK creates jobs only through `run_quick_submit`, which never threaded inputs into `apply_inputs`, and `RunSpec` had no `inputs` field. `JobCreateInput`/`inputs` existed only in the docs. ### Change (oschema-first; all types regenerated, none hand-written) - **oschema**: add an `inputs` map to `RunSpec`; add a `JobCreate { spec, context, inputs }` struct and a `job_create(req: JobCreate) -> str` method on the Jobs service (the macro generates `JobCreateInput`/`JobCreateOutput`). `openrpc_jobs.json` regenerated. - **server**: `run_quick_submit` now renders `RunSpec.inputs` into every action via the existing `apply_inputs`; `job_create` creates and submits a one-shot job, applying inputs the same way. Empty inputs short-circuit, so the no-inputs path is byte-for-byte unchanged. - **sdk**: generated `JobCreate`/`JobCreateInput` are surfaced; `.input()/.inputs()` setters added to the job and run builders, plus an `.input_schema()` setter on `ActionBuilder`; the fluent job builder now creates via `job_create` and returns the job sid. - **docs**: `api.md` typed-inputs section and the header banner reconciled with the restored surface; stale template-engine path fixed. ### Behavior (matches §1.5) `{{var}}` / `{{nested.path}}` render in `spec.script`, every `spec.env` value, and (for `ai`) `ai_config.{system_prompt,model}`; unresolved placeholders stay literal. Non-`ai` interpreters also get `HERO_INPUT_<UPPERCASE_KEY>` (strings verbatim, non-strings JSON-serialized). `input_schema` stays declarative (persisted + exposed, not enforced). ### Verification - `cargo build --workspace` clean; `cargo clippy --workspace` reports zero errors; the feature crates are clean under `-D warnings`. - New live-daemon test `basic::jobs_quick::typed_inputs_render_and_env` passes against a private isolated daemon: registers a `greet` action with an `input_schema`, runs two invocations (alice/3, bob/7), and asserts the rendered script output, `HERO_INPUT_NAME` in the job env, and `input_schema` round-trip. - The remaining full-suite failures are pre-existing in the integration test crate (which does not compile on `development` without the `StateOutput.value` fix included here) and are unrelated to typed inputs; the inputs-adjacent `uc40_job_inputs_map` passes when run alone. Closes #137 --- ## Update — merged `development` (#139) `#139` landed on `development` and overlapped this branch in `run_quick_submit`. Merged `development` in (`dbe6356`) and resolved: - **`run_quick_submit`**: kept **both** behaviours — persist the inline action **template** (`__inline:run=<id>` tag) **before** rendering, then `apply_inputs` into the **job's** spec copy only. So the stored action keeps its `{{placeholders}}` (#139 discovery + cascade-delete) and the job gets the rendered values (#140 typed inputs). - **`parallel_jobs_logging.rs`**: took development's de-noised log loop. - **`jobs_quick.rs`**: dropped a dead `last` initializer (`unused_assignments`, keeps `clippy -D warnings` clean). Re-verified post-merge against an isolated daemon — all pass: `typed_inputs_render_and_env`, `run_submit_trivial_inline`, `submit_inline_orders_job_sequence`, and `cleanup_on_success_deletes_inline` (the last confirms #139's inline persist + cascade survived). `cargo build` clean.
feat(jobs): restore typed inputs end-to-end
All checks were successful
Build and Test / build (pull_request) Successful in 7m42s
deea3c2de7
Typed inputs were half-removed in the multi-domain migration: the
templating engine and HERO_INPUT_* injection still lived in the server,
but the SDK could only create jobs via run_quick_submit, which never
threaded inputs, and JobCreateInput/inputs were gone from the wire.

- oschema: add inputs map to RunSpec, a JobCreate payload struct, and a
  job_create(req: JobCreate) -> str method (all types regenerated, not
  hand-written); regenerate openrpc_jobs.json
- server: thread RunSpec.inputs through apply_inputs for every action in
  run_quick_submit, and implement job_create reusing apply_inputs; empty
  inputs stay a no-op so the no-inputs path is unchanged
- sdk: surface generated JobCreate/JobCreateInput; add inputs()/input()
  setters on the job and run builders and an input_schema() setter; the
  job builder now creates via job_create and returns the job sid
- docs: reconcile api.md typed-inputs section and the header banner with
  the restored surface; fix the stale template engine path
- test: add a live typed-inputs case (render + HERO_INPUT_* + input_schema
  round-trip across two invocations); unblock the suite by fixing two
  pre-existing test-crate build/clippy breaks

Closes #137
merge: resolve conflicts with development (#139)
All checks were successful
Build and Test / build (pull_request) Successful in 7m14s
dbe63567c0
- run_quick_submit: persist inline action template BEFORE applying typed
  inputs — keeps #139 inline-action discovery/cascade and #140 {{var}} render
- parallel_jobs_logging: take development's de-noised log loop
- jobs_quick: drop dead `last` initializer (clippy -D warnings)
mahmoud merged commit 14ee3ea0f9 into development 2026-06-08 12:52:18 +00:00
mahmoud deleted branch development_restore_typed_inputs 2026-06-08 12:52:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_proc!140
No description provided.