IU Core Hygiene — 03 DOT visibility matrix
IU Core Constitution/DOT Hygiene — 03 DOT visibility matrix
Closes prompt-hygiene audit finding HYG-3 ("DOT visibility not yet proven complete").
Visibility per object class
| Class (count) | Pre-macro visibility | After this macro |
|---|---|---|
| 9 tables | per-layer scripts 040/070 (existence), observability views |
+ runtime/110 D1 — all 9 vs SSOT list |
| 5 views | 070 W3 (3 worker views only) |
+ runtime/110 D2 — all 5 |
| 12 functions | 040 V5, 070 W2/W6/W7 (subset) |
+ runtime/110 D3 — all 12 |
| 2 triggers | 040 V3 |
+ runtime/110 D4 — host + tgenabled |
| 2 config gates | 040 V4, 070 W4 |
+ runtime/110 D5 — live value |
| 1 event type | 040 V1 |
+ runtime/110 D6 |
| 2 routes | 040 V2 |
+ runtime/110 D7 — enabled/dry_run |
| healthcheck | fn_iu_route_worker_health (worker layer) |
unchanged |
Gap before this macro: no single artifact enumerated all 33 objects in one pass; coverage was spread across three per-layer scripts and a partial set of object names. A reviewer could not answer "is DOT coverage complete?" in one query.
Repair — runtime/110_iu_core_dot_conformance_scan.sql
A read-only BEGIN … ROLLBACK scan. Carries the SSOT inventory
(_iu_core_expect TEMP table, 33 rows) and emits:
- D1–D7 — per-class presence rows (name +
presentboolean, plus live state for triggers/config/routes). - D8_unregistered — reverse drift guard: any IU Core object present that is not in the SSOT list (catches an object created without registration).
- D9_conformance — actual-vs-expected count per class with an
okboolean.
Automation-first: registering a new IU Core object = adding one
_iu_core_expect row in the same change as its DDL migration. The scan can
never silently miss an object.
Live conformance evidence (read-only query_pg, 2026-05-21)
D9 verdict run against production directus:
| class | expected | found | ok | missing |
|---|---|---|---|---|
| table | 9 | 9 | true | — |
| view | 5 | 5 | true | — |
| function | 12 | 12 | true | — |
| trigger | 2 | 2 | true | — |
| config | 2 | 2 | true | — |
| event_type | 1 | 1 | true | — |
| route | 2 | 2 | true | — |
33 / 33 objects present. DOT conformance = PASS.
Verdict
DOT visibility matrix PASS — every production-visible IU Core object has a
visibility package (runtime/110) and live conformance is proven 33/33.