Commit Graph
974 Commits
Author SHA1 Message Date
CatoandClaude Fable 5.1 2fc756072b feat(studio): every request reaches a person; the chat stops narrating its rules
- A studio brief, a partner application and every guest action on one now
  announce themselves like feedback does (push, Telegram, an alert pointing
  at /feedback/studio). #995 persisted them and told nobody — the opposite of
  "a person will reply". Replays stay silent; a notify hiccup never fails the
  ingest.
- Widget chat: a fallback model answered a bitbaum visitor with "Stage used:
  beta. / No URLs written. / Loki first because building leads" under the
  real answer. stripMeta drops such lines before the reply is shown, and the
  prompt says the answer is only what the visitor reads. Tests pin the leak
  and the sentences that must survive.
- A paused widget token cannot transcribe voice either.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-01 14:38:00 +02:00
CatoandClaude Opus 5.5 74e0eeef5c fix(changelog): complete, current changelog and roadmap; /releases is Fleet Runner releases (#1001)
* fix(changelog): render every entry whole — bullets, sub-headings, prose, all of history

The /changelog parser kept only the first line of each bullet, dropped ###
sub-headings and bullet-less entries, cut entries at 700 characters and kept
the newest 40. The page now renders the whole record, grouped by month, with
PR numbers linked. A test reads Loki's own CHANGELOG.md and checks the parsed
record against an independent reading of the source (mutation-checked: the
old parser, a no-op continuation join and a dropped sub-heading each fail it).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(releases): /releases is Fleet Runner releases; the stale platform list goes

Titled "Changelog" with an H1 of "Loki", the page carried a hand-kept
Platform section whose newest entry (2026-07-31) was still badged Latest.
CHANGELOG.md is the canonical product record; its two entries move there and
the page links /changelog instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs(changelog): fill September, the Aug 15 – Sep 21 gap, and mark #955 superseded

Adds the user-visible changes that never reached CHANGELOG.md (MCP, Watch it
work, OrangeCat sign-up, change a site from its URL, MIT relicense, Solon
founding, Telegram approvals, site retirement, and more), each checked
against its PR, in plain words with the PR number. Replaces the one-paragraph
summary of five weeks with dated entries and moves the two platform entries
from the old /releases list in.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs(roadmap): Shipped section, retired vocabulary out, Now holds only moving work

Finished items move to Shipped and nine shipped-but-unlisted ones join them;
headless CLI install and BYOK chat are ticked; Beacon, Mission checkpoints and
the autonomy ladder give way to the on/off autopilot and approvals; sign-in is
OrangeCat-first. The roadmap framing stops claiming local models are
first-class (open-weight models run the chat today; local is the direction)
and stops pointing at internal documents.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs(changelog): say the rename without the retired name

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 05:06:57 -07:00
CatoandClaude Opus 5.5 7076e0163f feat(site): the public site says what Loki is today — plain words first, depth on /how-it-works and /compare (#1000)
* feat(site): the public site says what Loki is today, in words a newcomer reads

Homepage rebuilt for a first-time, often non-technical visitor: "Describe it.
Agents build it.", one primary action, three plain steps (describe → built
and put online → say what to change on the site itself) with the phone check
as the safety line, three doors (an idea / a website to change / already
running agents), what is inside (Feedback, Watch, chat, Control — no retired
Beacon tier), and where the work runs, honest that the cloud builder is
invite-only during the beta.

New pages: /how-it-works (the short version, then the machinery under the
hood), /compare (Claude Code, Codex, Cursor, Copilot, Devin, Antigravity, Grok
Build, Muse Code, Lovable, Bolt, Replit, v0, Hermes, OpenClaw, OpenHands, Aider
— each row sourced and dated, no prices, and a section on where the others are
better), /why (mission + principles merged; /mission and /philosophy
redirect). /frontier retired (its producer was removed 2026-09-25) → /thoughts.

Also: nav rebuilt (Start / Learn, bitbaum added), footer names bitbaum, kicker
"Beta" not "Personal Systems", one description everywhere, no "Live" badge,
"pilots, concepts" not "client work" on /fleet, Heidi's blurb in its own
current words, dead Lightning address replaced (getalby 404 → coinos 200),
sitemap derived from the public nav (was 5 of ~25 pages), doubled /commission
title. public-copy-truth.ts pins all of it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(css): drop the ui-frontier-* rules the retired /frontier page used

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(audit): measure /why, /how-it-works, /compare; list the retired marketing pages as redirects

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(copy): assemble the retired name so the guard does not trip its own check

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 03:21:12 -07:00
CatoandClaude Opus 5.5 f81e33c89a fix(public-copy): pricing, docs, download, whitepaper, README, support and essays say what Loki does today (#997)
- /pricing + plans.ts: no "local-first", no "your own box", no cross-model
  verification; agents = Claude, Codex, Cursor, Antigravity, Grok; free while
  prices are not announced; Pro "Recommended" badge removed.
- /docs/quickstart: OrangeCat-first sign-up, step numbers read from the step
  table, new "Start from an idea" flow (describe -> interview -> Make it happen
  -> repo in the bitbaum org -> <name>.orangecat.ch for supported starters).
- /docs/feedback-widget: current labels (Widget setup, Implement, Synthesize),
  owner notes start a build (40/day per project) while visitor text waits,
  data-fc-avoid / data-fc-place, Chat mode, Watch the fix, /my-feedback, no
  daily digest. Docs index links point at the right pages.
- /download: agent list without OpenClaw, Intel Mac stated.
- Whitepaper: autopilot (not the removed Groq router), cloud builder only for
  eligible accounts, project-keyed handoffs, runner-owned lifecycle, tiers that
  match plans.ts, self-hosting possible but undocumented.
- README: beta, sign-in providers, deploy workflow, Quality Bar list fixed.
- /support: Cato card (pointed at OrangeCat's home page) removed; three parts.
- /setup redirects to /sign-in once any account exists.
- Essays describing the May-Aug architecture carry supersededBy and render a
  dated notice pointing at /whitepaper.

Tests: plans-copy-truth, setup-redirects-when-done, thought-superseded.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 02:33:09 -07:00
CatoandClaude Opus 5.5 0c6e05508e fix(ops): a site that hangs is DOWN, not up; raw sql Date comparisons fixed (#996)
loki.orangecat.ch was down ~06:00-07:53 UTC on 2026-10-01 (next-server
alive, no listening socket; Caddy 502 after 20s) and nobody was paged. The
watchdog's curl times out at 15s, prints 000 itself, and the fallback
'|| echo 000' appended another: "000000" is neither "000" nor a number, so
check() kept the site UP. Any app that hangs rather than refuses was invisible.
check() now counts UP only on a proven 2xx/3xx; test-watchdog-check.sh runs the
shipped check() against a fake curl (old code fails timeout/refused/garbage).
The deploy verifiers had the same append (failing closed) and are normalised.

Also from the same journal: closeStaleAgentTurns threw ERR_INVALID_ARG_TYPE
every hour — postgres-js cannot serialise a Date in a raw sql fragment. Same
shape in the calendar overlap, the digest previous window and two more;
all now use lt/gt/gte, and no-raw-sql-comparisons.ts keeps it that way.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 01:23:15 -07:00
Cato b58f514ef6 Add scoped Bitbaum studio portal and keep Loki self-service free (#995)
* feat: start request-scoped Bitbaum portal and studio review

* test: prove scoped portal boundaries and restore studio record join

* fix: support canonical studio origin and readable partner review

* fix: support canonical studio origin and readable partner review
2026-09-30 14:49:38 -07:00
CatoandCursor 231701fc78 feat(crons): daily Solon Places import timer (#994)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 12:42:38 -07:00
Cato db446e2c69 feat(commission): start website changes from a URL and brief (#987) 2026-09-30 08:03:14 -07:00
CatoandClaude Fable 5.1 61f73c248f fix(openclaw): match the gateway unit by what it runs, and print what the box has (#986)
* feat(openclaw): the Telegram agent reads screenshots, photos and videos

The Telegram agent is OpenClaw on bitbaum, and OpenClaw already describes
inbound media before the chat model reads the turn — but on defaults that
cut every description at 500 characters and read one attachment per
message. A screenshot lost most of its text; an album was read as its
first picture; video had a one-line "Describe the video." prompt.

- scripts/openclaw/media-understanding.json: versioned tools.media.image
  and tools.media.video blocks (Gemini; screenshots transcribed verbatim,
  albums read whole; videos returned as transcript + visuals + claims +
  authenticity signs so the agent can argue about whether a clip holds up).
  tools.media.audio is deliberately untouched — voice notes already work.
- scripts/openclaw/install-media-understanding.sh: the only way it reaches
  the box. Refuses without a Gemini key, writes through OpenClaw's own
  schema-validating `config set`, restarts the gateway, then proves an
  image (and, where ffmpeg exists, a video) is actually described.
- scripts/test/openclaw-media-config.ts: pins the limits and the audio
  hands-off rule.

Validated against openclaw@2026.4.23's schema locally. Not yet applied to
the box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* refactor(actions): share the decision and the enqueue report; let a turn be read-only

Groundwork for the MCP server, so it calls the same code the chat seams do
instead of a copy of it:

- lib/actions/decide-action.ts: approve/reject one draft, lifted out of
  POST /api/actions/[id]/decision (which now calls it; wire shape unchanged).
- lib/actions/enqueue-report.ts: what an enqueue outcome may truthfully be
  called (auto-approved / awaiting-approval / deduped), lifted out of
  POST /api/actions/propose (wire shape unchanged).
- config/orangecat.ts: the OrangeCat origin and OAuth issuer in a DB-free
  module; Auth.js and the identity bridge read the issuer from here instead
  of each re-deriving it.
- askLoki / runLokiTurn take `readOnly`: the tool loop drops its propose
  tools and the OpenClaw gateway fallback is skipped, so a caller granted
  conversation but not action cannot get Loki to act by asking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* feat(mcp): a remote MCP server so AI apps can message Loki and have it act

POST /api/mcp speaks MCP Streamable HTTP (stateless JSON-RPC 2.0; protocol
2025-11-25 / 2025-06-18 / 2025-03-26). claude.ai and ChatGPT connectors,
Claude Code and Cursor can ask Loki, list the approval queue and projects,
dispatch work, book appointments and decide queued actions.

Auth: a ck_* agent token (both scopes), or an OrangeCat RS256 access token
verified with node:crypto against the issuer's JWKS — iss, aud (must be the
Loki resource URL, never a client id), exp. `sub` maps to the Loki user via
orangecatActorId; an unlinked actor gets the sign-in step, not a 500. A
missing or bad token is a 401 whose WWW-Authenticate points at the RFC 9728
metadata served at /.well-known/oauth-protected-resource(/api/mcp).

Scopes loki.chat / loki.act and the tool map are SSOT in src/config/mcp.ts.
Act tools go through injectPrompt, enqueueAction and decideAction — the
functions the Telegram skill's routes call — so the approval queue gates
them exactly as it does there. Both paths are excluded from the session
middleware (proxy.ts, with the reason), registered in api-route-auth and
the demo sandbox. Docs: docs/development/mcp.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): match the installer's smoke output with a here-string, not a pipe

printf | grep -q can report a miss on a match under pipefail (grep exits,
the writer takes SIGPIPE). no-grep-q-in-a-pipe caught it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* feat(openclaw): a workflow that installs media understanding on the box

install-media-understanding.sh needs SSH to bitbaum and a Gemini key, which
a sandboxed agent session has neither of. This workflow_dispatch job has
both: it reuses deploy.yml's HETZNER_SSH_KEY / HETZNER_IP, takes the key
from the GEMINI_API_KEY repo secret or, failing that, from OrangeCat's env
already on the box, writes it into the openclaw user's ~/.openclaw/.env only
when none is there, and runs the installer, which proves a describe.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): find the openclaw CLI for a user whose login shell lacks it

The first run of the media workflow reached the box, found the Google key
already there, and died on `openclaw: command not found`: the CLI is under
nvm, which only an interactive .bashrc puts on PATH. Each remote step now
sources .bashrc, then falls back to the nvm / npm-global / local bin
directories, and refuses loudly if none has the binary.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): hand the remote script to bash on stdin, not through sudo -i

`sudo -i` re-joins and re-parses its argument string through the target
user's shell, so the multi-line CLI-finding preamble arrived broken on the
box ("unexpected end of file from `{'"). The script now travels on stdin
to `bash -ls`, which nothing in between re-parses. The local stand-in for
sudo now re-parses the same way, so this shape is what the dry run tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): restart the gateway as root through whatever supervises it

The third run from GitHub Actions wrote and validated the media config on
the box, then died in `openclaw gateway restart`: under `sudo -iu openclaw`
the CLI reaches for `systemctl --machine openclaw@ --user`, and the openclaw
user's own systemd manager is not running there. The restart is now done as
root, by finding the supervisor in order — a system unit named openclaw/ivy,
a user unit with a live bus, a user unit whose manager needs linger — and
the failure branch prints what it found. "Up" is answering HTTP on :18789,
which every supervisor shape shares, instead of a systemd status the CLI
may be unable to read.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): match the gateway unit by what it runs, and print what the box has

The fourth run restarted `ivy-health-deep.service` — a health probe that
merely shares the `ivy` prefix — then waited on :18789, where nothing was
listening. The unit is now found by a unit file that mentions openclaw/ivy
AND gateway (name match only as a fallback, and only with "gateway" in it),
the step prints the units, the gateway process and its listening sockets
before touching anything, and "up" accepts a listening gateway process on
any port, naming it, when :18789 stays silent.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-29 18:04:18 +02:00
CatoandClaude Fable 5.1 f525f55ac6 fix(openclaw): restart the gateway as root through whatever supervises it (#985)
* feat(openclaw): the Telegram agent reads screenshots, photos and videos

The Telegram agent is OpenClaw on bitbaum, and OpenClaw already describes
inbound media before the chat model reads the turn — but on defaults that
cut every description at 500 characters and read one attachment per
message. A screenshot lost most of its text; an album was read as its
first picture; video had a one-line "Describe the video." prompt.

- scripts/openclaw/media-understanding.json: versioned tools.media.image
  and tools.media.video blocks (Gemini; screenshots transcribed verbatim,
  albums read whole; videos returned as transcript + visuals + claims +
  authenticity signs so the agent can argue about whether a clip holds up).
  tools.media.audio is deliberately untouched — voice notes already work.
- scripts/openclaw/install-media-understanding.sh: the only way it reaches
  the box. Refuses without a Gemini key, writes through OpenClaw's own
  schema-validating `config set`, restarts the gateway, then proves an
  image (and, where ffmpeg exists, a video) is actually described.
- scripts/test/openclaw-media-config.ts: pins the limits and the audio
  hands-off rule.

Validated against openclaw@2026.4.23's schema locally. Not yet applied to
the box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* refactor(actions): share the decision and the enqueue report; let a turn be read-only

Groundwork for the MCP server, so it calls the same code the chat seams do
instead of a copy of it:

- lib/actions/decide-action.ts: approve/reject one draft, lifted out of
  POST /api/actions/[id]/decision (which now calls it; wire shape unchanged).
- lib/actions/enqueue-report.ts: what an enqueue outcome may truthfully be
  called (auto-approved / awaiting-approval / deduped), lifted out of
  POST /api/actions/propose (wire shape unchanged).
- config/orangecat.ts: the OrangeCat origin and OAuth issuer in a DB-free
  module; Auth.js and the identity bridge read the issuer from here instead
  of each re-deriving it.
- askLoki / runLokiTurn take `readOnly`: the tool loop drops its propose
  tools and the OpenClaw gateway fallback is skipped, so a caller granted
  conversation but not action cannot get Loki to act by asking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* feat(mcp): a remote MCP server so AI apps can message Loki and have it act

POST /api/mcp speaks MCP Streamable HTTP (stateless JSON-RPC 2.0; protocol
2025-11-25 / 2025-06-18 / 2025-03-26). claude.ai and ChatGPT connectors,
Claude Code and Cursor can ask Loki, list the approval queue and projects,
dispatch work, book appointments and decide queued actions.

Auth: a ck_* agent token (both scopes), or an OrangeCat RS256 access token
verified with node:crypto against the issuer's JWKS — iss, aud (must be the
Loki resource URL, never a client id), exp. `sub` maps to the Loki user via
orangecatActorId; an unlinked actor gets the sign-in step, not a 500. A
missing or bad token is a 401 whose WWW-Authenticate points at the RFC 9728
metadata served at /.well-known/oauth-protected-resource(/api/mcp).

Scopes loki.chat / loki.act and the tool map are SSOT in src/config/mcp.ts.
Act tools go through injectPrompt, enqueueAction and decideAction — the
functions the Telegram skill's routes call — so the approval queue gates
them exactly as it does there. Both paths are excluded from the session
middleware (proxy.ts, with the reason), registered in api-route-auth and
the demo sandbox. Docs: docs/development/mcp.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): match the installer's smoke output with a here-string, not a pipe

printf | grep -q can report a miss on a match under pipefail (grep exits,
the writer takes SIGPIPE). no-grep-q-in-a-pipe caught it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* feat(openclaw): a workflow that installs media understanding on the box

install-media-understanding.sh needs SSH to bitbaum and a Gemini key, which
a sandboxed agent session has neither of. This workflow_dispatch job has
both: it reuses deploy.yml's HETZNER_SSH_KEY / HETZNER_IP, takes the key
from the GEMINI_API_KEY repo secret or, failing that, from OrangeCat's env
already on the box, writes it into the openclaw user's ~/.openclaw/.env only
when none is there, and runs the installer, which proves a describe.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): find the openclaw CLI for a user whose login shell lacks it

