01 — Overview & Control (Registries-Pivot Ratification + Commit-Ready Gateway)
title: 01 — Overview & Control
package: registries-pivot-ratification-commit-ready-gateway-2026-05-31
date: 2026-05-31
host: contabo VPS · DB directus (container postgres, postgres:16)
read_channel: KB + live PG read-only (role context_pack_readonly) + ssh read
apply_channel: ssh contabo → docker exec -i postgres psql -U workflow_admin -d directus (BEGIN..ROLLBACK ONLY)
mutation: ZERO net (two BEGIN..ROLLBACK rehearsals, both clean; entry==exit)
approval_artifact_found: NO
commit_actions: ALL DEFERRED (no valid human/council approval)
status: PASS (commit-ready pack + rehearsal proven; nothing committed)
01 — Overview & Control
Mission
Prepare the complete implementation gateway for Registries-Pivot: a human/council ratification packet, a commit-ready SQL pack for the corrected view/function layer, an expanded BEGIN..ROLLBACK rehearsal, drilldown wiring, drift reconciliation, a phantom decision pack, label/threshold/pin strategy, Directus/API + static-UI readiness, a legacy retirement plan, a no-hardcode enforcement pack, and next implementation prompts. No COMMIT without a valid approval artifact. No self-approval.
Hard Gate 0 — result (all verified live 2026-05-31, see doc 14)
| check | result |
|---|---|
| Host | contabo VPS — postgres container (postgres:16) Up 6 weeks; directus/nuxt/nginx/qdrant healthy |
| DB | directus; read role context_pack_readonly; PG 16.13 |
| Idle transactions | none (only the read session itself) |
| Apply channel | ssh contabo → docker exec postgres psql -U workflow_admin confirmed working |
| Approval artifact | NONE for registries-pivot (KB readiness doc = NOT_READY → unlock on human RG1+RG2; only other projects have ratifications) → all COMMIT DEFERRED |
| Route health | /knowledge/registries 200 · /knowledge/pivot 200 · /knowledge/registries-pivot 200 (1.73 MB — partially built already) |
Entry counts (live)
meta_catalog 169 · pivot_definitions 37 (35 active, parent_code NULL ×37) ·
pivot_results 126 · collection_registry 168 · table_registry 21 ·
entity_species 42 · species_collection_map 164 · taxonomy_facets 10 ·
taxonomy 58 · label_rules 38 · entity_labels 722,803 · dot_tools 309 ·
dot_iu_command_catalog 54 · information_unit 219 · iu_relation 60 ·
v_registry_counts 169 (note: it is a table, relkind r, not a view).
HEADLINE — the documented numbers are stale; count-integrity has MATERIALLY improved
A refresh scan ran today 2026-05-31 ~01:35 (135 rows scanned today). As a result the leaf-scoped count-integrity gap collapsed from the documented +36,783 to a live +132:
| metric | prior docs (this morning) | live now (verified, rehearsed) |
|---|---|---|
| leaf rows | 160 | 160 |
| Σ record_count | 1,954,686 | 2,002,041 |
| Σ actual_count | 1,917,903 | 2,001,909 |
| net_gap | +36,783 | +132 |
| drift rows | 3 | 3 |
| leaf orphans | 0 | 0 |
The entire +132 is explained by exactly 3 drift rows (drift-closure proven: 132 == Σ gap):
- CAT-006 dot_tools (model B): record 309 vs actual 163 = +146 →
model_b_phantom_candidate - CAT-007 ui_pages (model B): record 37 vs actual 52 = −15 →
model_b_unregistered_candidate - CAT-023 birth_registry (model A): record 985,472 vs actual 985,471 = +1 →
model_a_surplus_recheck(live-write race; this was the ~36k stale gap, now refreshed)
Plus 5 unmeasured leaf rows (CAT-1006..1010, source_model pg_table, record & actual both NULL → PIVOT_MISSING/unverified).
count_integrity_status is therefore still FAILED (FAILED ≠ 0 drift / 0 unverified), but
the story is no longer "a massive stale birth gap" — it is "3 small, well-characterized drifts +
5 unmeasured catalogs." RG2 reviewers must judge on this live picture, not the +36,783 number.
What is in this package
| doc | branch | content |
|---|---|---|
| 02 | A | RG1+RG2 ratification packet (exact wording, scope, rollback, risk) |
| 03 | B | Commit-ready SQL pack (8 files, corrected scalar-EXISTS, idempotent, rollback) |
| 04 | C | Expanded BEGIN..ROLLBACK rehearsal — 2 passes, both GREEN, raw evidence |
| 05 | D | Dynamic drilldown wiring plan (parent_code, proposed graph, overlay-proven) |
| 06 | E | Count drift reconciliation (3 rows + 5 unmeasured classified) |
| 07 | F | Phantom definition decision pack (source_model-aware, law patch draft) |
| 08 | G | Label / threshold / pin strategy (display_policy + registry_pin, rehearsed) |
| 09 | H | Directus/API exposure readiness |
| 10 | I | Static UI preview readiness (plan + mock contract; deploy gated to P3) |
| 11 | J | Legacy retirement plan (gap-math health API, disagreeing counts API) |
| 12 | K | No-hardcode enforcement pack (scan patterns + SQL checks) |
| 13 | L | Next implementation prompts (14 macros) |
| 14 | — | SQL appendix / evidence (all queries + raw rehearsal output) |
| 15 | — | Self-review & acceptance |
Commit-readiness verdict
- View/function layer (6 objects): COMMIT-READY. Compiled and behaved under live BEGIN..ROLLBACK; invariant reproduced; rolled back clean (0 leftover, idle_tx 0). Blocked only on human RG1+RG2.
- Additive structures (registry_pin, display_policy threshold, parent_code wiring, PIV-500/30x/31x): REHEARSED-VALID but gated (RG3/RG4/RG5 + Đ32). Propose-only.
- Phantom law: LAW_DEFINITION_GAP — decision pack only (RG4 / council).
Forbidden-compliance (this session)
No COMMIT · no self-approval · no persistent PG mutation (2× BEGIN..ROLLBACK, both clean) · no Directus mutation · no Qdrant write · no production Nuxt change · no route implementation (static preview deferred to gated P3) · no notification/event emit · no hardcoded counts/ categories/species/thresholds/pins. See doc 15 for the full matrix.