KB-1096

13 — Next Implementation Prompts (14 paste-ready gated macros)

7 min read Revision 1
registries-pivotnext-macropromptsroadmapgatedbegin-rollbackno-self-approval2026-05-31

title: 13 — Next Implementation Prompts (14 macros) date: 2026-05-31 standing_header: "Apply channel = ssh contabo → docker exec -i postgres psql -U workflow_admin -d directus. BEGIN..ROLLBACK ONLY until the named gate passes. Read = query_pg (context_pack_readonly) / KB / ssh read. Forbidden (all): COMMIT before the stated gate; self-approval; any count not pivot-backed or PIVOT_MISSING; frontend count logic; production Nuxt change outside the named macro; Directus/Qdrant mutation outside gate; notification/event emit before register-before-emit." ordering: "RG1+RG2 → M2(P1) → M3(P5) ∥ M5(P7) → M4(drill) → M8(P2) → M7(P6 council) → M9(P3) ∥ M6(P8 after approval) → M10(P4 after all RG) → M11(legacy) → M13(P9) → M14(acceptance); M12(CI) runs from M8 onward."

13 — Next Implementation Prompts

M1 — REGISTRIES_PIVOT_HUMAN_RATIFICATION_SESSION (gate: opens RG1+RG2)

Goal: run the human/council session over doc 02. Present the live +132 / 3-drift / 5-unmeasured picture (not the stale +36,783). Capture signed APPROVE/DEFER per the §I wording. Persist the signed artifact to KB knowledge/dev/laws/.../registries-pivot-rg1-rg2-ratification-outcome-<date>.md. No agent self-approval; the agent only records the human decision.

M2 — REGISTRIES_PIVOT_VIEW_COMMIT_AFTER_RATIFY (gate: RG1+RG2 signed)

Goal: COMMIT the 6-object read-only layer (doc 03) off-peak. Re-run the BEGIN..ROLLBACK rehearsal immediately before COMMIT; confirm V1=160, V3 closure, V7 tree 37/37/0; if green → COMMIT; else ROLLBACK. Run 900_verify post-commit. Stage 999_rollback. Do NOT commit pivots/parent_code/threshold/pin.

M3 — REGISTRIES_PIVOT_MISSING_PIVOT_BUNDLE (gate: M2 committed; RG3)

Goal: BEGIN..ROLLBACK INSERT then (on approval) commit PIV-500 (grand-total — DEFINE its semantics: what is being totaled), PIV-30x (orphan/phantom/drift totals), PIV-31x (label-by-facet over entity_labels 722,803), system_issues-total pivot. Then refresh_meta_catalog_from_pivot. Evidence: the ≥5 disagreeing totals (1,721,334 / 1,719,958 / 2,003,754 / 2,002,041 / 2,001,909) collapse to one explained anchor.

M4 — REGISTRIES_PIVOT_DRILLDOWN_PARENT_CODE_WIRING (gate: M2; P-DRILL)

Goal: implement doc 05 — fn_propose_pivot_parents() (derive edges from registry_group/source_object/ composition_level), council-review the generated edge list, then UPDATE pivot_definitions.parent_code (off-peak; fires trg_pivot_def_refresh) + ADD meta_catalog.pivot_code + backfill. Rehearse first. Confirm v_registries_pivot_tree becomes non-flat (≈24 roots / 6 parents). No frontend hierarchy.

M5 — REGISTRIES_PIVOT_THRESHOLD_REGISTRY (gate: RG5; P7)

Goal: birth display_policy(species_code, max_ungrouped default 50 CHECK ≤50) + rows (__default__=50, smaller per species). Replace the literal 50 in label-grouping with a PG lookup. Evidence: the 28-over-ceiling leaves resolve from PG; 0 literal 50 in app/SQL resolution.

M6 — REGISTRIES_PIVOT_PIN_REGISTRY_BIRTH (gate: RG5 + Đ32; P8)

