feat(server): wire wizard.* and deckjobs.* JSON-RPC dispatcher arms #52

Merged
mik-tf merged 1 commit from development_mik into development 2026-05-10 12:20:36 +00:00
Owner

Bucket A of #51 — 9 of 15 undispatched OpenRPC methods.

Summary

Adds 9 dispatch arms to the JSON-RPC dispatcher in crates/hero_slides_server/src/rpc.rs:

Method Backing handler
wizard.runAsync crate::generate_job::handle_wizard_run_async (existed since the wizard work landed; was orphaned at line 1127)
wizard.runJobStatus crate::generate_job::handle_wizard_run_job_status (line 1590)
wizard.runJobLogs crate::generate_job::handle_wizard_run_job_logs (line 1602)
wizard.runResult crate::generate_job::handle_wizard_run_result (line 1693)
deckjobs.list crate::jobs::rpc::handle_list (line 46)
deckjobs.status crate::jobs::rpc::handle_status (line 68)
deckjobs.logs crate::jobs::rpc::handle_logs (line 75)
deckjobs.cancel crate::jobs::rpc::handle_cancel (line 86)
deckjobs.result crate::jobs::rpc::handle_result (line 102)

Every one of these handlers already existed and was reachable from the JobManager — they just had no match arm in the dispatch table, so calls returned -32000 "Method not found" and the JS dashboard's Slide Wizard CTA + per-deck Jobs sidebar silently failed (each call wrapped in try{…}catch{toast(…)}).

Also drops the #[allow(unused_imports)] decorations on the pub use {JobHandle, JobManager, types::*} re-exports in jobs/mod.rs. The inline comment explicitly said they "become load-bearing when RPC handlers are wired in A.5 / A.6" — that's this commit.