The first run of the media workflow reached the box, found the Google key
already there, and died on `openclaw: command not found`: the CLI is under
nvm, which only an interactive .bashrc puts on PATH. Each remote step now
sources .bashrc, then falls back to the nvm / npm-global / local bin
directories, and refuses loudly if none has the binary.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): hand the remote script to bash on stdin, not through sudo -i

`sudo -i` re-joins and re-parses its argument string through the target
user's shell, so the multi-line CLI-finding preamble arrived broken on the
box ("unexpected end of file from `{'"). The script now travels on stdin
to `bash -ls`, which nothing in between re-parses. The local stand-in for
sudo now re-parses the same way, so this shape is what the dry run tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): restart the gateway as root through whatever supervises it

The third run from GitHub Actions wrote and validated the media config on
the box, then died in `openclaw gateway restart`: under `sudo -iu openclaw`
the CLI reaches for `systemctl --machine openclaw@ --user`, and the openclaw
user's own systemd manager is not running there. The restart is now done as
root, by finding the supervisor in order — a system unit named openclaw/ivy,
a user unit with a live bus, a user unit whose manager needs linger — and
the failure branch prints what it found. "Up" is answering HTTP on :18789,
which every supervisor shape shares, instead of a systemd status the CLI
may be unable to read.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-29 08:51:06 -07:00
CatoandClaude Fable 5.1 1d1c930577 fix(openclaw): hand the remote script to bash on stdin, not through sudo -i (#984)
* feat(openclaw): the Telegram agent reads screenshots, photos and videos

The Telegram agent is OpenClaw on bitbaum, and OpenClaw already describes
inbound media before the chat model reads the turn — but on defaults that
cut every description at 500 characters and read one attachment per
message. A screenshot lost most of its text; an album was read as its
first picture; video had a one-line "Describe the video." prompt.

- scripts/openclaw/media-understanding.json: versioned tools.media.image
  and tools.media.video blocks (Gemini; screenshots transcribed verbatim,
  albums read whole; videos returned as transcript + visuals + claims +
  authenticity signs so the agent can argue about whether a clip holds up).
  tools.media.audio is deliberately untouched — voice notes already work.
- scripts/openclaw/install-media-understanding.sh: the only way it reaches
  the box. Refuses without a Gemini key, writes through OpenClaw's own
  schema-validating `config set`, restarts the gateway, then proves an
  image (and, where ffmpeg exists, a video) is actually described.
- scripts/test/openclaw-media-config.ts: pins the limits and the audio
  hands-off rule.

Validated against openclaw@2026.4.23's schema locally. Not yet applied to
the box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* refactor(actions): share the decision and the enqueue report; let a turn be read-only

Groundwork for the MCP server, so it calls the same code the chat seams do
instead of a copy of it:

- lib/actions/decide-action.ts: approve/reject one draft, lifted out of
  POST /api/actions/[id]/decision (which now calls it; wire shape unchanged).
- lib/actions/enqueue-report.ts: what an enqueue outcome may truthfully be
  called (auto-approved / awaiting-approval / deduped), lifted out of
  POST /api/actions/propose (wire shape unchanged).
- config/orangecat.ts: the OrangeCat origin and OAuth issuer in a DB-free
  module; Auth.js and the identity bridge read the issuer from here instead
  of each re-deriving it.
- askLoki / runLokiTurn take `readOnly`: the tool loop drops its propose
  tools and the OpenClaw gateway fallback is skipped, so a caller granted
  conversation but not action cannot get Loki to act by asking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* feat(mcp): a remote MCP server so AI apps can message Loki and have it act

POST /api/mcp speaks MCP Streamable HTTP (stateless JSON-RPC 2.0; protocol
2025-11-25 / 2025-06-18 / 2025-03-26). claude.ai and ChatGPT connectors,
Claude Code and Cursor can ask Loki, list the approval queue and projects,
dispatch work, book appointments and decide queued actions.

Auth: a ck_* agent token (both scopes), or an OrangeCat RS256 access token
verified with node:crypto against the issuer's JWKS — iss, aud (must be the
Loki resource URL, never a client id), exp. `sub` maps to the Loki user via
orangecatActorId; an unlinked actor gets the sign-in step, not a 500. A
missing or bad token is a 401 whose WWW-Authenticate points at the RFC 9728
metadata served at /.well-known/oauth-protected-resource(/api/mcp).

