KB-4110

13 — Next Macro Prompts (paste-ready)

5 min read Revision 1
registries-pivotnext-macropromptsF1F2F3L1approval-gated2026-05-31

title: 13 — Next Macro Prompts (paste-ready) date: 2026-05-31

13 — Next Macro Prompts

Each prompt is approval-aware: it commits ONLY if the named approval is present, else rehearses/packs. None self-approves.

Macro F1 — Foundation Commit (RG1+RG2+RG3)

MISSION: REGISTRIES_PIVOT_F1_FOUNDATION_COMMIT
Effort xhigh. Host contabo, DB directus. Read channel KB + live PG RO. Apply workflow_admin.
GATE: Proceed to COMMIT only if a valid human/council approval for RG1+RG2 (six views) and
RG3 (pivot bundle + parent_code) is present in this prompt or in approval_requests/apr_approvals/
os_proposal_approvals. Else rehearse + stop. No self-approval.
DO:
 1. Re-scan approval. Classify COMMIT_ALLOWED vs FORBIDDEN per scope.
 2. Re-rehearse BEGIN..ROLLBACK: \i /Users/nmhuyen/rp_gateway/sql/001..006 + 900_verify; confirm V3 closure (Σ drift == net_gap), 160 leaf, idle 0.
 3. IF RG1+RG2 approved: record sign-off, then ONE tx \i 001..006 + 900_verify, COMMIT, verify 6 objects present + idle 0; keep 999_rollback ready.
 4. IF RG3 approved: CREATE VIEW v_count_rollup_src; bulk-INSERT PIV-500/301/302/303/311 in ONE statement is_active=false off-peak, activate, verify engine SUM (PIV-500 grouped-sum); then ONE-statement UPDATE parent_code (13 edges), verify 0 dangling.
 5. Output KB pack + evidence + rollback log. FORBIDDEN: row-by-row pivot insert (fires full refresh each), any commit without its own approval, Directus/Nuxt change.

Macro F2 — Surfaces (RG5+RG6+RG7)

MISSION: REGISTRIES_PIVOT_F2_SURFACES
Pre: F1 committed (six views + pivots + parent_code). GATE per scope.
DO:
 1. IF RG5: CREATE TABLE display_policy + seeds (__default__=50, dot_tool=30, collection=50); verify ceiling resolves from PG; feed grouping_required.
 2. IF RG6: CREATE TABLE registry_pin + PIV-321 (pins by scope).
 3. IF RG7: register the six views as Directus read collections (directus_collections/_fields) + read policy; build 8 read endpoints to the pivot-query.get.ts pattern (no count math, §0-AV).
 4. Static mock already shipped (v2 data.json) — re-point to live endpoints.
 FORBIDDEN: count math in API, frontend thresholds/pins, Directus write beyond collection registration, no commit without scope approval.

Macro F3 — Render & Converge (RG8 → acceptance → RG9)

MISSION: REGISTRIES_PIVOT_F3_RENDER_CONVERGE
Pre: F2 done (API live). GATE RG8 then RG9.
DO:
 1. IF RG8: implement /knowledge/registries-pivot render-shell + components (doc 08): dumb components, fetch doc-06 endpoints, loading/error/empty/PIVOT_MISSING states, a11y. Wire the v2 preview live. No business logic, no hardcode, no client count math.
 2. Run acceptance suite (doc 10): assert 100% counts pivot-traced or PIVOT_MISSING; invariant CLOSURE (not absolute); CI no-hardcode grep gate = 0 on the shell.
 3. IF acceptance green AND RG9: converge /knowledge/registries → redirect to /knowledge/registries-pivot; retire health.get.ts Σ|gap|, raw-counts Σrecord, index.vue hardcoded CAT-* rows; keep snapshot rollback; publish migration note.
 FORBIDDEN: cutover before acceptance green, deleting legacy files before soak, any hardcode in the new shell.

Macro L1 — Phantom Law (RG4, council, parallel)

MISSION: REGISTRIES_PIVOT_L1_PHANTOM_LAW
Independent of F1–F3 commits. Council/RG4 only. NO enactment without council quorum.
DO:
 1. Present the source_model-aware phantom definition (doc 05) to council: model-A surplus = recheck (NOT phantom); model-B surplus = phantom_candidate; phantom_confirmed needs source scan + ratification.
 2. IF ratified: draft law patch; authorize phantom_count column + PIV-302 promotion; add NEW system_issues/event types (count_integrity_failed, phantom_candidate, phantom_confirmed, label_grouping_required); define cleanup workflow (propose-only, Đ32 per action).
 FORBIDDEN: blind record>actual as phantom signal, auto-delete of candidates, law enactment without quorum, self-approval.

Scan-cadence side-task (Macro 2 leftover, low-gate)

Refresh CAT-023 actual_count (or source live from PIV-019) to stop monotonic net_gap growth; run a first count scan for CAT-1006..1010 (apr_action_types, apr_request_types, apr_approvals, admin_fallback_log, law_version_verification_log) and set registry_collection, then pivot. Read/scan only until counts approved.

Back to Knowledge Hub knowledge/dev/reports/architecture/registries-pivot-macro2-3-combined-ui-api-legacy-acceptance-2026-05-31/13-next-macro-prompts.md