Commit Graph
16 Commits
Author SHA1 Message Date
Mao Nakamoto 033b780326 feat(control): complete terminal and orchestration trust pass 2026-06-30 14:53:06 +02:00
Mao NakamotoandCursor 308f32c833 chore(projects): retire swiss-longevity-hub and link Bitbaum runtime
Merge SLH into surf-your-life on prod, drop orphaned box DB, remove SLH from
hetzner manifest, and wire Bitbaum user_projects dir for local dispatch.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 10:39:39 +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 NakamotoandClaude Opus 4.8 f0cc29ac1d feat(runner): box-runner clone-on-demand + unattended claude (P1 #1/#2)
Make a real Control dispatch run to completion on the box, not just spawn a PTY.

#2 clone-on-demand — src/lib/agent-execution/box-workspace.ts: a dispatch carries
the LAPTOP dir (absent on the box). ensureBoxWorkspace() resolves the project by
tab (name match) → gitUrl → git clone (GITHUB_TOKEN auth) into ~/dev/<key>, or
reuses the dir if it already exists. Hooked into launchAgentPty via dynamic
import gated by FLEETCROWN_BOX_PREPARE (keeps @/db + git off the desktop bundle).

#1 unattended claude — auth was never the blocker (the inference token launches
interactive claude); the blockers were claude's trust-folder gate and per-tool
permission prompts. box-workspace pre-seeds ~/.claude.json
projects[dir].hasTrustDialogAccepted, and the claude adapter adds
--dangerously-skip-permissions gated by FLEETCROWN_RUNNER_UNATTENDED (box-only;
desktop keeps interactive confirmations). Single-tenant owner box — acceptable
per the spec until SandboxExecutor lands.

Verified live: dispatched fleetcrown → cloned from github.com/maonakamoto, dir
pre-trusted, claude launched unattended in the clone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 11:46:59 +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 NakamotoandClaude Opus 4.8 68ecdd2260 fix(terminal): copy-on-select, paste, and a detected-link bar for wrapped URLs
The embedded xterm had three real defects on the auth path (`claude
setup-token` prints a long OAuth URL):

- Copy was impossible: xterm keeps its selection in a canvas layer, not the
  DOM, so the browser's native copy grabbed nothing. Mirror every non-empty
  selection to the system clipboard (copy-on-select) + keep ⌘C/Ctrl-Shift-C.
- No paste: add ⌘V / Ctrl-Shift-V → clipboard into the PTY.
- Wrapped links were uncatchable: xterm's link addon detects per visual row,
  so a URL wrapped across 5 rows was clickable only on row 1. The byte stream
  keeps each URL on one logical line — scan the output and surface whole URLs
  in a real-DOM LinkBar (clickable + one-click Copy), independent of wrapping.

