Step 14 of 16
Operate source and vector indexes with status, drift detection, safe reindexing, aliases, and audit logs.
เพิ่ม admin controls สำหรับ inspect, retry, reindex, delete และ rollback ก่อนข้อมูลเริ่มโตครับ
Level: Advanced
Vector index ต้องมี operational controls เหมือน database ครับ ทีมควรตอบได้ว่า document ใดถูก ingest, ใช้ version ไหน, chunk กี่ชิ้น, fail เพราะอะไร และจะ reindex แบบไม่หยุด service อย่างไร
สร้าง operator-only admin API หรือ CLI สำหรับ inspect, retry, reindex, cutover, rollback และ delete พร้อม audit ครับ
discovered -> parsing -> embedding -> indexed
-> failed
indexed -> stale -> reindexing -> indexed
indexed -> deleting -> deleted
เก็บ source record แยกจาก chunk records และใช้ index version ชัดเจน ตัวอย่าง fields คือ source ID, checksum, source version, parser version, chunker version, embedding model, vector dimensions, status, attempt, last error และ timestamps
ทุก mutation ต้องมี role-based authorization, confirmation และ audit event ครับ Bulk operation ควรเป็น background job พร้อม dry-run เพื่อให้ operator เห็นจำนวน records ก่อน execute
สร้าง collection ใหม่ เช่น handbook-v4, ingest และ run evaluation ก่อนสลับ alias จาก handbook-active เมื่อ metrics ผ่าน เก็บ version เก่าไว้ช่วงสั้นสำหรับ rollback แล้วลบตาม retention policy วิธีนี้ลด partial index ที่ผู้ใช้เห็นระหว่าง migration
Scheduled worker เปรียบเทียบ source checksum กับ indexed checksum และหา orphan chunks ที่ไม่มี source record Alert เมื่อ failed rate, indexing age หรือ orphan count เกิน threshold ครับ อย่า reindex ทุกอย่างอัตโนมัติเมื่อ model เปลี่ยนโดยไม่มี capacity plan เพราะ embedding cost และ rate limit อาจสูง
สร้าง disposable index แล้วทดสอบ full lifecycle: ingest, inspect, mark stale, reindex, evaluate, activate, rollback และ delete Inject failure ระหว่าง cutover แล้วตรวจว่า active alias ยังชี้ไป version ที่พร้อมใช้งานครับ
Admin mutation ต้องใช้ separate role, strong authentication, reason field, dry-run, rate limit และ immutable audit event ห้ามเปิด raw vector หรือ unredacted source text ในทั่วไป operator screen
ส่ง admin CLI/API, role policy, dry-run output, drift alerts, rollback test และ index lifecycle runbook