Scope Model and Data Ownership
Scope Model and Data Ownership
หัวข้อที่มีชื่อว่า “Scope Model and Data Ownership”Canonical Scope Axes
หัวข้อที่มีชื่อว่า “Canonical Scope Axes”projectId: isolation boundarythreadId: conversation boundaryboardId: board workspace scope (idea/strategy)mapId: map workspace scope (maps)dashboardId: analytics workspace scopeshareSessionId: shared-access boundaryagentId: mode/tool policy boundary
Scope Relationship Model
หัวข้อที่มีชื่อว่า “Scope Relationship Model”erDiagram
PROJECT ||--o{ THREAD : contains
THREAD ||--o{ MESSAGE : has
THREAD ||--o{ SCOPE_MAP : maps_to
SCOPE_MAP }o--|| BOARD : optional
SCOPE_MAP }o--|| MAP : optional
SCOPE_MAP }o--|| DASHBOARD : optional
THREAD ||--o{ SHARE_SESSION : optional
PROJECT {
uuid project_id
}
THREAD {
uuid thread_id
uuid project_id
string agent_id
}
MESSAGE {
uuid message_id
uuid thread_id
}
SCOPE_MAP {
uuid thread_id
uuid board_id
uuid map_id
uuid dashboard_id
}
BOARD {
uuid board_id
}
MAP {
uuid map_id
}
DASHBOARD {
uuid dashboard_id
}
SHARE_SESSION {
uuid share_session_id
uuid thread_id
}
Scope Contract Matrix
หัวข้อที่มีชื่อว่า “Scope Contract Matrix”| โหมด | Workspace | Canonical scope | ก่อนส่งแชตต้องมีอะไร | หมายเหตุ |
|---|---|---|---|---|
general | chat-only | threadId | thread | ไม่มี dedicated canvas |
idea | idea-canvas | boardId | board + thread | proposal/HITL เข้ม |
strategy | strategy-canvas | boardId | board + thread | framework item lifecycle |
maps | map-canvas | mapId | map + thread | realtime room map-first |
analytics | analyze-canvas | dashboardId | dashboard readiness + thread | dataset/template gate |
Ownership by Layer
หัวข้อที่มีชื่อว่า “Ownership by Layer”| ส่วนข้อมูล | Owner หลัก | จุดเขียนหลัก |
|---|---|---|
| Chat threads/messages | chat APIs + client lifecycle | /api/chat/* และ chat persistence paths |
| Scope mapping | BFF chat/scope services | kobi_scope_threads synchronization |
| Canvas nodes/edges | canvas/maps/dashboard services | /api/canvas/*, /api/maps/*, /api/dashboard/* |
| Decision/HITL metadata | action + resume flow | /api/ai/resume + decision telemetry paths |
| Realtime docs (maps) | maps realtime pipeline | `/api/maps/realtime/token |
Non-Negotiable Invariants
หัวข้อที่มีชื่อว่า “Non-Negotiable Invariants”- สำหรับ workspace APIs ต้องมี scope สำคัญที่ถูกต้อง (
boardIdหรือmapIdหรือdashboardId) ตาม endpoint - Thread/message/history ต้อง reject ทันทีเมื่อ scope mismatch กับ thread metadata
- ต้อง canonicalize URL/state ให้ scope ครบเมื่อ recover context ได้
- ต้องไม่ปล่อยให้ client ส่ง metadata นอก allowlist ผ่าน AI proxy