KB-1D58

IU Core 2000x — Next macro package

5 min read Revision 1
iu-core2000xnext-macro2400xdirectus-promotionqdrant-full-reindex

07 — Next macro package

1. State at handoff

  • Code commit 900d4c3 on main (parent 8c7d8dc).
  • 1093 tests (+10 net over 1500x).
  • Production directus DB: migrations 001–021 + runtime through 310 (unchanged from 1500x).
  • information_unit 151 active / v_ui_iu_three_axis_envelope 163 rows / iu_piece_collection 3 / iu_piece_membership 8 / dot_iu_command_run 18 / iu_tree_change_log 56 / iu_route_attempt 68 / dead-letter 0.
  • iu_vector_sync_point 9 rows total — 3 dryrun grandfather + 6 indexed (this macro). All point keys iu.ICX-CONST/....
  • iu_qdrant_collection_registry 1 row (iu_core_iu_chunks, status=active).
  • Qdrant iu_core_iu_chunks 6 points (was 0). Other collection production_documents untouched.
  • Directus directus_collections carries v_ui_iu_three_axis_envelope. Fields not registered (external blocker, doc 03).
  • All write gates closed: composer / delivery / operator_runtime / structure_ops / vector_sync = false; routes_master / route_worker = true.

2. No unsafe state

  • Backup directus-pre-iucore-2000x-20260523T033615Z.dump sha 812803…d2cbd is the rollback anchor.
  • Vector-sync gate closed.
  • Directus collection metadata is removable via DELETE /collections/... (no row data; just bookkeeping).
  • Qdrant points are addressable by deterministic UUIDv5; the rollback driver computes the same ids and DELETEs them.

3. Open gaps carried forward

  1. Directus field-permission blocker (doc 03 §3). POST /fields returns 403 on schema=null view-backed registrations even for the Administrator role. Two operator paths:

    • Path A (recommended): migration 022 promotes the view to a materialised table + refresh trigger.
    • Path B: configure the 16 fields + READ permission via the Directus admin UI.
  2. Nuxt screen wiring. The assembly contract is built and ready (doc 04). Until the Directus blocker clears, Nuxt calls return 403. Once cleared, the Nuxt SDK pattern works as-is.

  3. Broader Qdrant reindex. 6 of 163 IUs are now indexed. A subsequent macro can scale to the full corpus.

IU_CORE_2400X_DIRECTUS_TABLE_PROMOTION_AND_FULL_QDRANT_REINDEX — two parallel slices:

Slice A — Directus table promotion (closes blocker)

  1. Author migration 022_iu_three_axis_envelope_table.sql:
    • CREATE TABLE iu_three_axis_envelope (...) mirroring the view.
    • fn_iu_three_axis_envelope_refresh() — deterministic upsert from v_ui_iu_three_axis_envelope keyed by unit_id.
    • Trigger / lifecycle hook attaches refresh to the iu.lifecycle.enacted event.
  2. Re-issue the Directus registration package against the table name (Directus's normal field-management path works).
  3. Confirm the Nuxt SDK call returns real rows.

Slice B — Full Qdrant reindex (scale to 163 IUs)

  1. Reuse the bounded driver, but pass all 163 canonical addresses in chunks of 20.
  2. Track progress via iu_vector_sync_point (sync_status='indexed' count over time).
  3. Drift report — every 30 minutes during reindex.
  4. Close the gate between batches.

Both slices are independent; either can ship first.

5. Alternative smaller slices

  • IU_CORE_2100X_DIRECTUS_UI_FIELDS_ONLY — operator adds the 16 fields via the Directus admin UI; macro only verifies.
  • IU_CORE_2200X_QDRANT_DRIFT_AUDIT_ONLY — run drift_report against the 6 indexed IUs, prove no drift, document the verification workflow.

6. Is IU Core ready to ship?

Yes — externally integrated at the layer this macro owned. What remains is operator decision (which Directus path; when to scale the Qdrant reindex from 6 to 163). Neither is an IU Core code gap.

7. Verification gate before 2400x

2400x should start only after GPT/User has verified, via AgentData list_documents + search_knowledge, that the 7 reports in this directory are present and searchable, AND that production reports:

  • Qdrant iu_core_iu_chunks carries 6 points (unique_unit_ids=5, one IU split into 2 chunks under the boundary rule);
  • PG iu_vector_sync_point carries 6 rows with sync_status='indexed' and last_actor='iu_core_2000x_bounded_reindex';
  • dot_config.iu_core.vector_sync_enabled = false;
  • Directus /collections/v_ui_iu_three_axis_envelope returns HTTP 200;
  • 1093 tests passing on commit 900d4c3.
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-2000x-qdrant-reindex-directus-apply-external-pass-open-goal/07-next-macro-package.md