Commit Graph
1786 Commits
Author SHA1 Message Date
Mao NakamotoandClaude Fable 5 a6715e9956 fix(control): freeze project-rail row positions during live refreshes
Priority re-ranking reshuffled rows under the cursor on every state
refresh — two misdispatches on 2026-07-03 (one to the wrong project,
one swallowed by a re-render). Row order now recomputes only when the
sort mode, the query, or the set of visible projects changes; live
refreshes update card content in place.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:57:53 +02:00
Mao NakamotoandClaude Fable 5 77b9693ff1 fix(projects): cloud handoffs reach the changelog + clamp dossier subtitle
The devLog append (and its OrangeCat wall promote) only lived on the
LOCAL runtime path in /api/control — the cloud ingestion path
(runtime-state route, the ONLY path for box-executed sessions) persisted
handoffs to project_states but never recorded them in the project
changelog. Extracted recordSessionHandoffChangelog() as the single
append point (same changed-done guard, heartbeat-safe) and wired it
into both paths. Also: the dossier header clamps 1000-word agent briefs
to a gist — the full text stays in the brief attrs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:47:04 +02:00
Mao NakamotoandClaude Fable 5 d2f186c8f6 feat(projects): full project pages — the dossier replaces the drawer
/projects/[id] is a real server-rendered page answering the captain's
three questions per project: Done (changelog from devLog + run history
with outcomes/commits/durations), Now (live agent state, latest handoff
checks, mission/brief attributes), Next (resume state from the handoff,
linked goals with progress, dispatch CTA). Identity strip carries
status/maturity chips, the outcome streak (deep-linked to Activity),
and repo/live-site/OrangeCat/Control links.

One SSOT assembly (getProjectDossier) composes EXISTING queries —
getProjectDetail, getProjectOrchestrationRuns, getRecentOutcomes,
getProjectStateByProjectId, getProjectActivity, user_projects row —
zero new tables, no parallel state. Deliberately deterministic: no
vector retrieval (pgvector stays where similarity earns it — the
cross-project fleet-RAG already injected into dispatches); a project's
own dossier must be exact, not similar. getProjectContext (the
agent-facing projection) is slated to converge on this assembly so the
page a human reads and the context an agent receives cannot disagree.

