feat(FN-4029): expose database health in API and store contracts

Adds database health endpoints to the API layer (FN-4029), exposing a new store health accessor through `api-node.ts` and `api/legacy.ts`, with aligned auth middleware integration tests and updated architecture documentation.

Fusion-Task-Id: FN-4029
This commit is contained in:
Fusion
2026-05-11 22:11:29 -07:00
committed by gsxdsm
parent d7093dedac
commit afa2240fd6
10 changed files with 101 additions and 26 deletions

View File

@@ -1058,7 +1058,7 @@ export function createServer(store: TaskStore, options?: ServerOptions): ReturnT
app.get("/api/health", (_req, res) => {
const database = store.getDatabaseHealth();
res.json({
status: database.corruptionDetected ? "degraded" : "ok",
status: database.healthy ? "ok" : "degraded",
version: cliPackageVersion,
uptime: Math.floor(process.uptime()),
database,