Goal: birth registry_pin (doc 08 shape, Đ0-G), register in meta_catalog, add PIV-32x, register pin.created/pin.removed in event_type_registry before emit. Global pins require Đ32 approval. Soft-retire only. Rehearse, then commit on approval.

M7 — REGISTRIES_PIVOT_PHANTOM_LAW_PATCH (gate: council / Đ32; RG4)

Goal: take doc 07 §E to council. Define phantom source_model-aware (model-B file-absence; model-A live-pivot reconciliation; reject blind record−actual). Register count_integrity_phantom issue type

  • phantom_detected/cleared events. Author packet only; no enactment by agent.

M8 — REGISTRIES_PIVOT_DIRECTUS_API_EXPOSURE (gate: M2 committed; P2; design-first)

Goal: implement doc 09 — expose v_count_integrity/v_living_lists/v_count_drift/ v_registries_pivot_tree/fn_*substrate/pivot_count via read-only Directus collections or /api/registries-pivot/*. Map every contract field → its view/pivot source. Read-only role; GRANT EXECUTE on the fns. Shaper does NO counting. Rehearse permissions before enabling.

M9 — REGISTRIES_PIVOT_UI_PREVIEW_STATIC (gate: RG6; P3)

Goal: deploy doc 10 — /ui-preview/registries-pivot/v1/ static, fetch('mock-data.json'). Reuse the existing nginx location /ui-preview/; deploy via ssh+tar; verify 200; rollback = rm version dir. Zero DB/Directus/Qdrant/Nuxt change. Pending user/GPT design review.

M10 — REGISTRIES_PIVOT_NUXT_RENDER_SHELL (gate: ALL RG1–RG8 + M2/M8 live; P4)

Goal: implement the converged /knowledge/registries-pivot render-shell over the API (doc 09). Only registered templates; Đ28 NT-D1/D3. Run doc-12 Truth-Check (100% Nuxt==PG) + coverage 100% + 0 hardcode_violation. This is the production change; everything before it is read-only/design.

M11 — REGISTRIES_PIVOT_LEGACY_RETIREMENT (gate: M10 parity; P4)

Goal: execute doc 11 retire-after-replace — remove /api/registry/health gap-math, point /api/registry/counts at PIV-500, drop the hardcoded phantom rows in /knowledge/registries, stop using record_count as displayed truth, alias+deprecate the old route. Each as a reviewed web-repo PR.

M12 — REGISTRIES_PIVOT_NO_HARDCODE_CI (gate: M8 onward; P10; continuous)

Goal: implement doc 12 — static scan in the web source repo (not the bundle) + the SQL evidence checks; write hardcode_violation/hc_finding_* to system_issues; block merge on regression.

M13 — REGISTRIES_PIVOT_NOTIFICATION_CLEANUP_INTEGRATION (gate: M10 + M7 ratified; P9)

Goal: fn_count_integrity_check() writes idempotent system_issues (coalesce_key) and emits signal-only event_outbox events (Đ45 MOT-not-executor; register-before-emit). Register the check as an Đ31 self-verification contract + watchdog (silent-gap/heartbeat). No emit before registration.

M14 — REGISTRIES_PIVOT_PRODUCTION_ACCEPTANCE_TEST (gate: M10+M11 live)

Goal: end-to-end acceptance — Truth-Check 100%, coverage 100%, 0 hardcode, net_gap explained, drilldown works to leaf substrate, drift/phantom/orphan surfaced correctly, pins/labels/thresholds PG-backed, legacy endpoints retired, one converged surface. Produce the acceptance report + sign-off.

DEFER (not in this roadmap): ghost / Qdrant cross-store reconciliation; IU/KG dedicated pivots.

Back to Knowledge Hub knowledge/dev/reports/architecture/registries-pivot-ratification-commit-ready-gateway-2026-05-31/13-next-implementation-prompts.md