Scopes loki.chat / loki.act and the tool map are SSOT in src/config/mcp.ts.
Act tools go through injectPrompt, enqueueAction and decideAction — the
functions the Telegram skill's routes call — so the approval queue gates
them exactly as it does there. Both paths are excluded from the session
middleware (proxy.ts, with the reason), registered in api-route-auth and
the demo sandbox. Docs: docs/development/mcp.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): match the installer's smoke output with a here-string, not a pipe

printf | grep -q can report a miss on a match under pipefail (grep exits,
the writer takes SIGPIPE). no-grep-q-in-a-pipe caught it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* feat(openclaw): a workflow that installs media understanding on the box

install-media-understanding.sh needs SSH to bitbaum and a Gemini key, which
a sandboxed agent session has neither of. This workflow_dispatch job has
both: it reuses deploy.yml's HETZNER_SSH_KEY / HETZNER_IP, takes the key
from the GEMINI_API_KEY repo secret or, failing that, from OrangeCat's env
already on the box, writes it into the openclaw user's ~/.openclaw/.env only
when none is there, and runs the installer, which proves a describe.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): find the openclaw CLI for a user whose login shell lacks it

The first run of the media workflow reached the box, found the Google key
already there, and died on `openclaw: command not found`: the CLI is under
nvm, which only an interactive .bashrc puts on PATH. Each remote step now
sources .bashrc, then falls back to the nvm / npm-global / local bin
directories, and refuses loudly if none has the binary.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): hand the remote script to bash on stdin, not through sudo -i

`sudo -i` re-joins and re-parses its argument string through the target
user's shell, so the multi-line CLI-finding preamble arrived broken on the
box ("unexpected end of file from `{'"). The script now travels on stdin
to `bash -ls`, which nothing in between re-parses. The local stand-in for
sudo now re-parses the same way, so this shape is what the dry run tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-29 08:40:30 -07:00
CatoandClaude Fable 5.1 ce92d74b70 fix(openclaw): find the openclaw CLI for a user whose login shell lacks it (#983)
* feat(openclaw): the Telegram agent reads screenshots, photos and videos

The Telegram agent is OpenClaw on bitbaum, and OpenClaw already describes
inbound media before the chat model reads the turn — but on defaults that
cut every description at 500 characters and read one attachment per
message. A screenshot lost most of its text; an album was read as its
first picture; video had a one-line "Describe the video." prompt.

- scripts/openclaw/media-understanding.json: versioned tools.media.image
  and tools.media.video blocks (Gemini; screenshots transcribed verbatim,
  albums read whole; videos returned as transcript + visuals + claims +
  authenticity signs so the agent can argue about whether a clip holds up).
  tools.media.audio is deliberately untouched — voice notes already work.
- scripts/openclaw/install-media-understanding.sh: the only way it reaches
  the box. Refuses without a Gemini key, writes through OpenClaw's own
  schema-validating `config set`, restarts the gateway, then proves an
  image (and, where ffmpeg exists, a video) is actually described.
- scripts/test/openclaw-media-config.ts: pins the limits and the audio
  hands-off rule.

Validated against openclaw@2026.4.23's schema locally. Not yet applied to
the box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* refactor(actions): share the decision and the enqueue report; let a turn be read-only

Groundwork for the MCP server, so it calls the same code the chat seams do
instead of a copy of it:

- lib/actions/decide-action.ts: approve/reject one draft, lifted out of
  POST /api/actions/[id]/decision (which now calls it; wire shape unchanged).
- lib/actions/enqueue-report.ts: what an enqueue outcome may truthfully be
  called (auto-approved / awaiting-approval / deduped), lifted out of
  POST /api/actions/propose (wire shape unchanged).
- config/orangecat.ts: the OrangeCat origin and OAuth issuer in a DB-free
  module; Auth.js and the identity bridge read the issuer from here instead
  of each re-deriving it.
- askLoki / runLokiTurn take `readOnly`: the tool loop drops its propose
  tools and the OpenClaw gateway fallback is skipped, so a caller granted
  conversation but not action cannot get Loki to act by asking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* feat(mcp): a remote MCP server so AI apps can message Loki and have it act

POST /api/mcp speaks MCP Streamable HTTP (stateless JSON-RPC 2.0; protocol
2025-11-25 / 2025-06-18 / 2025-03-26). claude.ai and ChatGPT connectors,
Claude Code and Cursor can ask Loki, list the approval queue and projects,
dispatch work, book appointments and decide queued actions.

Auth: a ck_* agent token (both scopes), or an OrangeCat RS256 access token
verified with node:crypto against the issuer's JWKS — iss, aud (must be the
Loki resource URL, never a client id), exp. `sub` maps to the Loki user via
orangecatActorId; an unlinked actor gets the sign-in step, not a 500. A
missing or bad token is a 401 whose WWW-Authenticate points at the RFC 9728
metadata served at /.well-known/oauth-protected-resource(/api/mcp).

