KB-61A8
07 — Macro 2 Handoff (threshold, label, pin, phantom-law, Directus)
4 min read Revision 1
registries-pivotmacro2handoffregistry_pindisplay_policyphantom-lawdirectus-exposure2026-05-31
title: 07 — Macro 2 Handoff date: 2026-05-31
07 — Macro 2 Handoff
Exact enough that the next agent does not re-investigate from scratch. All items below were rehearsed GREEN this run (BEGIN..ROLLBACK) or are precisely specified.
M2.1 — Threshold registry (display_policy)
- Rehearsed:
CREATE TABLE display_policy(species_code text PK, max_ungrouped smallint DEFAULT 50, note text, CHECK(max_ungrouped>0 AND max_ungrouped<=50)). 50 = MAX ceiling (not a trigger-on-50). Seeded__default__=50,dot_tool=30,collection=50. - Live signal: 28 / 160 leaves exceed their species ceiling (ungrouped) → those get grouped/labelled by default.
- Reuse:
taxonomy_facets.max_labels_per_entityexists but is label-count, not a display ceiling — distinct concept;kg_thresholdstable exists → reuse for storage. - Gate: additive table; needs approval to commit.
M2.2 — Label / grouping (PIV-311 + existing machinery)
entity_labels= 726,850 rows, 23 distinctlabel_code→ PIV-311 (group by label_code) gives 23 groups (proven via real engine, doc 04).- Reuse:
label_rules(38, hasskip_wide_warning),taxonomy(58),species_collection_map(164) as discriminator. Do not build new label machinery.
M2.3 — registry_pin
- Rehearsed:
CREATE TABLE registry_pin(id, object_ref, object_kind, surface_ref, pinned_by, scope DEFAULT 'user', scope_ref, reason, priority, active, created_at, CHECK(scope IN ('global','user','role','team'))). Inserted 2 pilot rows GREEN. - No pin/ghim table exists today (REGISTRY_MISSING) → this is NEW, propose-only.
- Once committed, PIV-321 (pins by scope, grouped-count) activates (doc 04).
M2.4 — Phantom law (RG4, LAW_DEFINITION_GAP)
record > actualis source_model-dependent (doc 06): model-A = write-race, model-B = phantom candidate. There is no authoritative phantom definition and nophantom_countcolumn anywhere.- Council must (a) define phantom per source_model, (b) ratify a
phantom_count, (c) approve PIV-302 promoting from "candidate count" to "phantom count". event_type_registry(40) has nocount_integrity.*/phantom/pinevent types → NEW event types needed;system_issues(≈179k) is the notify substrate (Đ45).
M2.5 — Scan cadence (CAT-023 + 5 unmeasured)
- CAT-023
actual_countis a frozen scan (985,471) while record_count tracks live → net_gap grows. Decide: (a) faster scan cadence, or (b) sourceactual_countlive from PIV-019. - CAT-1006..1010 (
apr_action_types,apr_request_types,apr_approvals,admin_fallback_log,law_version_verification_log): counts NULL,registry_collectionNULL → run a count scan + set registry_collection, then pivot.
M2.6 — Directus / API exposure
- Expose the six committed views as Directus read collections / API endpoints so the Nuxt
shell reads pivot-backed counts — retiring the legacy
/api/registry/healthΣ|gap|math (Đ28 violation). REAL no-hardcode violations confirmed on VPS source/opt/incomex/docker/nuxt-repo/web:health.get.ts:123 totalGap=reduce(+Math.abs(gap)),index.vue:312 code:'CAT-017', etc. (full list in memory).pivot-query.get.ts= GOOD pattern to follow.
Macro-2 ordering
RG1+RG2 → six-object commit (Macro 1) → M2.1 display_policy ∥ M2.2 PIV-311 → M2.3 registry_pin → M2.4 phantom-law council (RG4) → M2.5 scan cadence → M2.6 Directus.