From fa2cfc66ed08ce03137ce19df7dd78d2c2544c5c Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Sun, 17 May 2026 08:18:40 +0000 Subject: [PATCH] safety: pass current task descr to render_step (Phase 10 C3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit helpers.render_step has supported a (step_n, max_n, descr) signature since Phase 3 (renderer.lua:246) but safety.norris_step has only ever called it with two args. Phase 10 lights up the descr slot: when ctx.norris_tasks is populated (cloud preplanner ran at :norris launch), the current task text becomes the per-step description so the user sees `─ step k/N ─ ` in real time. ctx.norris_tasks is nil when: - preplan disabled (cfg.norris.preplanner unset) - preplan failed (transport / parse / empty) - preplan emitted TASKs but already exhausted In all those cases descr falls through to nil → renderer prints just the step bar (Phase 3 behavior, no regression). Regression: 87/87 safety, 31/31 router_model, repl loads. No e2e visible change yet — ctx.norris_tasks is always nil until C4 wires the preplan call. R5 fix: this commit touches safety.lua ONLY (no repl.lua change as the prior plan implied). Executor cfg resolution + preplan wiring lands in C4 (next commit). Co-Authored-By: Claude Opus 4.7 (1M context) --- safety.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/safety.lua b/safety.lua index b8f3e4f..d033c8d 100644 --- a/safety.lua +++ b/safety.lua @@ -362,7 +362,17 @@ function M.norris_step(ctx, model_cfg, helpers, opts) local max_steps = opts.max_steps or 8 local cfg = opts.cfg - helpers.render_step(step_n, max_steps) + -- Phase 10 / #89: when the cloud preplanner emitted a TASK list + -- at :norris launch, surface the current task as the per-step + -- descr so the user sees `─ step k/M ─ ` in real time. + -- ctx.norris_tasks is nil when preplan is disabled / failed → + -- descr falls through to nil → renderer prints just the step bar + -- (existing behavior). + local task_descr + if ctx.norris_tasks and ctx.norris_tasks.list then + task_descr = ctx.norris_tasks.list[ctx.norris_tasks.current] + end + helpers.render_step(step_n, max_steps, task_descr) -- (1) one broker round-trip — stream text + collect tool_calls. --