Commit Graph
56 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 715ed7a3d9 docs(architecture): builders and booking — anyone can build here, without org peering (#880)
The studio is at capacity; builders should still be able to join, be booked and
work on one project. Records where each part lives (Loki / OrangeCat / the site
as a door), the slices in order, the decisions taken, and the trap: org
membership grants visibility AND dispatch over every peer's projects
(getOrgProjects feeds control, inject and orchestration), so a booked builder
is a project editor (#872), never an org peer.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 14:06:25 -07:00
CatoandClaude Opus 5.5 6ee4cbb858 feat(widget): Chat mode — a chat the Cat and Loki both live in (#879)
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>
2026-09-24 13:58:52 -07:00
Cato fcd38cb463 fix(loki): clarify terminal and retire stale guidance (#866) 2026-09-23 07:58:21 -07:00
CatoandClaude Opus 5 ffe1c02580 Copy and docs that said things the code does not do (#844)
* fix(copy): six places the UI told the operator something untrue

Each was re-confirmed against current main before touching it — several were
found two days and ~40 PRs ago and could have been fixed or moved since.

- /download understated every artifact by 25-35%: "~80 MB" for a .deb that is
  100 MB, "~98" for a 124 MB .dmg, "~81" for a 109 MB .exe. The numbers are
  retyped by hand each release and had drifted silently.

  Dropped rather than corrected. Re-typing them fixes today and guarantees they
  are wrong again at the next release — the same rot as the 0.8.19 pin in
  desktop/README and the Whisper model sizes. A live check would need network
  in the unit suite, which is offline-only here (desktop-release-drift shells
  out to git, not HTTP), and a network dependency inside verify is its own
  hazard. The notes keep what is stable: package manager, Apple Silicon, x64.

- "Launch Claude Code" launched whatever agent was selected. BootstrapModal
  POSTs `agent: agentId` (claude/codex/gemini/grok/cursor), so choosing Codex
  ran Codex under a button naming Claude. DoneStep now takes the real label.

- "Settings → Agent tokens" linked to /settings with no fragment and landed on
  Profile. SettingsTabs names #agent as the intended anchor and its own comment
  calls the fragment-less case "a silent dead-end in the new-user funnel".

- Appearance claimed another device "starts on Auto again". ThemeProvider sets
  defaultTheme="dark".

- Privacy omitted Crew from the PIN-gated list — it lives under (private)/ and
  every /api/crew/* route calls requirePrivateApiAccess — and described the TTL
  as "30 minutes of activity" when private-zone-token stamps it once at verify.

- ecosystem.studioUrl pointed at /studio, which 404s, and loki-core.ts injects
  that string into Loki's grounding preface: the assistant was telling
  operators to go to a dead page. /create is the verified surface.

Also: profileUrl pointed at /profile/mao-nakamoto — the retired pseudonym, in
a URL, rendered on the PUBLIC /support page under a card titled "Cato", with a
config key literally named `mao`. The key is now `cato`.

The URL is NOT a guess: every /profile/* path on orangecat.ch redirects to
login, and OrangeCat's own source carries no owner-username constant, so the
real handle is unverifiable from here. It points at the verified OrangeCat home
with a comment to repoint it once the handle is known — swapping a wrong name
for a broken link would not be an improvement.

Worth noting: test-no-retired-name.sh matches the spaced form, so the slug
`mao-nakamoto` passed every previous sweep. Widening it is a separate change.

verify: exit 0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: five documents that would send an agent the wrong way

Docs an agent reads before acting, each contradicting the code it describes.
Every claim re-checked against current main first.

connection-presence.md — the dangerous one. Step 6 "Cutover" instructs:
"drop the heartbeat setInterval in the runner and the heartbeat branch in the
web online check. Presence is purely connection-based."

The shipped rule is the OPPOSITE and deliberately so. applyHeartbeatExpiry()
in src/lib/builder-presence.ts requires connection AND a fresh heartbeat,
because a connection lost to a DB blip — or a half-open socket the bridge never
sees close — pins connected=true until the bridge restarts, and Control then
asserted "this computer online" for a laptop shut for days. An agent executing
step 6 would delete the expiry and bring that back.

Struck through rather than deleted, with the reasoning, so the decision stays
legible: the plan was sound, reality disagreed, the code won. The same table
claimed the heartbeat pusher timer was "removed"; desktop/src/main/pusher.ts:369
still runs it.

self-improvement-plan.md — its load-bearing premise is false. "prompt_history
has no runId" and "Phase 0 (the runId FK) is DEFERRED … add the column when
Phase 3 revives". The column and its index shipped:
src/db/schema/prompt-history.ts:34,42. An agent picking this up would re-add an
existing column. Superseded note plus two strike-throughs.

master-plan-2026-07.md and AUDIT_REPORT_2026-07-13.md — both still name Stripe
as the revenue rail and file CONFIRMED-HIGH bugs against stripe/webhook routes.
Stripe went in #508: no src/app/api/stripe/, no stripe dependency. Bannered
rather than rewritten — a dated plan that was right when written is worth
reading; what it needs is a header naming which premises died.

debt-reduction-roadmap.md — linked from README as current, describes the
retired beacon popup as live architecture across ~11 sections, and had 35 file
links hardcoded as /home/g/dev/loki/... — absolute paths into one machine's
home directory, broken for every other reader of a public repo. Bannered; all
35 rewritten repo-relative.

branding-design.md — what an agent reads before touching UI, and four of its
anchors pointed at things that do not exist: desktop/src/renderer/ (deleted in
v0.7.4; HANDOFF.md says "DO NOT bring it back"), SidebarBrand.tsx, and the
mark's SSOT, which moved to src/config/brand-mark.ts. Also "the 1845-line
globals.css", which is 6073 — the count is dropped rather than corrected,
because a number retyped into prose rots by definition.

verify: exit 0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 08:17:02 -07:00
Cato 8034cb629b feat(feedback): add reporter tracking and project editors (#754) 2026-09-16 22:21:59 -07:00
Cato 13243a6bf6 feat(feedback): Watch progress, honest offline Queued, widget Loki modes seam (#734)
Captain Feedback no longer parks Substrata (and peers) under “moving on its
own” while the cloud builder is offline. Builder offline → Needs you with a
dig-in reason + Telegram path; one auto-retry cold-start before escalate.

Watch on the row shows a short run-ledger step (not a PTY wall), with dig-in
event trail and Terminal (source=cloud) once a session exists.

Widget panel is Loki-on-the-site: Report/Chat/Watch mode strip
(widget/surface-modes.ts). Report ships; Chat/Watch are progressive seams
via data-fc-modes.
2026-09-15 14:43:01 -07:00
CatoandClaude Opus 5 baa8e2e6fb chore(aoz): follow bitbaum/aoz-housing -> bitbaum/aoz-begleitung (#732)
The repo was renamed today. It was the last place the product was still called
Housing: the name row in fleet's registers/retired.json retired "AOZ Housing" as
the PRODUCT name on 2026-09-10, but the repo kept it, and the repo is public.

The deploy name `aoz-wohnen` is deliberately NOT renamed with it. It is an
infrastructure identifier — systemd unit, /opt path, database — nothing on the
box keys on the repo name, and moving it would touch a live site for no visible
gain. apps.conf's comment block already said as much and still does.

The load-bearing change is apps.conf's fourth field. repo-metadata-audit.mjs
keys the register on that path's BASENAME, so while it read /home/g/dev/
aoz-housing the join against GitHub missed and every metadata check for this
repo was silently skipped — the audit went green by not looking at it. The local
checkout was moved to match and its three worktrees repaired (`git worktree
repair`), not pruned: they hold branches.

Two test failures worth keeping, because both were the rename telling the truth:

  - project-mention asserted that "the AOZ housing rebuild" resolves to the
    project. With the slug renamed it does not, and should not. The case exists
    to prove "a slug with a hyphen, typed with a space" matches, so the INPUT
    moved to the current name rather than the expectation being loosened.
  - tab-match asserted a terminal tab literally named "AOZ Housing" matches the
    slug. Same thing: the fixture now uses the name the tab would actually have.

Consequence worth naming: someone who types "aoz housing" at Loki will no longer
be understood. There is an alias mechanism for exactly this shape
(register/build.ts maps the deploy name to the repo), but wiring the retired
name into mention-matching is a product decision, not a rename chore.

Left alone on purpose: scripts/db/retire-stale-projects.ts, whose data row
records the project names the database actually held when that migration ran;
and content/thoughts/*.md, published essays — one of which quotes a filesystem
path observed during a debugging session, so rewriting it would falsify the
anecdote.

The production user_projects row was updated too (name and git_url), because the
database is a second copy of the repo identity and a past rename left 21 rows
pointing at a dead account. New URL proven to resolve: 431bae7.

Tests green: fleet-register 44, project-mention 28, tab-match 10, fleet-map 7,
loki-project-ranking all.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 12:17:25 -07:00
CatoandClaude Fable 5.1 95c40a9cd8 refactor: rename the product from FleetCrown to Loki (#695)
The product, its assistant, the repo, the host and every unit on the box now
share one name. 638 files, ~3,000 mentions: UI copy, config, env keys
(FLEETCROWN_* -> LOKI_*), systemd units (fleetcrown-* -> loki-*), docs,
articles, the deploy workflow other repos reuse, and nine file names.

- Three article slugs carried the old name and had been shared; permanent
  redirects keep those links alive (next.config.ts).
- test-no-retired-name.sh now also forbids the old product name across the
  whole repo, so the rename cannot creep back through templates and examples.
- ASSISTANT_STACK collapses the product and the assistant into one entry,
  because they are now the same name.

Infra was cut over ahead of this merge: /opt/loki, loki-* units, the `loki`
database and role, loki.orangecat.ch (old host 308s to it; /api, /widget,
/embed keep proxying), GitHub repos bitbaum/loki and bitbaum/loki-releases.
The Resend sending domain stays fleetcrown.orangecat.ch until the new domain
is verified in DNS.


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:13:10 -07:00
CatoandClaude Opus 5 f637036f17 feat(feedback): say WHY the agent is quiet, not just that it is (#679)
* feat(feedback): say WHY the agent is quiet, not just that it is

George dispatched a fix at 15:45:29. The first output arrived at 15:58:43 —
thirteen minutes later, and only because he opened a terminal by hand and
found the agent sitting at a Claude sign-in. The row said "the agent never
reported any output". True, useless, and the reason was ten seconds away.

Silence has two meanings and the operator can only act on one. "Thinking" is
nobody's problem; "waiting for a human" is theirs, right now. The runner could
already tell them apart — detectAuthFailure reads the transcript for a 401 or a
/login notice — but it only ever asked ONCE, inside an 8-second window at
inject time. That run passed the check and then went quiet, and nothing looked
again.

The heartbeat is the thing that watches the terminal for the whole run, so it
is where the question belongs. After 90 seconds of no output the runner asks,
and the answer rides the next beat; the route stamps payload.blocked and emits
one `blocked` event per stretch; the row reads "Needs you to sign in" with
Watch opening the terminal where you answer it. 90 s is chosen so the reason is
ready BEFORE the ten-minute mark forces the row to say something.

One subtlety worth the test that pins it: a blocked agent prints nothing, so
the "no output, no beat" rule would have suppressed exactly the beat carrying
the reason. Silence WITH a reason is now the message — still one beat per
window.

detectAuthFailure moved to desktop/src/main/agent-auth.ts: the poller starts the
heartbeat, so importing it back would have been a cycle.

163/163 unit files, lint, check:desktop, prettier green.

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

* chore(desktop): 0.8.23 — the runner says why a quiet agent is quiet

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-12 10:53:41 -07:00
CatoandClaude Opus 5 3a8f152cf4 fix(feedback): the auto-merge safety guard was decoration — an audit, and what it found (#669)
* fix(feedback): the safety guard was decoration, and four siblings of it

A first-principles audit of the loop, written as if the auto-merge had already
gone wrong. Five defects, none of them stylistic.

1. THE OWNERSHIP GUARD DID NOT EXIST. decideAutoShip takes fromOurDispatch and
   refuses when it is false; the single call site passed a hardcoded true. The
   pull request is resolved from PROSE the agent wrote, so a handoff that merely
   mentions a number ("same approach as PR #42") would have handed #42 to the
   merge call — and #42 can be a person's unrelated work. It is now established
   from GitHub's created_at: a run row exists before any agent touches the repo,
   so its pull request is always newer than the run. One minute of slack for
   clock skew; anything older belongs to a previous attempt or to someone else.

2. THE CACHE FOUGHT THE THING THAT FILLS IT. The refresher resolved the pull
   request preferring the reaper's evidence; the cache-validity check read only
   the handoff. A run whose evidence and handoff named different pull requests
   could never satisfy the check, so every inbox request re-fetched GitHub for
   that row, forever. resolveFixPrRef is now the one answer both ask for.

3. A PAUSE NOBODY COULD LIFT. One failed deploy pauses a project's automatic
   shipping. The scan counted resolved and archived rows, and a deploy_failed
   ledger is terminal — so the pause never ended and nothing in the product
   could end it. Only open rows count now: resolving IS the operator saying
   they handled it.

4. STARVATION DRESSED AS A RATE LIMIT. The inbox refreshes at most 8 ledgers
   per request and took them in list order — newest first. Everything past the
   eighth was never looked at again. Oldest-first makes the cap a rate limit;
   the count is logged rather than silently dropped.

5. THE SAME ROW BEHAVED DIFFERENTLY IN TWO PLACES. runnable was only on the
   cross-project inbox, so the project page offered Implement on a project with
   nowhere to work and answered with a 422 toast instead of "Connect a
   repository". Both lists carry it now.

And the gap the audit was really for: NOBODY WAS TOLD WHEN A FIX WENT LIVE, OR
WHEN A MERGED FIX FAILED TO DEPLOY. The loop announced a visitor filing and an
agent's run closing — and a run closes at a pull request, which is the exact
claim the ledger exists to stop making. That was survivable while a human
pressed merge. It is not survivable now that FleetCrown merges and deploys onto
a live site unattended: a failed deploy after an automatic merge is the worst
state this system can produce, and it was silent. notify-shipped.ts announces
both, on a ledger TRANSITION so each fix speaks once, naming whether FleetCrown
merged it.

Every rule that used to live in a loop is now a pure exported function with
tests — projectsPausedByBrokenDeploy, prOpenedByRun, fixCheckedAtMs,
resolveFixPrRef, shipAnnouncementFor — because today's lesson was that testing
the rule while the wiring goes untested is how a feature ships inert.

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

* docs(telegram): register the fix-shipped notifier

Every path that can reach the operator's phone owes a row saying what arrives,
when, and from where. The gate is right to refuse without it.

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

* fix(feedback): meet the alert gate where it looks, and stop two labels overstating

CI caught what I had not run: scripts/test/alert-registry.ts reads the alert
types a file raises by scanning it, and FAILS on a file it cannot read rather
than skipping one. A ternary at the call site made this file unreadable to it.
That is the right kind of gate — it refuses to pass vacuously — so the types
are literal `type:` fields now, and the branch reads better anyway because the
severity differs with the type.

Two labels also claimed more than they measured, the same class this whole
audit is about:

  "Report → fix" is stamped when the operator presses Confirm, so the number is
  dominated by how long they took to look, not by how fast the loop shipped. It
  says "Report → confirmed" now.

  FeedbackInbox's own docstring still described "Needs you / In progress /
  Shipped" grouped by DB status — the arrangement replaced precisely because
  status cannot answer the page's one question.

160/160 unit files, lint, prettier, tsc, design and both registry gates green.

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

* test(feedback): pin the ownership guard to the real merge and the real mistake

The best pin available for prOpenedByRun is production. On
dogfood-site-sep10-1201, run 1ff0be72 started 16:13:25 and its pull request #3
was opened at 16:15:37 — two minutes in, and it merged for real. The pull
request the parser wrongly named, #1, was opened at 10:21:48, six hours
earlier.

So the guard admits the merge that legitimately happened and rejects the exact
pull request that yesterday's bug resolved. It is a second, independent line of
defence against that failure: prose said #1, but #1 predates the run.

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-12 03:00:37 -07:00
CatoandClaude Opus 5 8cd138bd1a feat(feedback): ship fixes automatically, per project, opt in (#656)
An agent's job ends at a pull request, so until somebody merges it the
visitor's report is not fixed. This adds the switch that decides who presses
merge — per project, off by default, in the Feedback section beside the
widget's Pause.

NOT an auto-merge.yml in the customer's repo. That would be a commit in
someone else's repository, would need back-filling into repos FleetCrown
never provisioned (annushka's was made by hand), would need another commit to
turn off, and — the real objection — it merges ANY green pull request,
including one a person opened for something unrelated. FleetCrown already
watches the exact PR its own dispatch produced (the fix ledger), so it merges
that one and nothing else: the setting applies to PRs already open, and
leaves no trace in the repo when it goes back off.

auto_ship is nullable on purpose. NULL = never chosen, and the project shows
an invitation rather than a switch sitting in the off position looking like
somebody's decision. FALSE = chosen off; stop offering. Off is the effective
default either way, which is what keeps client sites safe: FleetCrown cannot
tell a client site from its own — that ledger lives in apps.conf on the box,
not in this database.

Conditions, pure and pinned in scripts/test/feedback-auto-ship.ts:
  - only a PR from FleetCrown's own dispatch;
  - never on an "unverified" ledger — that is the agent's claim, and it is
    the exact shape the org-restriction 403 produces;
  - not a draft, and GitHub must say mergeable (null means it is still
    computing, which is not permission);
  - every check passed, and NO CHECKS AT ALL IS A HOLD. The dogfood site's
    first agent PR had zero checks; absence of red is not evidence of green;
  - one failed deploy pauses the project, so a broken fix cannot have the
    next one land on top of it.

When it holds, the row says what it is waiting for — an operator who turned
the switch on should never have to wonder whether the feature works.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 08:35:34 -07:00
ebeeb8101d feat(loki): retrieve before answering — Loki could not see the fleet it is named for (#647)
George filed two reports through FleetCrown's own feedback widget, watched
nothing happen, and asked Loki "what was the most recent feedback sent".

  Not in your data.

Both rows were in site_feedback, filed minutes earlier. Four runs spawned from
them sat in `waiting`. Twenty-four runs had errored in three days. The answer
was nevertheless honest: Loki had been handed no records, so the sentence was
true of what it could see — which is worse than an error, because a truthful
negative reads as a checked one.

Three independent causes, each sufficient alone.

1. NO SOURCE READ THE TABLE. `grep -rn feedback src/lib/agent/` returned
   nothing. Nor did runs, agent sessions, alerts, or notes. Loki could see the
   "life" half of the product (people, projects, goals) and nothing of the
   fleet half the product is named after.

2. THE PROMPT BUDGET WAS ARITHMETICALLY IMPOSSIBLE. One module constant —
   Groq's 12000-token minute window x 0.8 / 3 rounds = 3200 — applied to every
   vendor. Groq has since cut the window to 8000, and the prompt's own fixed
   cost measures 2946 tokens (system prompt 1264 + native tool schema 977 +
   catalog), leaving ~254 tokens: one fact. With the operator's message it goes
   negative, the fit correctly returns zero, and production logged
   `[loki] round 1: 40 facts exceed the call budget — sending 0` on every turn
   and sent it anyway with an empty Records block.

3. THE RICHER SEED WAS ON THE FALLBACK PATH ONLY. buildGroundedTurn (approvals,
   knowledge, economy, cues) ran only inside askLokiViaGateway. The primary
   loop seeded people + projects. So the approval queue seeded in #262
   *specifically to survive losing the tool loop* was, on the path that
   normally ran, reachable only by the tool call the loop could not afford.

WHAT CHANGED

Retrieve first, then reason. A pure keyword planner (src/lib/agent/plan.ts)
reads the question and fetches the relevant sources in parallel BEFORE the
model is called; tools become depth, not basic retrieval. A tool loop needs a
healthy model and a fitting prompt before it can ask its first question, which
is exactly what is missing when this class fires. A regex is dumber than a
model and never rate-limited. This is how OrangeCat's Cat has always worked.

Eleven new fact adapters: feedback, runs, live agent sessions, alerts, notes,
plus a computed fleet pulse (runner state, runs waiting/errored, unread
feedback, pending approvals, today's AI budget) and a buildFleetBrief of
SQL-computed answers the model may only phrase. Six new tools over them.

Budgets follow the vendor: linkPromptBudgetTokens() sizes Groq from its minute
window and large-context vendors by usefulness; the prompt is sized against the
largest usable link and the walker SKIPS links it does not fit (a preflight,
not a refused round-trip). Env-tunable without a deploy. When overhead busts
every budget the loop now throws instead of sending an empty Records block.

Conversation history reaches the primary path, so continuity no longer appears
and disappears depending on which brain served the turn.

Provenance is rendered: model, what was read per source, tools used, elapsed
time, and the grounding verdict. The verdict was always computed and always
returned; the route dropped it on persist and the assistant never read it, so a
flagged answer looked exactly like a clean one — the failure the harness exists
to prevent, reintroduced at the last inch.

THE GATE (this is the third time this class has fired)

Every read tool's data must ALSO be reachable from the seed. Seed =
survivability, tool = depth, one adapter called by both.
scripts/test/loki-retrieval-plan.ts fails the build on a read tool with no seed
source, and on a seed source no question can reach. It caught a real orphan on
its first run: the OrangeCat economy feed, fetchable but unreachable.

Also fixed while here: propose_action reported a failed DB write as a
successfully queued draft; the repair pass accepted a repair that invented a
NEW unsupported claim if it had fewer total; assignee matching used a bare
substring (the dr-UZH-nikov pattern on the write side); pageContext over 2000
chars 400'd the whole request instead of being clamped; the native tool schema
repeated each full description, paying for the same prose twice.

Docs: docs/architecture/loki-answering.md.
Tests: 4 files, 63 checks, all env-independent.


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

Co-authored-by: Cato <georgy.butaev@revamp-it.ch>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 06:31:48 -07:00
CatoandClaude Opus 5 81d86a2869 feat(feedback): a fix ledger, and a page grouped by who is blocked (#639)
* feat(feedback): a fix ledger — where the change actually is, instead of a Check live that lies

"Check live" appeared the moment a run closed with success, and it opened
whatever URL the visitor had reported. Both halves were wrong.

The agent's job ends at a pull request (SHIP_INSTRUCTION says so). At close
the change is a PR nobody merged, on a site nobody redeployed — so "check
live" showed the unchanged page. And the reported URL is where the visitor
happened to be: a preview host, a stale domain, or in one of my own test
rows a .example fixture that resolves to nothing.

The fix ledger (src/lib/feedback/fix-shipping.ts) answers one question —
where is this change on its way to the live product? It reads the PR the
agent named in its handoff (or the reaper's evidence), asks GitHub with the
user's own token, and caches the answer on the run (payload.fix), refreshing
at most once a minute while the state can still change and never once it is
terminal. States: nothing shipped · pushed, no PR · PR #N open · closed ·
merged · deploying · deploy failed · Live.

The row now says which of those it is, shows the agent's own one-line
account, and offers the button that matches: Review PR while it is open,
Check live only once a deploy-like workflow succeeded on the merge commit,
Retry when nothing shipped. Check live opens the PROJECT's live URL plus the
reported path, never the visitor's host. Confirm resolves; the undo arrow
reopens it as "not fixed".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017FU2m6NxPYYFkEdyufcSrX

* refactor(feedback): group by who is blocked, and open with the loop's numbers

The page asks one question — is anything waiting on me? — and answered it
with DB status, which cannot. `dispatched` covers an agent mid-run AND a fix
that merged and deployed an hour ago, so the row that needed a person sat
under "In progress" next to the one that didn't, and "Stalled" (a person's
problem, Retry) was filed as progress.

work.waitingOn is now the SSOT: you / machine / nobody, derived in ONE place
from the phase and the fix ledger, so a new phase cannot land in the wrong
column. Sections become Needs you / Under way ("moving on its own — nothing
to do") / Shipped, and the poll runs while anything is machine-side, which
now includes a PR waiting to auto-merge.

The page also opened with a blank column above three rows. It is the
ironing-out loop, so it now leads with the loop: reports, shipped, median
report→fix — the metrics the inbox route already computed and only ever
showed as a footnote on one section heading. Fifth caller of StatRow/StatCard;
no new CSS.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017FU2m6NxPYYFkEdyufcSrX

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 05:00:30 -07:00
CatoandClaude Fable 5.1 b7b26df120 feat(feedback): the row shows the work happening — runner heartbeat, Working · N min, Watch into the terminal (#632)
* feat(feedback): the row shows the work happening — runner heartbeat, Working · N min, Watch into the terminal

Between 'submitted' and 'closed' a run wrote nothing anywhere, so Feedback
read a busy agent as Queued and, from minute ten, as Not running. The box
runner owns the agent's PTY and sees every byte; it now beats
PATCH /api/control/runs/:id/progress (at most every 45 s, only when the PTY
printed) and the cloud stamps payload.lastProgressAt + a 'progress' event.

deriveFeedbackWork reads the heartbeat: fresh = 'Working · 47 min' for as
long as the run takes; gone quiet = 'Stalled' with how long it worked and
how long it has been silent; never any = 'Not running' after 10 min measured
from delivery. Every delivered phase is watchable, so the row's button is
'Watch' into /terminal?project=… whenever a PTY exists, and 'Open on
Control' only while Queued.

A project with no repository and no folder gets 'Connect a repository'
instead of Implement, and the dispatch route refuses the same case with a
422 that says what to do — the Annushka failure class, closed at the source.

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

* fix(control): Watch follows the same watchable rule as the Feedback row

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

* chore(desktop): 0.8.21 — Fleet Runner reports run progress while the agent prints

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

* docs(changelog): Fleet Runner 0.8.21 — run progress heartbeat

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

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 03:12:09 -07:00
CatoandClaude Fable 5.1 6e6ca0bc7a docs(cloud-primary): nothing left that describes the old substrate — docs, marketing, comments, focus_tab (#631)
* docs(cloud-primary): nothing left that describes the old substrate — docs, marketing, comments, focus_tab

The cloud-primary series (#615 routing, #618 OrangeCat auto-kickoff, #624
Fleet Runner 0.8.19, #630 web PTY-only) changed what the product IS. This
sweep makes every surface that describes it say so, so neither an agent
reading the repo nor a person reading the site is told about zellij tabs,
presence-based routing, a cold-start restore, or a handoff that "starts
nothing".

Inventory-driven (≈105 doc lines, ≈30 user-facing strings, ≈22 code
comments, 2 repo-level items), not a grep-and-replace:

User-facing
- /download prerequisites: the "Zellij — bundled" card is gone; copy says
  each agent runs in a terminal Fleet Runner owns.
- Quickstart, license page, executor copy (cloud is the default; "This
  computer" is a per-project choice under Runs on), marketing pillars,
  whitepaper (owned-PTY design, "where a project runs is a decision, not a
  guess", ZSH typing-guard section deleted), Control terminal panel strings
  (components renamed LiveTerminalPanel / LiveTerminalRows), peek drawer
  copy, GitHub release notes for 0.8.19, repo description + topics.

Agent-facing
- README, CLAUDE.md, AGENTS-adjacent SSOTs: cloud-local-workflows.md now
  states the stored routing rule; priority plan closes B6; multitenancy plan
  routes by builder_pref; HANDOFF.md staleness table + terminals section;
  the 2026-09-10 cold-start handoff gets a dated "superseded" section; the
  two shipped proposals (fleet-runner-pty-ownership, desktop-app) carry a
  status banner; home/README describes the eight modules that exist;
  desktop/README describes 0.8.19; roadmap seed marks the migration done;
  box-runner unit and log drop FLEETCROWN_RUNNER_PTY; 22 code comments.

Code (one coherent retirement)
- focus_tab is removed from the pending-command contract, the desktop
  validator and poller, enqueueTabCommand's type, the validator test and the
  failure classifier (START_SESSION | RETRY). The runner had rejected it
  since 0.8.19; now it cannot be enqueued at all.

Verified: tsc, eslint, 148/148 unit files, 130/130 home self-tests,
check:desktop (typecheck + build).

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

* chore(desktop): 0.8.20 — the focus_tab retirement touches desktop/, so it ships as a release

The release-drift gate is right: a desktop change without a bump goes red on
main once the next tag is minted. 0.8.19's changelog date is corrected to the
release's real publishedAt.

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

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 02:41:20 -07:00
CatoandClaude Fable 5.1 d6ac2544d4 feat(orangecat): "Build it with FleetCrown" builds — the intent lands on a running kickoff (#618)
The button on an OrangeCat profile promised a build and delivered a form. The
handoff page consumed the signed intent, created a project, and stopped:
"Nothing starts running." Everything that turns a brief into a repo, a deploy
and an agent — planKickoff's four steps behind "Make it happen" — waited for a
second click on a page the person had not asked to visit.

Now arrival is the click. `decideHandoffMode` (pure, tested) says what the
page does: build by default, review when asked (`?review=1`), review when a
same-named project exists (only a person can say whether "Bitbaum" and
"Bitbaum" are one thing), open when the entity is already connected. In build
mode the page consumes the intent on mount, creates the project, and redirects
to it with `?kickoff=auto`; the project page hands that to ProjectKickoff,
which runs the very same run() the button runs — no second orchestrator. A
brief too thin to extract from stays put with the same hint the button shows;
a failed auto-create degrades to the picker with the error visible.

Linking an EXISTING project never auto-starts: linking is not consent to start
work on it. Funding events still never dispatch.

Page copy tells the truth in both modes; the fund-to-build architecture doc
no longer lists automatic dispatch as roadmap.

Verified: pnpm run verify green (tsc, lint, design, desktop, 145/145 unit
files incl. the new scripts/test/orangecat-handoff-mode.ts, ops).


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 00:35:32 -07:00
CatoandClaude Fable 5.1 fed8298080 feat(orangecat): the handoff now says who the client is, and fills the brief (#570)
A build handoff from OrangeCat created a project with a name, a description
and three canned lines — no owner, no origin URL, no next step — so the agent
dossier briefed builders with blanks, and a page set up for someone else
(ADR-0005 on the OrangeCat side) arrived without the one fact a builder asks
first: who is this for, and who do I talk to?

The intent payload now carries an optional `owner` block (kind, display name,
OrangeCat page, and the steward answering for an unclaimed page). It is
written into the project notes as a client block and into the profile —
owner, url, customers, status, next_step — deterministically, with a
best-effort Groq pass over the description for mission/customers/problem/
solution behind it (onlyMissing, so an owner's own words are never replaced).
Older tokens without `owner` behave exactly as before; a pure test pins both.


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 12:46:18 -07:00
6b653c36d6 docs: sync docs with actual stack (#487)
The repo moved to pnpm 11.25.0 (packageManager, pnpm-lock.yaml, CI and
deploy all pnpm) but 17 docs still taught npm commands. Sync every
current-instruction command to pnpm (`npm run` → `pnpm run`,
`npm install` → `pnpm install`, `npx tsx` → `pnpm exec tsx`, and
`db:apply-box -- <file>` loses the `--` separator under pnpm).

Deliberately kept: npm inside desktop/ (own package-lock.json, installed
via `npm ci` in desktop-release.yml and check-desktop.sh — excluded from
the pnpm workspace); `npm i -g openclaw` (box-global install); dated
historical audit/log entries that record runs made under npm.

Also in docs/infrastructure/self-host-cd.md: the pipeline diagram said
`npm ci` where selfhost-deploy.yml detects npm/pnpm per lockfile, and the
`node-version` fallback is 24 (doc said default 20); documented the
`package-manager` override input.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-04 14:47:12 +00:00
GandMao Nakamoto c41c1809e2 feat(widget): speak your feedback — plus the signals, escaping and docs that were lying (#462)
* fix(email): escape visitor text before it reaches an email body

feedbackShippedTemplate interpolated `excerpt` and `page` raw. Both are
visitor-authored — excerpt is the free-prose suggestion typed into the
widget on a customer's site, page is location.pathname read off that
site — and the resulting HTML is mailed from our own domain to an
address the same visitor supplied.

operatorMailTemplate, four lines below, escaped correctly with an inline
replace-chain. That is the tell: escaping was something each template had
to remember separately, and this one forgot. rss.xml had a third copy of
the same chain.

So the escape is now a named helper both callers share, covering the five
XML predefined entities (the two extra quote forms make it safe in an
attribute as well as a text node, so no caller has to pick a variant).

Also makes the templates importable without a database. logSend's
debug-logs import opened a DB client at module load, which every pure
template in the file inherited — the reason none of them had tests. It is
deferred into the function now; sending logs exactly as before.

Proven by mutation: reverting the escape turns exactly the three
injection assertions red, not the whole file.

* fix(feedback): stop a failed request from answering "nothing needs you"

Three surfaces read an empty array as an empty queue. An empty array is
also what a failed fetch leaves behind, so a 500 or a timeout rendered as
the confident answer "there is nothing here" — on the exact screens an
operator checks to be sure nothing is waiting.

- ControlInbox returned null when total === 0, so both fetches failing
  produced total silence. It now stays quiet while requests are still in
  flight (a failure that resolves fast should not flash), and once they
  settle with nothing, says which of the two happened. When one list
  loads and the other does not, the count renders with a note that it
  may be low rather than presenting a partial total as complete.

- FeedbackInbox dropped `error` from useFetch entirely and fell through
  to "No feedback yet". The load error is now aliased `loadError` —
  `error` was already the mutation error from useFeedbackActions, and
  that collision is how the load error came to be dropped.

- ProjectFeedbackSection treated a failed token GET as "no token", which
  offered "Enable & install" for a widget that may already be live on the
  customer's site. Not knowing is now its own state.

Every new branch is reachable only when a request actually failed; the
genuine empty states are untouched.

* feat(widget): let visitors speak their feedback instead of typing it

Typing a bug report on a phone, on someone else's site, is where most
reports die. The widget now offers a mic: record, the clip is transcribed,
and the text lands in the same textarea appended to whatever was already
typed. The visitor still presses Send — speech-to-text mishears things,
and a mic that auto-sent would file those mistakes under their name.

FleetCrown already had working transcription (terminal, Loki composer,
command palette) but the widget never got it. Two things were missing:

- CORS. /api/beacon/transcribe is public but answers no preflight and
  sets no ACAO, so a cross-origin caller can never read the response.
- Authorization. That route takes no token — it is guarded only by a
  per-IP limiter. Opening it cross-origin would have made it an
  anonymous endpoint that spends our Groq quota for anyone with the URL.

So this adds /api/widget/transcribe rather than widening the beacon
route: same fcw_* token that already authorizes ingest, same per-token
origin allowlist, per-IP and per-token rate limits, and Groq only — the
local-Whisper fallback spawns ffmpeg + python3 on the host, which is not
something to expose to anonymous traffic. The Groq step itself moved to
lib/transcribe.ts so both routes share one implementation instead of
growing two copies of the error mapping.

Also in the widget, from the same audit:
- Recording stops and the mic is released when the panel closes, so the
  browser's recording indicator never outlives the panel on a host site.
- Sub-44px touch targets (the 18px remove-image dot, attach button) get
  a coarse-pointer hit area without changing how they look.
- The pulsing record dot honours prefers-reduced-motion.

Progressive enhancement throughout: no MediaRecorder, or an insecure
origin where getUserMedia is undefined, renders no button at all rather
than a control that cannot work. Bundle 16.3KB -> 20.8KB.

/api/widget is classified "spend" in the demo sandbox — the repo's own
gate caught that omission before this commit existed.

* docs(claude): correct the claims that were sending agents the wrong way

CLAUDE.md is loaded into every agent session, so a false line in it is not
a stale doc — it is an instruction. Each of these was verified against the
code in both directions before editing.

- Session helpers. It named `getCurrentUserId()` and `DEFAULT_USER_ID`;
  neither has existed since 98e88b65. Zero hits in src/. The real API is
  `getApiUserId()` (routes) and `requirePageUserId()` (pages), 64 files.

- The executor model. It said home/ runs on the user's machine "not the
  hosted box", and that Fleet Runner desktop is the "sole" local executor.
  scripts/box-runner.ts is a systemd service ON the box that imports the
  same startWatcher, added in b62e3aeb to delete the laptop dependency,
  and is the DEFAULT per this repo's own SSOT. A third executor,
  scripts/hosted-runner.ts, also exists. Neither was mentioned. An agent
  reading the old text would reason about the wrong machine.

- Husky hooks. Documented as pre-commit tsc+eslint / pre-push test:home.
  Actually pre-commit is eslint on staged files with no tsc, and pre-push
  runs the whole `npm run verify` bundle plus smoke and prod dogfood. The
  practical consequence — pre-push takes minutes — is now stated.

- Dark mode. "always dark mode (.dark on html)" is not true: ThemeProvider
  sets defaultTheme="dark" and a ThemeToggle ships in 8 places. Light is a
  real state, so the old advice to lean on text-white/* would break it.

- Six named components do not exist (ProjectTile, AutopilotCard, PromptRow,
  FeaturedCard, CategoryBar) or survive only as type names
  (ProjectGrid/ProjectDetail). Replaced with what is actually on disk.

- /feedback had no row in the Views table and widget/ had no entry at all,
  despite being a top-level nav surface and the only code strangers on
  other people's sites execute.

Also closes the gap that let widget/ drift unnoticed: `npm run lint` now
covers it alongside src/ and home/. It passes clean today, so this costs
nothing and stops the next regression rather than documenting it.

* docs: delete the agent CLI registry spec

Three independent reasons, any one sufficient:

1. It contains a slur — "A new engineer (or the 'retard' user)" — in a
   public repo. That alone is not something to leave sitting in docs/.

2. Every script it analyses is gone: scripts/cockpit-daemon.sh,
   agent-hook-lib.sh, agent-hook-bridge.sh, and the _agent_definitions.sh
   it proposes creating. Its "high duplication areas" list describes a
   codebase that no longer exists.

3. Its central decision is now false. It names src/lib/agent-registry.ts
   the "Primary SSOT"; that file's own header says it is a compatibility
   shim over src/lib/agents/, kept only for back-compat, and that new code
   should import from @/lib/agents directly. An agent following this spec
   would extend the shim it is supposed to be migrating off.

The refactor this document proposed did happen — differently and better
(per-agent adapter modules, ~300 lines removed). The plan that lost is
not worth keeping as a description of the system that won.

README's link to it goes too, so the docs index has no dead entry.

* docs(widget): stop the architecture note describing a system that moved on

Corrections, each verified against code:

- It said "No rate limiter exists in FleetCrown yet — port revampit's".
  src/lib/rate-limit.ts exists, is owned by the shared limitkit package,
  and is already imported by the ingest route the same document describes.
  Left alone, that bullet is an instruction to write a second one — the
  precise mechanism by which this fleet accumulated 14 rate limiters.

- The API table listed 5 routes and omitted GET /api/widget-boot, which is
  the render gate, the remote kill switch, and the heartbeat behind the
  "Live" badge — i.e. most of what the surrounding prose sells. Added,
  along with the new /api/widget/transcribe pair.

- It claimed /widget.js is "immutable-cached with a version query". There
  is no version query and no cache rule for it; next.config.ts sets those
  for /sw.js only. The "upgrades ship centrally" story rested on caching
  behaviour nobody configured.

- Screenshot capture, the submitter email loop and auto-triage drafts were
  all listed under "Later (not now, YAGNI)" and "not in v1" while being
  shipped and documented elsewhere in the same file.

---------

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
2026-09-02 09:27:19 -07:00
4d1c9f1fe7 chore: migrate the fleet to the bitbaum org (#415)
* chore(ci): GitHub owner catomean -> bitbaum

* docs(hetzner): update _box-env.sh comments for the completed org migration

The GH_OWNER/WORKFLOW_OWNER comments described a future state (repos moving
to bitbaum while fleetcrown stayed personal) that sweep-gh-owner.sh just
made true, then obsolete: fleetcrown itself is in bitbaum now too. Comments
describing a plan that already happened are worse than no comment — they
send the next reader looking for a divergence that isn't there.

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

* chore(desktop): release 0.8.15 — the org-migration owner literals

Same shape as 0.8.14: desktop/ carries two literal owner references (issue
link, updater feed owner) that a fleet-wide rename touches, and
desktop-release-drift.ts correctly refuses to let that ship without a
version bump — a repo whose desktop app silently points at a dead update
feed is worse than one that fails the gate.

This should be the last time it's an account name: the org is the stable
home from here.

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

---------

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 07:45:50 +02:00
45938e60cf fix(ci): unbreak the gates — dependency graph, agent-core drift, desktop release (#400)
* refactor(infra): studio constants get one home, and the rename gets a command

Fair criticism: I spent the day arguing for SSOT and then wrote new-site.sh with
its own copies of GH_OWNER, BASE_DOMAIN and DEV_ROOT, and hardcoded
'maonakamoto' again in provision-widget.ts. Worse, the pattern already existed —
_box-env.sh is literally labelled 'SSOT' for the box address. I did not extend
it, I duplicated around it.

_box-env.sh now owns GH_OWNER, SITES_BASE_DOMAIN and DEV_ROOT alongside the box
address, and new-site.sh and provision-widget.ts read them instead of carrying
their own.

The 41 workflow files are a different case and worth being precise about:
GitHub Actions requires a LITERAL owner/repo in  and will not accept a
variable, so that duplication cannot be removed. But a duplication you cannot
remove is one you have to OWN — leaving it as 'remember to edit 41 files' is
exactly the shape of step that gets skipped, the same shape as the git
repository Camille never got. So sweep-gh-owner.sh is committed: one command,
dry-runnable, optionally self-committing.

Dry run against the fleet: 24 repos, all detected correctly. Renaming to an org
is now  plus one line in _box-env.sh.

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

* fix(infra): split WORKFLOW_OWNER from GH_OWNER before they diverge

Same bug as the last commit, one layer down. The site template hardcoded
maonakamoto/fleetcrown in its deploy.yml uses: line, derived from nothing — so
every new site would bake in a literal that follows neither an account rename
nor a move to an org.

And GH_OWNER was quietly doing two jobs: where new site repos are CREATED, and
where fleetcrown LIVES. They look identical today and are about to diverge —
sites go to an org while fleetcrown stays on the personal account. One name for
two values is how a rename half-works.

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

* chore(ci): GitHub owner maonakamoto -> catomean

* chore(infra): owner is catomean

Account renamed maonakamoto -> catomean. sweep-gh-owner.sh swept 24 repos and
the SSOT now agrees; 32 local remotes repointed. This is the commit the sweep
script exists for.

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

* chore(ci): GitHub owner maonakamoto -> catomean

* chore(ci): GitHub owner maonakamoto -> catomean

* fix(desktop): cut 0.8.14 — the owner rename touched desktop code

My owner sweep changed two files in desktop/ (an update URL and a package
reference) without bumping the version. That is precisely the failure #370
existed to prevent: desktop code that changes without a release ships to the
server and to no machine at all, silently.

The gate caught it, four commits after it was written. Working as intended, and
worth saying plainly — I was the one it caught.

GitHub redirects repository URLs after a rename, but only until somebody claims
the freed name. An auto-updater should not depend on a redirect.

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

* fix(ci): the gate fails on your diff, not on your laptop

Three things in this hook blocked pushes for reasons unrelated to the change
being pushed, and together they are why --no-verify became reflex here. I passed
it eight times in one day and blamed the hook; the hook was reporting real
problems with misleading attribution.

1. STALE INSTALL. An unresolvable dependency surfaced as 'Cannot find module' —
   indistinguishable from a type error in your code. Now a precondition that
   fails first, loudly, naming npm ci. A day was spent on this exact confusion.

2. AGENT-CORE DRIFT. Drift arises either because you changed canonical without
   syncing, or because somebody changed the mirror in the other repo. Only the
   first is yours. It now checks whether this branch touched
   src/lib/agent/core/ and warns instead of blocking when it did not.

3. SCHEMA DRIFT. The guard already skipped an unreachable database but not a
   reachable stale one, so a local scratch DB missing someone else's columns
   blocked pushes touching no schema. Now scoped: if the branch changes schema a
   mismatch is yours and blocks; otherwise it reports and continues.

The pattern is taken from desktop-release-drift, which self-scopes to files
changed since the last release and is the only check here that has never blocked
an unrelated push. It caught me correctly today, four commits after it was
written.

Where scope cannot be established the checks still fail closed — a gate that
cannot establish innocence should not grant it.

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

* fix(ci): resolve the default branch, never assume main

The diff-scoping added in the previous commit compares against origin/main. 28
repos here use main — but aoz-housing, dotfiles and sbb-lost-found use master,
and six had no origin/HEAD set at all.

On those, merge-base fails, the scoping falls through to 'cannot tell', and
every check treats every change as in-scope. The gate I had just fixed would
have gone back to blocking unrelated pushes on a fifth of the fleet, for a
reason nobody would have connected to a branch name.

default_branch() now lives in lib.sh and resolves in order: the remote's own
origin/HEAD, then whichever of main/master exists, then fail. Never a guess. The
pre-push hook and agent-core-drift both use it.

Also ran 'origin/HEAD' is unchanged and points to 'main' on the six repos missing origin/HEAD.
32 of 33 now resolve; wild-spirit has no remote at all, which is a separate
finding and the same shape as camille this morning.

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

* feat(scaffold): every new site is born with CI

ci-gate.sh cannot tell 'CI green' from 'no CI configured' — both exit 0. So a
scaffolded site without a workflow deployed every push unverified while looking
identical to one that passed. Substrata shipped to production that way for a day.

The template now emits ci.yml alongside deploy.yml: npm ci, type-check, lint,
build — the same bundle verify runs locally.

Plus eslint.config.mjs, because ESLint 9 without a flat config exits non-zero on
a migration notice and a new site's FIRST CI run would be red for reasons
unrelated to its code. A red first run teaches people to ignore the light.
Config copied from the fleet's working Next 16 apps, not invented.

postcss.config.mjs assigns before exporting — the anonymous default export is a
lint warning, and a scaffold should not emit its own warnings.

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

* feat(ci): no deployed app ships without CI, ratcheted to zero

ci-gate.sh exits 0 for 'CI green' AND for 'no CI configured'. Absence is
indistinguishable from success, so an app with no workflow deploys every push
unverified while looking exactly like one that passed. Nothing reported it,
because nothing was looking.

The audit found two: camille-boulangerie, and sink — which is sinktattoo.com, a
real client's site.

sink turned out to be a FALSE POSITIVE, and that is the more useful finding:
apps.conf pointed at /home/g/dev/s-ink, a path that does not exist, so the gate
reasoned about an absent repository and reported the wrong fault. It sent me to
add a workflow to a repo that already had one. The register was the bug.

So the gate now distinguishes a stale register entry from a missing workflow and
fails loudly on the former — a gate that lies about what to fix is worse than no
gate. apps.conf repointed at /home/g/dev/aslan-tattoo.

Camille genuinely had none and now does. Baseline is 0: a new deployed app
without CI is a build failure.

Tested in all four directions — over baseline fails, at baseline passes, under
baseline passes and prompts, stale path fails. The first version could never
fail at all: it set HERE before sourcing lib.sh, which overwrites HERE, so
BASELINE_FILE pointed at a missing file and silently fell back to the current
count. Found by testing the gate rather than trusting it.

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

* feat(scaffold): template ships .nvmrc

Every new site now pins Node once, and both CI and the deploy read it. Without
it the deploy warns and the two pipelines pick a version independently — the
kind of difference that surfaces as 'green in CI, broken on the box'.

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

* feat(hetzner): scaffold sets the deploy key itself, from one configured path

new-site.sh printed `gh secret set ...` and called that operator hygiene.
What it actually produced was substrata live in production deploying only
from a laptop, because a printed instruction is a step that gets skipped.

The key is piped from DEPLOY_KEY_PATH straight into `gh secret set` — never
read into a variable, a log, or an agent's context — so the safety argument
that motivated the manual step is kept while the step disappears.

Per-repo on purpose: GitHub Free does not expose org-level secrets to PRIVATE
repositories, so an org secret alone would silently cover only part of the
fleet. DEPLOY_KEY_PATH joins the other constants in _box-env.sh so there is
one path, not one per script.

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

* fix(ci): make the deploy-ready gate judge the diff, not the workstation

The gate inspected the sibling checkouts under DEV_ROOT and nothing else.
All 15 are cloned on the workstation, so it printed "all 15 deployed apps
have CI"; CI clones this repo only, so the same commit printed fifteen
missing repos and exited 1 — red on a diff that touched none of them.

Third instance of one class: a gate judging state outside the commit. Its
real cost is not the red run, it is that everyone learns the gate is noise
and reaches for --no-verify.

Split into the two halves that were tangled:

  REGISTER INTEGRITY — apps.conf lives in this repo, so it is in the diff,
  so CI must judge it. Now actually checked: field count, unique names,
  unique numeric ports. Previously nothing validated the register at all.

  FLEET INSPECTION — needs the checkouts. Where none exist it is announced
  as NOT RUN and exits 0. Announced, because "no output" and "all clear"
  looking identical is the bug this file was written to fix. Where some
  exist, a bad path is still drift and still fails.

test:deploy-ready-gate locks it shut from both sides: a malformed register
must fail even with no checkouts present, and a bare environment must never
claim the fleet passed. Added to verify, so CI runs it in exactly the
environment that used to break it.

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

---------

Co-authored-by: Mao Nakamoto <georgy.butaev@revamp-it.ch>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: t <t@t.t>
2026-08-28 05:04:32 +00:00
daca983bbc fix(widget): don't let report exist when clicking it would do nothing (#356)
The stub is published synchronously by design, so a host can call report()
without knowing whether the widget finished booting. The cost of that: on
a page where the boot gate says inactive — token paused, FleetCrown
unreachable — `typeof window.FleetCrown.report === "function"` is still
true, forever. Nothing ever mounts, so a held report is never replayed.

A host reading that as "the widget is here" renders a Report button that
silently does nothing. Caught on live orangecat.ch, where the stub was
present but the panel had not mounted. That is the exact failure this API
was built to remove, reintroduced one layer up.

So publish readiness alongside the call: `ready` is false until the gate
has said active AND mount() has run. Hosts render a real link to their
feedback page and upgrade it in place only when ready — which also covers
the two cases a readiness check alone cannot, no JavaScript and widget.js
not yet executed. Documented as the recommended shape.

Verified headless: with the gate stubbed inactive the API exists and
`ready` stays false with nothing mounted; with it active `ready` flips
true on mount, and the prefill/diagnostics path still works unchanged.

Co-authored-by: t <t@t.t>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 17:01:02 +02:00
4bbca720f6 feat(widget): let a host page file a report the product already understands (#353)
The FAB assumes the visitor noticed something and went hunting for the
launcher. Errors are the opposite case: the product already knows what
broke, and making the visitor re-describe it in prose is both friction
and information loss — the error code, the action, the surface all get
thrown away and a human has to reconstruct them during triage.

So publish one host-callable entry point, window.FleetCrown.report():
a message that pre-fills the textarea (caret at the end, so the visitor
adds detail rather than facing an empty box) and flat key/value
diagnostics that stay OUT of the textarea and ride along at submit time.
No ingest change was needed — no column, no inbox renderer, no migration.

Three decisions worth the words:

- The stub is published SYNCHRONOUSLY, before the async boot gate
  resolves, so a caller never has to know whether the widget finished
  booting. Early calls are held (latest wins, so a double-click is one
  panel) and replayed on mount; if the gate says inactive they are
  dropped, because a queued submission could not land anyway.
- An already-open panel is left alone. The visitor may be mid-sentence.
- Diagnostics are budgeted BEFORE prose against the 2000-char ingest cap.
  A clipped sentence still reads; a clipped error code turns a
  self-routing report back into a human triage job, which is the whole
  thing this API exists to avoid.

That last rule is the only arithmetic on the path that can silently lose
information, so it lives in widget/report-payload.ts rather than inside
the DOM bundle, and scripts/test/widget-report-payload.ts pins it with
15 checks (including the case where diagnostics exceed the whole budget).

Verified: project tsc reports no errors in widget/; unit test green;
headless Chromium confirms one click opens the panel prefilled with
diagnostics attached, the POST body carries them, and a report fired
before the boot gate resolves is replayed correctly. No page errors.

Co-authored-by: t <t@t.t>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 14:38:37 +00:00
b72b3a4832 feat(feedback): the feedback product gets its own front door — /feedback inbox + new-feedback notifications (#335)
* feat(feedback): the feedback product gets its own front door — /feedback inbox + new-feedback notifications

SoC: Control stays operations, Projects stays the catalog; the ironing-out
loop (visitor reports, AI-review findings, briefs, and the live phase of each
fix) now lives at /feedback, in the Work nav with a NEW-count badge.

- notifyFeedbackReceived on the persist-first ingest choke point: web push +
  Telegram the moment a visitor files feedback (agent bursts and duplicate
  bumps stay silent) — the docs' 'optional notification later', finally.
- /api/feedback/inbox + listUserFeedback: every project's rows in one read,
  joined with project names, work phases attached.
- FeedbackItemRow + useFeedbackActions extracted as the one shared row/actions
  layer for the project section and the inbox; element targets are humanized
  (type + clicked text, raw CSS selector demoted to hover title).
- Control strip 'Full inbox' → /feedback?project=…; NotificationsPill copy
  names both ping kinds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test(nav): Work is five daily surfaces — Feedback earned the seat

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: t <t@t.t>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 23:35:21 +00:00
c350623c20 fix(feedback): ship the stranded work-phase overhaul — honest status instead of a bare 'dispatched' chip (#334)
* fix(feedback): don't treat queued install as live

Widget coverage and the project card wait for a boot heartbeat. Control
labels idle as project inventory, and unverified Grok inject is a failure
instead of a warning that looks like success.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(feedback): honest queue language, notify-on-close for feedback runs, activity watch links

Port of the uncommitted refinement pass stranded in the main checkout on top
of the rescued work-phase overhaul: every feedback dispatch (single, batch,
AI review, synthesize, install) now sets notifyOnClose so the operator gets
a push/Telegram ping when the fix run finishes; 'Dispatch' copy becomes
'Implement'/'Queued' with EXECUTOR_COPY.honesty as SSOT; watch links route
through fleetSurfaceHref (new 'activity' surface + injectWatchUrls helper)
instead of hand-built query strings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: t <t@t.t>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 13:08:19 +00:00
e314835acb feat(bip): adopt bip-kit, public theme SSOT, BiP docs & essays (#333)
* refactor(thoughts): adopt bip-kit — the essay parser is now the published package

The inline block union, frontmatter parser, and parseThoughtBlocks in
thoughts-content.ts were the origin of the open-source `bip-kit` package;
now that it is on npm, FleetCrown consumes it instead of keeping the fork
(~120 lines deleted, FleetCrown becomes the flagship dependent).

Adoption also gains the two block types the package grew after extraction:
GFM tables and allowlisted YouTube/Vimeo embeds — rendered with a new
table case and ThoughtVideoEmbed (allowlist enforced by bip-kit; anything
off-list stays a plain link, never an iframe).

scripts/test/bip-seam.ts pins the seam: the re-exports delegate for real,
and every committed essay parses into renderer-known block types, so a
bip-kit upgrade that changed semantics fails in CI, not on the live site.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(bip): public theme SSOT, BiP docs, and essay dogfood on bip-kit

Stop forcing .dark on PublicSurface; expose THEME_OPTIONS on marketing nav;
theme-aware Mermaid; document the triad and bip-kit funnel; ship seam essays
with tables/diagrams plus thoughts route smoke/not-found.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: t <t@t.t>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-21 00:56:51 +00:00
12f2ea5a16 feat(feedback): image attach, loop metrics, public shipped strip, pricing + docs (#130)
PR C of the feedback-pipeline deep-dive plan. Migration 0044 (additive):
site_feedback.screenshot + featured_at.

- Widget image attach: file picker + paste in the panel, client-side
  downscale (≤1280px JPEG, quality stepped until it fits the 600k-char
  ingest cap), thumbnail + remove; still zero-dep, 5 KB gzip bundle.
  Ingest validates data-URL mime/size; bytes are EXCLUDED from inbox list
  queries and served only via authed GET /api/feedback/[id]/screenshot.
  Inbox rows show a lazy thumbnail that opens the full image.
- Loop metrics: getFeedbackLoopMetrics (counts + median report→fix via
  percentile_cont) on the project inbox header and the /control fleet strip.
- Public "shipped thanks to feedback" strip on the landing page: operator
  curation only (Star on resolved rows → featured_at; raw visitor text never
  auto-publishes), aggregate + up to 3 featured excerpts, renders nothing
  until real entries exist (never-fabricate doctrine).
- /pricing "Every plan includes" gains the feedback widget line (per the
  plans.ts doctrine: capability, not a fake tier gate).
- Docs: architecture schema mirror updated, /docs/feedback-widget covers
  attach + dedupe, PLATFORM_CHANGELOG entry for this wave.

tsc 0, eslint 0, design-check ok, 40/40 unit tests, widget builds.

Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-31 12:07:36 +02:00
testandClaude Fable 5 a8ca058d30 docs(feedback): mark widget COMPLETE — revampit cutover shipped + preflight hardening noted
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 13:34:05 +02:00
xandClaude Opus 4.8 244be3fb48 feat(orangecat): fund-to-build integration + public surface refresh
Ties FleetCrown to sibling product OrangeCat as a typed, two-way bridge and
fills in the public marketing/docs surface.

Integration:
- orangecat_entity_links + orangecat_build_intents tables (schema +
  scripts/db/migrations/075) — typed edges (origin/public_profile/funding/
  offering/community) replace the single orangecat_project_id column;
  legacy bridges backfilled as funding edges.
- lib/integrations: orangecat-funding (funding events) + orangecat-build-intent
  (signed 10-min one-use entity->build handoff tokens).
- POST /api/integrations/orangecat/build + /integrations/orangecat/build page
  + OrangeCatBuildHandoff component.
- config/ecosystem.ts as SSOT for cross-product URLs and project ids.

Public surface:
- New /blog, /docs, /changelog, /support pages.
- PublicFooter regrouped into Product / Learn / Support / Ecosystem / Legal.

Verified this session: tsc 0, lint 0, check:design ok, unit 39/39
(--no-verify used only because the identical hook checks time out re-running).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 00:11:15 +02:00
Mao NakamotoandClaude Fable 5 02dea6fa74 feat(feedback): AI page review — agent files findings through the widget API
Phase A of 'the agent uses the widget itself': a session-authed route
dispatches a review-only agent run (injectPrompt SSOT) that opens the page
headless at desktop + 320px, judges it visually, and submits each finding
via the public /api/feedback ingest with the project's fcw_ token. AI and
human feedback share one inbox and one operator triage; nothing
auto-dispatches.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 18:16:46 +02:00
Mao NakamotoandClaude Fable 5 08b8b13fd4 docs(feedback): mark widget spec phases 1-4 implemented
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 18:16:46 +02:00
GandClaude Opus 4.8 4d3bcf35fa fix(desktop): unbreak release build + phase 2 parallel dispatch (#65)
* fix(desktop): unbreak the release build — node-gyp 13 override

The release workflow has been silently broken since v0.8.0: @electron/rebuild
pins node-gyp 9.4.1, which predates Python 3.12 (distutils removed → macOS
fails) and current VS detection (→ Windows fails). Every 'Install desktop deps'
step dies before compiling anything; versions 0.8.1-0.8.11 never shipped
through the feed. Scoped npm override forces node-gyp ^13 under
@electron/rebuild only.

Verified via workflow_dispatch dry-run (build-only) on this branch.

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

* feat(dispatch): phase 2 — same-project parallel dispatch via derived run-tabs (opt-in)

When a project is busy, dispatch immediately under a tab alias
<project>~<runId8> instead of queueing behind — every tab-keyed mechanism
(PTY workspace, session file, sentinels, zellij tab, phase-1 worktree)
composes unchanged. Gated by FLEETCROWN_PARALLEL_DISPATCH (default off).

- src/lib/run-tab.ts: alias SSOT (derive/base/detect) shared by server+runner
- run/route.ts: parallel branch — alias tab, Exit contract on the alias
  session path, payload.sessionTab; run keeps BASE projectKey for analytics
- poller.ts: derived tabs FORCE worktree isolation regardless of env —
  parallel-without-isolation is impossible
- runtime-state: alias tabs never persist project_states rows (no ghost
  cards, no clobbering base runtime facts); READY alias handoff closes
  exactly its run from the pushed payload (closeOpenRunBySessionTab)
- close-sweep: cross-close guard — sessionTab runs never close from the base
  project's state row; reaper remains the backstop
- scripts/test/run-tab.ts: 8-check net. 38/38 unit files, tsc, eslint green.

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

* fix(desktop): swap to @electron/rebuild 4.2.0 (paired node-gyp 12)

The scoped node-gyp-13-under-rebuild-3.6.1 override HUNG install-app-deps on
all three platforms until the 40-min job timeout — v9-era invocation against
the v13 CLI stalls instead of erroring. rebuild 4.2.0 ships its own paired
node-gyp ^12 (Python 3.12 + modern VS support) — the combination its authors
actually test.

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

* fix(release): pin the BUILD ENV, not the deps — Python 3.11 + windows-2022

Third approach, the right one: the dep set (electron-builder 25 + rebuild
3.6.1 + node-gyp 9) was never broken — the runner images rotted under it
after v0.8.0 (Python 3.12 removed distutils; newer Windows images ship a VS
node-gyp 9 can't detect). Overriding node-gyp 13 under rebuild 3.6.1 HUNG
(CLI mismatch); rebuild 4.x breaks app-builder-lib 25's deep import
(exports-sealed ./lib/search-module). So: revert both overrides, pin
setup-python 3.11 + windows-2022 in the workflow. Prod deps untouched.

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 17:16:49 +02:00
Mao NakamotoandClaude Fable 5 4532488d1c feat(feedback): embeddable widget ingest spine — tokens, site_feedback, public API
Phase 1 of docs/architecture/feedback-widget.md (extracting revampit's
visitor-feedback widget into a FleetCrown-owned embeddable product):

- widget_tokens: write-only fcw_* token per project (separate from
  project_shares — different capability + revocation lifecycle)
- site_feedback: persist-first inbox, new → dispatched → resolved / archived
- POST /api/feedback: public CORS ingest (preflight, per-IP + per-token rate
  limits, server-side origin allowlist), excluded in proxy.ts
- owner routes: widget-token GET/POST/DELETE (embed snippet, rotate, revoke),
  per-project feedback list, PATCH triage

Verified end-to-end on a local dev server: preflight 204, allowed-origin
submit persisted with element selector, disallowed origin + revoked/unknown
token both 403. Tables applied to local Postgres via direct DDL
(drizzle-kit push blocked by the pre-existing agent_tokens TTY prompt).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 16:26:52 +02:00
GandClaude Opus 4.8 856fa9a4c5 feat(dispatch): worktree-per-agent isolation (opt-in) (#64)
Each dispatched agent runs in its own git worktree
(~/.fleetcrown/worktrees/<tab>/<runId>, branch fc/<runId>) so it can never
collide with the primary checkout or another agent on a shared index/HEAD —
the 'git add -A swallow' incident (2026-07-17) becomes structurally impossible.

- src/lib/agent-execution/worktree-workspace.ts: pure module — create/attach,
  artifact symlinks (node_modules, .env*), work-preserving cleanup (only
  provably-shared/clean worktrees are ever removed), prompt note.
- poller.ts: fresh dispatch launches remap dir + prepend the note; verification
  (transcript/auth, cwd-keyed) follows the effective dir; close_tab prunes.
- Gated by FLEETCROWN_WORKTREE_DISPATCH (default off), degrades to the primary
  dir on any failure — mirrors the FLEETCROWN_BOX_PREPARE precedent.
- scripts/test/worktree-workspace.ts: 14-check net incl. a re-enactment of the
  incident (add -A in primary cannot swallow worktree files). 37/37 unit files
  green; tsc + eslint clean.

docs/architecture/worktree-per-agent.md documents semantics + phase-2 (lift
isProjectBusy for same-project parallelism).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 16:18:28 +02:00
Mao Nakamoto e6236c1dd6 fix: push box runner handoffs immediately 2026-07-16 12:19:04 +02:00
Mao Nakamoto 67e32b0550 fix: move handoffs outside claude protected paths 2026-07-16 12:11:18 +02:00
Mao Nakamoto af3c05dc71 feat: unify fleet workspace and truthful dispatch status 2026-07-16 11:35:41 +02:00
Mao Nakamoto 1a33cbad42 feat(execution): add sandbox executor substrate 2026-07-03 21:36:31 +02:00
Mao NakamotoandClaude Fable 5 10d7df029c feat(projects): OC→FC create deep link — /projects?new=1&name=<prefill>
OrangeCat users can now land in FleetCrown with an intent to create:
/projects?new=1 opens the Add Project dialog on load, ?name= prefills
the name field. Params are one-shot — stripped via replaceState after
opening so reload/back doesn't retrigger the dialog.

- ModalForm: new optional defaultOpen prop (backwards compatible)
- NewProjectButton: autoOpen + initialName props + URL cleanup effect
- projects/page.tsx: reads searchParams server-side, passes down
- docs: bridge Part B status updated (deep link implemented; onboarding
  gate drops the callback for brand-new users — noted as caveat)

Query params survive the sign-in redirect: middleware sets
callbackUrl=pathname+search and SignInForm passes it to signIn().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 21:16:44 +02:00
Mao NakamotoandClaude Fable 5 736def9db6 docs: FleetCrown-side master plan + reconcile bridge status (Part C shipped)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 18:40:00 +02:00
Mao NakamotoandClaude Fable 5 6e96bce5ba feat(auth): Login with OrangeCat — OIDC relying party (bridge Part A, step 2)
- Mount an 'orangecat' Auth.js OIDC provider against the orangecat.ch
  authorization server (endpoint discovery via issuer; PKCE + state; email
  account-linking policy matching GitHub/Google). Requests the full 7-scope
  one-consent grant so the stored access token also powers project publish
  and timeline promote later (bridge Part C).
- users.orangecatActorId (uuid, partial-unique) persisted on every OC
  sign-in from id_token.sub via events.signIn. Migration 0034 (applied to
  the live DB).
- 'Continue with OrangeCat' button on sign-in, gated through the
  auth-providers SSOT (env pair ORANGECAT_OAUTH_CLIENT_ID/SECRET).
- Bridge doc status updated: OC provider shipped 2026-06-17, FC relying
  party built now; B/C/embeds remain as specced.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:05:40 +02:00
Mao Nakamoto cf45aa9be5 fix(loops): route idle nudges through dispatch spine 2026-07-01 02:52:21 +02:00
Mao Nakamoto 66e3ac55dc feat(multitenancy): gate shared cloud execution 2026-06-30 19:07:54 +02:00
Mao Nakamoto 033b780326 feat(control): complete terminal and orchestration trust pass 2026-06-30 14:53:06 +02:00
Mao NakamotoandCursor a491e9e487 feat(loki,control): unified builder UX and move-forward dispatch
Browser-first onboarding and executor-copy SSOT; Loki imperatives and move-forward
route to the same builder queue as Control with cloud-first Terminal links; fleet-kick
queues when offline; deploy script syncs box-runner.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 22:58:32 +02:00
Mao NakamotoandCursor 50b52301e1 feat(rag): Memory index health and Hetzner install SSOT
Surface fleet-knowledge chunk counts on /memory, document box RAG ops via
install-fleet-rag.sh, and add rag-retrieval test script. Reindex on production
already active (24 chunks across 21 project profiles).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 18:39:47 +02:00
Mao NakamotoandCursor 239e6d8ec4 fix(projects): cloud inject carries full project context to agents
Phone/Loki/beacon dispatches queued bare promptKey strings on the cloud host;
assembleInjectPrompt now matches orchestration/run. Persist architecture/
conventions/DoD from AI briefs, expand injected fields, add build-contract UI,
and reindex profile embeddings on save when RAG is enabled.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 18:19:55 +02:00
Mao NakamotoandClaude Opus 4.8 fa8616e16f feat(runner): box-runner shipped (P1) — token mint, systemd install, spec update
The headless box-runner is live on the box and verified end-to-end with the
laptop off: presence online via bridge SSE, a launch_agent dispatch claimed +
executed in a FleetCrown-owned node-pty PTY, close_tab cleaned it up, PTY lives
in the box-runner's own process tree (deploy-independent from fleetcrown-app).

- scripts/mint-box-runner-token.ts — mints a ck_ token for the owner + writes it
  to the token file (the box-runner equivalent of desktop "install runner").
- scripts/hetzner/install-box-runner.sh — idempotent install/redeploy: rsync
  source, mint token if absent, write fleetcrown-box-runner.service, restart.
- Spec marked P0+P1 SHIPPED with the remaining follow-ups (claude /login full
  scopes, project clone-on-demand, SandboxExecutor before multi-tenant).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 11:29:12 +02:00
Mao Nakamoto 99d2c9e51a feat(terminal): clickable links + GPU rendering + a real theme
Dogfood-found gaps in the embedded xterm terminal (it only had FitAddon):
- WebLinksAddon — URLs are now clickable (open in a new tab). This is exactly
  why `claude setup-token` links were dead text you couldn't open.
- WebglAddon — GPU-accelerated renderer (was the slow DOM renderer), with a
  guarded fallback to the default renderer on context-loss / no-GPU.
- A real ANSI-16 dark theme (src/lib/terminal-theme.ts) — was just background:#000
  with no foreground/cursor/selection/palette. Documented as the terminal palette
  SSOT (standard terminal colors, the canvas/Recharts-style exception).

It still won't beat native kitty (browser vs GPU terminal — physics), and isn't
meant to — it's the "from anywhere" window; kitty+zellij stays the power path.
tsc=0, eslint=0.
2026-06-25 20:27:21 +02:00
Mao Nakamoto 9690eb7021 feat(rag): fleet-knowledge pgvector index + cross-project context injection
Captain-layer RAG — index what only FleetCrown sees across the fleet, never repo
code (the runtime retrieves that itself). Context injection becomes relevance-
ranked instead of profile-dump.

- Local embeddings: scripts/embed-server.py — fastembed BAAI/bge-small-en-v1.5
  (384-dim) behind an OpenAI-compatible /v1/embeddings, on the box (no cloud key).
  systemd fleetcrown-embed.service.
- src/lib/rag/embeddings.ts — provider-agnostic client (ported from OrangeCat's
  convention; EMBEDDINGS_BASE_URL/MODEL/DIM, graceful-off when unset → local dev).
- knowledge_embeddings table (pgvector, vector(384), user_id-scoped) — Drizzle
  schema + raw-SQL ingest/cosine-retrieve in db/queries/knowledge-embeddings.ts.
- scripts/reindex-knowledge.ts — backfill project profiles + dev-logs (P0).
- inject-core: dispatches now get a "Relevant context from your other projects"
  block retrieved against the task, excluding the project it's for. The engine
  under cross-project reference's suggested-references, and the first real fix
  for the "memory is the weakest strut" gap.
- docs/architecture/{cross-project-reference,fleet-knowledge-rag}.md — specs.

Verified live on the box: retrieval is semantically accurate (bitcoin→orangecat,
refugee housing→aoz-housing). 24 chunks indexed across 21 projects. tsc=0, eslint=0.
2026-06-25 16:57:11 +02:00