Sample ERD

Index Health Service

Overview

Provide a deterministic, read‑only view of index coverage, freshness, and derived insights using the local code index database.

Contracts

Service Contracts

  • CodeIndexHealthService.getHealth(){ coveragePercent, indexedFiles, indexedChunks, lastIndexedAt }
  • CodeInsightsService.build(){ packages, hotspots, unusedImports, graph }

API Contracts

  • POST /code-index/refresh → triggers index rebuild

Test Strategy

  • Index DB missing → Health returns hasIndex=false.
  • Coverage percent computed from scanned vs indexed files.
  • Insights degrade gracefully on empty DB.

Non‑Functional Requirements

  • Deterministic output for identical index state.
  • Fast render (under 300ms for typical repos).
  • Read‑only, no side effects without explicit user action.