Skip to content

feat: AI Executive Briefing + minimal UI pass#9

Draft
nfaggian wants to merge 4 commits into
cursor/simplify-codebase-535cfrom
cursor/llm-briefing-535c
Draft

feat: AI Executive Briefing + minimal UI pass#9
nfaggian wants to merge 4 commits into
cursor/simplify-codebase-535cfrom
cursor/llm-briefing-535c

Conversation

@nfaggian

@nfaggian nfaggian commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Two changes on this branch, both aimed at increasing signal per pixel:

  1. AI Executive Briefing — a Generate/Regenerate button on the dashboard produces a 2–3 paragraph leadership summary composed by an LLM from live pipeline, capacity, and delivery data. Works with any OpenAI-compatible provider.
  2. Minimal UI pass — every element on screen should convey information that leads to a decision. Removed everything that didn't: non-functional header controls, hardcoded sidebar decoration, and dashboard panels that duplicated info already surfaced by KPIs, charts, or the AI briefing.

Stacked on top of cursor/simplify-codebase-535c. Base branch is set accordingly.


Part 1 — AI Executive Briefing

Backend (+237 / -4)

  • delta_command.briefing
    • build_context(db) — turns the current Database into a compact prompt (team headline + top 5 overallocated engineers, pipeline totals + late-stage count, delivery status + at-risk projects). Total prompt is ~10 short lines regardless of team size, so token cost stays flat as engineers grow.
    • call_llm(system, user) — async POST to {LLM_BASE_URL}/chat/completions with Authorization: Bearer {LLM_API_KEY}. Uses httpx.AsyncClient so the FastAPI event loop stays free.
    • Custom exceptions (LLMNotConfigured, LLMError) surface as 503 / 502 at the API layer.
  • POST /api/briefing{ "briefing": "..." } on success; { "detail": "..." } with a specific reason on failure.
  • httpx promoted from dev to runtime dependency.
  • 4 new tests covering: context summary shape, missing-key 503, happy path (mocked transport), upstream 500 → 502.

Frontend (+118 / -1)

  • ExecutiveBriefingPanel.tsx — Sparkles-marked card with Generate / Regenerate button, spinner, whitespace-preserving prose, and an inline error banner. Placed between KPIs and Action Required so the AI narrative sits next to the raw metrics.
  • core/api.ts::generateBriefing() — thin wrapper hitting POST /api/briefing.
  • apiFetch now parses {detail} from failed responses so users see actionable guidance (e.g. "LLM_API_KEY is not set. Configure an OpenAI-compatible provider (see backend/README.md).") rather than a generic HTTP status.

Configuration

Set in Cursor Dashboard → Cloud Agents → Secrets or your local env:

# OpenAI (default)
LLM_API_KEY=sk-...

# Groq
LLM_API_KEY=gsk_...
LLM_BASE_URL=https://api.groq.com/openai/v1
LLM_MODEL=llama-3.1-70b-versatile

# Local Ollama (any string works as the key)
LLM_API_KEY=ollama
LLM_BASE_URL=http://localhost:11434/v1
LLM_MODEL=llama3.2

Without a key, the panel renders a clear onboarding hint and the endpoint returns 503 — the app remains fully functional otherwise.


Part 2 — Minimal UI pass

Chrome removed (Header.tsx, Sidebar.tsx)

  • Header: non-functional Search input, Bell/notification badge, and "NF" avatar all gone. Now: page title + optional data-carrying meta + today's date.
  • Sidebar: hardcoded "Q3 Review — Leadership sync" card gone. "Engineering Hub" tagline gone. Brand mark + nav is all that remains.

Dashboard: 10 sections → 6

Removed Why
KPI card Late-Stage Pipeline count already carried by Pipeline chart + AI briefing
KPI card In Negotiation subset of above; visible on the same chart
PipelineHealthPanel (deleted file, -121 lines) 4 stats verbatim duplicate of KPI cards + chart
TeamSnapshotPanel (deleted file) overallocated list is verbatim in Action Required; other stats are in KPI + Utilization chart
DeliveryOverviewPanel (deleted file, -164 lines) budget burn is a KPI; status split is in Projects Needing Attention
Footer strip (Last updated · N engineers · N opps) date is in header; counts are in AI briefing

New structure:

Header              [title]                                    [date]
Row 1 — 4 KPI cards:  Pipeline · Delivery · Budget · Utilization
Row 2 — AI Executive Briefing
Row 3 — Action Required
Row 4 — Pipeline chart          |  Utilization chart
Row 5 — Upcoming Closes         |  Upcoming Milestones
Row 6 — Projects Needing Attention  (rendered only when at-risk > 0)

Other pages

  • Opportunities: 4 stat cards → 3 (fold Lost into the Won this cycle card as a small trailing annotation). Delete the redundant won/lost chip strip below the Board/List toggle. Header meta now reads 6 active · 1 won · 1 lost.
  • Team: remove the Overview view toggle. The Timeline view already shows current-week utilization and every other week and supports inline editing — Overview was a strictly less capable duplicate. Also deletes the orphaned EngineerCard.tsx.
  • Projects: drop the decorative status chip strip (sections below already group by status). 4 stat cards → 3.

Analytics pruning

dashboard-analytics.ts no longer computes 12 fields that only fed the deleted panels. Internal computations that feed the actions[] list (overdue milestones, unassigned engineers, etc.) are kept.

