/admin/codex-coverage) to see, at a glance, which tables are fully compliant, which are in progress, and which haven’t started yet.
Why it matters
Every row in the Codex catalog needs a populatedrecord_id to be traceable, deduplicated, and exportable in audit packages. The coverage dashboard gives you a single view into that progress so you can answer questions like:
- How close is my dataset to full APRS compliance?
- Which tables still have unpopulated records?
- Are nightly backfill jobs actually making progress?
What you’ll see
Summary cards
At the top of the dashboard, four summary cards show:
An overall percentage is displayed alongside the total number of envelope-compliant rows out of all rows across every tracked table.
Coverage table
Below the summary cards, a sortable table lists every catalog table, ordered worst-first by default. Each row shows:Color-coded status buckets
The percentage column is color-coded so you can scan for problem areas quickly:How data refreshes
Coverage statistics are refreshed automatically by a nightly job that runs at 05:00 UTC, after the backfill window finishes. The dashboard header shows when the last refresh occurred. You don’t need to trigger refreshes manually. Each nightly run scans every catalog table that has arecord_id column, counts total rows versus populated rows, and updates the dashboard.
If a table was recently added to the catalog, it will appear on the dashboard after the next nightly refresh.
Compliance views
Two SQL views give you direct access to coverage and backfill data without leaving your database client. Use them for ad-hoc queries, alerting integrations, or any workflow where you need the raw numbers behind the dashboard.codex_compliance_summary
Returns one row per tracked table with coverage percentages for every APRS envelope column, plus h3_index and mmsi. Coverage is derived from PostgreSQL catalog statistics (pg_stats.null_frac), so the query is fast and doesn’t scan table data.
codex_backfill_progress
Shows the status of h3_index and mmsi backfill jobs over the last seven days. Each row represents one table with aggregated run counts, rows updated, and a stall indicator.
Use this view to detect stuck backfills before they fall behind:
Vessel-level coverage for port events
Theport_events table now includes a dedicated mmsi column, completing the full APRS envelope for port-level activity data. This means you can:
- Join port events to vessel records — link arrivals, departures, and berth assignments directly to a vessel’s MMSI without going through a separate lookup table.
- Run spoofing-detection queries — the
mmsicolumn is indexed (partial index on non-null values), so queries that cross-reference vessel identity against port activity are fast even at scale. - Track
mmsicoverage in the dashboard — thecodex_compliance_summaryview reportsmmsi_pctfor every tracked table, includingport_events.
CLI compliance checker
Thecodex.cli check command validates APRS envelope compliance for any table — or all tables at once — from the command line. It samples recent rows and runs nine validation checks covering identity, provenance, temporal ordering, and access-tier fields.
Running a check
Check a single table:What gets checked
Each sampled row is validated against nine checks:Per-table column introspection
The compliance checker dynamically discovers which envelope columns each table actually has before running checks. This means:- Tables that use a timestamp column other than
created_atfor ordering (such astimestampon AIS positions,started_aton events,loaded_aton building permits, orupdated_aton vessels) are handled correctly. - Optional envelope fields like
occurred_at,effective_from, andeffective_toare only validated if the table has those columns. A missing optional column is not treated as non-compliant. - The checker exits non-zero if any table has critical issues affecting more than 5% of sampled rows, making it suitable for CI pipelines.
Reading the output
The checker prints a formatted report with pass, warning, and fail indicators for each table:- Pass — all critical checks above 95% compliance.
- Warning — non-critical checks below threshold, but no critical failures.
- Fail — one or more critical checks below 95% compliance.
--report JSON file includes per-table compliance rates and individual issue details, suitable for dashboards or alerting integrations.
When to use it
- During APRS rollout — monitor adoption as backfill jobs work through historical data. Commodity tables (
conab_crop_reports,antt_road_freight,cepea_commodity_prices) and maritime tables (antaq_vessel_calls,usace_lock_passages) now populate envelope fields at write time, so new rows appear as compliant immediately. - Before an audit — confirm that all evidence tables are fully envelope-compliant before generating an audit export.
- Troubleshooting stalled backfills — if a table’s percentage hasn’t changed in several days and the “Last backfill” timestamp is stale, the backfill job for that table may need attention. Query
codex_backfill_progressto check whether the job isrunningorstalled. - Programmatic alerting — query
codex_compliance_summaryorcodex_backfill_progressfrom your monitoring tools to trigger alerts when coverage drops or backfills stall.