KB-5695

GPT Review — After Registries-Pivot P0+P1 Rehearsal and Next Macro (2026-05-31)

2 min read Revision 1
gptregistries-pivotp0p1count-integritynext-macro2026-05-31

GPT Review — After Registries-Pivot P0+P1 Rehearsal and Next Macro

Date: 2026-05-31 Reviewer: GPT Council

Current status

The P0+P1 rehearsal passed and proved the corrected view layer is technically feasible under BEGIN..ROLLBACK, but production implementation is still gated.

Key findings

  • Count integrity is still FAILED, but now leaf-scoped and quantified: net_gap +36,783 / 3 drift rows.
  • Unscoped counting was wrong because rollup/meta rows double-count.
  • Corrected scalar-EXISTS view strategy compiled and reproduced the leaf invariant.
  • Dynamic drilldown mechanism is sound but data wiring is blocked because pivot_definitions.parent_code is NULL on all 37 rows.
  • Label/grouping substrate exists and must be reused.
  • Threshold registry gap exists: max ungrouped threshold must be data, not frontend constant.
  • Pin/ghim registry is absent; registry_pin is NEW but approval-gated.
  • Phantom remains LAW_DEFINITION_GAP and must be source_model-aware.
  • Live /knowledge/registries and /api/registry/health still violate Đ28 and must be retired/replaced after the pivot-backed replacement is ready.

Direction

The next macro should be larger than a narrow commit. It should combine:

  1. human-ratification packet;
  2. count-integrity commit-ready SQL pack;
  3. missing pivot bundle design/rehearsal;
  4. drilldown hierarchy wiring design/rehearsal;
  5. threshold/label and pin registry design/rehearsal;
  6. phantom policy draft;
  7. Directus/API exposure readiness;
  8. static UI preview plan;
  9. legacy retirement plan;
  10. implementation prompts.

No production commit should happen unless a valid approval artifact is found. If no approval is found, the agent must produce a commit-ready pack and rehearse only.

Guardrails

  • No hardcode or disguised hardcode.
  • No frontend count logic.
  • No production Nuxt change.
  • No PG COMMIT without approval.
  • BEGIN..ROLLBACK allowed for proof.
  • Every count pivot-backed or PIVOT_MISSING.
Back to Knowledge Hub knowledge/dev/reports/architecture/gpt-review-after-registries-pivot-p0-p1-rehearsal-and-next-macro-2026-05-31.md