KB-26B1

9000x-onboarding · 04 — Live apply (88 points upserted) + deltas + retrieval smoke

4 min read Revision 1
iu-corev0.69000xlive-applyqdrantretrieval-smokeboundary

9000x — Live apply + verification

Apply command

Run inside incomex-agent-data container (sibling of incomex-qdrant on docker_incomex net; carries both QDRANT_API_KEY and OPENAI_API_KEY):

ssh contabo 'docker exec -e PYTHONPATH=/tmp/iu_onboard_9000x \
    -e DB_USER=... -e DB_HOST=postgres -e DB_PORT=5432 \
    -e DB_DATABASE=directus -e DB_PASSWORD=... \
    incomex-agent-data python3 \
    /tmp/iu_onboard_9000x/ops/qdrant-onboarding-package-8000x/in_container_run.py \
    --apply --docs DIEU-28,DIEU-32,DIEU-35 \
    --actor iu-core-9000x/qdrant_onboarding \
    --collection iu_core_iu_chunks'

DB env vars sourced via shell substitution from incomex-directus's env inside the SSH session — never returned to the Mac transcript:

DB_PASSWORD=$(docker exec incomex-directus printenv DB_PASSWORD)

Apply outcome

{
  "mode": "apply",
  "ok": true,
  "collection": "iu_core_iu_chunks",
  "actor": "iu-core-9000x/qdrant_onboarding",
  "gate_opened": true,
  "gate_closed": true,
  "points_upserted": 88,
  "bounded_apply": {
    "boundary_assertions_passed": true,
    "collection_name": "iu_core_iu_chunks",
    "embedder_model_ref": "openai:text-embedding-3-small",
    "points_planned": 88,
    "points_recorded": 88,
    "points_upserted": 88
  },
  "plan_summary": { "candidate_count": 86, "empty_body_skipped_count": 5,
                    "to_index_count": 81, "point_count": 88, "preflight_ok": true }
}

Post-apply deltas (live verified)

Surface Before After Δ
iu_vector_sync_point rows 64 152 +88
iu_vector_sync_point indexed 61 149 +88
iu_vector_sync_point unique unit_id 60 141 +81
iu_vector_sync_point rows w/ actor=9000x 0 88 +88
iu_vector_sync_point rows w/ actor != 9000x (KT-B) 64 64 0 (unchanged)
Qdrant iu_core_iu_chunks points 61 149 +88
Qdrant production_documents points 9379 9379 0 (untouched)
Gate vector_sync false false closed
Gate three_axis_auto_refresh false false unchanged
Gate retention false false unchanged

KT-B (60 enacted ICX-CONST IUs / 61 KT-B Qdrant points) preserved byte-identical.

Retrieval smoke (in-container)

Top-5 search for query "sự phối hợp giữa các cơ quan trong việc thực hiện nhiệm vụ chung" filtered to axis_refs.doc_code in (DIEU-28, DIEU-32, DIEU-35):

Rank Score doc point_key
1 0.3794 DIEU-35 iu.D38-DIEU35-S1
2 0.3721 DIEU-32 iu.D38-DIEU32-S2-P4
3 0.3675 DIEU-35 iu.D38-DIEU35-S2
4 0.3626 DIEU-28 iu.D38-DIEU28-S11
5 0.3612 DIEU-32 iu.D38-DIEU32-S6

All five top hits are 9000x DIEU points carrying the correct axis_refs.doc_code / section_code / depth payload. KT-B points are NOT in the top-5 (correct — KT-B is about contract templates, not operational coordination).

Vector boundary (live verified)

Pagination scroll counted 149 indexed points with source_path LIKE 'information_unit/%' — matching the iu_vector_sync_point row count exactly. PG↔Qdrant drift: 0.

Per-IU boundary: no (unit_id, chunk_index) collisions; multi-chunk IUs have chunk_count > 1 consistent across their rows; assert_boundary returned True both before and after apply.

Rollback availability

--rollback would issue:

  • SELECT point_key FROM iu_vector_sync_point WHERE last_actor='iu-core-9000x/qdrant_onboarding' → 88 keys;
  • POST /collections/iu_core_iu_chunks/points/delete with points=[uuid…] (deterministic ids derived from point_id_for);
  • DELETE FROM iu_vector_sync_point WHERE last_actor='…'.

Not executed (apply was the goal). Full pg_dump backup also remains for disaster recovery.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-9000x-qdrant-onboarding-piece-platform-open-goal/04-live-apply-and-verification.md