Closes the Loop A persistence story. After
syncSubscriptionToOrangeCat() succeeds, the subscription row now stores
the OrangeCat service id back, so the /money page can render a per-row
"OC ✓" badge and future backfill jobs can target only the still-null
rows.
Schema (drizzle migration 0021):
- subscriptions.orangecat_service_id (uuid, nullable). Null = not
mirrored (integration off, sync failed, or row predates the
integration). Apply via `npm run migrate`.
- Partial index on (user_id) WHERE orangecat_service_id IS NULL — the
shape the "what still needs syncing" backfill query will use; the
column is mostly null for now.
orangecat.ts:
- syncSubscriptionToOrangeCat() now writes the back-link after a
successful POST. The DB update is also non-fatal — OrangeCat already
has the truth, and the next /money render still reflects the synced
state once the column is populated.
UI (/money page SubRow):
- New "OC ✓" badge appears next to the subscription name when
orangecatServiceId is present. Hover shows the OrangeCat service id
for cross-system debugging.
SDK bump:
- @orangecat/sdk moved from 0.1.0 → 0.2.0 (file:vendor/). 0.2.0 adds
.list() on every resource, which a future backfill script uses to
enumerate what's already on the OrangeCat side before re-syncing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
First real cross-product call from FleetCrown into OrangeCat. Whenever a
FleetCrown user adds a subscription on /money, the same record is
mirrored into OrangeCat as a `service` owned by the FleetCrown group
actor. Mao now sees FleetCrown's monthly burn inside the OrangeCat
ledger — the bitbaum studio narrative gets its first real data point.
- Adds @orangecat/sdk@0.1.0 as a file:vendor/ dep
(vendor/orangecat-sdk-0.1.0.tgz committed; mirrors npm-install
semantics for dev + Vercel until the SDK is published).
- src/lib/integrations/orangecat.ts: singleton client, no-ops when
ORANGECAT_API_KEY is unset. syncSubscriptionToOrangeCat() is
fire-and-forget — never throws, never blocks the subscription POST.
Stable Idempotency-Key (`fleetcrown_sub_<id>`) so retries dedupe
cleanly when server-side dedup lands.
- src/db/queries/money.ts: hook fires after the DB insert returns.
Whether the OC sync succeeds or fails is irrelevant to the user
response — the local subscription is already persisted.
- .env.example: documents ORANGECAT_API_KEY + ORANGECAT_API_BASE.
Reliability defaults baked in by the SDK: 20s timeout, 3 exp-backoff
retries on network / 5xx / 429 honouring Retry-After, User-Agent
identifying FleetCrown, AbortSignal-clean.
Failure modes are non-fatal and logged with enough context for backfill:
- ORANGECAT_API_KEY unset → silent no-op (most dev envs today)
- OrangeCat returns OrangeCatError → console.warn with code+status,
subscription still saved locally
- Network error → SDK retries internally, then console.warn
Follow-ups (each its own commit, all post-this-spike):
- schema: add subscriptions.orangecat_service_id column so the link
persists and the UI can render a "Synced ✓" badge
- once /api/v1 exposes GET via integration-key auth, run a backfill
job for existing subscriptions
- when OrangeCat publishes the SDK to npm, replace the vendor/ tarball
with a normal version range
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The cockpit→fleetcrown rename in e30c842 renamed packages/agent to
@fleetcrown/agent but the root lockfile still recorded it under the old
@cockpit/agent name, leaving the workspace entry missing entirely. Vercel
deploys masked this (they run `npm install`, which auto-heals the lockfile);
the desktop-release workflow uses strict `npm ci`, which surfaces it as
npm error Missing: @fleetcrown/agent@0.1.0 from lock file
Unblocks fleet-runner-v0.2.0 release build. No source/runtime changes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- desktop build clean, tsc clean, lint 0, home/ 89/89
- advances desktop-2/3: dispatches now produce durable events in ~/.fleetcrown/events.jsonl with proper runId/sentinel so stop-hooks and web control plane treat them as first-class
- still no embedded watcher (idle via co-running home/watcher.ts for now)
Refs: desktop-app.md phases, Cockpit.roadmap T1/T2, prior landing 2d98638
Vendor-neutral DATABASE_URL helpers, dump/restore/sync tooling, and one-command
Oracle migration after a single console VM step. Publishes the studio-stack
thoughts article and hardens build (dynamic layout, resilient sitemap).
Co-authored-by: Cursor <cursoragent@cursor.com>
- After drag-to-reorder, selected Set still held old indices — item X selected
could now refer to a different item at that position. Clear on drop instead.
- remove() was reading from localStorage which may lag behind React state when
called immediately after enqueue(). Switch to setQueue updater form so next
is derived from the authoritative React state, then write localStorage and
file synchronously inside the updater before returning.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Parser: new 'image' block () and 'code' block (fenced backtick blocks)
Paragraph accumulator breaks on backtick fences and ![ so neither leaks into prose
- MermaidDiagram client component: dynamic mermaid import, dark theme matching
Cockpit surface colors; SVG inline; falls back to raw text on render error
- Page: Next.js Image for image blocks with figcaption; MermaidDiagram for mermaid
fenced blocks; pre/code for all other lang tags
- Images convention: /public/thoughts/{slug}/, referenced as /thoughts/{slug}/file
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Auth & multi-user:
- GitHub OAuth via next-auth DrizzleAdapter; signIn callback absorbs first
login into is_default=true user so all pre-auth data stays accessible
- getCurrentUserId() helper; onboarding + profile pages
- normalizeUsername() extracted to lib/username.ts (DRY fix)
Design system:
- All public pages (landing, sign-in, onboarding, settings) rebuilt to use
ui-* classes and semantic tokens only — zero raw Tailwind color violations
- ui-input, ui-btn-*, ui-panel, bg-surface-*, text-text-* throughout
Reliability (M1–M7):
- M1: Stale claude-stop-active lock cleanup on stop hook entry
- M2: /api/inject validates tab exists in Zellij before writing /tmp
- M3: Prompt SSOT unified — claude-prompts.json single array format
- M4: DBUS UID hardcode removed (already in dotfiles)
- M5: auth.ts signIn callback + AdapterAccountType cast
- M6: project_states DB table — persists ready/closing/closed/session/prompt
across reboots; stop.sh PATCHes on stop/close; control falls back to DB
when /tmp is empty (24h window); inject writes currentPrompt to DB
- M7: scheduleOpenClawWorker now async; waits for spawn event (2s timeout);
marks run as error in DB if worker fails to start
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Patch-level bump within the 16.x line. npm flagged it as outside the
stated dep range only because package.json pinned exactly "16.2.2";
relaxing to "16.2.4" lets the security patch land without --force.
Fixes the high-severity advisory:
next Denial of Service with Server Components
GHSA-q4gf-8mx6-v5v3
Vulnerability count: 6 (5 moderate, 1 high) → 6 (all moderate).
The remaining moderates are transitive (esbuild via @esbuild-kit
inside drizzle-kit, postcss-via-next on a different branch) and need
larger major-version bumps that aren't safe to do automatically.
Bumps eslint-config-next in lockstep (same 16.2.2 → 16.2.4) since
they're released together and stay version-synced.
Verified: tsc clean, eslint clean, smoke 18/18.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Non-breaking semver-range updates to three transitive deps that had
moderate-severity advisories. All transitive — no direct package.json
change needed.
@hono/node-server 1.19.12 → 1.19.14 GHSA-92pp-h63x-v22m
hono 4.12.10 → 4.12.15 (multiple GHSAs in chain)
postcss 8.5.8 → 8.5.10 GHSA-qx2v-qp2m-jg93
Vulnerability count drops from 8 → 6. The remaining 6 (5 moderate, 1
high — Next.js DoS via Server Components, GHSA-q4gf-8mx6-v5v3) need
`npm audit fix --force` which is a breaking dep upgrade (next major)
and warrants the user's call before shipping.
Verified: tsc clean, eslint clean, prod build passes, smoke 18/18.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds husky as a dev dep and wires .husky/pre-commit to run:
npx tsc --noEmit
npx eslint src/
Both must pass for the commit to land. Smoke is intentionally NOT in
the hook because it needs a live dev server — run `npm run smoke`
manually before opening a PR.
Catches the regressions a 100-commit refactor sweep can introduce
(broken zod schema, missed import, accidentally-disabled rule)
before they reach origin/main, complementing the human / cron /
agent commit flow we've established.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>