feat(scripts): promote log() to write into event_logs master
The Lua `log("...")` primitive used to call `tracing::debug!` only — fine for ops who tail server stderr, useless for operators who use the dashboard. Wire it into `event_logs` so script output is queryable from `/dashboard/events` without shell access. New `register_log_event_api(lua, state, trigger_id, caller_did)` in `src/lua/scripts.rs` registers a Lua `log(msg)` global that does both: - Emits `tracing::debug!(lua_log = msg, trigger = trigger_id, ...)` for ops who do tail. - Inserts a row into `event_logs` with: event_type = "script.log" severity = Info actor_did = caller_did (XRPC handlers; None for record / label) subject = trigger_id (queryable per script) detail = { trigger, message } This intentionally OVERRIDES the basic `log()` from `sandbox::create_sandbox()`. All four script runners (record-event, label-applied, xrpc.procedure, xrpc.query) now wire it through: - `register_default_apis(lua, state, trigger_id, caller_did)` gains the `trigger_id` parameter and calls `register_log_event_api` after the other registrations. - `execute_procedure_script` and `execute_query_script` register the log API directly with `xrpc.{procedure,query}:<lexicon.id>` as the trigger. E2E test in `tests/e2e_scripts.rs` verifies a record-event script's `log("hello from script")` produces a `script.log` row whose subject is the trigger id and detail carries `{ trigger, message }`. Signed-off-by: Chris Pardy <chris.pardy@gmail.com> Signed-off-by: Trezy <tre@trezy.com>