Scopes loki.chat / loki.act and the tool map are SSOT in src/config/mcp.ts.
Act tools go through injectPrompt, enqueueAction and decideAction — the
functions the Telegram skill's routes call — so the approval queue gates
them exactly as it does there. Both paths are excluded from the session
middleware (proxy.ts, with the reason), registered in api-route-auth and
the demo sandbox. Docs: docs/development/mcp.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): match the installer's smoke output with a here-string, not a pipe

printf | grep -q can report a miss on a match under pipefail (grep exits,
the writer takes SIGPIPE). no-grep-q-in-a-pipe caught it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* feat(openclaw): a workflow that installs media understanding on the box

install-media-understanding.sh needs SSH to bitbaum and a Gemini key, which
a sandboxed agent session has neither of. This workflow_dispatch job has
both: it reuses deploy.yml's HETZNER_SSH_KEY / HETZNER_IP, takes the key
from the GEMINI_API_KEY repo secret or, failing that, from OrangeCat's env
already on the box, writes it into the openclaw user's ~/.openclaw/.env only
when none is there, and runs the installer, which proves a describe.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): find the openclaw CLI for a user whose login shell lacks it

The first run of the media workflow reached the box, found the Google key
already there, and died on `openclaw: command not found`: the CLI is under
nvm, which only an interactive .bashrc puts on PATH. Each remote step now
sources .bashrc, then falls back to the nvm / npm-global / local bin
directories, and refuses loudly if none has the binary.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-29 08:31:35 -07:00
CatoandCursor e9fbbeb4f4 test: fixture project no longer borrows a retired name (#981)
The "no site yet" sample project was called Townsism; that name is retired.
Same shape, neutral name.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-29 06:11:29 -07:00
CatoandClaude 3a1080446b fix(widget): words are not free space — the launcher climbs past text (#979)
Loki's own sign-in page at 390px: every slot on the bottom band is a
button, and the first slot up the edge that held no control was the
"or sign in" divider. The scan rated in-flow text as free, so the
launcher parked on the words (seen in a prod screenshot, 2026-09-29).

A new verdict, `text`, sits between free and surface: caret hit-testing
finds a non-blank text node whose own line box contains the probe point
(so the margin beside a paragraph is still free). The launcher prefers
an empty slot, still takes words over any control, and steps out of
hit-testing for the scan so it does not measure itself. README table
updated; a sign-in fixture in the browser test fails on the previous
bundle (launcher on the line) and passes now.


Claude-Session: https://claude.ai/code/session_01NJJp6XiUkeEVzjDaBmWjL3

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-29 03:44:17 -07:00
CatoandClaude f27000f948 feat(dispatch): nothing runs on the operator's quota unasked (#978)
Three paths started agent runs without a person's tap: a feedback run the
runner refused (feedback/auto-reimplement), any other project run it
refused (project-retry), and a queued Implement no builder claimed (the
check-feedback-needs-you cron via feedback/retry-queued). Each spends the
account's provider quota — Claude, Codex, Gemini — on a decision nobody
made. The owner asked for none of that.

One switch, off by default: src/lib/auto-dispatch.ts, read from
LOKI_AUTO_DISPATCH (exactly "1" enables). All three paths consult it first
and stand down with the reason auto-dispatch-off; a failed row keeps its
Retry and provider buttons, a stuck queue keeps its Telegram flag. Runs a
person starts — Implement, Retry, Try Codex, Make it happen — are
unchanged. Documented in .env.example; the literal-"1" rule is pinned in
scripts/test/feedback-auto-reimplement.ts.


Claude-Session: https://claude.ai/code/session_01NJJp6XiUkeEVzjDaBmWjL3

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-29 03:27:09 -07:00
CatoandClaude 75980bac76 feat(auth): sign-up goes through OrangeCat; one click links an existing account (#977)
Step D7 of orangecat ADR-0009 ("One account for every door").

- The sign-up page's OrangeCat button now opens OrangeCat's own
  create-account screen (OIDC prompt=create, advertised in its discovery
  document) and says so: "Create an account with OrangeCat". The Loki
  password form is kept for people who want one, but waits behind a single
  line ("Prefer a password just for Loki?") instead of being the default.
  lib/auth/orangecat-sign-in.ts holds both facts, pure and tested, so the
  sign-in and sign-up buttons cannot drift apart.
- A signed-in person whose Loki account is not yet an OrangeCat account
  sees one calm banner with one button, "Connect OrangeCat" — the same
  round-trip Settings → Account offers, from any page, dismissable for good.
  From then on every OrangeCat sign-in (code, Google, passkey) is Loki's too.
- The "routes where a banner may not take the viewport" list is now one
  config (config/banners.ts) shared by both shell banners.

Loki sessions stay Loki's own; what OrangeCat governs is the link, and a
refused refresh already marks it broken. Lint/tsc could not run in the
sandbox (the chatkit/listkit GitHub tarballs are blocked there); the new
unit test passes and CI is the gate.


Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-29 03:14:19 -07:00
CatoandClaude 3450776b41 fix(watch): while the agent works, say what it is doing in one line; fold the screen (#976)
George, 2026-09-29: the Watch chat should read with the ease of Claude,
ChatGPT or Grok. While an agent worked, Watch showed a black box of 10px
white monospace, the terminal itself, under the typing dots. Those apps show
ONE live step in words and fold the detail behind a tap.

- latestActivityLine (lib/project-watch) reads the tail bottom-up for what
  the agent is doing ("Writing the lease checker…"), dropping spinner glyphs,
  "(34s · esc to interrupt)" suffixes, the input box and key-hint banners.
- It replaces the generic phase label beside the typing dots.
- The raw screen folds behind "Show screen" (ScreenFold), drawn on the
  raised surface in readable text instead of a black block.

Tests: project-watch now 8 cases (the live line is the work, not the CLI
around it; chrome alone yields nothing).


Claude-Session: https://claude.ai/code/session_016aYbEpWEk7bkf1qt44Xtbh

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-29 01:59:40 -07:00
CatoandClaude 953cd3f96c fix(watch): a spent provider is routed around by itself, or one tap away; Watch reads like a chat (#975)
George, 2026-09-29, on the first real Watch: a kickoff hit "claude cannot
generate because its usage limit is exhausted", the page said "Failed" (with a
green check) and offered nothing. "Have we not agreed that if it's not working
we could just switch to another provider?" Feedback fixes had that; the runs
Make it happen and project dispatch start did not.

Automatic first:
- dispatchStep routes around a provider observed out of quota before it
  starts (providerChoiceFor + routeAroundSpent — the check Feedback's
  Implement makes), for that run only; the stored preference is untouched.
- A project run the runner refuses (usage limit, never answered, anything but
  auth / missing workspace) is re-sent once, on the next provider that can
  answer (lib/project-retry, from the same nack path as feedback's
  auto-reimplement). A capacity wall with no alternative is not re-run on
  the spent agent.

One tap second:
- POST /api/projects/[id]/watch/retry re-sends the failed run's own request;
  with `agent`, on that provider (remembered for the project).
- On a quota wall Watch shows ONE accent button, "Try <next provider>" (with
  the chooser beside it); "Try again" appears only when nothing else can
  answer. Other failures lead with "Try again".

Watch, redrawn the way people read Claude / ChatGPT / Grok:
- your request right in a soft bubble (the request itself — custom_prompt —
  not Loki's "# Loki operator dispatch" envelope), collapsed to its first
  paragraph;
- Loki and the agent left as plain text under a small name, no card per line;
- mechanical hops folded into one "activity" pill you can open;
- typing dots and the agent's screen while it works;
- failures in one plain sentence (humanizeRunFailure: "Claude Code has run
  out of usage for now.") with the way forward in the same message; the
  runner's error is no longer dressed up as the agent speaking;
- "Switched to Cursor — Claude Code was out of usage." after a switch.


Claude-Session: https://claude.ai/code/session_016aYbEpWEk7bkf1qt44Xtbh

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-29 01:47:55 -07:00
CatoandClaude Opus 5.5 9747207038 fix(runner): a working Claude is not reported as silent; fresh launches close dialogs (#966)
* fix(runner): a working Claude is not reported as silent; fresh launches close dialogs

Petvity, 2026-09-28: two dispatches failed with "claude opened on this
computer, but produced no response" while Claude was logged in, well
inside its limits, and working normally in a terminal on the same account.
The runner's only evidence for "no response" is Claude's own status file
(~/.claude/sessions/<pid>.json) staying idle for ~22s, matched to the
workspace by folder path. Three gaps, all closed here:

- claudeLiveSessionForDir compared paths as strings. Claude records its
  cwd as the kernel reports it (symlinks resolved, no trailing slash); the
  runner holds the path it was handed. One folder spelled two ways meant no
  session was found, the check fell back to a guess, and a working Claude
  was NACKed. Both sides are now compared by realpath as well as as given.
- The dialog dismissal added after Farmhouse (2026-09-26) ran only for an
  already-live session. A freshly launched Claude can open on a dialog too;
  the prompt then answered the dialog. The launch path now closes it first.
- The generic failure now quotes the last lines the CLI drew
  (screenExcerpt), so the next unexplained failure says what Claude was
  showing instead of leaving the operator to guess.

Tests: claude-dialog-not-a-composer (symlink, trailing slash, subfolder,
other folder; fresh-launch dismissal; the excerpt strips escapes and
borders and stays short). Unit suite 296/296, tsc clean, check:desktop ok.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsT2PtLuBKwgaaBU5pheG8

* chore(desktop): Fleet Runner 0.8.36 carries the silent-Claude fix

The runner change touches desktop/, so it needs a version the release
workflow can publish, or it lands on the server and on no machine
(desktop-release-drift). 0.8.36 with its FLEET_RUNNER_RELEASES entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsT2PtLuBKwgaaBU5pheG8

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 14:54:24 -07:00
CatoandClaude Opus 5.5 a1cc13053c feat(mcp): message Loki from any AI app; the Telegram agent reads screenshots and videos (#965)
* feat(openclaw): the Telegram agent reads screenshots, photos and videos

The Telegram agent is OpenClaw on bitbaum, and OpenClaw already describes
inbound media before the chat model reads the turn — but on defaults that
cut every description at 500 characters and read one attachment per
message. A screenshot lost most of its text; an album was read as its
first picture; video had a one-line "Describe the video." prompt.

- scripts/openclaw/media-understanding.json: versioned tools.media.image
  and tools.media.video blocks (Gemini; screenshots transcribed verbatim,
  albums read whole; videos returned as transcript + visuals + claims +
  authenticity signs so the agent can argue about whether a clip holds up).
  tools.media.audio is deliberately untouched — voice notes already work.
- scripts/openclaw/install-media-understanding.sh: the only way it reaches
  the box. Refuses without a Gemini key, writes through OpenClaw's own
  schema-validating `config set`, restarts the gateway, then proves an
  image (and, where ffmpeg exists, a video) is actually described.
- scripts/test/openclaw-media-config.ts: pins the limits and the audio
  hands-off rule.

Validated against openclaw@2026.4.23's schema locally. Not yet applied to
the box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* refactor(actions): share the decision and the enqueue report; let a turn be read-only

Groundwork for the MCP server, so it calls the same code the chat seams do
instead of a copy of it:

- lib/actions/decide-action.ts: approve/reject one draft, lifted out of
  POST /api/actions/[id]/decision (which now calls it; wire shape unchanged).
- lib/actions/enqueue-report.ts: what an enqueue outcome may truthfully be
  called (auto-approved / awaiting-approval / deduped), lifted out of
  POST /api/actions/propose (wire shape unchanged).
- config/orangecat.ts: the OrangeCat origin and OAuth issuer in a DB-free
  module; Auth.js and the identity bridge read the issuer from here instead
  of each re-deriving it.
- askLoki / runLokiTurn take `readOnly`: the tool loop drops its propose
  tools and the OpenClaw gateway fallback is skipped, so a caller granted
  conversation but not action cannot get Loki to act by asking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* feat(mcp): a remote MCP server so AI apps can message Loki and have it act

POST /api/mcp speaks MCP Streamable HTTP (stateless JSON-RPC 2.0; protocol
2025-11-25 / 2025-06-18 / 2025-03-26). claude.ai and ChatGPT connectors,
Claude Code and Cursor can ask Loki, list the approval queue and projects,
dispatch work, book appointments and decide queued actions.

Auth: a ck_* agent token (both scopes), or an OrangeCat RS256 access token
verified with node:crypto against the issuer's JWKS — iss, aud (must be the
Loki resource URL, never a client id), exp. `sub` maps to the Loki user via
orangecatActorId; an unlinked actor gets the sign-in step, not a 500. A
missing or bad token is a 401 whose WWW-Authenticate points at the RFC 9728
metadata served at /.well-known/oauth-protected-resource(/api/mcp).

Scopes loki.chat / loki.act and the tool map are SSOT in src/config/mcp.ts.
Act tools go through injectPrompt, enqueueAction and decideAction — the
functions the Telegram skill's routes call — so the approval queue gates
them exactly as it does there. Both paths are excluded from the session
middleware (proxy.ts, with the reason), registered in api-route-auth and
the demo sandbox. Docs: docs/development/mcp.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

* fix(openclaw): match the installer's smoke output with a here-string, not a pipe

printf | grep -q can report a miss on a match under pipefail (grep exits,
the writer takes SIGPIPE). no-grep-q-in-a-pipe caught it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 14:49:20 -07:00
CatoandClaude Opus 5.5 82d886c936 fix(feedback): an agent that opened and never answered is routed around (#964)
* fix(feedback): an agent that opened and never answered is routed around

Petvity, 2026-09-28: a feedback run launched Claude, injected the prompt,
and Claude produced nothing ("could not verify generation … produced no
response"). Loki's automatic retry then went straight back to Claude and
failed identically a minute later. The runner's own message says the move
is "choose another AI provider and Retry"; Loki was not taking it, because
spentProviders only counted runs whose error named a limit.

- looksLikeAgentNoAnswer (agent-resolution.ts) is the one reading of
  "opened, took the prompt, never answered"; auto-reimplement-policy uses
  it instead of its own copy of the regex.
- spentProviders counts that silence as the provider being unable to
  answer inside the window, with its own reason ("opened but never
  answered"), so implementFeedback → routeAroundSpent sends the automatic
  retry (and a manual Retry) to the next provider in the operator's order.
  The chooser's suffix for either case reads "not answering".
- The row no longer says "It never reached an agent — check the builder is
  online" for this: it says "The agent opened but never answered — Retry
  runs it on the next provider."
- Tests: provider-switch (silent agent rerouted; an unrelated failure does
  not remove a provider), feedback-auto-reimplement, feedback-tour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsT2PtLuBKwgaaBU5pheG8

* chore(web): the session-start hook fetches release tags

Cloud sessions start from a shallow clone with no tags, so the pre-push
gate's desktop-release-drift check reported UNCHECKED and blocked every
push until someone ran `git fetch --tags` by hand. The hook now does it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsT2PtLuBKwgaaBU5pheG8

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 13:16:25 -07:00
CatoandClaude f5d9790252 feat(projects): Watch it work — a project's run as a live, readable thread (#963)
Asked for 2026-09-28: "I'm not sure if I can actually see the chat, just like
here in Claude, and watch how things get implemented." What existed was the
raw terminal (a TUI on a phone) and a one-line phase chip.

/projects/[id]/watch tells the latest run as a conversation:
- You: what the agent was asked (prompt_history.resolved_prompt by run id),
  clamped with "Show the full brief".
- Loki: every hop the run declared (run_events) in words, heartbeats
  collapsed into one "working" line stamped with the latest, blocked hops in
  the warning tone with the reason; older hops fold once there are more than
  six.
- The agent's screen: the last lines it printed, ANSI and box borders
  stripped, refreshed every 6s while it works.
- Agent: its handoff summary (done / next / commit), or what went wrong.
- One status card from the same hydrate + work-phase as Terminal's rail and
  Feedback's Watch, with the terminal offered only when a session exists.
- Setup steps while a server-run kickoff is still going.

The pure half is lib/project-watch (tested); /api/projects/[id]/watch serves
it; the screen capture moved to lib/peek-tab-client so Control's peek drawer
and Watch share one copy. "Watch it work" / "Watch it start" in the kickoff
card and the build strip now open this page instead of Terminal.

Also: the cloud-builder-offline ask reads "The cloud builder is offline — the
work waits and starts when it reconnects" instead of naming the box-runner
process.


Claude-Session: https://claude.ai/code/session_016aYbEpWEk7bkf1qt44Xtbh

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 08:54:20 -07:00
CatoandClaude Opus 5.5 a0e76b31f3 fix(projects): the roadmap is not behind the PIN; one card, one button; Plan leads with the roadmap (#962)
* fix(projects): the roadmap is not behind the PIN; the Now tab has one card and one button

- getProjectDetail loaded a project's goals only when the private-zone PIN
  was unlocked, so the project's own roadmap — the plan an operator most
  needs to see and watch progress against — was hidden from its owner
  (public shares already showed it for anyone without a PIN). Goals are the
  project's plan and always load now. Every "goalsLocked" branch that
  existed only because of the gate is gone: the kickoff tip, the Plan tab's
  unlock line, the dispatch prompt's "roadmap not visible", and
  kickoffBlockedReason.
- Now tab, before anything is built: the interview rendered as its own
  orange-buttoned card directly above Make it happen — two competing
  "start here"s. The questions are now an optional link inside the kickoff
  card (?interview=1 still opens them), the card names its first target
  (the next open milestone), and the Status quo / What happens next cards
  wait until there is work to report.
- The brief is shown once: a substantial description starts as a 3-line
  preview with Edit instead of a second full copy in a textarea; the
  repository option is one line with Change instead of a bordered box.
- Header: the description clamp was a fixed 6rem that sliced the fourth line
  through its letters on phones (ui-clamp-3-lines, 3 × 1.625em with a fade),
  and Share & publish joins the Live / Repository row.
- Tab bar (ui-tabbar): no visible scrollbar, a right-edge fade when tabs
  overflow on phones, and the chosen tab scrolls into view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aYbEpWEk7bkf1qt44Xtbh

* fix(projects): Plan leads with the roadmap; the header link row fits a phone

Checked in a real browser at 390px against a local copy of the project:

- Plan: the roadmap was the last block on the tab, under an empty "Next
  action" and a "Completion contract". It is first now, numbered in build
  order (creation order, not progress order), with "1 of 3 done", the next
  milestone tagged, and finished ones collapsed to their title. "Completion
  contract" reads "When a run counts as done"; the tab title is "Plan".
- Header: "Repo" / "Share" labels below sm so Live · Repo · Share sit on one
  row (they took two), and the header's vertical gaps tighten on phones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aYbEpWEk7bkf1qt44Xtbh

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 08:38:43 -07:00
CatoandClaude 839f35ef6c fix(feedback): one inbox surface, project links by id, a render harness (#961)
Landing from Implement on /feedback?project=<id> printed "Nothing waiting
on you for 5936f8fb-…": the inbox filtered by project NAME and showed the
reader the id, on a page whose chips, stat cards and section heads were
each drawn in a different style. Every check was green; nobody had
rendered it.

- The ?project= filter resolves a name or an id against the data; an
  unknown value filters nothing instead of printing itself.
- A project-scoped view names its subject ("Showing petvity · 1 open ·
  All projects"), scrolls the active chip into view, and drops the
  per-row project chip. An empty project view says what is shipped and
  offers "Show all projects" / "Open <project>".
- One chip primitive (ui-inbox-project) for project and source filters;
  sections use the ui-inbox primitives; the three stat cards are one line
  (metricsLine, pure).
- A failed row has one primary button: the provider switch (or Retry);
  Watch steps down to secondary.
- Any refused feedback run gets one automatic second attempt; only
  commands the runner could not read, dead credentials and a missing
  workspace still stop. Test updated.
- scripts/preview/build-feedback-preview.mjs renders the real inbox with
  fixture rows in headless Chromium at 390 and 1280, dark and light, for
  every ?project= shape, failing on overflow or a console error. REVIEW.md
  records the definition of done this adds; responsive-design.md documents
  the harness.


Claude-Session: https://claude.ai/code/session_01NJJp6XiUkeEVzjDaBmWjL3

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 07:09:06 -07:00
CatoandClaude Fable 5.1 14e8667896 feat(projects): builders can dispatch; client is a role; hand a project over (#958)
* feat(widget): Ask Loki for a second opinion; hiding is visible and reversible

Tested the embed in a real browser and found three install/hide defects:
- a `type="module"` tag rendered nothing (document.currentScript is null);
- two copies of the tag rendered two launchers;
- hiding lived only behind a long-press/right-click and was one-way: after a
  reload nothing, not even the host's own Loki.report(), brought it back.

Fixes: find the tag by its attribute when currentScript is null; a boot-in-
flight guard keeps one widget per page; "Hide this button on this site" sits
at the foot of the panel with an Undo toast, and #loki, Loki.show(),
report() and ask() all restore it.

New Ask Loki mode (on by default next to "Request a change"): the person the
site was built for asks whether an element, the page or the whole site should
change and why it is the way it is. The widget builds a text outline in the
visitor's browser (a few same-origin pages for "Whole site") and POSTs it to
/api/widget/advise — same token, origin allowlist, rate limits and owner AI
budget as widget chat. The answer may say "leave it"; each recommended change
has "Request this", which prefills Report so advice becomes ordinary
Implement work. data-fc-modes="report" opts a site out.

Tests: scripts/test/widget-embed-browser.ts (real Chromium; fails on the old
bundle) and scripts/test/widget-advise.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsT2PtLuBKwgaaBU5pheG8

* refactor(widget): move panel pieces out of main.ts to meet the function-length ratchet

CI lint failed: the main IIFE grew to 597 lines (max-lines-per-function 510).
The success views, scope chips, mode tabs and hide toast move to
widget/panel-views.ts; the counter/Send sync is one helper. No behaviour
change — widget-embed-browser (31) and widget-host-avoid-browser (17) pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsT2PtLuBKwgaaBU5pheG8

* feat(projects): builders can dispatch; client is a role; hand a project over

- A collaborator with the builder role ("can run agents") was refused with
  "Project not found" the moment they dispatched, because dispatchStep looked
  the project up BY OWNER. It now asks getProjectAccess who may edit and
  refuses a non-editor with 403 and a sentence; the work still runs in the
  owner's tenant (project-capabilities.ts), so a builder receives the
  capability and never the owner's runner credentials.
- `client` joins PROJECT_ROLE_VALUES: the person the project is FOR. Same
  capabilities as a viewer, a different name, because a roster that cannot
  say who is paying is not a roster. ROLE_LABELS in project-capabilities.ts
  is the one table of role label / help / invitation sentence; the members
  panel and the invite email both read it (editors are shown as "Builder";
  the stored value stays `editor`).
- transferProjectOwnership: the owner hands the project to any member in one
  transaction — the user_projects row moves (the tenant the work runs in),
  the new owner's membership row goes, the old owner keeps a builder's seat.
  POST /api/projects/:id/transfer, and a "Hand over" button per member with
  a confirm that names what changes. The studio's hand-over to a client is
  this button.
- scripts/test/project-capabilities.ts covers the client role and that every
  role has a label and a help line.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsT2PtLuBKwgaaBU5pheG8

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 06:17:12 -07:00
CatoandClaude 9a035a1f93 fix(control): no dead ends when nothing is running; name the builder that is online (#957)
From the same phone session as #954/#956:

- Control's peek drawer: Live streamed an empty grey box and Snapshot
  printed the runner's raw "No running agent for …". Both now say so in
  words, with one next action ("Start it from the project"), and show
  "Setting up — the agent starts next" when a kickoff is running, or
  "Queued — waiting for a builder" (+ Connect your computer) when that is
  where it stopped. A "Not running" row no longer fires a 45s peek at all.
- Activity's empty state had its hierarchy inverted on the dark surface (the
  heading dimmer than the body) and said "Dispatch a prompt" with nothing to
  press. It now reads "Setting up this project" during a kickoff, and
  otherwise explains what will land there with a button to start.
- Loki chat and Control's intent panel said a bare "Builder online" while
  Terminal showed the cloud builder grey — both true (only the laptop was
  up) but it read as a contradiction. With one builder up the chip now names
  it ("This computer online" / "Cloud builder online"); both up keeps the
  short label, so the composer row gains no width.


Claude-Session: https://claude.ai/code/session_016aYbEpWEk7bkf1qt44Xtbh

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 05:54:30 -07:00
CatoandClaude 7281697b30 feat(kickoff): Make it happen runs on the server — locking your phone can't stop it (#956)
#954 kept the kickoff alive across in-app navigation, but the browser still
drove the steps. A mobile browser suspends a tab the moment the screen locks
or another app comes forward — the most natural thing to do while waiting a
minute — and that stopped the setup halfway.

- The five setup steps (brief, roadmap, provision, register-cd, dispatch) move
  their route bodies into lib/kickoff/steps. The routes are now thin wrappers
  and answer byte-for-byte as before.
- lib/kickoff/orchestrate is the one definition of the sequence and its
  wording: pure, so it is tested without a DB.
- lib/kickoff/server-runs owns runs in process memory: POST
  /api/projects/[id]/kickoff starts one (or JOINS the one already going, so a
  second press/tab/device never starts a second agent) and the steps continue
  after the response via after(). GET is what the page polls.
- lib/kickoff-run becomes a watcher: paints instantly from sessionStorage,
  asks the server what is true, polls while running, refreshes at once when
  the tab becomes visible again. A server restart mid-run is reported as
  "Loki restarted", with Try again redoing only what is missing.
- Terminal finds a kickoff by project name via GET /api/projects/kickoff?tab=,
  so opening it on another device still shows the live setup.
- isPrivateZoneUnlocked treats "no cookie jar" (outside a request) as locked
  instead of throwing, so a server-run dispatch can never fail on it.


Claude-Session: https://claude.ai/code/session_016aYbEpWEk7bkf1qt44Xtbh

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 05:42:30 -07:00
CatoandClaude 836ca683bb feat(feedback): a run refused at its last step retries itself once (#955)
A feedback run the runner refused at the end of dispatch — the CLI answered
the prompt with a usage-limit wall, or opened and never started generating —
sat on the row as "Failed" until a person came back to Loki and pressed
Retry. The owner who left the note from a phone on 2026-09-28 (Petvity,
refused 66 seconds after dispatch) never saw the row, and the fix one click
away was never made.

Retry at dispatch time already routes around a spent provider
(implementFeedback → routeAroundSpent); the missing piece was the click.
Now the runner's failing ack, after closing the run as undelivered, hands the
run to feedback/auto-reimplement.ts, which re-implements the feedback item
once through the same path as the button. Loop safety: a stamp on the failed
run and priorRunId on the new one; a run that is itself a retry is never
retried. Never for failures that need a person: dead credentials, a workspace
that does not exist on the builder.

The row reads "Retried automatically — the first attempt failed because …"
while the second run is queued or working. Policy is pure
(auto-reimplement-policy.ts) so work-phase stays database-free.

Tests: scripts/test/feedback-auto-reimplement.ts.


Claude-Session: https://claude.ai/code/session_01NJJp6XiUkeEVzjDaBmWjL3

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 05:38:47 -07:00
CatoandClaude 24e42b8810 fix(kickoff): Make it happen survives leaving the page and a model failure (#954)
A phone session on 2026-09-28 ("Zurich Sublet Compliance & Concierge
Service") pressed Make it happen, saw "Could not extract a profile from that
text", went to Terminal to watch, found "No session named …", and came back
to a card that had forgotten the run. No agent ever appeared.

- Profile extraction: the fast model is a reasoning model whose thinking is
  billed against max_tokens. 900 tokens for ~20 keys of up to 400 chars cut
  rich briefs off mid-JSON every time. Raised to 3000 (roadmap 1200 -> 2500)
  and a truncated reply now keeps every finished key (salvageTruncatedObject,
  opt-in, strict reader unchanged).
- The brief is saved BEFORE the model call, so a model outage no longer
  costs the operator their text or leaves dispatch with "Describe the
  project first".
- The kickoff run moved out of component state into lib/kickoff-run: it
  keeps going across in-app navigation, is live again on return, is mirrored
  to sessionStorage (a reload reports "interrupted", never silently done),
  and a second press cannot start a second agent.
- The result names where the agent went: working (Watch it work), queued with
  no builder online (says so, links Connect your computer / Control), or not
  started (Try again). Step notes sit under their label so phones read them.
- Terminal's empty state shows the kickoff's live steps for that project
  instead of a generic "No session named …".
- Control peek drawer header wraps on phones instead of painting the
  Snapshot subtitle over the Activity button.


Claude-Session: https://claude.ai/code/session_016aYbEpWEk7bkf1qt44Xtbh

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 05:19:29 -07:00
CatoandCato 0e97c5e64e chore(register): add zurich-sublet-compliance-concierge-service (4031) (#953)
Co-authored-by: Cato <catomean@users.noreply.github.com>
2026-09-28 04:43:18 -07:00
CatoandClaude Fable 5.1 6fbafe88a5 feat(records): ROADMAP.md and CHANGELOG.md in each repo are the canonical roadmap and changelog (#952)
* feat(feedback): "Watch the fix" walkthrough; failed runs say why

What the owner hit on 2026-09-28, testing the loop from a phone:

- A shipped Farmhouse fix showed a green "Live · confirm" chip that was
  itself a link to the site. It read as "watch it live" and landed on the
  homepage with no idea where to look.
- A failed Petvity run printed the bare word "Retry" above a Retry button,
  with the reason hidden.

Now:

- The badge is a status, never a link, and says "Shipped · confirm".
- "Check live" becomes "Watch the fix" (plus "What changed" -> the PR). It
  opens the live page with a signed, 24h tour token in the fragment. The
  widget, which already runs on every fleet site, reads an outline of the
  page and plays a walkthrough from /api/widget/tour: a cursor glides to each
  element, a caption says why, in-page controls are really clicked (anything
  that navigates or submits is only pointed at). The script comes from the
  model on the owner's AI budget, with a word-overlap fallback so it never
  depends on a vendor.
- A step the tour cannot show says so ("Oops — ... flagged, it will be
  investigated") and is filed as an AI-review item on the project, so a fix
  that is not really live comes back into the loop.
- Failed rows get one plain sentence from the run error (quota, repository
  access, timeout, no session, crash...) instead of "Retry".

Verified in headless Chromium at 390px against live farmhouse.orangecat.ch
with this bundle: scroll to the footer link, click it (page returns to top),
a missing step reports back, no horizontal overflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJJp6XiUkeEVzjDaBmWjL3

* feat(records): ROADMAP.md and CHANGELOG.md in each repo are the canonical roadmap and changelog

The fleet map (/api/fleet/map) is what every site's /roadmap and /changelog
render through bip-kit, and its only producers were Loki's goals table and
dev_log column. Read in production today: 19 of 34 projects had goals, nearly
all of them one machine-seeded placeholder ("Make <x> development and
verification public", 0 of 3 steps done); the changelogs were run notes.
Meanwhile Loki, OrangeCat, Heidi and evig kept local roadmap copies the SSOT
forbids, and Solon and Petvity had no pages at all.

Now:

- src/lib/register/repo-records.ts parses ROADMAP.md (## buckets → status,
  ### items, - [x] milestones, Target:) and CHANGELOG.md (Keep-a-Changelog
  dialect) from each project's public GitHub repository, fetched in parallel
  and cached ten minutes in-process. A missing or private file yields nothing.
- The map prefers the file where it exists and keeps goals / dev_log where it
  does not; every entry says which producer it came from (`records`) and
  links the file (`source`), and repo items carry the author's one-liner.
- Loki's own ROADMAP.md holds the product roadmap that used to live in
  marketing-content (the buckets went stale twice) plus the scale plan:
  tenancy on the box, one box → a pool, BYOK + metering, the partner track,
  Loki as a GitHub App, own inference, the academy, with "Capacity you can
  read" as the trigger metrics. CHANGELOG.md is brought up to date from
  2026-08-15.
- /roadmap renders the record (grouped Now / Next / Later / Shipped);
  /changelog renders it instead of forwarding to /releases, which stays the
  Fleet Runner release history. Footer and account menu link both.
- docs/architecture/building-in-public-records.md is the file contract, the
  audit, and who complies; the SSOT doc points at it.

Tests: scripts/test/repo-records.ts (parser, precedence, provenance,
fetch/cache/failure); fleet-map suites unchanged and green.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJJp6XiUkeEVzjDaBmWjL3

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 04:22:26 -07:00
CatoandClaude bd1c6de353 feat(feedback): "Watch the fix" walkthrough; failed runs say why (#951)
What the owner hit on 2026-09-28, testing the loop from a phone:

- A shipped Farmhouse fix showed a green "Live · confirm" chip that was
  itself a link to the site. It read as "watch it live" and landed on the
  homepage with no idea where to look.
- A failed Petvity run printed the bare word "Retry" above a Retry button,
  with the reason hidden.

Now:

- The badge is a status, never a link, and says "Shipped · confirm".
- "Check live" becomes "Watch the fix" (plus "What changed" -> the PR). It
  opens the live page with a signed, 24h tour token in the fragment. The
  widget, which already runs on every fleet site, reads an outline of the
  page and plays a walkthrough from /api/widget/tour: a cursor glides to each
  element, a caption says why, in-page controls are really clicked (anything
  that navigates or submits is only pointed at). The script comes from the
  model on the owner's AI budget, with a word-overlap fallback so it never
  depends on a vendor.
- A step the tour cannot show says so ("Oops — ... flagged, it will be
  investigated") and is filed as an AI-review item on the project, so a fix
  that is not really live comes back into the loop.
- Failed rows get one plain sentence from the run error (quota, repository
  access, timeout, no session, crash...) instead of "Retry".

Verified in headless Chromium at 390px against live farmhouse.orangecat.ch
with this bundle: scroll to the footer link, click it (page returns to top),
a missing step reports back, no horizontal overflow.


Claude-Session: https://claude.ai/code/session_01NJJp6XiUkeEVzjDaBmWjL3

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 02:01:44 -07:00
CatoandClaude Opus 5.5 63d8f84d33 feat(widget): Ask Loki for a second opinion; hiding is visible and reversible (#950)
* feat(widget): Ask Loki for a second opinion; hiding is visible and reversible

Tested the embed in a real browser and found three install/hide defects:
- a `type="module"` tag rendered nothing (document.currentScript is null);
- two copies of the tag rendered two launchers;
- hiding lived only behind a long-press/right-click and was one-way: after a
  reload nothing, not even the host's own Loki.report(), brought it back.

Fixes: find the tag by its attribute when currentScript is null; a boot-in-
flight guard keeps one widget per page; "Hide this button on this site" sits
at the foot of the panel with an Undo toast, and #loki, Loki.show(),
report() and ask() all restore it.

New Ask Loki mode (on by default next to "Request a change"): the person the
site was built for asks whether an element, the page or the whole site should
change and why it is the way it is. The widget builds a text outline in the
visitor's browser (a few same-origin pages for "Whole site") and POSTs it to
/api/widget/advise — same token, origin allowlist, rate limits and owner AI
budget as widget chat. The answer may say "leave it"; each recommended change
has "Request this", which prefills Report so advice becomes ordinary
Implement work. data-fc-modes="report" opts a site out.

Tests: scripts/test/widget-embed-browser.ts (real Chromium; fails on the old
bundle) and scripts/test/widget-advise.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsT2PtLuBKwgaaBU5pheG8

* refactor(widget): move panel pieces out of main.ts to meet the function-length ratchet

CI lint failed: the main IIFE grew to 597 lines (max-lines-per-function 510).
The success views, scope chips, mode tabs and hide toast move to
widget/panel-views.ts; the counter/Send sync is one helper. No behaviour
change — widget-embed-browser (31) and widget-host-avoid-browser (17) pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsT2PtLuBKwgaaBU5pheG8

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 00:11:04 -07:00
CatoandClaude Opus 5.5 e727405020 fix(sites): new sites skip ports in use; private sites' deploys are actually gated on CI (#948)
Found by the untouched end-to-end test (probe-loop2):

1. Registration took the next port after the register's highest. annushka's
   enquiry API has held 4030 for days with no register row, so the new site
   got 4030, crash-looped on EADDRINUSE and every deploy rolled back. Ports
   something already listens on (ss -Htln on the box) are now skipped, and
   the skip is said out loud.

2. selfhost-deploy's CI gate reads the commit's workflow runs with the job
   token. The org default token is read-only on contents, and a private
   repo's Actions runs are not public, so the call was refused on EVERY
   private deploy and read as "API unreachable — passing open": no private
   site was ever gated on CI (farmhouse too). Both deploy.yml templates now
   grant actions: read; a shim without it is rewritten on the next
   registration; the gate now says "NOT gated" with the fix instead of
   blaming the network.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 13:54:04 -07:00
CatoandClaude Opus 5.5 2cdc648145 fix(sites): a new private site's CI can ship it; registration clears every message it wrote (#946)
* 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>
2026-09-26 13:20:39 -07:00
CatoandClaude Opus 5.5 0ac9990603 fix(chat): a reader's own Groq key is not held to the free-tier minute window (#945)
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>
2026-09-26 13:19:57 -07:00
CatoandClaude Opus 5.5 5c5d201426 feat(deploy): every site deploy looks at the page on a phone before and after, and rolls back if it got worse (#943)
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>
2026-09-26 12:50:55 -07:00
CatoandClaude Opus 5.5 3829e63cb9 chore(register): retire aoz-demo — the AOZ demo moves back onto aoz.orangecat.ch (#941)
George's decision 2026-09-26, relayed by the aoz session: no separate demo
instance. Removes the apps.conf row (port 4028, db aoz_demo) and its nightly
reset-demo cron. aoz-wohnen is unchanged. The box teardown (unit, timer,
Caddy vhost, database, /opt/aoz-demo) is done from the aoz session once this
is merged, so sync-infra cannot re-create it. test-demo-instance.sh keeps its
guard that no non-demo app carries the reset route; zero demos is now valid.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 12:37:44 -07:00
CatoandClaude Opus 5.5 e750315f0f fix(crons): the feedback check runs every 15 minutes, as its own comment said (#940)
* fix(crons): the feedback check runs every 15 minutes, as its own comment said

check-feedback-needs-you is where Loki merges a finished fix that nothing else
merges (and retries a stuck queue). Its route has always said "every 15 min",
but the timer fired hourly, so a green owner fix could sit up to an hour
(Farmhouse#2 waited 11 minutes for :05). GitHub reads only, no AI; its
Telegram alerts already back off, so a tighter tick sends no more messages.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* style: format telemetry-paths

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 12:16:22 -07:00
CatoandClaude Opus 5.5 4c9b13aa65 fix: a Claude dialog no longer holds runner updates; repeating an owner note retries it (#939)
* 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>
2026-09-26 04:47:36 -07:00
CatoandClaude Opus 5.5 3af2fec589 fix: what the Farmhouse end-to-end test broke — Live link, stuck Claude dialog, owner wording (#938)
* 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>
2026-09-26 04:27:44 -07:00
CatoandClaude Opus 5.5 61d585557b feat: say what to change on your own site, and it gets built (#937)
* 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>
2026-09-26 03:53:05 -07:00
CatoandClaude Opus 5.5 1a3e087700 chore(crons): substrata data-quality run every six hours at :41 (#936)
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 00:36:06 -07:00
CatoandClaude Opus 5.5 8e1e70cf05 fix: quiet runs stop claiming "working"; /loki Back returns to the open conversation (#935)
* 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>
2026-09-26 00:22:45 -07:00
CatoandClaude Opus 5.5 cf0dc57d42 fix(infra): registration sets HETZNER_IP on the repo so private projects can deploy (#933)
Free-plan orgs expose org variables to public repos only; Loki provisions
private by default, so Farmhouse's Deploy failed with no box address.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 23:16:32 -07:00
CatoandClaude Opus 5.5 77b474f5df fix(feedback): a deploy_failed fix heals once a later deploy of main ships it (#932)
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>
2026-09-25 23:16:30 -07:00
CatoandClaude Opus 5.5 f34c15cd62 fix(infra): aoz-demo serves at aoz-demo.orangecat.ch, which resolves (#931)
demo.aoz.orangecat.ch did not: *.orangecat.ch covers one label only, and
aoz.orangecat.ch is its own DNS node, so the deploy's final check failed
with "does not resolve — DNS gap". Checked against 1.1.1.1:
aoz-demo.orangecat.ch -> 167.233.22.31, demo.aoz.orangecat.ch -> nothing.
Only the domain field changes.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 22:53:44 -07:00
CatoandCato 97200d1d4f chore(register): add farmhouse (4029) (#927)
Co-authored-by: Cato <catomean@users.noreply.github.com>
2026-09-25 18:57:16 -07:00
CatoandClaude Opus 5.5 1f1323d8b1 fix(loki): answer instead of asking which project when there are none (#925)
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>
2026-09-25 10:30:13 -07:00
CatoandClaude Opus 5.5 989cd865b8 fix(status): registering a site keeps the owner's next step; Today's running agrees with Control (#924)
- 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>
2026-09-25 10:25:24 -07:00