* fix(sites): a new private site's CI can ship it; registration clears every message it wrote
The site template's ship job granted its token only actions:write. A
job-level permissions block switches everything else off, so on a PRIVATE repo
checkout answered "Repository not found": CI went red on main, the fleet
sweep never ships a red main, and a brand-new site stopped one step before
going live (probe-loop, 2026-09-26). contents:read added to the template and
to loki's own ship job; ci-jobs-can-read-their-repo.ts fails any job that
checks out without it.
isRegistrationNextStep missed the deployment verdicts from
site-cd-deployment.ts, so Farmhouse kept telling its owner "Deployment
failed" after it was live. The test now collects every reason sentence from
the source and requires the matcher to know it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(cron-runner): free ports and a subshell that always records its exit
Several sessions run verify on one machine at once; two runs on the fixed
ports 4997/4998 answered each other's jobs, and the retry subshell inherited
errexit so a failing job never wrote its rc file. The retry case failed
twice in one day. Four parallel runs: old test 1/4 pass, this one 4/4.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
linkPromptBudgetTokens sized every Groq link to Loki's free-tier 8000
tokens/min, including a reader's own Groq key — whose limits are their
account's — so the person who brought the stronger key got their context cut
to fit Loki's pool. Own-key links (ai-kit 1.18 marks them; isOwnKeyLink) now
get the large-context budget like every other vendor.
ai-kit ^1.18.0.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A green deploy proved only that the site answered 200: an agent's change could
pass its checks and still leave the page scrolling sideways on a phone,
throwing in the browser, with broken images or most of its text gone, and on
autopilot nobody looks. The shared self-host deploy now reads the live page in
headless Chrome at 390px before and after shipping (page-check.mjs); if the
change ADDED any of those problems (page-check-compare.mjs), it rolls back to
the previous release and fails with the reasons. No baseline is never a
regression, and a checker that cannot run warns instead of blocking.
Screenshots are kept as an artifact for 14 days.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(drain): a Claude session showing a dialog does not hold runner updates
A dialog over an empty composer holds no work a restart could lose, but the
drain read Claude's "waiting" as working. Farmhouse sat on "Teach auto mode
about your environment?" and held every runner update for the whole cap —
including the one that clears such dialogs. session_status now reports
"dialog" for waiting + waitingFor dialog; a permission prompt mid-task is
still work.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(feedback): the owner repeating a note retries it instead of dropping their pass
A repeated note was de-duplicated onto the earlier row and answered as a
visitor's, so the widget concluded the pass was bad and forgot it. The pass
is now checked before dedupe: the owner's repeat starts a failed attempt
again, and one already running answers "On it".
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(sites): a site that goes live after registration is recorded, and its owner told
Registration wrote the live URL only if the site answered at that moment.
Farmhouse's first deploy failed, a later one succeeded, and nothing looked
again: no live URL, a Live link that opened the OrangeCat listing, and no word
to the owner. An hourly check (and the owner opening the project page) now
asks the same question registration asks and, the first time the answer is
yes, sends the owner their link that readies the widget.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(telemetry): six crons run hourly now that check-site-live does
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(runner): a Claude session showing a dialog is cleared before a prompt is sent into it
Farmhouse's parked session sat on Claude Code's "Teach auto mode about your
environment?" dialog. The owner's widget note was injected into the dialog,
nothing ran, and the run was NACKed 33s later while the widget said "On it".
Claude reports this itself ({status: waiting, waitingFor: "dialog open"}); the
runner now presses Escape and, if the dialog stays, starts a fresh session.
Also: on the box every live-session lookup used the dispatch's laptop path,
which no session has, so the generation check fell back to guessing from
screen activity. They now use the folder the agent really runs in, and the
reader accepts current CLIs' updatedAt.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(widget): owner mode reads as the owner's, and the agent is told the owner asked
The widget no longer asks the owner for a name/email and says what happens
("Your site: what you say here gets built and goes live"). The agent's brief
now opens with "The owner of <project> asked for this change" instead of
"Fix this visitor feedback" — still fenced as text from a browser.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore(desktop): 0.8.35 — ships the dialog-clearing runner fix to Fleet Runner too
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(changelog): Fleet Runner 0.8.35
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(feedback): the owner's note from their own site starts the fix and ships itself
The widget could not tell the owner from a stranger, so a note the owner said
on their live site waited in /feedback for them to come back, press Implement,
then merge. A signed owner pass (project + owner, 90 days, URL fragment only)
now marks the note as the owner's; ingest starts the fix through the same
implementFeedback() the Implement button now uses, and the fix merges once
green unless the project explicitly turned auto-ship off.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(widget): the owner's Live link opens their site ready to say what to change
Loki's Live link now carries the owner pass in the URL fragment. The widget
lifts it out of the address bar, keeps it for that site, opens straight to the
note, and sends it with each note; the reply says the fix is being built and
offers the next note. A refused pass is forgotten and the owner reads as a
visitor. Lint + tsc + test run on these files before committing.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(feedback): a run that went quiet no longer reads "Agent is working"
The step line claimed working whenever any progress had ever been recorded,
so a run whose laptop builder went offline showed "Agent is working" beside
"Needs you: Open Fleet Runner" (run ccaf19cf).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(loki): keep the open conversation in the URL so Back returns to it
Dispatching from /loki and navigating back landed on an empty composer while
the thread's follow-up chips still showed (feedback b8a97aef). ?c= now holds
the thread beside ?project=; a stale id falls back to the start page.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* style: format loki-conversation-in-url test
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The ledger judged deploy_failed only from the merge commit's own Deploy
runs, then froze it as terminal. PR #540's rows said "deploy failed" for
two weeks while dozens of later main deploys shipped the merge, and the
two OPEN rows kept loki's automatic shipping paused.
- healDeployFailed/pickLaterBaseDeploy (pure): a later successful deploy
of the base branch, created after the merge, whose head commit is dated
at/after it, with no revert of the PR seen, turns it into deployed
(liveVia: later_deploy; ownDeploy keeps the failed run).
- deploy_failed is no longer terminal: re-checked every 15 min, for 30
days after the merge.
- The deploy workflow's runs are listed without branch= (fleet#146) and
filtered on head_branch here.
- Healing announces "live" once, with copy that says a later deploy
shipped it; it can never re-announce "deploy failed".
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
In a workspace with no projects the reply said "Pick one below — or I can
just answer instead" and showed nothing: the picker returns null with no
options, taking its "Just answer" button with it. The server now only asks
when there is a project to pick (shouldAskForProject, tested), and the
picker still offers "Just answer" if it ever gets no options.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Site registration wrote "Live site: <url>" / "Deployment queued…" into
next_step, which Control shows as "Suggested next" and every dispatch
briefs the agent with; Skif's agents were told their next step was a URL.
Success no longer writes a status there, and clears a message registration
itself left; failures (the owner must act) still say what to run.
isRegistrationNextStep lives in the pure site-cd module.
- Today's "N running" counted prompts STARTED in a window, so dead agents
kept counting ("2 running" beside Control's "1 working", zero open runs).
It now counts projects with a live agent turn, Control's source.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
getOrgProjects() includes the caller (403f47cd), so `[...own, ...org]`
listed every own project twice. OrangeCat's actor-status spent half its
25-project cap on duplicates (orangecat appeared twice), and
loki_fleet_status reported double the project count. /control already
deduped on its own. One pure helper, mergeVisibleProjects, own rows first.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* wip: user_model_keys table + ai-kit 1.17.0
* wip: chat runs on the user's own model
* wip: settings API + screen for the user's own model
* wip: budget refusal offers your own model; tests
* fix: narrow userId for the own-model path; document BYOK_SEAL_SECRET
* fix(demo): the shared demo account may not store a model key
* fix(settings): deep links no longer cause a hydration mismatch
The reaper closes a stale run as timeout ("closed"); reap-evidence then
finds a PR it pushed and upgrades it to partial, and emitted a SECOND
"closed". Skif's history read "closed, closed" on two runs today. The
correction is now its own run_event kind, reclassified (text column, no
migration; nothing decides closedness from the latest kind).
Also: the partial note said "ran out of time", which is false for a run a
builder restart ended (#917 reaches the same copy). Now "ended before it
could report back".
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Banners, session summaries, the previous run and the Launch row appear and
disappear as live state polls in. Stacked above the composer, each one
moved Send: twice on 2026-09-25 a click on Skif's Send landed on nothing
and the brief stayed in the box. The composer now comes first; status
settles below it. Pinned by control-composer-leads-card (fails on the old
order). No lines added: ProjectCard sits at its 510-line ratchet.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The launcher knew its corner, an offset, a global data-fc-bottom and one
foreign fixed launcher. Everything else it could miss: any layer wider than
90% of the viewport was ignored, so on substrata /atlas at 390px it parked on
the country bottom sheet; and it re-measured only on load, resize, window
scroll and URL change, so a sheet mounted later was never seen.
One engine now, for every width and obstacle:
- placement.slotOrder: preferred corner up its near band, the mirrored
corner, then the rest of each edge (pure, unit-tested).
- host-scan: hit-tests each slot (launcher + 12px gap) with
elementsFromPoint and judges free / surface / layer / blocked. Controls
(incl. [tabindex], iframes, cursor:pointer) block; fixed/sticky bars and
inner scroll panels are layers; a control >=25% of the viewport (a
pannable map) is a surface.
- placement.chooseSlot: first free, else least-bad, else HIDE - never sit
on a control.
- Re-measures on DOM mutation (throttled 1/s) and on inner-panel scroll.
- Host contract: data-fc-avoid (never overlap), data-fc-place=
left|right|hidden on <html> or a page region. Documented in
widget/README.md.
Also fixes a latent bug the browser test caught: clearing inline edges to ""
let the shadow stylesheet's right:16px survive a move to a LEFT corner, so
"Move to other corner" stretched the launcher across the page.
Tests: widget-placement.ts (pure) and widget-host-avoid-browser.ts (real
Chromium, 9 fixtures). Against the pre-fix bundle 7 assertions fail; each
new rule (layer, surface) fails its fixture when mutated out. CI installs
chromium-headless-shell so the browser test runs rather than skips.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The runner now reports bootedAt (process start, captured once) on every
runtime-state post. Runs on that runner's channel whose agent session was
live before the boot (claimed/launched/submitted/generating/progress event
older than bootedAt), with nothing heard since and no un-acked command, are
closed at once with the restart named, instead of reading 'waiting' until
the hourly reaper. Only-dispatched runs are left for the new runner.
Verdict matches the reaper's (partial on handoff, else timeout) so the same
repo-evidence correction upgrades runs that had already pushed work.
Fleet Runner 0.8.34.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The cap took the first 25 projects in list order, so an account with 37
projects never showed OrangeCat's Cat its own `orangecat` project. Sort by
what needs the owner (blocked on them, new feedback, working, queued,
linked, live) and cut after. Stable: ties keep list order.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Found on Skif's page, live (2026-09-25):
- The headline read "…freedom. From the owner: Who is this for, and who
pays for it? Year one pays per booking…". The interview appends the
owner's answers to the description ON PURPOSE (kickoff, dispatch and
search read the brief), but header, project row, public profile and the
OrangeCat listing showed the transcript. projectHeadline() cuts at the
brief heading for display surfaces only; agent briefs keep it all.
- The action row laid four ways of going public (List publicly, Publish,
Govern, Share) beside Live and Repository with nothing saying how they
differ. They are now one "Share & publish" door with a line each. The
"Live site set" chip went (the Live link says it, and does something).
- BRIEF_HEADING has one home (project-display) and the interview imports
it, so the dependency stays one-way.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The workspace strip (Profile · Chat · Control · Terminal) showed
"skif~d0a14b69" on every page after a parallel run's tab was opened:
the terminal remembered the raw tab as the fleet project. asFleetProject
normalises through baseProjectKey on the route parser, the stored read
and the write, so a stale stored alias heals on read.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(projects): tell the truth about cloud presence and separate header state
Box-runner heartbeats as cloud but could register bridge presence as local,
so /terminal said Cloud offline while the journal shipped work. Infer cloud
from box-* versions, force the channel in box-runner, and scope the terminal
honesty chip. Project header now shows listing/live as status, not peer links;
catalogue invite waits until kickoff/build is idle.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore(desktop): bump Fleet Runner to 0.8.33 for presence-channel fix
desktop/bridge-subscriber changed so box-* runners register as cloud; the
release-drift gate requires a version bump and changelog entry before merge.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Since #900 an extra concurrent run gets the tab alias <project>~<runId8>.
The terminal context matched tabs to projects by raw name, so the alias
matched nothing: the strip, page header and composer showed
"skif~d0a14b69", and the Loki rail said "No run on skif~d0a14b69 yet"
beside an agent nine minutes into its work (2026-09-25).
- terminal context resolves tabs via baseProjectKey (the run-tab SSOT)
- getLatestRunForProjectKey understands a lane tab: base project AND the
run its suffix names (runLaneOfTab), so parallel lanes don't swap runs;
a malformed suffix is rejected, never a LIKE wildcard
- the strip labels a lane "Skif · parallel", with the alias in the tooltip
Tests: run-tab (lane parse, malformed suffixes, context uses the SSOT).
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 10:53: the box ran out of RAM during a heidi deploy, the
kernel OOM-killed one chrome-headless an agent was screenshotting with,
and systemd's default OOMPolicy=stop took the whole box-runner unit down,
with every agent session in it (Skif, 13 minutes into a brief).
OOMPolicy=continue in the unit install-box-runner.sh writes; pinned in
deploy-runner-decoupling. Applied live as a drop-in without a restart.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
On Skif the interview said "It does not say who it is for or what finished
looks like... Five questions" above ONE question about why it exists, on a
project that had answered both. interviewIntro(planned) now words it from
the fields the interview will actually ask, with the count.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Found by trying, as the owner, to tell Skif's story in Loki (2026-09-25).
1. The place for it was "Context", tab 4 of 6. It is now "Story", second,
right after Now. The id stays `context`, so #context links still work.
2. The interview never asked for a mission, though its own comment said a
project with "mission, problem and solution" is not interrupted. Skif had
customers, problem and solution but no WHY, so every dispatch briefed its
agent on a booking app. The interview now asks "Why does this exist?" as
the fourth essential question. The cap stays at 5 questions.
3. Pasting the 8.5k-character doctrine into "Sync from doc" failed twice
over. The textarea's maxLength (8,000) truncated the paste silently, and
given the full text, the server said "at least a sentence". Brief,
roadmap and reconcile now share pastedText() (DOC_PASTE_MAX 24,000;
too short and too long say which). Boxes keep the text and show
<CharCount>, and submit refuses while over. No maxLength remains.
Tests: project-story-tab-leads, pasted-docs-are-never-cut (both
mutation-checked), and project-interview updated for the mission question.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(build): keep fs out of the browser bundle — the exit-contract matcher gets a Node-free home
loki#900 made activity-status.ts import EXIT_CONTRACT_PATTERN from
agent-config.ts. activity-status is shared with client components (the
Activity feed strips the contract from a dispatch before showing it), and
agent-config imports `fs` — so `fs` landed in the browser bundle and
`next build` failed: "Module not found: Can't resolve 'fs'". Four deploys of
main were refused; production kept serving the previous release, but nothing
merged after #900 could ship either.
`verify` could not see it: CI deliberately does not run `next build`, so a
client/server boundary break only surfaces at deploy.
The heading and the matcher move to src/lib/exit-contract.ts, which imports
nothing. agent-config builds the full contract from that heading; the client
and the lane prompt read the matcher from the Node-free module.
Proved by the step that failed: `pnpm run build` against a schema-only
Postgres, exactly as the deploy runs it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh
* test(build): catch a Node builtin in the browser bundle before the deploy does
verify does not run `next build`, so a client/server boundary break only
surfaces when the deploy builds — after the PR has merged. That is how #900
reached main and blocked every deploy.
client-bundle-node-free.ts walks the client graph the way Turbopack does,
without building: from every "use client" module through static value
imports, stopping at "use server" modules (RPC stubs on the client), and
fails on any builtin Next does not polyfill for the browser.
Proved against the real break: with #900's activity-status.ts it reports
exactly the two errors the deploy printed — `fs` in agent-config.ts and in
session-paths.ts via activity-status.ts <- project-intent-panel.tsx — and on
this branch it reports none.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh
* style: format
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A cloud `claude` tab viewed in a 46-column pane (41 after A+) kept a PTY of
120 columns (confirmed on the box: stty size 32 120, the spawn default).
ptyResizeToPublish stays silent under TERMINAL_MIN_COLS (60) so a narrow viewer
cannot squash the session, but the grid itself stayed 46 wide, so every row the
agent drew at 120 wrapped mid-token. The resize chain (route, bridge, runner)
was never reached: the client never sent anything.
gridForSession pins a real-but-narrow grid up to the floor (the host scrolls
sideways) and that size is published: the same size clampPtyGeometry would
apply on the server, so grid and PTY agree by construction. A collapsed host
(< 20 cols or < 6 rows) still publishes nothing and pins nothing.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(ai): no box timer or background path spends the shared free AI tier
Removes the frontier-digest, feedback-digest and scout-events cron routes and
timers; the digest email is built without a model; check-model-ids no longer
sends a one-token completion per pinned model; the DoD model judge on run
close (page poll / runner push / cron sweep) is gone - precheck only; the
Today Watch nudge composes on click, rate-limited, not on mount; the loki-e2e
check (a real chat turn 4x/day) is on demand only; standing-rule calendar
bookings never call the model to recover a date.
scripts/test/no-free-background-ai.ts walks the call graph from every cron
route and close path and fails if any reaches a model endpoint.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
* fix(ai): delete the scout and feedback-digest producers the removed crons left dead
Also lowers the telemetry monitored-path floor to 2: frontier_digests was
demoted on purpose with its cron.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
---------
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(composer): the composer is @bitbaum/chatkit
Every Loki composer (chat, the terminal's Ask/Inject rail and Prompt box,
Control's quick send) now renders chatkit's Composer through one adapter that
keeps this app's API: the model picker sits in chatkit's tools slot, the mic's
server leg is /api/control/transcribe (prefer server: dictation here is often
mixed German/English). New for every composer: mic failures shown in words and
a browser-recogniser fallback when the server leg cannot work.
globals.css imports chatkit's stylesheet and maps our OKLCH tokens onto --ck-*
once in :root; 22 composer/voice rules and two keyframes the old composer alone
used are deleted. one-composer.ts now asserts chatkit's class names — same
guarantee: the chat and the rail render the same input.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* style(test): prettier on one-composer.ts
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Two defects hit one Skif dispatch on 2026-09-25, and either alone loses work.
1. The dispatch was NACKed "claude cannot generate because its usage limit
is exhausted" 14s in, while Claude was visibly working on the brief. The
capacity check scanned the WHOLE PTY buffer with a topic-word regex
("rate limit", "credit", "context window"), so the echoed prompt, the boot
banner or a file the agent printed read as a quota wall. Now it reads only
what the CLI printed after the injection, ignores lines that are just the
prompt echoed back, and for Claude defers to its own session status: a
session still generating has not hit a wall.
2. Two minutes later the box runner restarted and killed every session. The
post-deploy drain waited for agent processes to EXIT, and interactive CLIs
never exit, so it always ran to its 30-minute cap and then killed whatever
had started most recently. It now counts agents that are WORKING: an idle
Claude does not hold the restart; generating, waiting mid-task, or any
status it cannot read does.
Fleet Runner 0.8.32 (desktop/ changed, so it ships as a release).
Tests: terminal-run-view (echo vs real wall, mutation-checked) and a new
test-drain-and-restart-runner.sh (18 checks, four mutations each caught).
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(terminal): resize the PTY to the grid on screen, not only when typing
The resize was published only from an interactive (Type + live keys) view,
so Prompt mode, Voice mode and every phone fitted xterm locally and never
told the PTY. Measured: 79-col grid drawing a 120-col PTY on desktop Prompt
mode, 86 vs 120 on a 390px phone — torn words and stray columns at the
right edge. Fit + publish now run on mount, on every host resize, on a font
step, and re-assert on window focus.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(terminal): one composer for chat and inject; expandable, full-width pane
- components/composer/Composer is THE composer (text, attach, voice, model,
Send/Stop, optional modes). Loki chat (LokiComposer), the terminal's
Ask/Inject rail, the Prompt-mode box / phone dock and Control's quick send
all render it. TerminalLokiComposer (bare textarea, no attach/voice) is
deleted; Control's one-line ⌘Enter input is gone.
- The rail's Inject is the prompt composer while the rail is beside the
session, so the page no longer shows two inject boxes at once.
- Terminal pane: rail is a fixed width (lg+) instead of 40% of the row, can be
closed (remembered), is a sheet below lg; Expand works at every width and
Esc leaves it, except when typed into the xterm or handled by a dialog.
- Tests: one-composer (logic, per-call-site render, no private textareas),
terminal-expand (Esc rules).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
OrangeCat's Cat could hand work to Loki (build intent, site commission) but
never see what became of it. POST /api/orangecat/actor-status lets OrangeCat
ask, on the existing ORANGECAT_WEBHOOK_SECRET rail, what is happening to the
projects of the Loki account signed in with a given OrangeCat actor.
- Body { actorId, issuedAt }; readSignedOrangeCatBody (503/401/400), plus a
5-minute freshness window — the body has no nonce, so a captured request
would otherwise replay forever.
- Unknown actor → { ok, linked: false, projects: [] }.
- Otherwise the fleet-status queries + listFeedbackSummary +
getOrangeCatLinksForUser, shaped by a pure function: status
(working/blocked/idle), live URL (http only), queue, current work, last 5
outcomes, feedback new/open (matched by entity id), OrangeCat links. Max 25.
No prompts, dirs or tokens cross the boundary.
- Caller: orangecat src/services/loki/actor-status.ts (live, reads "unknown"
until this deploys).
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Seen on production right after #879:
- a reasoning model spent the 700-token budget and the Cat stopped mid-clause
('…which is running, in') — budget 1600, and trimToLastSentence drops a
trailing half sentence rather than show it;
- the speaker label 'Loki:' counted as a mention, so a Loki chip led an answer
recommending Heidi — labels are stripped before links are found;
- 'running, in beta' was copied verbatim — the stage word is now 'in beta';
- Loki described itself in the third person and sent a self-serve need to the
closed studio waitlist — an agent that fits recommends itself in the first
person, and a product that fits always beats the waitlist.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Found by dogfooding: Skif's project interview on 2026-09-24. All five real
answers ran 522-631 characters. The textarea's maxLength silently stopped
typing at 500, and the API (which accepts up to 2000) clamped each stored
answer to exactly 500 characters mid-sentence, e.g. "...Protectors are
chosen for judgment, calm and communication," and nothing more. Those
clipped fields are what brief the build agent, so an owner who wrote a
careful answer briefed the agent with half-sentences and was never told.
Clamping rather than rejecting stays: that was deliberate in #799 ("no
dead ends"), and its test still holds. What changes is that the cut is
never silent:
- The textarea shows a counter once an answer passes 60% of the limit,
and says plainly at the cap that this is the limit and the agent reads
the field whole. Short answers still look like a quiet form.
- The API response names the fields it cut (`clamped: [...]`), so a
direct caller can shorten and re-save. Empty in the normal case, since
maxLength means only an API caller can send more.
Tests: clampedAnswerFields names exactly the cut field, and does not
false-alarm on an answer that is at the limit only once trimmed. Proven
by mutation (reporting nothing; counting untrimmed length).
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The interactive-control hit-test only ran at <=480px. On OrangeCat /messages
the launcher stepped over the Cat FAB (a fixed element, correctly avoided) and
landed exactly on the composer's Send button: clicking Send opened the
feedback panel and no message went out, from Sep 6 until now.
- stepOffControls: pure, bounded, tested; runs at every viewport width.
- Re-run placement after client-side navigation (URL poll), since SPA route
changes emit neither load nor resize.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The widget's Chat tab ships. A visitor on an embedding site asks; whichever of
the Cat (earning, getting paid) and Loki (getting things built) the question
belongs to answers as itself — both when both have something useful — from the
public fleet map, and is sent to the project that fits.
- POST /api/widget/chat: fcw_* token + origin allowlist + per-IP/per-token
limits, charged to the token owner's fair share of the free AI pool. Links are
attached from the map, never typed by the model. When the budget or every
vendor refuses it still routes by keyword match (degraded: true).
- src/lib/widget-chat/concierge.ts: pure facts/prompt/links/fallback. Retired
projects, throwaway names (same pattern as the litter gate, pinned equal) and
unwritten not-running projects are not offered; stage words say beta/pilot,
never live/client; facts are budgeted to survive free-tier limits.
- Chat is OPT-IN per embed (data-fc-modes="chat,report"); the default is now
Report alone, because the same bundle runs on pilot sites. The first listed
mode opens first. window.Loki.ask(question) lets a host page hand a question
over (bitbaum's homepage does).
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`echo "$x" | grep -q PAT` under `set -o pipefail` can report "not found"
for text that IS there: grep -q exits on its first match and closes the
pipe, the writer takes SIGPIPE (141), and pipefail makes the pipeline
status 141. An `if` then takes the else branch on a successful match.
#587 found this in one file and noted it "only fires when the payload
exceeds the ~4KB pipe buffer". That is not so, and the belief is why
82 copies in 22 scripts survived. Measured today on retire-site's real
1,158-byte plan output with has()'s exact pattern, 3,000 calls each:
'DRY RUN' line 3 of 20 echo|grep -q 2/3000 false misses
'apps.conf row' line 11 of 20 echo|grep -q 2/3000 false misses
last phrase line 20 of 20 echo|grep -q 0/3000
'DRY RUN' here-string 0/3000
Rare per call, but verify makes hundreds of these calls, and the
retire-site suite went red on those two exact phrases twice this week,
passing every rerun. It is worse in a NEGATIVE check - hasnt() read a
false miss as a PASS. And several copies are not tests: deploy-hetzner.sh
exits 1 on a false miss, and the sshd drift watch would raise a false
security alert.
All 82 rewritten to `grep -q PAT <<<"$x"` (a here-string is not a
pipeline, so there is no writer to signal) by a script that only touched
the simple quoted-variable form and reported anything else. Checked: all
22 files pass `bash -n`, every file is a 1:1 line swap (82 lines), and
the 20 line-continuation sites keep the here-string before the trailing
backslash (the first draft of the rewrite got those wrong; caught in a
dry-run diff before anything was written).
#587's comment is corrected so it stops teaching the wrong threshold.
Gate: scripts/test/no-grep-q-in-a-pipe.ts ratchets it repo-wide,
including forms the rewrite skipped (e.g. "$(cmd)" | grep -q), and
self-tests that its detector still fires. Proven by restoring the
original deploy-hetzner.sh line.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
getLatestRunsByProjectPaths selected every run for every path and kept
the first per path in JS. Measured on production today for the busiest
user: 699 rows at ~1.26 KB each (~880 KB, mostly `summary` JSON) fetched
and parsed to keep 32. Control paid that on every poll; since #863 the
/today front door pays it on every load, and it grows with every run.
Postgres time was ~2 ms either way, so the cost was transfer and parsing.
DISTINCT ON (project_path) returns only the 32 rows the caller keeps.
The repo already uses selectDistinctOn on this table (register/load-map).
Equivalence checked against production data before changing it: the old
and new selection pick the same run for all 36 (user, path) pairs, with
0 mismatches; there are 0 ties on the latest started_at and 0 NULL
started_at values, so neither tie-breaking nor NULL ordering can differ.
The drizzle-generated SQL (via .toSQL()) was run read-only on prod and
returned 32 rows.
Gate: latest-run-is-one-row-per-path.ts pins both halves. The ORDER BY
must lead with the DISTINCT ON column or Postgres rejects the query at
runtime, which tsc cannot see and both callers would swallow into an
empty map, so run health would silently stop reporting. Proven by
mutation both ways.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Inviting a collaborator required them to already have a Loki account.
The members route answered "No Loki account uses that email. Ask them to
register first." — a dead end with no way to ask. The only other invite
path creates a LOCAL-PASSWORD account and adds it to the inviter's whole
org: broader than one project, and a second identity path beside
OrangeCat, which fleet STACK.md says our own products must not grow.
Now any email works:
- Has an account: added at once, as before.
- No account: a one-time invite is created, emailed when mail is
configured, and ALWAYS returned as a link to copy — an email that was
sent is not an email that was received. They open it, sign in with
OrangeCat (creating that account on the way), and join exactly this
project with exactly the role chosen. No Loki password anywhere.
The link is bound to the invited email. A token is a bearer secret that
gets forwarded; on its own it would let whoever holds the link in. The
wrong account is told which address it was for, masked (ge•••@gmail.com)
because the link may be in the wrong hands.
Only a sha-256 of the token is stored, so a leaked backup cannot be
replayed as working links. Acceptance spends the invite and grants the
membership in one transaction guarded on accepted_at/revoked_at IS NULL,
so a double click or two tabs grants once. Re-inviting the same email
revokes the old link rather than leaving two live ones.
"emailed" is only reported when mail is configured AND the send
succeeded: sendEmail returns quietly when mail is off, so trusting the
call alone would have claimed an email nobody sent.
The panel moved from a collapsed "Editors" disclosure inside the
Feedback tab to the top of the project's Settings tab — where every other
product keeps "people with access", and where George looked for it. It
now offers Editor or Viewer, lists pending invites, and lets the owner
withdraw one. Editors do not see pending invitees' emails.
The accept API lives under /api/invitations/project/ so it inherits the
existing public-route exclusion instead of widening the proxy allow-list.
Migration 0080 is hand-written, like 0073-0079: drizzle/meta's snapshot
stops at 0072, so `drizzle-kit generate` diffs against a stale picture —
it believes beacon_sessions still exists and calendar_busy does not, and
would have emitted a DROP and a duplicate CREATE alongside this table.
Tests: 14 checks on the acceptance rule, proved by mutation — removing
the email binding turns the suite red. tsc clean, lint 0 errors,
check:design ok, format ok, test:unit 260/260, test:home 130/130.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Control's hero counted ONLY agent attention (session or last-run health)
but claimed the whole phrase: "1 project needs you - loki". /today's
verdict counts raised flags too, and named evig. Same three words, two
populations, one click apart.
/today is now the complete answer (#863). Control is the fleet page, so
it keeps its scope and says it: "1 project's agent needs you".
Gate: one-meaning-of-needs-you.ts gains a check; proven by restoring the
unqualified phrase.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Seen on production today, evig's health panel, three headings stacked:
x Security risk Email verification bypass: anyone can register...
x Broken Marketplace, Repairers, IT-Hilfe (API returns HTML)...
x Deploy issue CMS backend (Express port 3001) not deployed...
"Broken" is not a thing. It read as an unfinished string between two
real labels - and four inches away on the same page, the same signal
was writing itself out as "4 broken features".
The cause was two fields for one concept. Every signal carried BOTH a
`label` and a `cardLabel`, drifted in wording AND in casing:
label cardLabel
"Security risk" "Security Risk"
"Broken" "Broken Features"
"Deploy issue" "Deployment Issue"
Nothing distinguished them. No surface needed a different word - they
were written twice and maintained once, so the badge said one thing and
the raise-a-flag sheet another about the same flag, and the copy that
got left short is the one at the top of the panel.
One name per signal, sentence case, and `cardLabel` is gone. The one
surface that wanted it lowercase calls .toLowerCase() instead of
keeping its own copy. The "4 broken features" row is unaffected - that
label is a runtime count, not this field.
Also repoints an existing gate. a-flag-can-be-raised-and-cleared.ts
required a `cardLabel` specifically, which pinned the IMPLEMENTATION
(two label fields) rather than the rule (a signal the operator can
raise must have a name) - so collapsing the two fields failed a gate
even though it fixed the defect. It now asserts the rule.
Gate: scripts/test/one-name-per-signal.ts, 5 checks. Proven by mutation
- restoring the "Broken" stub, letting Title Case back in, and
reintroducing a second name field each fail on the matching check.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Measured on production today, same login, minutes apart:
/control hero "1 project needs you - loki"
/today verdict "7 things need you", and the project it names is evig
/projects chip "Site issues 1" - evig
/projects and /today agree since #857. Control overlapped with NEITHER:
it counts projects whose agent SESSION or last RUN is unhealthy, the
other two count raised flags (security / broken features / deploy issue
/ site down). Same three words, three different populations.
So the front door said seven things needed me, and Control - one click
away - named a project that was in none of the seven. Trust /today and
you miss a blocked agent; trust /control and you miss an authentication
bypass. A front door that is incomplete teaches you to check everything
anyway, which is the whole thing it exists to stop.
ONE DEFINITION. The scoring moved out of control-presenter into
src/lib/project-attention.ts, taking two health strings and nothing
else - so a client component holding live SSE state and a server
component holding two DB reads can both ask it. Control is now a
four-line adapter. The scoring, including the `score <` guards that
stop one trouble seen in two places counting twice, is preserved
exactly, and the reason strings are unchanged so both surfaces name the
same trouble with the same words.
THE FRONT DOOR ASKS IT. /today derives blocked projects server-side
from the same two sources Control reads (project_states.session_health,
orchestration_runs.summary.health), joined on the same keys Control
joins on (normalized tab name, dirPath), and merges them with the
flagged list - deduped, with the flag winning, because a flag says what
is wrong in the operator's own words where a health word does not.
NO ROW LINKS TO A 404. /projects/[id] resolves by ENTITY id, and a
catalog project need not have an entity row. Those are still NAMED and
simply are not links; dropping them would make the verdict quietly
incomplete again.
Gate: scripts/test/one-meaning-of-needs-you.ts, 8 checks. Proven by
mutation - deleting the /today call, double-counting one trouble,
treating missing health data as a problem, and restoring Control's own
scoring each fail on the matching check.
Two of those mutations initially passed. `src.includes("symbol")`
survives a rename (the original stays a substring) AND survives
deleting the call (the import still matches). The gate now asserts the
symbol is CALLED, with import lines stripped first.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Caught before this shipped, not after it paged someone.
Without the `repo` scope, GitHub answers 404 for a PRIVATE repository —
byte for byte the same response as a deleted one. The checker would have
read that as "your repo is gone" and raised an alert for every private
project of any user whose GitHub link is sign-in-only. An alarm that
fires on healthy projects is worse than no alarm: it teaches the operator
to dismiss the surface, and the real 404 goes with it.
So ask once per user what the token is actually allowed to see —
`x-oauth-scopes`, which GitHub sets on every API response — and let that
decide what a 404 is permitted to mean. No scope, no verdict: it
downgrades to `unchecked`, which already exists and is already excluded
from auto-resolve.
Absence of the header, or a failed call, counts as "cannot see private" —
the pessimistic read is the only safe one here, because the cost of
guessing wrong is a false alarm about a repo that is fine.
Proven by mutation: trust the 404 regardless of scope → the test fails
with expected 'unchecked'.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Measured on production today, evig's Now tab, top of the viewport:
BUILD
* Nothing is being built right now [ Make it happen ]
Last attempt finished partially 24d ago after 16m
--------------------------------------------------------------
Security risk Email verification bypass: anyone can register
@revamp-it.ch and get Staff role with admin
access to 14 areas [Fix]
4 broken features ...
Deploy issue ...
The page's largest type and its only orange button went to "nothing
is happening". A live authentication bypass was plain grey text
underneath it.
That is the same fault /today had and #855 fixed: the surface reported
the MACHINE'S STATUS where the reader was asking what needs them. Idle
is not news; a security hole is.
So the flags lead WHEN THERE ARE FLAGS, and the build status leads when
there are none - at which point "nothing is being built right now" is
genuinely the most useful thing the tab can say. Need above status, but
only when there is need. The block carries one warning rule and no tint
(principles 2 and 3), and the heading names the count in words rather
than showing a bare number.
Raising, editing and clearing still live in ProjectFlags further down,
which is always rendered.
Gate: scripts/test/project-leads-with-need.ts, 5 checks, picked up by
the test-unit glob. Proven by mutation - restoring build-above-flags,
rendering the alarm unconditionally, and tinting it instead of ruling
it each fail, on the matching check.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
`git_url` was written once, when a project was registered, and trusted
forever. Nothing ever asked GitHub whether it was still true.
Measured against production on 2026-09-22: eight of thirty-three stored
repos were wrong. Four point at repositories that no longer exist (three
are abandoned factory experiments), two at a retired personal account
that has since been renamed, two at deleted scratch repos.
That is not cosmetic. git_url is the address every agent dispatch, clone
and CI lookup starts from, so a stale one surfaces as a confusing build
error inside a run the operator already paid for, rather than as "this
project points at nothing".
THE DISTINCTION THIS IS BUILT ON
GitHub already knows the difference between a repo that MOVED and one
that is GONE, and Loki was throwing it away. A rename answers with a
redirect and the new full_name — so Loki can simply fix it, which is the
automatic repair that being connected to GitHub is supposed to buy. A 404
cannot be repaired by a machine: deleted, or made private, or renamed
away without a redirect, and the only honest response is to say so once.
moved → healed silently, logged
gone → one alert, refreshed not duplicated
unchecked → neither, and explicitly NOT counted as healthy
That third state is load-bearing. A dead token or a network blip must
never read as "all repos fine" — the auto-resolve is gated on it, so a
tick that could not look can never clear a real alert.
- src/lib/github-repo-ref.ts — parsing and one lookup, kept apart from
the route so both are testable with no network and no database
- src/app/api/crons/check-project-repos/route.ts — daily 06:20 UTC
- project_repo_missing registered in config/alert-types.ts, whose own
gate checks the producer file really raises it
scripts/test/github-repo-ref.ts covers 15 stored URL forms (ssh remotes,
trailing .git, deep links, a dot in the repo name, non-GitHub hosts) and
pins all three verdicts across 9 responses. Case alone is not a move —
GitHub is case-insensitive here, and healing on case would rewrite rows
forever without changing anything.
Proven by mutation: treat 401/403 as healthy → "HTTP 401 must be
unchecked, got ok"; stop detecting renames → the moved assertion fails.
tsc caught a real bug pre-commit: the summary's `ok` count would have
overwritten the response's boolean `ok`, so every caller checking it
would have read a number. Renamed to `healthy`.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Two follow-ons found by the gate from the previous commit.
1. The summary SHAPE was declared three times. NotificationPanel and
NotificationsPill each carried a structural copy of
ProjectFeedbackSummary. A second declaration never breaks at runtime,
which is why it survives - it just quietly stops seeing any field the
real type gains. Both now import it, and the gate has an eighth check
that refuses a re-declaration. I only spotted the panel by hand; the
gate found the pill.
2. scripts/hetzner/test-retire-site.sh failed once inside a full verify
("expected output to mention 'DRY RUN'") and then passed 25/25
standalone. The cause is still unknown - it only misses under
concurrent load - and it was undiagnosable after the fact because the
assertion prints what it WANTED and never what it GOT. has() now dumps
the first 400 chars of the actual output on a miss, in the three
hetzner suites that share the idiom. Proven by mutating an assertion to
look for a string that is not there.
Not claiming the flake is fixed. Claiming the next occurrence will say
what happened instead of costing an hour of guessing.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>