- Fix stale paths/links in docs (model-vendors billingUrl, agent adapter
placeholder, bridge host setup, entitlements not yet created, tokens module).
- hetzner-migration: current hosts (evig, aoz) and a pointer to
scripts/hetzner/apps.conf as the live app list.
- Archive two point-in-time records (fleet-runner-pty-ownership,
terminal-parity) into docs/archive with a README; fix inbound refs.
- Thoughts essays: repo aoz-housing is now aoz-begleitung.
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD
Co-authored-by: Claude <noreply@anthropic.com>
"Ask Loki" from a project, the terminal and Control all link to
/loki?project=X. Each landed on an empty start screen, so the next message
minted another thread — which is how fifteen "move forward on loki"
threads came to exist, and why the rail had to collapse them into one row
with a count.
Now such a link opens X's most recent thread when it was active in the last
14 days, with New chat one tap away for a new topic. ?c= still wins, and a
link carrying ?q= (a prefilled ask, a site hand-off) still starts fresh: it
is a beginning by construction. The rule is initialThreadId in
lib/loki/conversation-param.ts, pure, pinned by
scripts/test/loki-home-thread.ts, and reads the list the page already
prefetches — no extra request.
Claude-Session: https://claude.ai/code/session_01CG9dupSVqoXCCqKfBCfd9B
Co-authored-by: Claude <noreply@anthropic.com>
An answer that drafted a message, an event or a commitment ended in a link:
"Added to your approval queue — review to run it". Approving meant leaving
the conversation for the approvals page, finding the row, deciding, and
coming back to see whether it happened. The decision is one word; the place
to say it is under the answer that proposed it.
The line under such an answer is now a card. It reads the action's real
status when it loads (new GET /api/actions/[id]/status, session-only — the
status word reveals nothing the chat did not already say), so a draft
decided on another device or one that expired never shows buttons a reload
would take back. "Do it" and "Not now" post to /api/actions/[id]/decision,
the same decideAction → finalizeApproved path the Approvals page and the MCP
server use, so the IRON RULE is unchanged: nothing runs without the
operator's explicit word.
Deciding stays behind the private-zone PIN. A locked zone is not a dead
end: the PIN field opens in the card, and the tapped decision goes through
the moment the PIN is accepted.
Every outcome is said plainly (lib/loki/queued-action-view.ts, pure, pinned
by scripts/test/loki-queued-action-view.ts): done; approved but waiting in
Approvals because Loki has no executor for that kind yet; approved but
failed, with the reason and a retry link; declined; expired. An action a
standing approval already started keeps its "Doing it now" line.
Claude-Session: https://claude.ai/code/session_01CG9dupSVqoXCCqKfBCfd9B
Co-authored-by: Claude <noreply@anthropic.com>
A thread was titled with the first sixty characters typed into it. Fifteen
threads that each began "move forward on loki" were fifteen rows that read
the same, and the rail had to fold them into one row with a count to stay
usable. The opening line says how a conversation started; the title has to
say what it is about, and only the exchange knows that.
Now, once a thread has its first answer, Loki asks the fast model for a
two-to-six word title from the question and the answer (with the project
first when there is one): "Checkout bug on kivvi", not "can you look at why
the checkout on kivvi keeps…". Older threads are named the first time they
are opened. lib/loki/thread-title.ts holds the prompt and a parser that
strips the model's habits (quotes, markdown, "Title:", "Chat about") and
returns nothing rather than a bad title.
A person's name always wins. POST /api/conversations/[id]/title replaces a
title only while it is the placeholder or exactly the derived opening line,
declines without a model call otherwise, and skips Loki's own channel
threads. Rename by clicking the title in the desktop top bar (new: the open
thread had no name on screen at md+) or "Rename" in the phone's thread
menu. Neither naming nor renaming bumps the thread's recency.
The chat chrome above the transcript moved into WorkspaceChrome, keeping
LokiWorkspace under its line cap. scripts/test/loki-thread-title.ts pins the
parser, the auto-title rule and the prompt.
Claude-Session: https://claude.ai/code/session_01CG9dupSVqoXCCqKfBCfd9B
Co-authored-by: Claude <noreply@anthropic.com>
A person running a dozen projects opens the rail to answer "what needs
me, what is running, what finished since I looked". The rail answered
"what did I touch last": a title, a last line, a time. The only live
signal was a spinner on the thread open in this tab, and the outcome a run
wrote back into its thread showed only if that thread was open. Come back
on the phone an hour later and nothing said two runs had finished and one
had failed — Claude's session list, with its crude dot and spinner per row,
answered that question better than Loki did.
Now each row carries a state read off the thread's last message
(lib/loki/thread-state.ts): needs you (a project pick, a dispatch that
could not start, a run that did not finish), running (a dispatch with no
outcome yet, for at most six hours), came back (an outcome or an answer
written after you last had the thread open), or nothing. The list sorts
by that before recency, pinned threads on top. "By project" folds the
same rows under one header per project, with that project's counts, the
most urgent project first. The start screen carries the same counts as
one line of taps above the greeting.
Two columns make it possible: conversations.last_read_at (having the
thread open is reading it — written on open and on every message that
lands while open, from the server's answer, never a guess) and pinned_at.
The list query returns the last message's role, kind, time and the three
meta facts the states need, as correlated subqueries over the same
indexed row; PATCH /api/conversations/[id] takes read, pinned and title.
Pin is on the row (hover, or dimmed on touch) and in the phone's thread
menu.
scripts/test/loki-thread-state.ts pins the states, the sort, the counts,
the summary line and the project grouping.
Claude-Session: https://claude.ai/code/session_01CG9dupSVqoXCCqKfBCfd9B
Co-authored-by: Claude <noreply@anthropic.com>
The product, its assistant, the repo, the host and every unit on the box now
share one name. 638 files, ~3,000 mentions: UI copy, config, env keys
(FLEETCROWN_* -> LOKI_*), systemd units (fleetcrown-* -> loki-*), docs,
articles, the deploy workflow other repos reuse, and nine file names.
- Three article slugs carried the old name and had been shared; permanent
redirects keep those links alive (next.config.ts).
- test-no-retired-name.sh now also forbids the old product name across the
whole repo, so the rename cannot creep back through templates and examples.
- ASSISTANT_STACK collapses the product and the assistant into one entry,
because they are now the same name.
Infra was cut over ahead of this merge: /opt/loki, loki-* units, the `loki`
database and role, loki.orangecat.ch (old host 308s to it; /api, /widget,
/embed keep proxying), GitHub repos bitbaum/loki and bitbaum/loki-releases.
The Resend sending domain stays fleetcrown.orangecat.ch until the new domain
is verified in DNS.
Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
George filed two reports through FleetCrown's own feedback widget, watched
nothing happen, and asked Loki "what was the most recent feedback sent".
Not in your data.
Both rows were in site_feedback, filed minutes earlier. Four runs spawned from
them sat in `waiting`. Twenty-four runs had errored in three days. The answer
was nevertheless honest: Loki had been handed no records, so the sentence was
true of what it could see — which is worse than an error, because a truthful
negative reads as a checked one.
Three independent causes, each sufficient alone.
1. NO SOURCE READ THE TABLE. `grep -rn feedback src/lib/agent/` returned
nothing. Nor did runs, agent sessions, alerts, or notes. Loki could see the
"life" half of the product (people, projects, goals) and nothing of the
fleet half the product is named after.
2. THE PROMPT BUDGET WAS ARITHMETICALLY IMPOSSIBLE. One module constant —
Groq's 12000-token minute window x 0.8 / 3 rounds = 3200 — applied to every
vendor. Groq has since cut the window to 8000, and the prompt's own fixed
cost measures 2946 tokens (system prompt 1264 + native tool schema 977 +
catalog), leaving ~254 tokens: one fact. With the operator's message it goes
negative, the fit correctly returns zero, and production logged
`[loki] round 1: 40 facts exceed the call budget — sending 0` on every turn
and sent it anyway with an empty Records block.
3. THE RICHER SEED WAS ON THE FALLBACK PATH ONLY. buildGroundedTurn (approvals,
knowledge, economy, cues) ran only inside askLokiViaGateway. The primary
loop seeded people + projects. So the approval queue seeded in #262
*specifically to survive losing the tool loop* was, on the path that
normally ran, reachable only by the tool call the loop could not afford.
WHAT CHANGED
Retrieve first, then reason. A pure keyword planner (src/lib/agent/plan.ts)
reads the question and fetches the relevant sources in parallel BEFORE the
model is called; tools become depth, not basic retrieval. A tool loop needs a
healthy model and a fitting prompt before it can ask its first question, which
is exactly what is missing when this class fires. A regex is dumber than a
model and never rate-limited. This is how OrangeCat's Cat has always worked.
Eleven new fact adapters: feedback, runs, live agent sessions, alerts, notes,
plus a computed fleet pulse (runner state, runs waiting/errored, unread
feedback, pending approvals, today's AI budget) and a buildFleetBrief of
SQL-computed answers the model may only phrase. Six new tools over them.
Budgets follow the vendor: linkPromptBudgetTokens() sizes Groq from its minute
window and large-context vendors by usefulness; the prompt is sized against the
largest usable link and the walker SKIPS links it does not fit (a preflight,
not a refused round-trip). Env-tunable without a deploy. When overhead busts
every budget the loop now throws instead of sending an empty Records block.
Conversation history reaches the primary path, so continuity no longer appears
and disappears depending on which brain served the turn.
Provenance is rendered: model, what was read per source, tools used, elapsed
time, and the grounding verdict. The verdict was always computed and always
returned; the route dropped it on persist and the assistant never read it, so a
flagged answer looked exactly like a clean one — the failure the harness exists
to prevent, reintroduced at the last inch.
THE GATE (this is the third time this class has fired)
Every read tool's data must ALSO be reachable from the seed. Seed =
survivability, tool = depth, one adapter called by both.
scripts/test/loki-retrieval-plan.ts fails the build on a read tool with no seed
source, and on a seed source no question can reach. It caught a real orphan on
its first run: the OrangeCat economy feed, fetchable but unreachable.
Also fixed while here: propose_action reported a failed DB write as a
successfully queued draft; the repair pass accepted a repair that invented a
NEW unsupported claim if it had fewer total; assignee matching used a bare
substring (the dr-UZH-nikov pattern on the write side); pageContext over 2000
chars 400'd the whole request instead of being clamped; the native tool schema
repeated each full description, paying for the same prose twice.
Docs: docs/architecture/loki-answering.md.
Tests: 4 files, 63 checks, all env-independent.
Claude-Session: https://claude.ai/code/session_01CAfKwM1oUSA9tU9fgdhfdf
Co-authored-by: Cato <georgy.butaev@revamp-it.ch>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* docs(cloud-primary): nothing left that describes the old substrate — docs, marketing, comments, focus_tab
The cloud-primary series (#615 routing, #618 OrangeCat auto-kickoff, #624
Fleet Runner 0.8.19, #630 web PTY-only) changed what the product IS. This
sweep makes every surface that describes it say so, so neither an agent
reading the repo nor a person reading the site is told about zellij tabs,
presence-based routing, a cold-start restore, or a handoff that "starts
nothing".
Inventory-driven (≈105 doc lines, ≈30 user-facing strings, ≈22 code
comments, 2 repo-level items), not a grep-and-replace:
User-facing
- /download prerequisites: the "Zellij — bundled" card is gone; copy says
each agent runs in a terminal Fleet Runner owns.
- Quickstart, license page, executor copy (cloud is the default; "This
computer" is a per-project choice under Runs on), marketing pillars,
whitepaper (owned-PTY design, "where a project runs is a decision, not a
guess", ZSH typing-guard section deleted), Control terminal panel strings
(components renamed LiveTerminalPanel / LiveTerminalRows), peek drawer
copy, GitHub release notes for 0.8.19, repo description + topics.
Agent-facing
- README, CLAUDE.md, AGENTS-adjacent SSOTs: cloud-local-workflows.md now
states the stored routing rule; priority plan closes B6; multitenancy plan
routes by builder_pref; HANDOFF.md staleness table + terminals section;
the 2026-09-10 cold-start handoff gets a dated "superseded" section; the
two shipped proposals (fleet-runner-pty-ownership, desktop-app) carry a
status banner; home/README describes the eight modules that exist;
desktop/README describes 0.8.19; roadmap seed marks the migration done;
box-runner unit and log drop FLEETCROWN_RUNNER_PTY; 22 code comments.
Code (one coherent retirement)
- focus_tab is removed from the pending-command contract, the desktop
validator and poller, enqueueTabCommand's type, the validator test and the
failure classifier (START_SESSION | RETRY). The runner had rejected it
since 0.8.19; now it cannot be enqueued at all.
Verified: tsc, eslint, 148/148 unit files, 130/130 home self-tests,
check:desktop (typecheck + build).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WSNERoZZqW2TgqbAGHSQZf
* chore(desktop): 0.8.20 — the focus_tab retirement touches desktop/, so it ships as a release
The release-drift gate is right: a desktop change without a bump goes red on
main once the next tag is minted. 0.8.19's changelog date is corrected to the
release's real publishedAt.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WSNERoZZqW2TgqbAGHSQZf
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Audit wave 1 of 3 (six-agent sweep findings):
- secrets/identity: private-zone PIN literal out of 3 scripts (rotate the
PIN separately — it lives in git history), seed email now env-driven,
GEORGE_USER_ID renamed, real-name comments neutralized, CODEOWNERS off
the old org, /home/g fallback replaced with os.homedir(), phone + path
examples anonymized; DEFAULT_USER_EXTERNAL_ID default now 'self' with
both DBs migrated (UPDATE entities SET external_id='self')
- URL SSOT: every product-code literal of the app domain now flows through
APP_URL (desktop menus, runner banner curl, templates, UA, doctor,
orangecat publish origin); new GITHUB_API_BASE shared by 7 files;
openclaw gateway fallback imports its constant; ORANGECAT_BASE_FALLBACK
+ LOCAL_DEV_URL single-sourced
- design tokens: --scrim/ui-backdrop (4 raw bg-black/NN backdrops),
--toggle-knob, --surface-terminal (cross-linked with terminal-theme.ts),
--text-compact, ui-pin-input + PIN_MAX_DIGITS=12 shared client/server
(fixes the 20-vs-12 maxLength drift), ui-icon-nudge for the 3px cluster
- dead code: HistoryFeed + loki-prompts deleted whole, 13 more dead
symbols removed; all console.log verified intentional and kept
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cloud inject always queues even when box-runner is connected; distinguish
runnerConnected in Loki footer, Control toasts, and dispatch-status SSOT.
Add prod dogfood script and dispatch-status tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
Browser-first onboarding and executor-copy SSOT; Loki imperatives and move-forward
route to the same builder queue as Control with cloud-first Terminal links; fleet-kick
queues when offline; deploy script syncs box-runner.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add Build/Pause selected on Control, multi-project command fan-out in Loki,
and route scoped screenshots to dispatch with vision preflight instead of chat.
Co-authored-by: Cursor <cursoragent@cursor.com>
Start building now batch-dispatches next_best on eligible idle projects
(capped at three concurrent) and Loki accepts develop-all phrasing; restore
the daily idle nudge for users with autopilot on after the mode collapse.
Co-authored-by: Cursor <cursoragent@cursor.com>
Wire NL fast paths before resolveCommand so Loki can generate living business
plans and queue profile field changes through Today’s action queue instead of
silent chat writes.
Co-authored-by: Cursor <cursoragent@cursor.com>
When a project is selected, named, or resolved for chat, prepend the same
getProjectContext block dispatch uses so Loki answers with mission, stack, and goals.
Co-authored-by: Cursor <cursoragent@cursor.com>
Groq Llama 4 Scout describes pasted/picked images for chat and dispatch.
Add scoped-project pill, quick-action chips, hide model picker on mobile,
and hide the shell FAB on /loki.
Co-authored-by: Cursor <cursoragent@cursor.com>
Route shell FAB and loki:open to /loki with composer prefill; retire the
chat-only modal. Add fleet list/create NL fast paths, project picker chips
for ambiguous dispatches, and a db helper to inspect recent conversations.
Co-authored-by: Cursor <cursoragent@cursor.com>
The doc was still labeled 'design / not built' but Loki is live and in
daily dogfood use: NL composer with project resolution, the 3-pane page,
mic/attach/model-picker, and dispatch parity with Control. Add a verified
'Shipped state' note, resolve open questions 1-2, and mark the phased plan
(1-3 done, 4 partial). Discovered by dogfooding FleetCrown via FleetCrown:
this very doc fix was dispatched through Loki.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Best-practices pass on the Phase 1 composer + standards reflected in docs so they
don't need restating:
- resolve route now derives intent ids from ORCHESTRATION_TASK_INTENT_IDS (SSOT)
instead of a hardcoded local copy; type is OrchestrationTaskIntentId.
- palette status line uses a new neutral `ui-palette-status` class instead of
reusing the negative/error class (design discipline — no stray design).
- CONTRIBUTING "Engineering Standards" now names the full bar (first-principles,
SSOT, DRY, SoC, no god files, no hardcoded values, four-layer design system,
config-driven, validate-at-boundary) and points to the global standards in
CLAUDE.md as the authoritative source.
- loki-command-surface.md references those standards.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Structured design docs for George's 2026-06-18 vision, kept as separate threads:
- docs/loki-command-surface.md — the "Loki" ChatGPT-style page + NL command
composer (auto-routes "code review for kivvi"); a new front-end over the
existing dispatch backend. Design only; open questions need sign-off.
- docs/terminal-parity.md — why the server terminal scrambled input (fixed) and
the plan for true interactive parity on the machine terminal.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>