safety: pass current task descr to render_step (Phase 10 C3)

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 ─ <task>` 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) <noreply@anthropic.com>
This commit is contained in:
2026-05-17 08:18:40 +00:00
parent 477d8a76cc
commit fa2cfc66ed
+11 -1
View File
@@ -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 ─ <task text>` 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.
--