ข้ามไปยังเนื้อหา

Architecture Guardrails

  1. Scope-first always
  • ทุก API ที่เกี่ยวกับ workspace ต้องมี canonical scope key ที่ถูกต้อง
  1. BFF as hard trust boundary
  • inference/chat/workspace requests ต้องผ่าน validation และ normalization ก่อนออกจาก kobi-ai
  1. Single source of truth for mode capability
  • capabilities ต้องมาจาก manifest + tool policy + node registry เท่านั้น
  1. Deterministic lifecycle
  • thread bootstrap, URL canonicalization, resume flow ต้องมี guard สำหรับ stale/race
  1. Explicit fallback lifecycle
  • fallback branch ทุกตัวต้องมีแผน deprecate และ metric ติดตาม
flowchart LR
  A[Route/State] --> B[Scope Canonicalization]
  B --> C[Client Service Payload]
  C --> D[BFF Validation]
  D --> E[Downstream Execution]
  E --> F[Persistence/Reconciliation]

  G[Manifest/Policy/Node Registry] --> C
  H[Test + Telemetry] --> B
  H --> D
  H --> F
  • โค้ดที่แก้กระทบ scope keys หรือไม่
  • มี test ครอบคลุม deep-link/new-chat/share/recovery แล้วหรือยัง
  • resume stream/non-stream fallback ยังทำงานครบหรือไม่
  • action -> workspace persisted state ยัง converge เหมือนเดิมหรือไม่
  • มีการเพิ่ม/แก้ field ใน /api/ai/* โดยไม่อัปเดต allowlist หรือไม่
  • scope mismatch rate ต่อ endpoint
  • fallback branch hit rate
  • resume synthetic-finalization rate
  • maps realtime reconnect failures
  • analytics readiness gate stuck duration