Skip to content

feat(insight-cards): add real-time agent-generated insight cards for … - #606

Merged
Wilfred007 merged 1 commit into
Protocol-Guild:mainfrom
Mainnet-ops:feature/insight-cards
Aug 25, 2026
Merged

feat(insight-cards): add real-time agent-generated insight cards for …#606
Wilfred007 merged 1 commit into
Protocol-Guild:mainfrom
Mainnet-ops:feature/insight-cards

Conversation

@Mainnet-ops

Copy link
Copy Markdown

…dashboard

Add backend service that aggregates payroll, workforce, liquidity, and schedule data into severity-ranked insight cards. Expose via GET /api/v1/insight-cards with configurable lookback window.

Frontend InsightCards component renders cards on the Home page with severity badges, metrics, and deep-link actions. 16 unit tests cover all card generation paths including edge cases and partial failures.

Closes #1299
Closes #1305
Closes #1296
Closes #1295
Backend (3 new files + 1 modified)

  • backend/src/schemas/insightCardsSchema.ts — Zod schema defining InsightCard (id, title, body, category, severity, metric, actionRoute) and InsightCardsResponse
  • backend/src/services/insightCardsService.ts — Core service that runs 4 builders in parallel (payroll, workforce, liquidity, schedule), merges results, and sorts by severity. Each builder is wrapped in Promise.allSettled so partial failures don't break the whole response
  • backend/src/routes/insightCardsRoutes.tsGET /api/v1/insight-cards?windowDays=30 with JWT auth + org isolation + EMPLOYER role gate
  • backend/src/app.ts — Route registered

Frontend (3 new files + 1 modified)

  • frontend/src/services/insightCardsApi.ts — Typed axios client
  • frontend/src/components/InsightCards.tsx — Renders a responsive grid of cards with severity badges, metric callouts, category icons, loading skeletons, and error/retry states
  • frontend/src/pages/Home.tsx — InsightCards section inserted between the hero CTA and the static feature cards

Tests (16 passing)

  • backend/src/services/__tests__/insightCardsService.test.ts — Covers all card IDs: payroll disbursed/failure/no-activity, workforce headcount/high-inactive/no-employees, liquidity not-configured/zero-balance/balance, schedule summary/none/upcoming, plus severity ordering, response shape, and partial-failure resilience

…dashboard

Add backend service that aggregates payroll, workforce, liquidity, and
schedule data into severity-ranked insight cards. Expose via
GET /api/v1/insight-cards with configurable lookback window.

Frontend InsightCards component renders cards on the Home page with
severity badges, metrics, and deep-link actions. 16 unit tests cover
all card generation paths including edge cases and partial failures.
@Wilfred007
Wilfred007 merged commit f21cfa2 into Protocol-Guild:main Aug 25, 2026
1 of 2 checks passed
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