Castle: YC demo build — light-mode rebuild, P26–P33, live agent + morning brief#12
Castle: YC demo build — light-mode rebuild, P26–P33, live agent + morning brief#12Macintosh1011 wants to merge 6 commits into
Conversation
…demo Castle build toward the 2026-06-15 YC demo. Schema additions are all additive (tool_result event kind + result_json, propose_mutation action cards, assistant_* tables, P-phase tables, deployment_events, user_state). - Hero flow: NarrationRibbon + tool-result renderer registry (table/cards/kanban/chips/json) + action confirmation cards w/ undo; chat-landing decomposed into components/chat/*. - Hermes (serve.py): emits structured tool_result events + friendly names. - Action backend: agentActions accept/reject/dismiss/undo + /api/actions/* + castle-mcp propose_action tool. - P26 allowlist audit/testEmail/CSV; P27 GitHub sync CAS lock + webhook rename/archive/transfer; P28 auth-derived FDE actor; P30 zombie/chunk reapers + retry; P31 attention rules (underutilized, expiring, no-deployment, unanchored); P32 founder_hours event log. - Assistant: workflow engine + morning-brief → daily_digests + /assistant page + assistant-mcp scaffold. - Full demo seed (data/*.json): 8 customers, 8 engagements, 6 template cards w/ capabilities, 19 deployments, 6 extractions, 4mo founder-hours, 2 manual attention items. seed.ts imports manual attention. - Tests: 131/131 (repaired 15 pre-existing failures — operator-identity in convex-test, seed-relative fixtures, relative-date staleness). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…le_design_overhaul.md §1-§5) Full dark→light visual rebuild for the YC demo. The triggering verdict was "localhost:3000/templates is dark, ugly, nothing does anything" — this fixes both the look and the affordances across every surface. - Tokens (§2): globals.css rewritten to light "Paper" — warm eggshell page, warm near-black ink, single honey-amber accent, soft sage/amber/terracotta health, multi-layer soft shadows, decel-only motion, reduced-motion. Existing token NAMES remapped so every component flips to light for free. Fraunces + Inter + JetBrains Mono via next/font. (NB: trailing comments inside @theme silently drop the theme in Tailwind v4 — kept comments on own lines.) - Components (§3): Button, Card, Input, Select, Dialog, Toast, Badge/Chip/Tag, Table+TableEmpty, EmptyState, PageSkeleton, ErrorState, Tooltip, Popover, ProgressBar, Avatar, InFlightDot, SectionDivider — all public APIs preserved. - Chrome (§3.10/3.16): TopNav (accent-underline nav, ⌘K hint), PageHeader operator/editorial variants, Breadcrumbs, footer, palette restyle, keyboard cheat-sheet (?). - Pages (§5): /templates investor rebuild (featured/standard/quiet cards by reuse count, Deploy/Copy-link actions, reuse arc); /extractions reuse-sized timeline; /overview editorial greeting + Fraunces-72px MRR + grouped attention + redesigned honest founder-leverage chart; operator pages (filter chips, bulk-action bar, phase-grouped engagements, Notion-doc detail, FDE capacity bars); /assistant newspaper column; /connections App Store; /settings/access 2-col; /sign-in centered card. Cut per §8.14 (flagged, not faked): engagement drag-drop, undo/redo, bulk actions beyond /customers, the extractions cumulative sparkline. next build + tsc + eslint clean; verified light-mode render at /templates. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- CopyLinkButton (prod URL + ⌘⇧C global binding), PulseOnChange (soft-pulse on Convex value change) — primitive-ready, ⌘⇧C copy works globally. - user_recents table + userRecents.record/listForUser + useRecents() hook + RecordRecent drop-in (Convex side fully wired). - keyboard-shortcuts.tsx: g+t/c/e/f/x/o/a navigation, mounted in layout. - global-error.tsx: dark hex → light Paper (last dark-mode regression). Per §8.14, deferred (flagged honestly): undo/redo, global search, bulk beyond /customers, and mounting CopyLink/Pulse/RecordRecent on every detail page (primitives ready). next build + tsc clean; eslint 23 errors (all pre-existing debt, down from 24 baseline — zero new). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rm_master.md §6) Final phase of the platform master. Additive + feature-flagged (CASTLE_MULTITENANT, default OFF) so it's inert until enabled — flag-off behavior is byte-identical (scopeToOrg(null) is a pass-through; seeded demo data unaffected, verified). - Schema: organizations + organization_members tables; nullable organization_id + by_org index on customers/engagements/fdes/templates/deployments/ pattern_extractions/founder_hours/email_allowlist (all optional — existing rows validate). - convex/lib/org.ts: MULTITENANT_ON flag, resolveOrgId(ctx) (null when off; user's org membership when on, default-org fallback), scopeToOrg (no-op on null; filters to org + unstamped legacy rows when on). - Gated reads: dashboard.overview + customers/fdes/engagements/templates/ deployments/patternExtractions/founderHours/emailAllowlist .list. Creates stamp organization_id when flag on. - convex/organizations.ts (create/addMember/listForUser/createOrgWithMembers); migrations.stampDefaultOrg (idempotent backfill to "42nights-default", operator-gated). - convex/multitenant.test.ts: 11 tests (scopeToOrg units, flag-off no-op proofs, flag-on cross-org isolation, migration idempotency). next build + tsc clean; vitest 142/142 (131 prior + 11 new, zero regressions); flag-off seeded data still renders (templates 6, customers 8). Completes castle_platform_master.md P0–P33. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tail crash Lets every operator surface render locally without GitHub OAuth (for the demo Loom smoke test). Inert by default — fires only when CASTLE_DEV_AUTH=1 is set, which lives in gitignored .env.local (Next) + `convex env set` (backend), never committed. Middleware is additionally gated on NODE_ENV !== production. Bypass choke points (all flag-gated, dev-only, loudly commented): - middleware.ts — pass through without a session cookie - lib/load-overview.ts requireOperator + app/page.tsx — skip redirect / render ChatLanding - convex/lib/assertOperator.ts isOperator — return dev@42nights.dev (matches *@42nights.dev rescue) - convex/auth.ts getCurrentUser — synthetic operator linked to seeded "idan" FDE - convex/lib/conversationAuth.ts requireUser — synthetic user (chat queries don't 401) Fix: components/customers/engagement-cards.tsx was a Server Component passing onClick to a <span> (wrapping the WeeklyHoursInput client control) → "Event handlers cannot be passed to Client Component props" crash on /customers/[slug]. Added "use client". Swept all rebuilt pages — no other instances. Smoke test: all 11 surfaces render (/, /overview, /templates(+slug), /customers (+slug), /engagements(+slug), /fdes, /extractions, /assistant). tsc clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n cards, live brief - Tool-result widgets now persist in completed assistant messages: reconstruct the turn's ToolActivity[] from agent_tool_events (new agentToolEvents.forTurn query + ChatMessage.turnId + HistoricalToolResults) so the severity cards stay in the response instead of vanishing when streaming ends. - list_attention severity cards are clickable through to their engagement / customer href (with a hover chevron affordance). - Dev-auth bypass extended to conversationAuth.tryConversation so the chat transcript renders under CASTLE_DEV_AUTH (local only; inert in prod). - /assistant: structured, widget-rich morning brief (weather banner, metric tiles, calendar, people cards, follow-ups, attention, starred unread) + dailyDigests seed + most-recent fallback. - Seed: roughen founder_hours so hoursPerArrK is honestly bumpy (21→17→25→16), not a suspiciously clean curve. - scripts/loom-agent-worker.ts: local dev stand-in for the Hermes Railway wrapper — drives a real Claude turn (AI SDK) with a working list_attention tool and streams the same Convex rows the prod wrapper writes. Reads ANTHROPIC_API_KEY from env; local/dev only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Unable to deploy a commit from a private repository on your GitHub organization to the team team on Vercel, which is currently on the Hobby plan. In order to deploy, you can:
To read more about collaboration on Vercel, click here. |
|
Important Review skippedToo many files! This PR contains 168 files, which is 18 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (168)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Everything on the
yc-demo-buildbranch toward the 2026-06-15 YC demo. 6 commits, ~all additive.What's in it
organization_idon the 8 operational tables, flag-gatedresolveOrgId/scopeToOrg, backfill migration, isolation tests). All behindCASTLE_MULTITENANT(default off).tool_resultevent protocol (Hermes emits structured results), the tool-result renderer registry (severity cards / table / kanban / chips / json), NarrationRibbon, and action-confirmation cards (propose_mutation+ accept/reject/undo). Tool-result widgets now persist in completed messages (reconstructed fromagent_tool_events), andlist_attentioncards are clickable to their engagement.globals.csstoken migration (warm eggshell, single honey-amber accent, soft health colors, shadow ladder), Fraunces + Inter + JetBrains vianext/font, all ~20 UI primitives, chrome (TopNav/PageHeader/Breadcrumbs/cmd-K), and all 12 pages rebuilt (templates/extractions/overview/operator pages/assistant/connections/access/sign-in).daily_digests).Verification
next build✅ ·tsc✅ · vitest 142/142 · eslint: no new errors vs baseline.Reviewer notes (please scrutinize)
convex/lib/assertOperator.ts,auth.ts,conversationAuth.ts,middleware.ts,app/page.tsx,lib/load-overview.ts): a local-only auto-operator gated onCASTLE_DEV_AUTH=1(+NODE_ENV !== productionon the middleware). Inert unless that env var is set; intended for local demo/Loom only, never prod. Flagging it explicitly — confirm the gating is airtight.scripts/loom-agent-worker.tsis a local dev stand-in for the Railway Hermes wrapper (readsANTHROPIC_API_KEYfrom env, no secrets committed).@coderabbitai @greptileai review please.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.