Grid/list clicks navigate to the page; the drawer remains the
quick-edit surface via the page's Quick-edit button and ?open= links.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:34:25 +02:00
Mao NakamotoandClaude Fable 5 f72556ac30 fix(orchestration): queued dispatches carry the handoff exit-contract
The cloud dispatch path (assembleInjectPrompt) never instructed agents
to write ~/.claude/sessions/<tab>.md — the run-closure signal
(closeRunFromSession reads the pusher-persisted handoff). Box agents
finished real work, ls'd ~/.claude/sessions/ for the contract, found
nothing, wrote no handoff, and were reaped as timeouts; laptop agents
only complied because the founder's personal global CLAUDE.md happens
to describe the same contract. Extracted the field block into
sessionHandoffContract() (SSOT) — buildPromptWithSession (local
enrichment) and assembleInjectPrompt (cloud) both consume it.
Tilde-relative path on purpose (executing machine expands HOME);
resolveSessionFile already reads case-insensitively.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 01:57:20 +02:00
Mao NakamotoandClaude Fable 5 8fe05e718c fix(runner): bracketed-paste injection + bare-Enter retry so big prompts submit
Big dispatch prompts (RAG context blocks) were still being ingested by
the TUI when injectPty's fixed-delay CRs arrived — swallowed as
in-paste newlines, prompt parked unsubmitted in the composer (visible
in the Workspaces activity column). Wrap the body in explicit
ESC[200~/ESC[201~ so ingestion is atomic and the trailing CR is a real
keypress; the poller's verify-retry now sends a bare Enter first (a
parked composer submits without duplication) before a full re-inject.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 00:13:17 +02:00
Mao NakamotoandClaude Fable 5 9ee86d29c6 fix(runner): verify dispatch against the CLI's own live session status
Claude Code writes live per-PID status to ~/.claude/sessions/<pid>.json
(status idle|working, cwd). Three fixes hang off it:

- Dispatch verify: isPtyBusy was fooled by boot-screen redraw — on a
  fresh clone the trust-folder dialog ate the injected paste and six
  agents were acked 'launched + injected' while idle at an empty
  composer. waitForAgentGenerating() now polls the CLI's own status
  (fallback to isPtyBusy for agents without live status files) and
  re-injects once when verifiably idle.
- Pusher lifecycle: readFastState synthesizes the direct_terminal
  observation from live status, so headless PTY agents mid-task read
  as Working instead of 'process detected, no lifecycle signal'
  (the producer the presenter test always described but nothing built).
- Deploy hardening: the restart ssh runs under timeout 180 +
  keep-alives after hanging 47 minutes post-restart and freezing the
  deploy before verification and the runner sync.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 00:04:22 +02:00
Mao NakamotoandClaude Fable 5 9545d38fcc fix(runner): pusher derives projects from live PTYs when no projects.conf
The headless box has no claude-projects.conf (a laptop dotfile), so
buildProjectRuntimePayload pushed ZERO project entries — project_states
was only ever fed by the laptop runner. When the laptop slept, the
cloud UI froze on a days-old snapshot ('5 awaiting input') while real
PTY agents ran unseen. With an empty conf the pusher now synthesizes
{tab, dir} from the agent processes actually running.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 22:43:07 +02:00
Mao NakamotoandClaude Fable 5 f2c3ee7b6b fix(loops): throttle nudge-idle to MAX_CONCURRENT_BUILDING per tick
The 25-nudge cap predates the scheduler actually firing (the
user-selection bug made it a no-op); the first live tick would have
cold-started ~18 agent PTYs at once on the 4 GB box. Same throttle as
fleet-kick; idle/cooldown gates spread the rest over later ticks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 22:15:01 +02:00
Mao NakamotoandClaude Fable 5 5fc3333f9a fix(control): fleet truth pass — honest hero, live janitors, actionable streaks
Dogfood session drove FleetCrown against production and found the fleet
had been silently dead for 2 days behind a green light:

- nudge-idle raw-queried beacon_settings WHERE mode != 'off', so users
  with NO row (missing row = default 'on') were invisible to the
  scheduler — autopilot dispatched nothing while the hero said
  'Autopilot on'. New SSOT getFleetAutopilotUserIds() decides
  enrollment for schedulers; missing rows count as on.
- The stale-run reaper only ran on /api/control page loads: 16 runs sat
  'waiting' for 51h until a human looked, then got stamped with
  fabricated 51h durations. New hourly reap-stale-runs cron reaps all
  users; finishedAt = startedAt + STALE_RUN_MINUTES (truthful).
- Hero headline was mode-derived ('Building' + pulsing green with 0
  working and 16/16 failed runs). deriveFleetPulse() (pure, tested)
  now derives Building / Waiting to dispatch / Stalled(+Review
  failures link) / Paused from live counts + latest outcomes.
- OutcomeStreak ✗ glyphs were unlabeled dead-ends; the streak now
  deep-links to /activity?window=week&project=<key>.
- box-runner logged 'connected · last poll 0s ago' every 2s to journald
  (~40k lines/day); now logs on state change + 15-min heartbeat.

Presenter tests 25/25 (6 new fleet-pulse cases).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 22:00:50 +02:00
G 0c3b8d800b Merge pull request #56 from maonakamoto/feat/oc-create-deeplink
feat(projects): OC→FC create deep link — /projects?new=1&name=<prefill>
2026-07-02 21:20:15 +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 d9b784d33f feat(bridge): promote backfill cron + settings Connect OrangeCat
Closes the two operational gaps in bridge Parts A/C (FC master plan
Phase 0.4/0.5):

- /api/crons/orangecat-promote-backfill re-emits project_published +
  recent devlog promotes for every OC-linked project daily (09:00 UTC
  timer added to install-hetzner-crons.sh). Deterministic external ids
  make re-posting idempotent — 'best-effort must not mean silently
  lossy' is now true.
- promoteMomentToOrangeCat/promoteDevLogEntry return a PromoteOutcome
  so the janitor can count posted/skipped/failed (user-action call
  sites still fire-and-forget via void).
- Settings → Account gains a Connect OrangeCat row for existing users
  (env-gated like the sign-in button); links via the same OIDC flow,
  which also unlocks Publish to OrangeCat.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 19:40:15 +02:00
Mao NakamotoandClaude Fable 5 5253c156a7 fix(deploy): don't exit pre-push before the push-deploy block
The smoke section's early exit 0 (server not running) returned from the
hook before the appended push-deploy block, silently disabling
push-to-deploy whenever the local dev server was down.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 19:39:13 +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 7bdf0c91ee fix(auth): send OC client creds in token request body
OrangeCat's token endpoint only supports client_secret_post; Auth.js
defaults to client_secret_basic, so the code exchange failed with
400 "client_id is required" and sign-in surfaced error=Configuration.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 18:36:52 +02:00
G 761cc2f7fa Merge pull request #55 from maonakamoto/feat/login-with-orangecat
feat(bridge): Login with OrangeCat + Publish to OrangeCat (identity bridge Parts A2 + C)
2026-07-02 16:27:43 +02:00
Mao NakamotoandClaude Fable 5 b879625c93 feat(bridge): Publish to OrangeCat + changelog→wall promote (Part C)
- publishProjectToOrangeCat: opt-in per-project publish as the USER's OC
  actor (OIDC access token from Login with OrangeCat, with refresh-token
  rotation persisted); back-link on user_projects.orangecatProjectId
  (migration 0035, applied to live + dev DBs).
- Promote step: config-driven policy (src/config/orangecat-publish.ts),
  async + fire-and-forget + idempotent (deterministic external_id) onto
  OC's publish bus /api/v1/timeline/publish. Dev-log appends now promote
  as project_updated; first publish posts project_published.
- Cat icon action in the project detail header: publish / view-on-OC /
  connect-first states.
- orangecat-identity: per-user token resolution distinct from the studio
  ORANGECAT_API_KEY service key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:23:45 +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 bffe2387d0 Harden responsive runtime tracing 2026-07-02 15:03:18 +02:00
Mao Nakamoto bd5da41132 fix(loops): surface readiness and auth labels 2026-07-01 04:20:42 +02:00
Mao Nakamoto cf45aa9be5 fix(loops): route idle nudges through dispatch spine 2026-07-01 02:52:21 +02:00
Mao Nakamoto fd213fb46f fix(onboarding): keep new users in project setup 2026-06-30 19:23:12 +02:00
Mao Nakamoto 66e3ac55dc feat(multitenancy): gate shared cloud execution 2026-06-30 19:07:54 +02:00
Mao Nakamoto afaac0388d fix(loki): clarify dispatch handoff copy 2026-06-30 18:24:25 +02:00
Mao Nakamoto d908145a1f feat(loki): refine command composer UX 2026-06-30 18:09:49 +02:00
Mao Nakamoto 033b780326 feat(control): complete terminal and orchestration trust pass 2026-06-30 14:53:06 +02:00
Mao NakamotoandClaude Opus 4.8 23ae8b6c80 feat(dogfood): handle Loki Send hang/failure gracefully in self-dogfood
Wrap the dispatch-footer wait in a non-throwing gotDispatch check (local +
prod paths). On timeout, record a high-severity weakness and a timeout
screenshot instead of throwing on waitForSelector, so a hung Send produces a
report rather than aborting the whole run. Also force-click the owner-key tab
with a bounded timeout. (Concurrent-session edit, committed to keep the tree
clean — see pattern-concurrent-autopilot-worktree-race.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 01:10:26 +02:00
Mao NakamotoandClaude Opus 4.8 ae88653d9e chore(dogfood): add self-dogfood script driving fleetcrown via its own UI
npm run dogfood:self drives Control → Loki "Move forward" → Terminal Cloud →
Projects against local or prod (fleetcrown.orangecat.ch), screenshots each
step, and emits a weakness report. Mirrors dogfood:loki (same playwright/
chromium convention, undeclared dep shared by both — tracked as follow-up).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 00:50:06 +02:00
Mao NakamotoandCursor f755b4f134 fix(loki,control): show builder-online copy for cloud queue dispatches
Cloud inject always queues even when box-runner is connected; distinguish
runnerConnected in Loki footer, Control toasts, and dispatch-status SSOT.
Add prod dogfood script and dispatch-status tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 00:08:43 +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 480294fa15 feat(control,loki): subset loops and screenshot dispatch
Add Build/Pause selected on Control, multi-project command fan-out in Loki,
and route scoped screenshots to dispatch with vision preflight instead of chat.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 19:45:42 +02:00
Mao NakamotoandCursor 9f0d170484 feat(control): fleet-kick on Start building and fix nudge-idle cron
Start building now batch-dispatches next_best on eligible idle projects
(capped at three concurrent) and Loki accepts develop-all phrasing; restore
the daily idle nudge for users with autopilot on after the mode collapse.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 18:58:10 +02:00
Mao NakamotoandCursor a07cd7276e feat(loki): business plan generation and profile update drafts
Wire NL fast paths before resolveCommand so Loki can generate living business
plans and queue profile field changes through Today’s action queue instead of
silent chat writes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 17:57:29 +02:00
Mao NakamotoandCursor 24471d795c feat(loki): inject project profile into chat turns
When a project is selected, named, or resolved for chat, prepend the same
getProjectContext block dispatch uses so Loki answers with mission, stack, and goals.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 16:32:15 +02:00
Mao NakamotoandCursor f37780c82c feat(loki): screenshot vision preflight and composer polish
Groq Llama 4 Scout describes pasted/picked images for chat and dispatch.
Add scoped-project pill, quick-action chips, hide model picker on mobile,
and hide the shell FAB on /loki.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 15:27:06 +02:00
Mao NakamotoandCursor 5ac16ea023 feat(loki): consolidate on /loki as single command surface
Route shell FAB and loki:open to /loki with composer prefill; retire the
chat-only modal. Add fleet list/create NL fast paths, project picker chips
for ambiguous dispatches, and a db helper to inspect recent conversations.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 14:45:06 +02:00
Mao NakamotoandCursor 507cc661d9 refactor(control): Phase 3 prompt vocabulary SSOT
Clarify Saved prompts vs Up next vs Recent dispatches vs Paste from history
via config/control-labels.ts; align activity stats and composer hints.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 08:53:36 +02:00
Mao NakamotoandCursor 281bcf81b9 fix(css): inline autopilot button classes for Tailwind apply
Tailwind cannot @apply custom ui-* classes from other component classes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 11:21:48 +02:00
Mao NakamotoandCursor f62565e9b8 feat(control): ship Phase 1 fleet play/pause hero UX
Prominent ui-control-hero autopilot card with Building/Paused status, large
Start/Pause CTA, per-project toggles, rail override chips, and refresh sync.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 11:09:33 +02:00
Mao NakamotoandCursor 414a8a0bfa docs: note swiss-longevity-hub retirement in hetzner runbook
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 10:45:55 +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 4a47546273 docs: note reparaturbonus-zh profile backfill complete
All 19 prod projects now have build-contract attrs after enrich run.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 10:05:39 +02:00
Mao NakamotoandCursor 3b94efbb67 chore(db): retire stale prod projects and add cleanup tooling
Merge Cockpit and empty dupes into canonical entities, delete infra/stub
rows, and ship retire-stale-projects.ts plus merge helpers for future hygiene.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 09:59:27 +02:00
Mao NakamotoandCursor 826dc5c92b fix(profiles): batch applyProjectProfile writes for prod enrich
Transaction upsert prevents remote DB timeouts. Replace placeholder
descriptions on enrich. Backfilled petvity, sbb-lost-found, Bitbaum.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 20:43:39 +02:00
Mao NakamotoandCursor 36d1802469 chore(profiles): backfill prod build-contract attrs from local repos
Re-ran enrich-prod-profiles against Hetzner — 16 projects now have
architecture/conventions/DoD. Add Groq retry for transient fetch failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 20:05:23 +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 NakamotoandCursor ba7ac4b328 fix(mobile): full-screen overlays and project drawer tap targets
Hide bottom nav and top bar while drawers/modals are open; improve project
profile header layout, tab bar, and card action sizes. Add mobile pages audit script.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 17:30:17 +02:00
Mao NakamotoandCursor 6dd74f2c2b feat(terminal,loki): mobile full-screen terminal and develop handoff
Expand/collapse on phones gives xterm usable height; Loki dispatches route
"let's develop" through next_best and link to watch the agent. Profile drawer
follows action-first hierarchy with filtered activity noise.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 16:22:30 +02:00
Mao NakamotoandCursor 215a4fe3ea fix(projects): merge duplicate entities and simplify fleet overview
Resolve case-insensitive duplicate project rows in Postgres, prevent
recurrence in entity creation, and redesign the Projects page hierarchy
(search-first, compact list, attention cards, activity redaction).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 12:13:43 +02:00