Two OrangeCat companions (Loki Architect, Loki Critic), briefed with Ask
Loki's real prompts, route and panel, argued to an agreed list of three
improvements; this implements them as agreed.
- Mechanical next-build guard (lib/loki/build-line.ts): the bold
**<project>: <task>** line stays only when the person's message asked
for direction; otherwise it comes off the answer and travels apart as
`buildLine`. Applied in /api/loki and in the main chat route (stored in
meta); the floating panel offers a held line as "Next build, if you
want it" instead of printing it as the answer's last word.
- Scoped persistence for the floating panel (lib/loki/panel-thread.ts):
one localStorage thread per viewer and per project (or fleet-wide),
so project B never sees project A's turns and A's come back on return
and are sent as history. Clear forgets the thread on the device. The
viewer id comes from the (app) layout's session.
- Advisor identity boundary (lib/loki/advisor-boundary.ts): one sentence
— advisory surface, not executor; no Calendar, no email, no direct
change to the fleet; proposals for the approval queue only — opens the
role in both system prompts, from one constant.
Tests: scripts/test/loki-build-line-guard.ts, loki-panel-thread-scope.ts,
loki-advisor-boundary.ts. CHANGELOG entry for 2026-10-31.
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et
Co-authored-by: Claude <noreply@anthropic.com>