Verification

  • cargo check -p hero_slides_server clean (no new warnings — the 11 existing warnings are unrelated legacy_param_shim helpers from PR #50 reserved for future buckets).
  • scripts/smoke_openrpc.py post-merge: METHOD_MISSING count expected to drop from 15 → 6 (only bucket B/C methods left).
  • Hero Browser MCP smoke (post-merge, on a workstation with hero_aibroker reachable):
    • Slide Wizard CTA on Home page produces a real wizard job (wizard.runAsync returns {key, job_id} instead of -32000).
    • Per-deck Jobs sidebar populates after a generate (deckjobs.list returns [JobSnapshot]).
    • Cancel + log-tail buttons work in the Jobs sidebar (deckjobs.cancel / deckjobs.logs).

Out of scope

Bucket B (slide.clearLink, slide.setImageModel, slide.revertToLastGenerated, slide.resolveContext, bg.extractTheme) — pure wire-up against existing lib helpers; sibling PR.

Bucket C (slide.setLink, slide.getStaleness, deck.staleness, folder.pick) — blocked on missing lib code (link persistence design, staleness computation, file-dialog crate); fresh issue at session end.

Signed-off-by: mik-tf

Bucket A of https://forge.ourworld.tf/lhumina_code/hero_slides/issues/51 — 9 of 15 undispatched OpenRPC methods. ## Summary Adds 9 dispatch arms to the JSON-RPC dispatcher in `crates/hero_slides_server/src/rpc.rs`: | Method | Backing handler | |---|---| | `wizard.runAsync` | `crate::generate_job::handle_wizard_run_async` (existed since the wizard work landed; was orphaned at line 1127) | | `wizard.runJobStatus` | `crate::generate_job::handle_wizard_run_job_status` (line 1590) | | `wizard.runJobLogs` | `crate::generate_job::handle_wizard_run_job_logs` (line 1602) | | `wizard.runResult` | `crate::generate_job::handle_wizard_run_result` (line 1693) | | `deckjobs.list` | `crate::jobs::rpc::handle_list` (line 46) | | `deckjobs.status` | `crate::jobs::rpc::handle_status` (line 68) | | `deckjobs.logs` | `crate::jobs::rpc::handle_logs` (line 75) | | `deckjobs.cancel` | `crate::jobs::rpc::handle_cancel` (line 86) | | `deckjobs.result` | `crate::jobs::rpc::handle_result` (line 102) | Every one of these handlers already existed and was reachable from the JobManager — they just had no `match` arm in the dispatch table, so calls returned `-32000 "Method not found"` and the JS dashboard's Slide Wizard CTA + per-deck Jobs sidebar silently failed (each call wrapped in `try{…}catch{toast(…)}`). Also drops the `#[allow(unused_imports)]` decorations on the `pub use {JobHandle, JobManager, types::*}` re-exports in `jobs/mod.rs`. The inline comment explicitly said they "become load-bearing when RPC handlers are wired in A.5 / A.6" — that's this commit. ## Verification - `cargo check -p hero_slides_server` clean (no new warnings — the 11 existing warnings are unrelated `legacy_param_shim` helpers from PR #50 reserved for future buckets). - `scripts/smoke_openrpc.py` post-merge: METHOD_MISSING count expected to drop from 15 → 6 (only bucket B/C methods left). - Hero Browser MCP smoke (post-merge, on a workstation with hero_aibroker reachable): - Slide Wizard CTA on Home page produces a real wizard job (`wizard.runAsync` returns `{key, job_id}` instead of -32000). - Per-deck Jobs sidebar populates after a generate (`deckjobs.list` returns `[JobSnapshot]`). - Cancel + log-tail buttons work in the Jobs sidebar (`deckjobs.cancel` / `deckjobs.logs`). ## Out of scope Bucket B (`slide.clearLink`, `slide.setImageModel`, `slide.revertToLastGenerated`, `slide.resolveContext`, `bg.extractTheme`) — pure wire-up against existing lib helpers; sibling PR. Bucket C (`slide.setLink`, `slide.getStaleness`, `deck.staleness`, `folder.pick`) — blocked on missing lib code (link persistence design, staleness computation, file-dialog crate); fresh issue at session end. Signed-off-by: mik-tf
feat(server): wire wizard.* and deckjobs.* JSON-RPC dispatcher arms
Some checks failed
Test / test (push) Failing after 21s
Test / test (pull_request) Failing after 16s
638d47bab8
Adds 9 dispatch arms in `crates/hero_slides_server/src/rpc.rs`:

  wizard.runAsync       → handle_wizard_run_async
  wizard.runJobStatus   → handle_wizard_run_job_status
  wizard.runJobLogs     → handle_wizard_run_job_logs
  wizard.runResult      → handle_wizard_run_result
  deckjobs.list         → jobs::rpc::handle_list
  deckjobs.status       → jobs::rpc::handle_status
  deckjobs.logs         → jobs::rpc::handle_logs
  deckjobs.cancel       → jobs::rpc::handle_cancel
  deckjobs.result       → jobs::rpc::handle_result

Every handler already existed in the codebase — wizard.* in
generate_job.rs (lines 1127, 1590, 1602, 1693), deckjobs.* in
jobs/rpc.rs (lines 46, 68, 75, 86, 102) — but no dispatch arm pointed
at them, so calls returned -32000 "Method not found" and the JS
dashboard's Slide Wizard CTA + per-deck Jobs sidebar silently failed.

Also drops the `#[allow(unused_imports)]` decorations on the
`pub use {JobHandle, JobManager, types::*}` re-exports in jobs/mod.rs
— the inline comment explicitly said they "become load-bearing when
RPC handlers are wired in A.5 / A.6", which is what this commit does.

Bucket A of #51
(9 of 15 undispatched methods). Bucket B (slide.* + bg.extractTheme)
follows in a sibling PR; bucket C (slide.setLink, slide.getStaleness,
deck.staleness, folder.pick — blocked on lib stubs) gets a fresh
issue.

Signed-off-by: mik-tf
mik-tf merged commit 1c4391e8b8 into development 2026-05-10 12:20:36 +00:00
mik-tf deleted branch development_mik 2026-05-10 12:20:36 +00:00
Sign in to join this conversation.
No reviewers
No labels
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_slides!52
No description provided.