3 Commits

Author SHA1 Message Date
marfrit cbef05ff40 phase10: fold in Sonnet review — 2 blockers + 4 important + 2 nits
All 8 actionable findings accepted; R9-R11 were confirmations.

Blockers:
  - R1: sys:gsub("N", ...) would corrupt "No prose / commentary /
    numbering" → "16o prose" etc. Switch to %d + string.format.
  - R2: §5 had a 2-slot NORRIS_SUFFIX_TEMPLATE redesign that
    contradicted §11's "don't change the template; append helper
    output after". §5 now shows the helper-append approach.

Important:
  - R3: preplan bypasses call_broker (no fallback retry) — keep that
    by design; retry would silently swap planning models. Documented
    in §10 Risks so it doesn't get "fixed" later.
  - R4: no pcall around run_norris → ctx.norris_active/_goal/_tasks
    can leak across launches if a Norris step crashes. Fix: clear all
    three at the TOP of run_norris before preplan. Cheaper than full
    pcall wrap; handles the stale-tasks vector.
  - R5: clarified C3 commit scope — safety.lua ONLY in C3; the
    executor cfg resolution + preplan wiring lands in C4.
  - R6: Context:reset() now also clears self.norris_tasks (defensive;
    :reset is unreachable mid-Norris but one line is cheap).

Nits:
  - R7: timeout_ms = pre_cfg.timeout_ms or 60000 (respect the
    configured per-model timeout).
  - R8: "Status:" → "Terminal output:" in §1 acceptance criterion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 08:17:30 +00:00
marfrit cb2f948e76 phase10: analyze + plan — answer Q-PP1..6, 5-commit roadmap
Analysis resolves 6 OQs from the formulate:
  - executor cfg independent of preplanner cfg (Q-PP1)
  - preplan non-streaming for v1 (Q-PP2)
  - re-launch fires preplan again, naturally (Q-PP3)
  - executor sees goal + current task (Q-PP4)
  - :norris introspection out-of-scope v1 (Q-PP5)
  - 1-task degenerate case runs as normal (Q-PP6)

Code-reading findings: safety.norris_step signature unchanged
(executor cfg flows in as model_cfg param); NORRIS_SUFFIX_TEMPLATE
stays stable (task hint appends after); renderer.norris_step already
accepts descr (just unused by safety.norris_step today).

Plan: 5 commits — executor / context / safety / repl / config-and-
memory. Each commit verifiable in isolation; the orchestration lights
up at C4 (repl preplan wiring); C5 documents.

Sonnet review next (per ~/.claude/projects/.../memory rule).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 08:12:43 +00:00
marfrit a7cbe22d1d phase10: formulate manifest — cloud preplanner / local executor split
Resolves direction for #89. Splits Norris into two roles:

- Preplanner (cloud) fires ONCE at :norris launch; emits TASK: list.
- Executor (local) handles each TASK; existing HALT protocol intact.

ctx.norris_tasks anchor survives eviction (mirrors ctx.norris_goal).
Cost category 'norris-preplan' separates the cloud preplan call
from per-step executor cost in :cost detail.

Graceful fall-back when cfg.norris.preplanner is unset OR preplan
call fails — Norris runs as today (single-model). No regression for
existing users.

PHASE0 §11 amended to add Phase 10 row.

Manifest declares 6 Open Questions for analyze step; 12 design
decisions table; module-touch table; 4-pillar plan.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 08:11:33 +00:00