- Scope-first always
- ทุก API ที่เกี่ยวกับ workspace ต้องมี canonical scope key ที่ถูกต้อง
- BFF as hard trust boundary
- inference/chat/workspace requests ต้องผ่าน validation และ normalization ก่อนออกจาก
kobi-ai
- Single source of truth for mode capability
- capabilities ต้องมาจาก manifest + tool policy + node registry เท่านั้น
- Deterministic lifecycle
- thread bootstrap, URL canonicalization, resume flow ต้องมี guard สำหรับ stale/race
- 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