Verification

  • uv run pytest13/13 pass
  • npm run build — clean. Bundle size shrank on every page:
    • dashboard 106 kB → 105 kB
    • opportunities 4.57 kB → 4.06 kB
    • projects 4.68 kB → 3.98 kB
    • team 6.41 kB → 4.95 kB
  • ✅ Live-checked every page.

Dashboard (full length)

Minimal dashboard

Other pages

Opportunities
Team
Projects

Line-count delta on this branch

Commit Net
Add LLM briefing (backend + frontend + tests) +355 / -5
Remove decorative chrome + duplicate dashboard panels +164 / -641
Total +519 / -646

The dashboard now presents 4 KPIs, one AI-authored paragraph of narrative, an action list, two charts, and two lookahead lists. Nothing is on screen unless it drives a decision.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 4 commits July 4, 2026 22:50
- delta_command.briefing: builds a compact state summary (team/pipeline/
  delivery) and calls an OpenAI-compatible chat completions endpoint
- POST /api/briefing wires it into FastAPI with typed error responses:
  503 when LLM_API_KEY is missing, 502 on upstream failure
- httpx promoted from dev to runtime dependency
- config via LLM_API_KEY / LLM_BASE_URL / LLM_MODEL — works with OpenAI,
  Groq, Ollama, or anything else on the /v1/chat/completions protocol
- 4 new tests covering context summary, missing-key 503, happy path with
  mocked transport, and upstream-error 502

Co-authored-by: Nathan Faggian <nathan.faggian@gmail.com>
- ExecutiveBriefingPanel: Sparkles-marked card with Generate/Regenerate
  button, loading state, whitespace-preserving briefing display, and
  inline error banner
- Placed at the top of the dashboard between KPIs and Action Required so
  the AI narrative complements the raw metrics
- api.ts: generateBriefing() helper hitting POST /api/briefing
- apiFetch now parses {detail} from failed responses so the panel can
  surface backend guidance (e.g. 'LLM_API_KEY is not set. Configure an
  OpenAI-compatible provider') instead of a generic HTTP status
- README documents LLM_API_KEY / LLM_BASE_URL / LLM_MODEL with copyable
  OpenAI / Groq / Ollama examples

Co-authored-by: Nathan Faggian <nathan.faggian@gmail.com>
Meaningful and minimal — every element on screen should convey information
that leads to a decision. This pass removes the pieces that don't.

Chrome:
- Header: drop the non-functional Search input, Bell/notification badge,
  and 'NF' avatar placeholder. Keep title + date only. Optional 'meta'
  slot for a single actionable summary (e.g. '6 active · 1 won · 1 lost').
- Sidebar: remove the hardcoded 'Q3 Review — Leadership sync' card and
  the 'Engineering Hub' tagline. Brand mark + nav is enough.

Dashboard panels (delete files):
- PipelineHealthPanel — its 4 stats (in-proposal, in-negotiation,
  closing-in-30d, avg deal / probability) are already carried by the
  KPI cards, Pipeline chart, and the AI briefing.
- DeliveryOverviewPanel — budget burn is a KPI, active/planning/at-risk
  is already surfaced by the Projects Needing Attention list.
- TeamSnapshotPanel — the overallocated engineer list is verbatim in
  Action Required; the utilisation stats duplicate the KPI card and
  Team Utilization chart.

Also removed EngineerCard.tsx (orphaned after the Team Overview view
was retired).

Co-authored-by: Nathan Faggian <nathan.faggian@gmail.com>
Dashboard:
- 6 KPI cards -> 4. Late-Stage Pipeline and In Negotiation were both
  subsets of the Weighted Pipeline card and are already visible on the
  Pipeline by Stage chart and in the AI briefing.
- Delete the bottom 'Last updated ... N engineers ... N opportunities'
  strip — date is already in the header; counts are in the briefing.
- Restructure to 6 clearly-distinct sections: KPIs -> AI Briefing ->
  Action Required -> Pipeline chart | Utilization chart -> Upcoming
  Closes | Milestones -> (Projects Needing Attention, only when
  something is at-risk).

Opportunities:
- 4 stat cards -> 3. Fold 'Lost' into the 'Won this cycle' card as a
  small trailing annotation — lost counts rarely change strategy.
- Delete the won/lost chip strip below the Board/List toggle; the stat
  card already carries the same counts.

Team:
- Remove the Overview view toggle. The Timeline view already shows
  current-week utilization (the middle column) plus every other week
  and supports inline editing — the Overview was a strictly less
  capable duplicate.
- Drop EngineerCard consumers.

Projects:
- Remove the decorative status chip strip below the KPI row. The
  sections below already group projects by status with counts.
- 4 stat cards -> 3 (fold budget/spent, keep progress percentage as
  sub-detail on the 'Spent to Date' card).

Analytics:
- Prune dashboard-analytics.ts to only what the dashboard actually
  reads. Removed 12 unused fields across PipelineInsight,
  DeliveryInsight, TeamInsight. Internal computations feeding the
  actions[] list are kept.

Filler subtitles like 'Pipeline, delivery, and capacity — updated for
leadership sync' are replaced with a data-carrying meta line, or
removed. Every visible string now conveys real information.

Net: -641 lines across page components and analytics with zero loss of
decision-relevant content.

Co-authored-by: Nathan Faggian <nathan.faggian@gmail.com>
@cursor cursor Bot changed the title feat: AI Executive Briefing (LLM integration) feat: AI Executive Briefing + minimal UI pass Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants