feat(cli): add express checkup command with direct PostgreSQL health checks + fix H004 and A003

Summary

Adds express checkup command to the CLI that generates PostgreSQL health check reports directly from the database, without requiring Prometheus infrastructure.

Key features:

  • New postgresai checkup command for direct database health analysis
  • Support for 11 check types: A002, A003, A004, A007, A013, D004, F001, G001, H001, H002, H004
  • Automatic upload to PostgresAI Console (optional, requires API key)
  • JSON output mode for scripting and automation
  • Build-time embedding of SQL metrics for smaller bundle size

Changes

CLI (cli/)

  • Added checkup command with connection handling, SSL fallback, and progress spinner
  • Added set-default-project command for storing upload preferences
  • New modules: checkup.ts (report generators), checkup-api.ts (RPC client), metrics-loader.ts
  • Build script to embed metrics.yml at compile time
  • Preserves defaultProject on re-authentication

Reporter (reporter/)

  • Added generation_mode field to distinguish "express" vs "full" reports
  • Added redundant_to array to H004 schema for better index relationship tracking
  • New helper methods for filtering A003 settings by report type (D004, F001, G001)

Metrics (config/pgwatch-prometheus/metrics.yml)

  • Enhanced settings metric with setting_normalized and unit_normalized fields
  • Updated redundant_indexes to output redundant_to_json with index sizes
  • Added index_definition to unused_indexes metric

https://gitlab.com/postgres-ai/platform/-/issues/346

Edited by Nikolay Samokhvalov

Merge request reports

Loading