workspace_id เป็นขอบเขตอนุญาต ไม่ใช่กำแพง — identity/v1 v1.1.0 - #41
Merged
Conversation
ADR-0021 เคาะ option B ตอบ enterprise-knowledge#23 ที่บล็อก schema.sql ของเขาอยู่ สองในสามข้อที่เขาถาม ADR-0007 ตอบไว้แล้ว knowledge ต้องมี workspace_id (เขียนไว้ใน Consequences ตรง ๆ) และ department เป็น label ของ workspace ไม่ใช่ metadata อิสระ ต้องชี้ให้เห็น ไม่ใช่ตัดสินใหม่ ข้อที่สามยังไม่มีใครเคาะ ADR-0007 พูดสองอย่างที่ต้องอ่านคู่กัน คือ workspace = grouping กับเหตุผลที่ปฏิเสธ option C ว่าไม่มี workspace แล้ว ทีมหนึ่งเห็น knowledge อีกทีมทั้งหมด ถ้า workspace ไม่บังคับอะไรเลยการปฏิเสธ option C ก็ไม่มีความหมาย ถ้าแข็งเท่า tenant ก็ไม่มีเหตุผลที่ต้องมีสองชั้น คำตอบที่ทำให้ทั้งสองประโยคจริงพร้อมกันมีทางเดียว สองชั้นต่างกันที่ข้ามได้ไหม ถ้ามีคนอนุญาต ไม่ใช่ที่เข้มแค่ไหน tenant ไม่มีใครอนุญาตได้และบังคับที่ชั้นเก็บ ข้อมูล workspace ปฏิเสธโดยปริยายแต่ขยายได้ผ่าน policy/v1 บังคับที่ชั้นตรวจสิทธิ์ และการข้ามที่สำเร็จต้องออก audit event เสมอ ไม่งั้นก็ไม่ต่างจากไม่มี workspace ไม่มี field ใหม่ ไม่มี contract ใหม่ กลไกครบอยู่แล้ว เปลี่ยนแค่คำอธิบายให้คน เจอกฎนี้ตรงที่เขาอ่านจริง Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LHv7HRmnnGAoKT5BvxDWHs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADR-0021 option B · ตอบ enterprise-knowledge#23 ที่บล็อก
schema.sqlของเขาอยู่2 ใน 3 ข้อ ADR-0007 ตอบไว้แล้ว — ต้องชี้ ไม่ใช่ตัดสินใหม่
workspace_idไหมdepartmentเป็น metadata filter ได้ไหมworkspace_idnullable ก่อน) ใช้ไม่ได้ — ขัดทั้ง ADR-0007 และ §25 ของเขาเองที่ห้าม scope filter เป็น optional ใน production pathข้อที่ยังไม่มีใครเคาะ
ADR-0007 พูดสองอย่างที่ต้องอ่านคู่กัน:
คำตอบที่ทำให้ทั้งสองประโยคจริงพร้อมกันมีทางเดียว — ต่างกันที่ "ข้ามได้ไหมถ้ามีคนอนุญาต" ไม่ใช่ที่ "เข้มแค่ไหน"
tenant_idworkspace_idpolicy/v1(+consent/v1ถ้าเป็นข้อมูลส่วนบุคคล)แถวสุดท้ายคือหัวใจ — ถ้า cross-workspace ทำได้เงียบ ๆ มันก็ไม่ต่างจากไม่มี workspace
ทำไมไม่เลือกให้แข็งเท่า tenant
สิ่งที่เปลี่ยน — ไม่มี field ใหม่ ไม่มี contract ใหม่
กลไกครบอยู่แล้ว (
policy/v1·consent/v1·event/v1) · เปลี่ยนแค่คำอธิบายให้คนเจอกฎนี้ตรงที่เขาอ่านจริง:identity/v1WorkspaceIdTenantIdให้ชัด —v1.0.0→v1.1.0planes/knowledge.mdไม่มี field เปลี่ยน ไม่มีอะไร breaking — เป็นการเขียนสิ่งที่ ADR-0007 ตัดสินไว้แล้วให้ชัดขึ้น
ผลต่อ consumer
enterprise-knowledgeปลดบล็อก Phase 1 ได้ทันที และรู้ว่าต้องบังคับ workspace ที่ชั้นไหน (ไม่ใช่ชั้นเดียวกับ tenant)care-agent-platformไม่กระทบ — บังคับ tenant ด้วย RLS อยู่แล้วซึ่งแข็งกว่า และcare_organizationเป็น record ในโดเมน ไม่ใช่ workspacedevfactory-coreไม่กระทบ —workspace_idoptional สำหรับ event ระดับ tenant ตาม ADR-0007 เดิมdrift_check.py→passed=20 FAIL=0 WARN=0🤖 Generated with Claude Code
https://claude.ai/code/session_01LHv7HRmnnGAoKT5BvxDWHs