Skip to main content
The envelope coverage dashboard shows how far along each catalog table is in adopting the APRS data envelope. Open it at Admin → Codex coverage (/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 populated record_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 a record_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.
Coverage percentages are based on the most recent ANALYZE run. If you need sub-percentage-point accuracy, run ANALYZE on the target table first:

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

The port_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 mmsi column is indexed (partial index on non-null values), so queries that cross-reference vessel identity against port activity are fast even at scale.
  • Track mmsi coverage in the dashboard — the codex_compliance_summary view reports mmsi_pct for every tracked table, including port_events.

CLI compliance checker

The codex.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:
Check all tables and write a JSON report:

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_at for ordering (such as timestamp on AIS positions, started_at on events, loaded_at on building permits, or updated_at on vessels) are handled correctly.
  • Optional envelope fields like occurred_at, effective_from, and effective_to are 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.
The compliance checker runs automatically in CI on every pull request that touches data collectors or migrations. You can also run it locally to validate your changes before pushing.

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.
The optional --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_progress to check whether the job is running or stalled.
  • Programmatic alerting — query codex_compliance_summary or codex_backfill_progress from your monitoring tools to trigger alerts when coverage drops or backfills stall.