feat: AI Executive Briefing + minimal UI pass#9
Draft
nfaggian wants to merge 4 commits into
Draft
Conversation
- 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>
This was referenced Jul 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two changes on this branch, both aimed at increasing signal per pixel:
Part 1 — AI Executive Briefing
Backend (
+237 / -4)delta_command.briefingbuild_context(db)— turns the currentDatabaseinto 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/completionswithAuthorization: Bearer {LLM_API_KEY}. Useshttpx.AsyncClientso the FastAPI event loop stays free.LLMNotConfigured,LLMError) surface as503/502at the API layer.POST /api/briefing—{ "briefing": "..." }on success;{ "detail": "..." }with a specific reason on failure.httpxpromoted from dev to runtime dependency.Frontend (
+118 / -1)ExecutiveBriefingPanel.tsx— Sparkles-marked card withGenerate/Regeneratebutton, 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 hittingPOST /api/briefing.apiFetchnow 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:
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)Dashboard: 10 sections → 6
Late-Stage PipelineIn NegotiationPipelineHealthPanel(deleted file, -121 lines)TeamSnapshotPanel(deleted file)DeliveryOverviewPanel(deleted file, -164 lines)Last updated · N engineers · N opps)New structure:
Other pages
Lostinto theWon this cyclecard as a small trailing annotation). Delete the redundant won/lost chip strip below the Board/List toggle. Header meta now reads6 active · 1 won · 1 lost.Overviewview 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 orphanedEngineerCard.tsx.Analytics pruning
dashboard-analytics.tsno longer computes 12 fields that only fed the deleted panels. Internal computations that feed theactions[]list (overdue milestones, unassigned engineers, etc.) are kept.Verification
uv run pytest— 13/13 passnpm run build— clean. Bundle size shrank on every page:Dashboard (full length)
Minimal dashboard
Other pages
Opportunities
Team
Projects
Line-count delta on this branch
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.