Verify hero_proc executes nushell scripts as Action → Job #9
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?
Parent: #8
Context
hero_codescalers features should trigger nushell scripts via hero_proc's
Action → Job pattern, not execute them in-process.
What to verify
crates/hero_proc_server/)crates/nu_exec/in hero_codescalersRelevant paths
hero_proc/crates/hero_proc_server/— supervisor daemonhero_proc/crates/hero_proc_lib/— SQLite persistencehero_codescalers/crates/nu_exec/— async nushell executor$HERO_SOCKET_DIR/hero_proc/rpc.sockAcceptance Criteria
Verification — Action → Job pipeline works (after fixing one bug)
Bug found
hero_codescalers_serverwas passinginterpreter: "nu"(binary name) tohero_proc.action_set, but hero_proc's serde deserializer expects the enum variant name"nushell". The error was being swallowed by anyhow context, so the user saw only"user.bridge_ping enqueue failed"with no underlying cause.After temporarily changing the RPC handler in
main.rsfrome.to_string()toformat!("{:#}", e)to surface the chain, the real error showed up:Fix (1-line normalization)
In
crates/hero_codescalers_server/src/jobs.rs::enqueue, afterwrap_as_user:Caught all 12 call sites that use
interpreter: "nu"(inusers.rs,services.rs,template.rs) without having to touch each one. Will commit on a feature branch (fix/nu-interpreter-name) and PR.The error-chain improvement to
main.rs(format!("{:#}", e)for the dispatch error path) is also worth keeping — included in the same commit. Without it, future serde mismatches will be invisible the same way.Verification on kristof4
After the fix,
user.bridge_pingfor usermahmoud:In hero_proc job list:
Acceptance criteria
action_setaccepts the spec withinterpreter: "nushell".user.bridge_pingenqueued job 25.succeeded, run completed.Tag set (informs #10)
The four-tag scheme already in place:
codescaler— canonical filter tag (every codescaler-driven action carries it)codescaler_<actor>—codescaler_mahmoudcodescaler_kind_<kind>—codescaler_kind_usercodescaler_target_<t>—codescaler_target_mahmoudThis is exactly the substrate #10 needs: a tag-based bulk cleanup RPC operates over
tag=codescaler(or narrower facets likekind/actor/target).Next
Moving to #10 (cleanup RPC) and then #11 (ADMIN_SECRETS configuration). Will commit the
nu → nushellfix + error-chain improvement under a separate branch so it can be reviewed independently of the new code in #10.Closed — verified end-to-end + bug fix landed
The hero_proc → nushell pipeline works as designed: action defined with
interpreter: nushell, job created, executed, logs captured, exit code reported.During verification, surfaced a bug where hero_codescalers passed
interpreter: "nu"(the binary name) to hero_proc, which expects the enum variant"nushell"—action.setwas rejecting withunknown variant 'nu', expected one of bash, sh, rhai, python3, bun, node, nushell, exec, ai, mcp. The error was masked becauserpc_handlerusede.to_string()instead offormat!("{:#}", e), swallowing the anyhow chain.Fixed in PR #13 (merged):
jobs::enqueuenormalizes"nu"→"nushell"before callingActionBuilder. One site catches all 12 callers.rpc_handlernow returnsformat!("{:#}", e)so future serde mismatches surface their full cause chain.Verified on kristof4:
user.bridge_pingsucceeds; job runs with the canonical codescaler tags (codescaler,codescaler_<actor>,codescaler_kind_<kind>,codescaler_target_<t>).