Two things ship together in this commit because they are answers to
the same question — how should Cockpit and OrangeCat relate to each
other from a visitor's perspective.
1. New "external" entry kind in PUBLIC_NAV. PublicNavEntry can now
be "menu" (dropdown), "link" (internal route), or "external"
(cross-origin link with an ExternalLink indicator). Adds an
OrangeCat entry at https://orangecat.ch so visitors landing on
cockpitapp.vercel.app can discover the sibling product.
Renders on desktop with a small chevron-out icon and on mobile in
the drawer with the same indicator + the description as subtext.
target=_blank rel=noopener so the cross-origin handoff is clean.
2. New Thoughts essay "Two Products or One" — direct answer to the
strategic question of whether Cockpit and OrangeCat should
eventually merge into a single product. Argues the systems-
engineering cut: converge the user experience now, converge the
agent reasoning soon, leave the codebases separate until merging
clearly reduces complexity rather than introducing it. Names the
phased path (six months / twelve months / twenty-four months) and
the concrete scenarios where each direction wins out.
Companion to "The Two Halves of the Individual Singularity,"
"From Two AIs to One," "Where Stakeholders Live," and "The Techno-
Capital Machine for Individuals." Together those five essays form
the strategic substrate under which the joint engineering work
happens.
The user explicitly framed this turn as "approach as a team of
extremely high level systems engineers and designers." This commit is
that team's coherent answer to (a) how the products should reference
each other in their marketing surfaces and (b) whether they should
fuse into one. Both questions answered concretely, both deliverables
pointable-at.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Watch's templated context line ("Overdue by 29d", "85% done · 1mo
past target", etc.) is concrete and ships in the server render. This
commit adds an LLM-composed paragraph on top — Ivy speaking the focus
back to the user in one or two warm, direct sentences with a
proposed move.
Architecture:
POST /api/today/watch/compose
Body: { kind, title, context }
Returns: { composed: string }
Calls Groq with GROQ_FAST_MODEL via the existing callGroqText helper.
System prompt enforces the voice: direct, warm, no preamble, no
hedging, no questions back. Two-sentence cap. 8s timeout, 120 tokens.
IvyNudge client component renders inside the Watch card. Reads from
localStorage cache first (1h TTL keyed by kind|title|context). If
miss, posts to compose; replaces "Ivy is composing…" shimmer with
the prose when it lands. If the endpoint 503s (no key, rate-limit,
timeout), renders nothing — parent's template prose stays in place.
Strict enhancement, never a regression.
Why this matters:
The Watch already proves Ivy is paying attention. This makes Ivy
*speak* — and speaking specifically about the user's life with prose
the user could not have written themselves is the demo moment that
shows the AI is composing, not just templating. It is the next step
of the same line that shipped the Watch's seven priority branches
(commitments, goals, habits, bills, events, relationships, stalled
goals).
Cost shape: caches aggressively in localStorage. A focus item
typically lasts hours or days — most page loads hit cache, not Groq.
The compose call only fires when the focus changes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Direct answer to the founder's question: where should the stakeholder
map (competitors / collaborators / investors / customers / employees /
acquirers / acquisition targets / in-house dev projects) live —
Cockpit, OrangeCat, or both?
Honest answer: the graph belongs in OrangeCat, the operations belong
in Cockpit, and the convergence is what makes the feature feel
seamless instead of split.
Two deliverables:
1. New Thoughts essay "Where Stakeholders Live"
(content/thoughts/where-stakeholders-live.md) — argues the eight
stakeholder categories are all edges between entities OrangeCat
already has (no new entity types). The clean split: OrangeCat
stores the typed-edge graph; Cockpit reads it via the identity
bridge and surfaces signals through the Watch and approval queue.
Ship competitors first — most automatable, highest signal density,
concrete action loop.
2. New STAKEHOLDERS phase in Cockpit's public roadmap, placed under
CONVERGE because the stakeholder graph IS the first concrete cross-
product use case — same data, two surfaces, one agent reasoning
across both. Five bullets covering the storage / operations split,
the competitors-first sequencing, and the no-second-graph
architectural commitment.
This makes the convergence argument concrete. From Two AIs to One was
the abstract case for convergence; this is the first feature that
operationalises it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Direct answer to the founder's strategic question: is Ivy as the tie
between Cockpit and OrangeCat sustainable at billions of users? Honest
answer: no, not as currently structured. The tie today is the founder
owning both products, not the software. That scales to one user.
Two deliverables, one strategic thesis:
1. New Thoughts essay "From Two AIs to One"
(content/thoughts/from-two-ais-to-one.md) — argues that two AIs per
user is engineering convenience and must converge into one agent per
user before the architecture scales beyond the early adopter phase.
The user-facing reality has to be "my agent" — one memory graph, one
reasoning loop, one autonomy ladder, one approval queue — with
Cockpit and OrangeCat fading into engineering boundaries below the
surface. The approve/disapprove interaction model is what makes
nine-billion-builder scale work; humans cannot direct eight agents
each, but they can triage hundreds of decisions per day.
2. New CONVERGE phase in Cockpit's public roadmap. Five concrete
convergence steps: memory unification, reasoning-loop unification,
autonomy-ladder unification, approval-queue unification, surfaces-as-
engineering-boundaries-only.
The phase ordering is now: NOW → NEXT → AFTER → THEN → LATER → TEAMS →
CONVERGE → ECONOMY → ROBOTICS. CONVERGE precedes ECONOMY because the
identity bridge / integration work assumes a single user-facing agent
model that we are explicitly committing to here.
Paired with the prior essay "The Two Halves of the Individual
Singularity": that piece argued why production and transaction must be
paired infrastructure. This one argues that the pairing itself has to
collapse from two AIs into one as scale moves from thousands to
billions.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two deliverables, one strategic thesis:
1. New Thoughts essay "The Two Halves of the Individual Singularity"
(content/thoughts/the-two-halves-of-the-individual-singularity.md)
— published at /thoughts/<slug>. The argument: the individual
singularity is not a productivity gain, it is a leverage shift, and
that shift requires both production (Cockpit) and transaction
(OrangeCat) infrastructure built from the same first principles. AI
agents as first-class actors, the individual as the unit of leverage,
no gatekeepers between you and what you can build.
2. New ECONOMY phase in the public roadmap (src/config/marketing-content.ts).
Five concrete first integrations:
- Identity bridge — Cockpit users connect their OrangeCat actor.
- Publish to OrangeCat — agent output becomes a Lightning-paid listing
in one click.
- Agent costs as outflows — compute, API tokens, third-party services
route through the operator's OrangeCat Cat, per project.
- Subscriptions as assets — drag becomes liquid; refinance, sublet,
co-fund via OrangeCat without leaving the platform.
- Cockpit pricing on Lightning rails — settle through OrangeCat. No
Stripe in the path. Pseudonymous customers welcome.
Why this matters strategically: it makes the integration pointable-at.
Investors evaluating either platform see the pair, not the silo. The
founder eats their own dogfood — Cockpit revenue routes through
OrangeCat — proving both platforms at once. The roadmap phase is a
public commitment; the essay is the argument behind it.
The pieces exist in production today on both platforms. The integration
is engineering, not invention.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The third major private-zone domain joins the synthesizer. A habit due
today, not yet done, with a streak ≥ 7 days is a real psychological
moment — the user has built momentum and is one missed day from the
streak breaking. Surface it.
Reuses getTodayHabits which already computes the streak from completion
history (no duplicate streak math). Filters to streak ≥ HABIT_STREAK_THRESHOLD
(7d) and not-done-today, sorts by streak desc so the longest streak
gets the focus when multiple qualify.
Priority order in pickFocus (full chain):
1. Overdue commitment — explicit promise, now late.
2. Overdue goal — close to done, past target.
3. Habit at risk — ≥7 day streak, not done today. ← NEW
4. Imminent bill — money about to leave in <5d.
5. Imminent event — non-financial deadline in <5d.
6. Stale contact — relationship past fading threshold.
7. Stalled goal — 21+ days idle on an active goal.
Habits slot ahead of bills because the streak is broken at midnight if
you do nothing today; a bill renewal has more flexibility. Below
overdue commitments and goals because those have an explicit promise
already broken.
Ivy handoff is direct: "Nudge me to do it now in two short lines — be
direct and warm, not preachy."
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The first cut of Ivy's Watch was aware of goals, events, commitments,
and subscriptions. Relationships — the largest private-zone domain by
volume (this account has 1,286 contacts) — were invisible to the
synthesizer. Add them.
A new stale-contact branch in pickFocus + a dedicated query that returns
the top N entities of type=person whose last interaction is older than
HEALTH_FADING_DAYS (30d). The Watch's totals strip now surfaces the
count ("25 relationships going stale"); when the priority chain falls
to relationships (no overdue commitments, goals, bills, or events), the
focus zooms in on the most-stale person by name with their days-since
context.
The Ivy handoff prompt is deliberately direct: "Draft a warm, short
check-in message I can send to {first-name}. Keep it natural, no
business angle, in the tone I'd actually use." That turns the Watch
from "here is who you should think about" into "here is the AI doing
the work of remembering for you."
Priority order in pickFocus (highest first):
1. Overdue commitment — explicit promise, now late.
2. Overdue goal — close to done, past target.
3. Imminent bill — money about to leave the account in <5d.
4. Imminent event — non-financial deadline in <5d.
5. Stale contact — relationship past the fading threshold. ← NEW
6. Stalled goal — 21+ days idle on an active goal.
Relationships slot below acute money/deadline categories but above
stalled goals — losing a relationship is slower than missing a deadline
but more emotionally consequential than an idle work item.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The product had data (1,286 contacts, 7 goals, 15 commitments…) but no
moment where the user felt the AI was actually managing their life. The
Brief-Ivy button was user-initiated; the Action Queue surfaced templated
check-ins. Nothing proactive said "here is the one thing right now."
Build a Watch card that sits at the top of /today (when the private zone
is unlocked) and synthesizes signals across categories into one focus:
IVY IS WATCHING
OVERDUE COMMITMENT
Get a $50 signup bonus when you spend $100 within 30 days of
getting a new Coinbase One Card →
Overdue by 29d
Also: 1 overdue goal · 5 more imminent bills · 7 stalled goals.
[Brief Ivy on this]
Priority order is deliberate:
1. Overdue commitments — promises the user made, now late.
2. Overdue goals — close to done, past target.
3. Imminent renewals — money about to leave the account in <5 days.
4. Imminent events — non-financial deadlines in <5 days.
5. Stalled goals — 21+ days idle on an active goal.
When nothing in any category fires, the card stays present but shows
"Nothing pressing in the private zone right now" — calm, not absent.
Implementation:
- New src/db/queries/today-watch.ts — one getTodayWatch(userId) that
fans five COUNT+TOP queries through Promise.all and runs the priority
ordering in a single pickFocus pure function. SSOT for what counts as
"the focus" lives there; future refactor (LLM synthesis, learned
weighting, etc.) just swaps that one function.
- New src/components/today/TodayWatch.tsx — server component, gated by
isPrivateZoneLocked, wired to the existing IvyDispatchButton so the
"Brief Ivy on this" handoff prebuilds a prompt body specific to the
current focus.
- New ui-today-watch-* class block — theme-aware tokens throughout.
No LLM call yet — this is pure data synthesis. The hooks are in place for
a future iteration that replaces the templated context strings with
Ivy-composed prose without touching the data layer.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The /unlock page listed what private areas exist (Memory, People, Goals…)
with abstract descriptions. The user had no concrete sense of what
unlocking actually restores — "your contacts" is vague; "1,286 contacts"
is visceral.
Add a single getPrivateZoneStats(userId) query that aggregates COUNTs
for memory entities, person entities, goals, habits, events,
subscriptions, and commitments — seven independent queries fanned out
through Promise.all so the total latency is one round-trip.
Wire the counts into the "What this unlocks" panel — each area now shows
its label, description, AND the live count on the right. Empty areas
render without a count (zero is noise; "Memory · 0 entities" would
imply the gate is gating nothing).
End-to-end Playwright test:
POST /api/auth/pin (PIN: 55550) → ok: true
navigate /today (locked) → banner up top, cards hidden
navigate /today (unlocked) → Action Queue, full SummaryBar
navigate /unlock → counts render (1.286 contacts,
1.324 entities, 15 commitments…)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two real bugs surfaced by testing the locked /today end-to-end through
the actual UI:
1. PrivateZoneDataGate placeholders read "Enter your PIN on **People**
to view {label}" — stale copy from the era when /people was the
unlock entry point. /unlock now exists; the placeholder routed the
user to the wrong page.
2. A locked /today was a silent collection of empty / placeholder cards
with no inviting unlock CTA. The user had no obvious "this is gated
on purpose, click here" affordance.
Fixes:
- PrivateZoneDataGate: copy now reads "Unlock the private zone to view
{label}" with the link pointing at /unlock.
- New LockedZoneBanner — a server component that renders a single
prominent card at the top of /today when isPrivateZoneLocked(userId).
Names what's behind the gate (goals, people, habits, events, money,
memory) and surfaces one Unlock CTA. Renders nothing when unlocked.
- Three new ui-locked-banner-* classes for the banner styling, all
theme-aware tokens (no hardcoded colours).
Verified end-to-end via Playwright: unlock with PIN 55550 succeeds via
the API endpoint, locked state hides every private card and zeroes the
SummaryBar chips, unlocked state restores the full Today.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three cards still rendered private data on /today even when the PIN gate
was locked. Each one had a different data path, so the previous
gating sweep missed them:
- ActionQueueCard — surfaces "Check in with X" actions where X is a
contact from the People graph. Names leaked through even when locked.
- AlertsCard — alerts can include contact names ("Andreas needs
attention"), goal titles, and money amounts. All locked-state
visible.
- CommitmentsCard — commitments are personal life management; same
sensitivity as habits / money / events. Title + due date + financial
impact were rendering through.
Same pattern as the existing gates (GoalsDueCard, EventsDueCard,
StuckGoalsCard, MemorySummaryCard) — return null when
isPrivateZoneLocked(userId).
Also tighten SummaryBar — the locked-state field zeroing now covers
overdueCommitments, urgentAlerts, and pendingDrafts in addition to the
goals / habits / events / contacts counts. Those three are all
private-zone-derived too.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three sections × ~6 items each plus headers added up to a sidebar that
required scrolling on shorter viewports and gave the user no way to hide
groups they don't need right now. Make sections collapsible.
Behaviour:
- Defaults: Work expanded, Private collapsed, Site collapsed. Picked so the
daily operational nav is visible while less-frequent groups stay quiet.
- User toggles persist in localStorage (key cockpit-sidebar-sections-v1)
with DEFAULT_EXPANDED merged in, so adding a new section in the future
picks up its default without overwriting saved prefs.
- Section containing the active page auto-expands so the active item is
never hidden under a collapsed header.
- When the whole sidebar is in icon-only mode, expansion is ignored and
every item renders as an icon — toggling has no meaning without labels.
Private when locked:
- The Private section header transforms into the unlock affordance itself.
No expand chevron, no internal "Unlock to view" entry — clicking the
header routes straight to /unlock. The auto-expand-on-active rule skips
Private when locked (the user shouldn't even be on a private page).
- When unlocked, the user can expand/collapse like any other section.
Implementation:
- ui-sidebar-section-toggle for the chevron+label button.
- ui-sidebar-section-locked for the lock-state non-toggle header.
- Drop the now-redundant ui-sidebar-section-header + ui-sidebar-private-unlock
classes (the locked header subsumed both roles).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous model gated the entire private surface behind a single
PRIVATE_ZONE_PIN_HASH env var, which only the founder could set. That
worked for one user; it does not scale to a SaaS where each operator has
their own contacts, goals, habits, events, money, and memory graph.
Move the PIN to the user record so every user can manage their own gate.
Schema:
- Add private_zone_pin_hash (text, nullable) + private_zone_pin_set_at
(timestamptz) to the users table on both local and Neon.
Library:
- Refactor src/lib/private-zone.ts around getEffectivePinHash(userId),
wrapped in React's cache() so multi-component pages only hit the DB
once per request. The env var stays as a fallback for users without
their own hash so existing installs keep working through the
transition; new users set their PIN in-app.
- isPrivateZoneConfigured and isPrivateZoneUnlocked become async +
per-user. New isPrivateZoneLocked(userId) helper collapses the common
configured && !unlocked pattern into one call.
- guardPrivateZoneApi is now async + per-user.
API:
- POST /api/auth/pin still verifies and sets the unlock cookie, but
resolves the hash via the user record. Rate-limit moved from IP-key
to userId-key (multi-user prod has many users behind shared IPs).
- New POST /api/auth/pin/setup — set or change the PIN. Requires the
current PIN when one already exists.
- New DELETE /api/auth/pin/setup — disable the PIN entirely. Always
requires the current PIN.
UI:
- New /unlock page replaces the arbitrary "click Unlock → land on /people"
flow. The form shows what's behind the gate (Memory, People, Goals,
Habits, Events, Money) and accepts a ?next= param so the user lands
back where they were going after a successful unlock.
- Sidebar "Unlock to view" now routes to /unlock (not /people).
- Settings → Privacy gets real management UI: Set PIN, Change PIN,
Disable PIN, Lock now. Each action lives in its own subform with
proper validation (digits only, 4–12 length, confirm match).
- Every call site of the old configured && !unlocked pattern migrated
to await isPrivateZoneLocked(userId).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two issues bundled:
1. After the sidebar section refactor, Settings stopped rendering — NAV.settings
was kept in the flat NAV_ITEMS list but absent from every SIDEBAR_SECTIONS
group, so SidebarNav had nothing to draw. Restore access by adding a
Settings link to the sidebar footer cluster alongside Lock / Theme /
Sign out, where utility navigation already lives in this product.
2. Settings was rich on the operational side (Profile, Account, Location,
Agent, Projects, Team, Billing) but had no surfaces for two things the
user explicitly asked for: appearance customization and privacy.
Add two tabs:
- Appearance — Light / Dark / System theme picker. Future expansion
hook for density, accent, etc.
- Privacy — Status panel showing PIN configuration + current
lock state, with a Lock-now button when unlocked. Honest copy
about the env-managed PIN and the roadmap items (in-app PIN
management, data export, full deletion).
Tab order placed near the front so customization is reachable before the
operational tabs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Architectural distinction the public marketing nav has been blurring:
platform-wide content (mission, philosophy, roadmap, whitepaper, investors)
belongs in the public nav. Per-user content (a particular user's Thoughts)
does not — even when the founder's own essays happen to discuss the
platform. Marketing surfaces the product; user surfaces (the in-app
sidebar, /u/<username>/...) surface the person.
- Drop Thoughts from the public nav. The /thoughts route stays reachable
for now (the founder's essays are the only data there), but it is no
longer surfaced as platform marketing — a downstream refactor will move
individual essays under their author's profile route.
- With Thoughts gone, the "Company" mega-menu had only Investors left. A
one-item dropdown is silly; refactor the SSOT type so entries can be
either a "menu" (dropdown + descriptions) or a "link" (direct nav
link), and make Investors a link.
- Rename PUBLIC_NAV_GROUPS → PUBLIC_NAV (it is no longer all groups) and
derive PUBLIC_NAV_LINKS from it.
- PublicNav.tsx walks the entries and renders the right shape per entry
on both desktop and the mobile drawer.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Memory is the user's personal entity graph — contacts, projects, decisions,
conversations — derived from the same private data People / Goals / Habits
surface. It belongs alongside them in the PIN-gated zone, not in a separate
"Knowledge" category invented to pair it with Thoughts.
Thoughts is the opposite: essays the user authors and publishes to the
public /thoughts route. Its sensitivity is "published content," not
"private graph." Different domain → different home.
Re-audit by data sensitivity, three sections instead of four:
- WORK (always visible): Today, Control, Projects, Prompts, History,
System, Thoughts.
- PRIVATE (PIN-gated): Memory, People, Goals, Habits, Events, Money.
- SITE (marketing): Mission, Philosophy, Roadmap, Investors,
Whitepaper.
Concrete changes:
- SIDEBAR_SECTIONS in config/navigation.ts: drop "Knowledge" group.
- Move /memory route into src/app/(app)/(private)/memory so direct visits
hit the existing PrivatePinGate flow.
- MemorySummaryCard on /system returns null when PIN-locked so entity /
relation counts do not leak through the System surface.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolve three coupled issues:
1. Sidebar gets too crowded with 19 items and no domain grouping.
2. Goals lives outside the (private) route group even though it is one of
the personal-life surfaces the user wants PIN-gated alongside money,
habits, people, events.
3. Public marketing nav exposes six flat links; the sign-in / get-started
pair on the right is visible even for already-signed-in users.
Sidebar restructure (SSOT in config/navigation.ts):
- Replace flat NAV_ITEMS with SIDEBAR_SECTIONS — work / knowledge / private
/ site groupings. NAV_ITEMS is now derived from the sections so mobile
bottom nav and the command palette keep working without duplication.
- SidebarNav renders a section header per group. The private section uses
the existing usePrivateZone() hook; when the PIN is configured but
locked, the section collapses to a single "Unlock to view" entry that
routes through /people (existing PrivatePinGate flow).
- New ui-sidebar-section-header / -lock / -private-unlock classes —
theme-aware tokens, no hardcoded colours.
Private zone consistency:
- Move /goals into src/app/(app)/(private)/goals so direct visits hit the
existing layout's PIN gate, matching events / habits / money / people.
- GoalsDueCard, StuckGoalsCard, EventsDueCard return null when PIN-locked
so Today's actionable grid does not leak counts.
- SummaryBar zeroes out activeGoals / habitsTotal / goalsDueSoon /
stuckGoals / eventsDueSoon / staleContacts when locked.
Public mega-menu (SSOT in config/auth.ts):
- Replace flat PUBLIC_NAV_LINKS with PUBLIC_NAV_GROUPS = Product (Mission,
Philosophy, Roadmap, Whitepaper) + Company (Investors, Thoughts). Each
item carries a one-line description. PUBLIC_NAV_LINKS is now derived
from the groups so legacy consumers keep working.
- New PublicNav client component renders two hover/click dropdowns on
desktop (md+) and a portaled full-screen drawer on mobile (<md). Esc
closes either; click-outside closes the dropdown; body scroll locks
while the drawer is open. createPortal ensures the drawer is not
trapped inside ui-public-surface's stacking context.
- PublicSurface now uses PublicNav internally and drops the navLinks prop;
pages pass right={<PublicHeaderActions />} only. AuthShell opts out of
the marketing nav via showNav={false}.
Misc cleanup:
- Replace remaining inline border-white/10 in marketing JSX with
border-border-subtle.
- Drop the now-unused PUBLIC_NAV_LINKS imports across marketing pages and
AuthShell.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bring the public marketing pages (/, /mission, /philosophy, /investors,
/roadmap, /whitepaper) and the auth surface (/sign-in, /sign-up, /onboarding,
etc.) onto the same theme-aware token system that the rest of the app uses.
Before: ui-public-* and ui-auth-* both hardcoded text-white/X and bg-white/X
opacities. Marketing was visually broken in light mode; the two namespaces
duplicated the same visual primitives with bespoke opacity values.
After: both class families resolve every visible decision through the shared
--text-*/--surface-*/--border-* tokens that flip with .dark. One change to
:root/.dark in globals.css now rethemes both surfaces in lockstep.
Specific changes:
- ui-public-surface: bg-surface-public (always dark) → bg-background (flips).
- Backdrop grid + glow gradients now read --public-grid-stroke and
--public-glow-* variables that flip with theme.
- All ui-public-* + ui-auth-* classes refactored: text-white/X → text-text-*,
bg-white/X → bg-surface-*, border-white/X → border-border-*, bg-white text-black
buttons → bg-text-primary text-text-inverted.
- Drop dead ui-brand-mark-inverted / ui-brand-kicker-inverted /
ui-brand-wordmark-inverted classes and the BrandMark `inverted` prop; the
brand mark now uses --text-primary which already flips correctly.
Bidirectional navigation:
- New PublicHeaderActions server component renders session-aware right-side
CTA — guests see Sign in / Get started; signed-in users see Open Cockpit →.
Used by every marketing + whitepaper page.
- Add Thoughts to PUBLIC_NAV_LINKS; reorder Mission → Philosophy → Roadmap →
Investors → Thoughts → Whitepaper for a clearer narrative flow.
- New SITE_NAV_ITEMS in config/navigation.ts surfaces the marketing pages
inside the app sidebar under a "Site" header so logged-in users can reach
Mission/Philosophy/Roadmap/Investors/Whitepaper without leaving the shell.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the three-paragraph skeleton with seven detailed phases — Foundation,
Local Fleet Runner, Remote Control Channel, Mobile Fleet Control, Cloud Agents,
Teams, Robotics — each with a summary, concrete bullets, and (where useful) a
trailing note.
Adds a Throughlines section enumerating the cross-cutting constraints that hold
across every phase: local execution privileged, open and local models first-class,
autonomy as a user-controlled dial, outbound-only connections, nothing hidden.
This brings the public roadmap into alignment with the depth of the two Thoughts
essays shipped yesterday — the Electron app, the authenticated outbound WebSocket
to the control plane, mobile apps, complementary cloud execution, and the
robotics continuity.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add /mission, /philosophy, /investors, /roadmap with x.ai-style discipline:
giant display titles, sparse confident statements, numbered value markers,
generous whitespace, consistent final CTA, opacity-graded body text.
- Rewrite landing page with the same shared ui-public-* primitives so all
marketing pages share one design surface.
- Add src/config/marketing-content.ts as the SSOT for every public string —
rebrand or A/B test by editing this one file.
- Extend src/config/brand.ts with MARKETING_TAGLINE / MARKETING_SUBTITLE /
MARKETING_HERO_PRIMARY / MARKETING_HERO_SECONDARY / MARKETING_POSITIONING.
- Add ~20 new ui-public-* classes to globals.css (display titles, hero parts,
eyebrow, lede, body, meta, step-num, prose-strong/-muted, CTAs, band) so
components carry zero arbitrary values and zero raw color/typography.
- Add FinalCta component used by every marketing page for a consistent close.
- Add the four marketing routes to the public matcher in src/proxy.ts so they
render without auth.
- Replace generic Features/Pricing entries in PUBLIC_NAV_LINKS with the four
new pages + keep Whitepaper.
- Publish two Thoughts essays: enabling-the-individual-singularity and the
local-fleet-runner-and-remote-control-plane-architecture.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Added support for 'Auto paused' chip in ProjectStatusChips when autoContinueEnabled=false for the project.
The indicator is ready (one-line wiring from the card passes the value). Combined with the existing prominent Play/Pause button in the input, this makes per-project pause obvious for launch.
Part of the final launch-day tranche.
Only render the 'Reuse recent prompts' section when there are 2+ useful non-meta items after filtering.
This directly improves the visual duplication the user reported between 'Sent prompts', 'Reuse recent prompts', and the Prompt library on the /control project cards.
Part of launch-day tranche for cleaner, more trustworthy cards.
The previous quit logic was too polite (only sent quitCommand and polled). Now it always does:
- quitCommand (if registered)
- Ctrl+C (hard interrupt)
- longer best-effort wait
This makes the switcher in the /control cards actually work for real usage (Grok, custom Claude wrappers, etc.) instead of leaving the old agent running.
Part of the launch-day tranche for functional agent switching + per-project pause.
- Card header: when project is ready and has a real handoff with 'next', show 'Next: <short>' instead of generic 'Ready for next step' tag. Directly reduces the duplicate 'Ready for next step ✓ ✓ Ready for next step today' + meaningless checkmarks the user sees on the Cockpit card.
- sendCustom + smartEnqueue: strengthened special case so any prompt starting with 'status: working/ready' (the exact pattern the user pastes to drive the agent) always takes the direct send path instead of being routed to queue just because the card thinks the project is busy.
- Builds on previous agent label fallback (now shows correct live agent like 'Grok' instead of stale 'Claude ready') and mobile label cleanup.
This delivers real, visible progress on both the lying/crowded card UI and the 'UI send not landing in tab' problem in one deployable change. Enough micro-slices.
When the text the user pastes into a project card starts with 'status: working' (or ready), treat it as an intentional custom instruction and send direct instead of routing through the 'if not idle then queue' logic.
This directly addresses the reported symptom: pasting a full task starting with 'status: working' + sending (via queue button or direct) was not landing in the active tab.
Part of making the UI→tab dispatch loop reliable while fixing the lying/crowded card status.
- formatAgentRuntimeLabel now accepts optional liveTab and falls back to inferAdapterFromTabName when activeAgents and currentPrompt.adapter are empty.
- Updated call sites in ProjectStatusChips and live tab rows.
- This makes the card for a project the user is actively in (e.g. running Grok in the Cockpit tab) show the correct agent instead of stale 'Claude ready'.
- Part of the duplicate H2 + status labels truthfulness slice.
- ControlPanel mobile summary: 'Terminal workspaces' → 'Workspaces' (shorter, less visual duplication with the inner live panel content and desktop h2).
- ProjectStatusChips: improved tooltip on the agent chip to explicitly address 'why does it say Claude ready when I'm using Grok?' and point to live detection source + switcher/repair.
Part of the duplicate H2 + status labels truthfulness slice (user dogfood feedback).
- project-intent-panel.tsx and BeaconClient.tsx now exclude the autopilot 'Setup (run, read outputs)...' and 'Picked X (T_)' prompts from the recent chips the user sees in /control cards and beacon popup.
- Directly addresses the reported pollution (same meta prompt showing 'used 123×' in Reuse recent while Sent prompts also lists them, with Prompt library between).
- Reduces visual duplication and makes real user history more prominent.
Part of the ordered UI truthfulness work (recent prompts section cleanup).
- ProjectCard: onEnqueueCustom now smartEnqueue — if project idle/ready (no agent, ready tone), sendText() direct; else enqueue() to DB queue for auto-drain. Matches exact user spec for type/library/history flows. Alt+Enter and ListPlus + mic path all benefit.
- prompt-input: updated status/tooltip to describe the new "queues (or sends now if idle)" behavior.
- use-project-card-actions + dispatch/route: pass project.profile?.mission (and accept in body). buildPrompt includes it in projectCtx; COMPOSED instruction updated to require the body stay aligned with mission.
- dispatch-gates: import canonical AutoInjectMode from config/beacon (was local stale type missing "beacon"); explicit fallthrough for beacon + strategist so Groq composer runs for popup auto-pick and L5.
Delivers the 4 explicit requirements (proper tab already solid; smart queue #2; beacon countdown+pause already wired + now feeds better prompts; internal Groq AI now mission-aware for the next-best when queue empty).
Pre-existing: 2 lint warnings (unrelated files), 8 template TODO mentions, tsc clean. No same-dir regression on these changes.
Picked via rule 2 on uncommitted work from the 4-point request.
User clarified the actual product vision: autopilot is a TRUST LADDER,
not a config screen. Five levels, each adding one more thing Cockpit
decides on your behalf. The middle level (Beacon — popup + countdown
auto-pick) was orphaned by commit 848da6c "stop hook calls strategist
(no more popup race)" — that swap traded the popup race for a
loose-cannon strategist that fired AI-composed prompts without consent.
Bringing the popup back, without the old race (KDE D-Bus + Chrome
+ /tmp polling), since the SSE-driven Chromium window already
replaced the old multi-layer setup.
The five-level ladder, marketing-clear:
L1 Manual — only what you type (Free tier)
L2 Queue — drains your queue (Free tier)
L3 Beacon — popup + countdown (Pro $20/mo) ← new default
L4 Continuous — auto-fires next-best (Pro $20/mo)
L5 Mission — Groq composes from
mission/goals/roadmap (Mission $50/mo)
Concrete changes this commit:
- src/config/beacon.ts: AUTO_INJECT_MODE_VALUES gains "beacon" (the
popup level). All five values have user-facing labels Manual / Queue
/ Beacon / Continuous / Mission with description lines that name the
level number and the sales-grade one-line pitch.
- src/lib/constants/control.ts: DEFAULT_AUTO_INJECT_MODE flips from
"strategist" (L5) to "beacon" (L3). New users start at the right
trust level — Cockpit shows them every dispatch through a popup
with countdown auto-pick, so they earn confidence in the system
before opting into Continuous or Mission.
- scripts/agent-hook-bridge.sh:
• autopilot_dispatch_and_inject() gains a new branch for
mode="beacon": calls ./beacon.py stop $tab $session_file, captures
the user's choice (or countdown auto-pick) on stdout, then
dispatches via emit_or_inject_prompt with the chosen prompt key.
Custom prompts come back as "__custom__<body>".
• Bash defaults for _BEACON_AUTO_MODE change from "strategist" →
"beacon" in both the API-fetch path and the Python-config
fallback path, so a fresh install with no settings row lands at
L3, not L5.
- src/components/control/AutomationPolicyControl.tsx: MODE_STYLE record
gains the "beacon" case (cyan-dot, pulsing). Tooltips for all five
cases rewritten with the level number + the one-line pitch so
hovering the pill teaches the trust ladder.
- src/components/control/ControlFleetStatus.tsx: AUTOMATION_HINT
record gains the "beacon" case. Hints under the fleet chips now
describe the level in plain English (was: jargon like "strategist
composes context-aware prompts" → now: "Mission — Cockpit composes
context-aware prompts from project mission, goals, and history").
Note: the existing "strategist" code value is preserved as the L5
storage key. Mission as a customer-grade feature still needs the
work tracked in roadmap "## Proposed": project context loader,
quality gate, audit trail, sleep budget, trust score. Today's commit
is just the ladder + the missing beacon wire.
beacon.py itself was already installed at
~/.local/share/cockpit-beacon/beacon.py (orphaned since 848da6c);
this commit puts it back in the call path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Browser dogfood 2026-05-31: user typed into the /control textarea
"Fix the 'Saved agent context Xw ago' wording — it sounds like a
security leak. Use 'Idle · last active Xw ago' instead." Caught
that the label was opaque jargon — it describes the INTERNAL
data state ("we have a saved handoff blob") rather than the
OBSERVABLE state for the human reader ("the agent is idle").
control-presenter.ts:563 — handoff-present-but-no-live-observation
case now reads "Idle" instead of "Saved agent context". The row's
timestamp column already shows recency (Xw ago) so the prefix
doesn't need to duplicate it.
Test updated to match the new wording. 19/19 stays green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Browser dogfood 2026-05-31 surfaced: querySelectorAll('h2') returned
two "Terminal workspaces" headings on /control. Mobile renders the
section inside a <details> whose <summary> already labels it
"Terminal workspaces", but the embedded ZellijLivePanel rendered
its own <h2> with the same text — same heading shown twice in a
single mobile viewport, broken document outline for screen readers.
ZellijLivePanel.embedded prop now suppresses the inner H2. The
parent <summary> owns the label when embedded; desktop renders
directly with no summary so the H2 still appears.
Caught while user-flow walking through cockpitapp.vercel.app. The
prior commit's hierarchy-rewrite (383e9b0) moved sections around
but didn't catch this — the duplicate was always there, just
buried below the fold.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Page hierarchy was upside-down: user landed on /control and saw
(1) vague title preamble "Live agent state, project readiness, and
next actions" — meaningless words, (2) small fleet-status header,
(3) "Agent operations / Current work, queued instructions, and
saved context by project" section header explaining nothing the
user couldn't infer, (4) THEN the actually-actionable daemon-offline
banner. The thing that fixes their problem was four scrolls below
the thing they didn't need.
Three coordinated cuts:
1. PageLayout subtitle removed from /control. The chip strip and
banner below carry all the real state — the subtitle was just
text taking space.
2. DaemonStatusBanner moved to the TOP of ControlPanel — when
daemon is offline, the Start/Restart buttons are now the first
thing the eye lands on. When daemon is healthy, the banner
self-hides (existing behavior), so this move costs nothing for
the happy path.
3. "Agent operations" section header collapsed. Renders only when
headerRight has content (project filters etc); the wordy
subtitle is gone. Empty div placeholder keeps the flex layout
stable when headerRight is present.
Final item of the 7-item Elon-team-pass plan. Net effect: /control
opens with the actionable signal first, vague chrome last.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Header chips said "2 need you · 6 open" while the projects rail
underneath said "0 working · 0 ready · 2 open". Different
denominators ("need you" conflated attention + failed + waiting),
different verbs, same data — the user couldn't reconcile what
either number meant.
Header now mirrors the rail's structure: "X working · Y ready · Z
open", with the attention chip ("X need you") shown ONLY when
attention+failed > 0 — kept first in the row, kept red, kept loud
because it's the genuinely user-blocking signal. Rail still computes
its own counts from snapshots[].phase; both surfaces now read the
same vocabulary regardless of source.
"All clear" fallback preserved for the empty state when literally
nothing is going on (no attention, no working, no ready, no open).
Item 6 of the 7-item Elon-team-pass plan. Item 5 (page hierarchy)
is the last remaining piece.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
User audit 2026-05-31 surfaced three loud noise sources in the
project rows that were diluting every other signal on the page:
1. Saved-handoff dumps leaking into row activity text. Lines like
"Saved handoff: Wait for user to (a) resolve the OAuth blocker
by signing in with a fresh GitHub account..." were the agent's
own internal notes being pasted verbatim into the user-facing
table. getTabActivityText() now returns short lifecycle states
only — "Ready — pick the next task", "Agent open · idle",
"Closed", "Tab open · no agent process". Handoff content
belongs in a per-project expand/tooltip, not the always-visible
row.
2. "Last sync 6h ago" prefix repeated on every one of 21 project
rows when the daemon was offline globally. staleEvidenceLabel()
dropped the prefix in the common case — the global offline
banner already owns the "system is stale" signal; rows should
just describe last-known state. Preserve the prefix ONLY when
there's no other evidence to show (rare).
3. "Tab #1 Unlinked" dangling scratch tabs surfacing in the
workspace table. buildLiveTabRows now filters tabs that map to
no registered project — they're visible noise that the user's
actual zellij window already shows. The control surface is for
fleet ops, not a generic tab list. Test updated to assert the
filter behavior (Mystery tab dropped, registered tabs kept).
All three were silent UX papercuts that the SSOT and gate work
couldn't surface — the user had to point at the screenshot.
control-presenter tests stayed 19/19 after the test rewrite.
Items 2, 3, 4 of the 7-item Elon-team-pass plan. Items 5 (hierarchy)
+ 6 (header/rail vocab reconciliation) coming next.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The recurring "daemon offline" complaint had no UI path forward —
the only recovery was a terminal command, which broke the "fleet
control" value prop. Now solved with a 3-button row in the
DaemonStatusBanner that fires the systemd lifecycle directly.
New endpoint POST /api/system/daemon { action: start | restart |
stop | status } shells out to `systemctl --user <action>
cockpit-daemon.service`. Hard-coded unit name + action whitelist —
no user input flows into the shell command. RUNTIME_AVAILABLE gates
the route: cloud users get 403 with "Daemon control unavailable on
cloud — runs only on the local install."
New DaemonControls component renders three buttons (Play / RotateCw
/ Square icons) with state-aware disabling: Start is disabled when
already active, Stop is disabled when not active, all are disabled
on cloud with a tooltip explaining why. After each action the
component re-fetches state so labels reflect post-action reality.
DaemonStatusBanner integrates the controls into the "Local daemon
offline" branch, replacing the wordy install-instruction paragraph.
Cloud users now see a clear one-liner: "Open Cockpit at
http://localhost:3000 to start/restart the helper" — directs them
to the correct surface instead of leaving them stuck.
Local build + postbuild already deployed the route to the running
cockpit-app systemd unit; cloud picks it up on next Vercel deploy.
Closes the first item of the 7-item Elon-team-pass plan.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Live regression caught while sessioning with the user. After
b89fdfc shipped the status:working gate on /api/control/dispatch,
the daemon still fired autopilot injects into the user's terminal
— 5 injections in 90 seconds, despite status:working AND a pending
blocker file. Root cause: the daemon has TWO injection paths, and
b89fdfc only covered one.
Path A (gated by b89fdfc):
daemon watchdog → POST /api/control/dispatch → returns prompt
→ daemon writes to terminal via autopilot_dispatch_and_inject()
Path B (the bypass — fired all 5 times):
user click OR ReadyBanner auto-fire OR stop-hook re-fire
→ POST /api/orchestration/run
→ enqueueInjectCommand writes a pending_commands row
→ daemon polls pending_commands, consumes row
→ daemon writes to terminal via execute_inject()
Gates added at TWO chokepoints (defence-in-depth, since either
path can be reached without the other):
1. scripts/cockpit-daemon.sh:execute_inject() — reads local FS for
~/.claude/sessions/<tab>.md status field and the .blockers/pending/
directory count. Refuses the inject (returns 1, logs "REFUSED")
when either signal says the agent is mid-task. hard_stop bypasses
the gate since it's the literal kill switch.
2. src/app/api/orchestration/run/route.ts — reads cached session
state from project_states.sessionStatus (already pushed by the
daemon to the DB). Returns HTTP 409 with reason="agent-status-
working" when working. Saves a database write + pending_commands
queue entry vs letting the request through to be rejected by the
daemon-side gate.
Both gates exempt hard_stop and close_session (lifecycle intents
that end sessions, not start work).
The dispatch-gate test suite (11 tests, scripts/test/dispatch-gates.ts)
still covers the original /api/control/dispatch gate. New tests for
the orchestration/run + execute_inject paths are TODO — gating them
without a live integration test scaffold means I'd be unit-testing
mock interfaces. For now, the live witness is the daemon log line
"inject REFUSED — <tab> session status=working" when a refused
inject lands.
Daemon stopped manually during this session; will be restarted by
the user after they pick where to take the UI work next (we had a
7-item plan queued before this bypass was found).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Root frustration from 2026-05-31 was that the autopilot's current
mode wasn't visible enough — the user couldn't tell at a glance
whether a click on any prompt chip would queue, send-immediate, or
trigger AI composition. AutomationPolicyControl was a small text
dropdown labeled "Automation" that gave you the mode name but no
visual state.
AutomationPolicyControl now renders a colored, optionally pulsing
status dot that encodes the mode at a glance:
off → gray dot, no pulse
queue_only → amber dot, no pulse
next_best → blue dot, pulsing (Groq off, canned template)
strategist → green dot, pulsing (Groq on, autonomous)
Each mode gets a long tooltip that explains exactly what dispatches
when. The strategist tooltip teaches the safety controls in one
line: "Set status:working in your session file to pause; raise a
blocker to halt." Direct surfacing of the gates shipped in the
earlier commits.
Plus a tooltip on the Next-best CTA itself ("Strategist picks the
next task autonomously … This click dispatches without preview")
so the asymmetry from the universal fill-first UX is explained
right where it happens. Every other prompt-click on /control fills
the textarea; this CTA bypasses it. Users need that signal in the
moment, not buried in docs.
No structural changes to IntentPanel layout — the existing 3-row
hierarchy (composer / library / workflow shortcuts) is already
readable. Original plan called for a Composer/Library/Workflows
restructure; deferred because the visual prominence win is in the
pill + tooltip pair, not in another layout pass.
All 9 test suites green: 167/167 (89 home + 11 dispatch-gates +
19 control-presenter + 22 autopilot-defaults + 7 push-notifications
+ 4 onboarding + 6 onboarding-heal + 5 db-url + 4 orchestration).
Closes the 4-commit fix-it-all-once-and-for-all set with the user
asked for. The autopilot now: refuses to fire when status:working
or blockers pending (b89fdfc), reads from a single prompt SSOT
(1bfe2d1), fills first on every surface (aaec08a), and shows its
state unmistakably (this).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same prompt click did different things depending on which surface
the user was on:
/control DimensionSection → SEND immediately (no preview)
/control ProjectPromptLibrary → FILL textarea (banner active = send)
/beacon ProjectPromptLibrary → SEND immediately
AskIvy global-scope prompt → SEND immediately
AskIvy project-scope prompt → FILL input
Recent chips everywhere → FILL textarea
The user named this directly: "only ones under prompt library fill
the field." Confirmed via audit — three distinct fork points across
four components, each making its own local decision about whether a
click should commit or preview.
Universal rule now: clicking any prompt anywhere fills the composer
textarea so the user previews/edits before sending. Per-prompt
opt-in via the new sendNow:true field in the SSOT (added to
PromptTemplate type in the previous commit) for prompts where
preview makes no sense — currently only hard_stop, which is a
literal kill switch. sendNow prompts render as a two-segment chip:
the main fill action on the left + a small ↪ Send button on the
right, so the bypass is visible in the UI rather than hidden in
code.
Component changes:
- project-profile-sections.tsx: DimensionSection now takes
required onFill + optional onRun. Default click → onFill. When
prompt.sendNow is true AND onRun is provided, render the ↪ Send
button as a sibling. Hover state separates fill (raised surface)
from send (warning-tinted) so users see the difference.
- ProjectProfile.tsx: thread onFillPrompt through as a required
prop, pass to every DimensionSection. handleRun (existing send-
immediate path) stays wired for the ↪ button.
- ProjectCard.tsx: wire onFillPrompt={setCustom} so the existing
textarea state becomes the universal target.
- project-intent-panel.tsx: drop the bannerActive ? onSendText :
onCustomChange branch from ProjectPromptLibrary's onSelect. Now
always onCustomChange — same behavior on every surface.
- BeaconClient.tsx: ProjectPromptLibrary.onSelect switched from
submit(CUSTOM_CHOICE_PREFIX + prompt) to setCustom + focus.
Beacon library now matches /control library — fill first.
- AskIvyModal.tsx: drop the t.scope === "global" ? send : setInput
branch. All clicks fill the input. Globe vs FolderOpen icon stays
to indicate scope visually, but click semantics are unified.
No prompt content changed. No new components. Only the click
handlers were rewired to match the universal rule.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Until today, prompts lived in two parallel files: 35 entries in
~/.config/agent-prompts.json (out-of-repo, snake_case keys,
dev/ship/vision taxonomy + dimensionId) and 35 in
src/config/prompt-library.ts (in-repo, kebab-case ids, domain
taxonomy + scope). 12+ duplicate pairs with subtly different
bodies; 6 security prompts in TS only (invisible to DimensionSection
in /control); 6 control prompts in JSON only (invisible to /prompts
library page and ProjectPromptLibrary modal). Adding a new prompt
required two edits in two formats. Real SSOT violation.
This commit promotes the in-repo TS file to canonical SSOT for
prompt METADATA (id, name, description, category, scope, style,
slot, sendNow). For the subset of prompts that also need to be
dispatchable by the autopilot daemon, an optional `agentKey` field
ties the TS entry back to the snake_case identifier the daemon
expects. JSON becomes a build artifact, regenerated from TS via
`npm run generate:agent-prompts`.
Mechanics:
- PromptTemplate type gains optional agentKey, icon, style, slot,
dimensionId, sendNow fields. Category enum gains "control" and
"content". CATEGORY_META extended. No breaking changes to existing
fields.
- All 6 JSON-only control prompts (hard_stop, blocker_create,
orient, unblock, roadmap_check, onboarding) added to TS with
agentKey set to their daemon key + dimensionId: "control". They
now appear in BOTH /prompts library page AND DimensionSection AND
remain dispatchable by the daemon. hard_stop is the only one
flagged sendNow:true (kill switch — preview makes no sense).
- /api/prompts/agent route gains a mergePromptSources() helper that
reads JSON, transforms TS entries with agentKey, dedups by key
(TS wins on conflict). The DimensionSection in /control now sees
the unified set without a UI change. Old reference to
PROMPTS_FILE() preserved so the daemon still works during the
incremental migration.
- New scripts/generate-agent-prompts.ts generator transforms
PROMPT_TEMPLATES → AgentPrompt[] and writes them back to JSON,
preserving any legacy JSON entries not yet migrated. Wired as
`npm run generate:agent-prompts`. Backup of pre-regen JSON kept
at ~/.config/agent-prompts.json.bak-20260531-ssot.
Verification: tsc clean. Generator dry-run output: 35 entries (29
legacy + 6 TS-overridden). The 6 TS-sourced entries are byte-
identical to their old JSON bodies (same key, same prompt text).
Adding a new prompt is now ONE TS edit. Migrating the remaining 29
JSON-only entries to TS is a follow-up commit; the bridge keeps
everything working during the transition.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Live-incident regression. Earlier today the autopilot injected a
2000-char next_best template into the user's keystrokes mid-typing
while they were composing a message to the agent, producing garbled
text like "wtf ust happened? what is this injecSetup (run, read
outputs):...". The session handoff said status:working — which is
documented in three places as the suppression signal — but the
daemon fired anyway because nothing in the dispatch pipeline
actually read the status field.
Root cause: agent-hook-bridge.sh:autopilot_dispatch_and_inject()
extracted done/next/tests/todos/health from the session file but
not status. The dispatch route's HandoffSchema didn't include
status either. The user trusted a guarantee the code never made.
Three coordinated fixes:
1. agent-hook-bridge.sh now reads `status:` from the session file
AND counts files in ~/.claude/sessions/<P>.blockers/pending/.
Either condition (status:working OR blockerCount>0) causes the
daemon to skip the dispatch HTTP call entirely — saves a network
round-trip and surfaces the gate in daemon logs.
2. The dispatch route's HandoffSchema gains a `status` field and
the body gains `blockerCount`. Defence-in-depth: even if a
custom integration or cloud-only caller bypasses the daemon's
client-side gate, the route refuses to act on a working status
or pending blockers. Two new DispatchResult.source values
(status_gate, blocker_gate) make these refusals greppable in
logs.
3. The gate logic moves out of the route handler into a pure
helper at src/lib/orchestration/dispatch-gates.ts so the
invariants can be unit-tested without spinning up a real Next
request. 11 inline tests cover: status:working wins over every
mode; blockers beat happy-path; legacy empty status preserves
existing permissive behavior; etc. Wired into
`npm run test:dispatch-gates`.
Closes the highest-impact symptom of the strategist's broken trust
model. The user can now leave autopilot on and trust that their
status:working handoff actually stops it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The pill-shaped mobile nav (.ui-mobile-nav) sat at z-50, same as Modal
and Drawer. When a drawer opened — e.g. project detail — the nav was
still painted over the drawer at the bottom of the screen, eating
~60px of vertical space and splitting attention. Demoted nav to z-40
and the More-sheet backdrop to z-30 so the layering goes:
z-30 more-sheet backdrop
z-40 nav
z-50 drawer / modal / more-sheet panel
Modals and drawers now cleanly cover the nav on mobile, which is the
conventional layering for "focused overlay over chrome".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
After Goals (3f062a8) + Memory (1baa421) + Money/Habits (44e991a)
all landed the same grid-cols-3 gap-2 sm:gap-4 wrapper around three
stat cards, the className was repeated 4× — and the inner comments
explaining the density fix had degraded into "same as Goals" /
"same as Memory" chain references.
Extract src/components/ui/stat-row.tsx — a children-passing wrapper
that owns the canonical three-column grid. Each call site drops to
one line. Callers keep ownership of the card shape inside (StatCard
for Goals/Money/Habits, Card+CardHeader+icon for Memory) — the
primitive only owns the wrapper.
Mirrors the ScrollAffordance extraction (0429728) which paid off one
commit later (b44cf5d) when Thoughts needed the 5th surface and
landed with a single import + wrap. Same expected payoff here when
the 5th stat row eventually appears.
Fifth horizontal-scroll surface to get the treatment, but the first
one to use the extracted <ScrollAffordance> primitive (0429728)
instead of re-inlining the relative+chevron+fade pattern. Live audit
at 414px on cockpitapp.vercel.app/thoughts caught the tag filter row
("All / agents / ai / architecture / automation / a…") cut off mid-
word with neither a chevron nor a fade mask.
Also missing ui-scroll-fade-right (every other scroll surface had it
even before the chevron landed); added for consistency with the
other four sites.
Net: 5 of 5 horizontal-scroll surfaces now have the same affordance
treatment, and the most recent one shows the extracted primitive
paying for itself — single-line wrap, no copy-paste.
Codebase sweep after the Goals (3f062a8) + Memory (1baa421) fixes
found two more instances of the exact same pattern:
- src/app/(app)/(private)/money/page.tsx — Monthly Burn / Unverified
- src/app/(app)/(private)/habits/page.tsx — Active Habits / Completions / Best Streak
Both PIN-gated so the audit couldn't catch them visually, but the
source pattern was identical: grid-cols-1 sm:grid-cols-3 with three
StatCards stacking full-width on mobile.
Same fix: grid-cols-3 gap-2 sm:gap-4 everywhere. Stat row collapses
to a compact horizontal triplet instead of eating ~400px of vertical
space before the first list of subscriptions / habit cards.
After this commit, codebase has zero remaining `grid-cols-1
sm:grid-cols-3` stat-row instances. Pattern is now duplicated 4× —
extracting <StatRow stats={[...]} /> is the natural next refactor
when (if) a 5th surface lands.
Same density issue as Goals (3f062a8), same fix. Three single-stat
cards (Entities / Relations / Types) used grid-cols-1 sm:grid-cols-3,
stacking full-width on mobile and eating ~400px before the user saw
any actual recent-additions or activity content. Caught live on
cockpitapp.vercel.app/memory at 414px in this iteration's audit.
Drop to grid-cols-3 everywhere with gap-2 on mobile, gap-4 sm+. Short
labels (Entities / Relations / Types) and short values (1,324 / 11 /
5) fit comfortably in ~130px-wide cards at 414px. First "Recently
Added" card now near the fold instead of below it.
No layout change for desktop (already 3 cols).
Live audit at 414px on cockpitapp.vercel.app/goals: header + 3 stat
cards consumed ~400px of vertical space before the first actual goal
appeared, because grid-cols-1 stacked each StatCard full-width on
mobile. User saw one stat per ~140px scroll instead of all three at
a glance.
Drop grid-cols-1 sm:grid-cols-3 → grid-cols-3 (with tighter gap-2 on
mobile, gap-4 sm+). Short labels ("Active Goals" / "Avg Progress" /
"Total") and 1-2 digit values fit comfortably in ~130px-wide cards
at 414px; the sub line wraps to 2 lines at worst. Net: first goal
card is now ~250px above the fold instead of below.
No layout change for desktop (already 3 cols). Verified mobile via
live cloud screenshot post-deploy on next iteration.
Verifying /system on cloud after the resilience fixes (ee6df43 +
ef2ceff): the page rendered fine, but caught a real UI bug —
"Recent telemetry" header showed "all clear" while the body listed
10 warning rows ("api/control/dispatch · Groq fallback (key
invalid): groq 401"). Badge logic only counted level==="error" and
treated everything else as clear.
Reserve "all clear" for genuinely empty problem state. When there
are errors, badge stays red with the error count. When there are no
errors but there are warnings, render the warning count in the
warning tone. Both counts visible in a single source of truth.
Side observation worth filing separately: 10 groq 401s on cloud
mean the Strategist auto-inject mode is silently degraded to canned
next_best — env-var issue, not a code fix. The honest badge now
makes that situation visible from the System page instead of
hidden behind "all clear."