{
  "slug": "home-dashboard",
  "spec_file": "docs/specs/2026-05-31-home-dashboard.md",
  "findings": [
    {
      "id": "home-dashboard-001",
      "severity": "P0",
      "type": "missing",
      "summary": "Spec GET /api/dashboard unified endpoint not implemented",
      "spec_ref": "API Endpoints — GET /api/dashboard",
      "code_ref": "apps/zync-api/src/routes/dashboard.ts:4",
      "evidence": "dashboard.ts exposes /kpis, /activity, /checklist sub-routes only; grep finds no GET '/' handler returning DashboardResponse.",
      "repro": "curl /api/dashboard → no matching route; client calls /api/dashboard/kpis instead."
    },
    {
      "id": "home-dashboard-002",
      "severity": "P1",
      "type": "missing",
      "summary": "Quick Actions bar (invoice/task/timer/customer) absent from home page",
      "spec_ref": "Sections — 1. Quick Actions Bar",
      "code_ref": "apps/zync-app/src/routes/home.tsx:290",
      "evidence": "HomePage JSX renders checklist, KPI strip, activity feed only; no QuickActions component or equivalent buttons.",
      "repro": ""
    },
    {
      "id": "home-dashboard-003",
      "severity": "P1",
      "type": "missing",
      "summary": "Upcoming sidebar (calendar today + tasks due) not implemented",
      "spec_ref": "Sections — 4. Upcoming Sidebar",
      "code_ref": "apps/zync-app/src/routes/home.tsx:290",
      "evidence": "HomePage layout is single column (checklist, KPIs, feed); no upcoming events/tasks sections or API fields.",
      "repro": ""
    },
    {
      "id": "home-dashboard-004",
      "severity": "P1",
      "type": "missing",
      "summary": "API modules map and module-aware KPI nulls not returned",
      "spec_ref": "DashboardResponse — modules map",
      "code_ref": "packages/db/src/queries/dashboard.ts:30",
      "evidence": "getDashboardKPIs returns flat DashboardKPIs struct; no resolveModules, no modules object, no per-KPI permission gating.",
      "repro": ""
    },
    {
      "id": "home-dashboard-005",
      "severity": "P2",
      "type": "divergent",
      "summary": "KPI row uses seven different metrics vs spec five StatCards",
      "spec_ref": "Sections — 2. KPI Row table",
      "code_ref": "apps/zync-app/src/routes/home.tsx:306",
      "evidence": "UI shows Revenue (30d), Outstanding, Overdue invoices, Active customers, Open projects, Open tasks, merge suggestions; spec requires Revenue this month, Open invoices, Active projects, Pending tasks (assignee-scoped), Overdue (tasks+invoices).",
      "repro": ""
    },
    {
      "id": "home-dashboard-006",
      "severity": "P2",
      "type": "divergent",
      "summary": "Client loads dashboard via three waterfall fetches not one query",
      "spec_ref": "Frontend — single useQuery(['dashboard'])",
      "code_ref": "apps/zync-app/src/routes/home.tsx:234",
      "evidence": "Three separate useEffect hooks call /kpis, /checklist, /activity independently with local useState.",
      "repro": ""
    },
    {
      "id": "home-dashboard-007",
      "severity": "P2",
      "type": "divergent",
      "summary": "Activity feed is cursor-paginated raw audit rows, not 30 typed events",
      "spec_ref": "Sections — 3. Activity Feed",
      "code_ref": "packages/db/src/queries/dashboard.ts:49",
      "evidence": "getActivityFeed returns ActivityFeedPage with eventType strings; no mapping to seven feed types, no entity_url, no permission/module filters, load-more UI in home.tsx:373.",
      "repro": ""
    },
    {
      "id": "home-dashboard-008",
      "severity": "P2",
      "type": "divergent",
      "summary": "Setup checklist has four items and wrong completion signals",
      "spec_ref": "Sections — 5. Setup Checklist items table",
      "code_ref": "apps/zync-app/src/routes/home.tsx:129",
      "evidence": "Checklist steps: customer, invoice, calendar, team member; spec requires five items including business info and integration with different DB signals and ADMIN/OWNER gating.",
      "repro": ""
    },
    {
      "id": "home-dashboard-009",
      "severity": "P2",
      "type": "divergent",
      "summary": "Checklist dismiss allows owner only; spec requires ADMIN or OWNER",
      "spec_ref": "PATCH /api/dashboard/checklist/dismiss — Auth",
      "code_ref": "apps/zync-api/src/routes/dashboard.ts:91",
      "evidence": "Handler checks session.role !== 'owner' for 403; spec requires ADMIN or OWNER.",
      "repro": ""
    },
    {
      "id": "home-dashboard-010",
      "severity": "P2",
      "type": "divergent",
      "summary": "Checklist dismiss returns JSON 200 instead of 204 No Content",
      "spec_ref": "PATCH /api/dashboard/checklist/dismiss — Response",
      "code_ref": "apps/zync-api/src/routes/dashboard.ts:97",
      "evidence": "Returns c.json({ ok: true }); spec mandates 204 empty body.",
      "repro": ""
    },
    {
      "id": "home-dashboard-011",
      "severity": "P3",
      "type": "cosmetic",
      "summary": "Page centered max-w-5xl vs spec left-aligned 12-column grid",
      "spec_ref": "Layout — 12-column grid, left-aligned",
      "code_ref": "apps/zync-app/src/routes/home.tsx:291",
      "evidence": "Root Stack uses 'max-w-5xl mx-auto' centering; spec wireframe shows full-width left-aligned grid with 8/4 split.",
      "repro": ""
    }
  ],
  "summary": { "P0": 1, "P1": 3, "P2": 6, "P3": 1, "total": 11 }
}