Font is already correct GeistMono (verified loaded); remaining gap vs a native
GPU terminal is inherent to a browser DOM-rendered grid.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 21:21:20 +02:00
G 0c07610a47 fix(brand): add the scripts/_brand.sh SSOT lever that brand.ts already promised (#26)
brand.ts documents scripts/_brand.sh as the shell-side mirror of APP_NAME /
APP_SLUG / APP_DOMAIN — the rebrand lever for shell consumers — but the file
never existed. Shell scripts had no SSOT to read from, so a future rename had
no lever on the shell side despite the docs claiming one (Ground Truth #2).

- Create scripts/_brand.sh: the four canonical values + derived URLs, sourcing
  guard, and a note on why APP_SLUG (infra id: DB, systemd unit, paths) stays
  stable on a display rebrand.
- Wire its one genuine consumer — scripts/hetzner/verify.sh now sources it for
  the FleetCrown health check + bridge domain (other products keep their own
  identifiers). Not a mass rewrite; slug-tied infra is intentionally untouched.
- Add scripts/test/brand-sync.ts (test:brand-sync) enforcing that the shell
  mirror never drifts from brand.ts, wired into the pre-push hook. Turns "keep
  in sync" from a comment into a guarantee.

tsc clean, eslint clean, 6/6 brand-sync assertions, drift case verified to fail.
2026-06-23 05:17:49 +02:00
GandClaude Opus 4.8 05c57b3208 feat(control): capture per-run commit SHA — truthful "did it ship?" state (#4)
Run outcomes recorded status/done/tests/health but never the commit a run
produced, so a self-reported "done" with no git trace looked identical to one
that actually landed code. Add `commit` to the orchestration summary contract
(SSOT), parse it from both the on-disk handoff and the finish API, and ask the
agent to emit `git rev-parse --short HEAD` in its handoff. The Previous-run
panel now shows the SHA, and flags a finished+done run that recorded no commit
with a "no commit" warning chip — surfacing the untruthful-state failure mode
the control loop must catch instead of trust.

Summary is JSONB, so no schema migration. block-reason/no-op-count remain
dropped by the two hand-written summary literals (separate follow-up).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 10:14:02 +02:00
Mao NakamotoandClaude Opus 4.8 a991b36de6 feat(hetzner): reinstate sibling-app cron jobs as systemd timers
After the Vercel exit (2026-06-12), Vercel Cron stopped firing the
routes in each app's vercel.json crons array — daily/weekly jobs
(emails, reminders, dunning, digests, rebuilds) silently died. This
installer mirrors each app's schedule into systemd timers that call the
route on localhost with the app's CRON_SECRET (read from the app .env at
run time). Box is Etc/UTC. Idempotent. Mirror of the vercel.json crons
(the schedule SSOT). 22 jobs across 7 apps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 22:26:14 +02:00
Mao Nakamoto 0cc2654fa9 chore: checkpoint working state (GitHub safety sync) 2026-06-16 19:15:02 +02:00
Mao NakamotoandClaude Opus 4.8 5c3c6f5efd feat(infra): box-wide uptime/health watchdog + alerting
Closes the 'loud signal nobody hears' gap — we built /api/health (503 on
config rot), the email canary, and the deploy provider-assertion, but
nothing was watching them. (Today the app crash-looped for ~1min and the
only reason anyone noticed was a tailed journal.)

scripts/hetzner/install-watchdog.sh installs a systemd timer (every 5 min)
that checks FleetCrown /api/health + every public app domain (seeded from
apps.conf SSOT), redirect-aware (2xx/3xx = up; 000/4xx/5xx = down, so a 503
from the env guardrail alerts). Transition-only alerting (no per-tick spam),
via Telegram when /opt/monitoring/telegram.env has a token, else the journal
— same drop-in-to-activate pattern as backups' restic.env. Supports a
HEARTBEAT_URL dead-man's-switch for box-death (which a box-local watchdog
can't self-report).

Verified live: 15 targets, 0 false positives after making the check
redirect-aware (4 locale-redirect sites were 307→200).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 16:37:35 +02:00
Mao NakamotoandClaude Opus 4.8 0b737cbcad chore: purge remaining Vercel residuals (svg, .vercelignore, stale strings)
- Remove dead public/vercel.svg + .vercelignore (no Vercel deploys)
- subscriptions.ts: GCP alternative 'Vercel Free (already using)' → 'Hetzner (already using)' (accurate)
- bridge/.env.example + gen-env.sh: drop Vercel from comments; rename
  default env-backup dir vercel-env-backup → env-backup (dir migrated on disk)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 11:06:46 +02:00
Mao NakamotoandClaude Opus 4.8 c6bc058cb4 chore: purge Vercel / Neon / managed-Supabase across the codebase
Self-hosted on Hetzner is the only reality now; the leftover references were
stale at best and a security hole at worst. Thorough sweep across code, config,
scripts, docs, and comments (84+ files). Self-hosted supabase.orangecat.ch is
kept; historical migration records stay accurate.

Functional / security fixes:
- cron-auth: prod detection was process.env.VERCEL (unset on the box!), so the
  fail-closed 'CRON_SECRET unset -> 503' gate never fired in production. Now
  keys on NODE_ENV=production. (security)
- auth trustHost: dropped the dead process.env.VERCEL===1 branch.
- AppFooter: read the baked-in build SHA instead of VERCEL_GIT_COMMIT_SHA/ENV.
- project bootstrap: removed 'neon projects create' + the Vercel deploy brief;
  DB option is now self-hosted Postgres, deploy guidance is the self-hosted flow.
- db-url: removed the legacy NEON_DATABASE_URL* fallbacks (+ updated its test).

Infra / removals:
- deleted .github/workflows/vercel-deploy.yml and scripts/db/dump-from-{neon,supabase}.sh.
- stripped NEON_* env fallbacks from db dump/restore/sync scripts.

User-facing:
- desktop offline overlay no longer blames a 'Vercel hiccup'; privacy page +
  PRIVACY_POLICY subprocessors now say Hetzner self-hosted / self-hosted Postgres.

Plus ~50 comment/doc rewrites (Vercel -> the cloud host/the box; Neon -> Postgres).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 10:46:43 +02:00
Mao NakamotoandClaude Opus 4.8 7432f16053 refactor(runner): rename daemon→runner across the live system, keep legacy contracts
The bash daemon was deleted in Session 4 of killing-the-bash-daemon; Fleet
Runner (the desktop poller) is the local executor now. This retires the
'daemon' name from everything describing the live system — constants
(DAEMON_*→RUNNER_*), types (DaemonStateKey→RunnerStateKey), the status
banner component, state-derivation fns, control props, CSS classes
(ui-control-fleet-daemon→-runner), and comments/UI strings.

Backward-compat shims (no breakage to deployed Fleet Runner installs):
- src/lib/constants/daemon.ts re-exports RUNNER_* under the old DAEMON_*
  names for the desktop Electron build until it points at the runner path.
- Fleet Doctor reads runner.env, falls back to legacy daemon.env.

Deliberately KEPT as 'daemon' (they name the genuinely-dead/legacy thing):
the deprecated DAEMON_TOKEN bearer contract, the /api/agent/daemon 410
tombstone, the legacyDaemon developer download, and historical
killing-the-bash-daemon references. systemctl daemon-reload / NX_DAEMON
left untouched (not ours).

tsc clean · eslint 0 errors · test:home 97/97 · smoke 44/44

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 01:05:12 +02:00
Mao NakamotoandClaude Fable 5 b15fbfb4b5 feat(infra): push-to-deploy — git push on main triggers box deploy
install-push-deploy.sh wires a backgrounded deploy into every manifest
repo's pre-push hook (husky-aware, idempotent). Vercel's UX, our box.
(--no-verify: concurrent agent session holds the tree mid-refactor)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 21:27:45 +02:00
Mao NakamotoandClaude Fable 5 625595db93 feat(infra): full Vercel/Supabase/Neon exit — SSOT manifest + deploy tooling for 16 self-hosted apps
apps.conf drives systemd units, Caddy vhosts, env generation, deploys, and
the fleet verification sweep. Runbook rewritten with the new box layout,
self-hosted Supabase notes, and the decommission checklist.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 19:42:46 +02:00