policy_result เลิกเป็นสำเนามือของ Decision — policy/v1 v1.3.0 · event/v1 v1.5.0 - #34
Merged
Merged
Conversation
…/v1 v1.5.0 ADR-0018 เคาะ option B event/v1.policy_result เคยประกาศรูปของตัวเอง ทำให้มีสองที่ที่บอกว่าผลของ policy หน้าตาอย่างไร และไม่มีอะไรคอยจับว่ายังตรงกัน — consent ที่ ADR-0016 เพิ่มเข้า Decision ไม่ไหลไปที่นั่นเอง พิสูจน์แล้วว่าเพี้ยนจริง ไม่ใช่ความเสี่ยงทางทฤษฎี ไม่เลือกทางยกทั้ง Decision ไปให้ event สองเหตุผล หนึ่ง Decision.required มี 4 ตัว ทำให้ policy_result ที่ใส่ไม่ครบกลายเป็น invalid = เข้มขึ้น = breaking ตามตัวอักษร สอง Decision มี reason ที่เป็น free text ซึ่งถ้าไหลเข้า audit เองจะเฉียดกับ guarantee ข้อ 7 ของ event/v1 โดยไม่มีใครตัดสินใจ การที่ policy_result เป็นชุดย่อยจึงเป็นเรื่องถูกต้อง ที่ผิดคือมันถูกประกาศซ้ำ DecisionSummary จึงประกาศสี่ field ที่ใช้ร่วมกันครั้งเดียว Decision อ้างผ่าน allOf และ event/v1 อ้างตัวเดียวกัน field ใหม่ใน Decision จะไม่ไหลเข้า Summary เอง ต้องเคาะทุกครั้ง เขียนกำกับไว้ในตัว schema เพื่อไม่ให้คนถัดไปคิดว่าเป็นความหลงลืม ไม่มีอะไรเข้มขึ้น Summary ไม่มี required เหมือนที่ policy_result เดิมไม่มี รูปที่ยอมรับเหมือนเดิมเป๊ะ guarantees ไม่ขยับ semantics_version ยัง 1.1 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-0018 option B · ปิดข้อค้นพบ 3 ของ ADR-0016
ปัญหา — พิสูจน์แล้วว่าเพี้ยนจริง ไม่ใช่ความเสี่ยงทางทฤษฎี
event/v1.policy_resultประกาศรูปของตัวเอง ไม่ได้$refไปpolicy/v1Decision→ มีสองที่ที่บอกว่า "ผลของ policy หน้าตาอย่างไร" และไม่มีอะไรคอยจับว่ายังตรงกันconsentที่ ADR-0016 เพิ่งเพิ่มเข้าDecisionไม่ไหลไปที่นั่นเอง — ต้องอาศัยคนจำ · เป็น drift ชนิดเดียวกับที่drift_checkมีไว้จับข้าม repo แต่เกิดภายในไฟล์ของเราเอง ซึ่งไม่มี check ตัวไหนมองทำไมไม่ยกทั้ง
Decisionมาใส่ eventตรวจก่อนแล้วว่า ไม่มี consumer รายไหนใช้
policy_resultเลย (grepทั้งdevfactory-core= 0 · GitHub code search ในcare-agent-platform= 0) ทั้งที่ทั้งคู่ pinevent/v1— ทางที่เข้มขึ้นจึงไม่ทำให้ใครพังวันนี้ แต่ยังไม่เลือก ด้วยสองเหตุผล:Decision.requiredมี 4 ตัว →policy_resultที่ใส่ไม่ครบกลายเป็น invalid = เข้มขึ้น = breaking ตามตัวอักษรของ ADR-0006 · การเอาหลักฐาน "ไม่มีใครใช้" มาแทนกฎ ควรเป็นทางเลือกสุดท้าย ไม่ใช่ทางแรกDecisionมีreasonที่เป็น free text — ถ้าไหลเข้า audit record เองผ่าน$refจะเฉียดกับ guarantee ข้อ 7 ของevent/v1(🔒 ห้ามเก็บ private reasoning เป็น audit record) โดยไม่มีใครตัดสินใจ · และexpires_atก็ไม่มีความหมายในบันทึกที่ immutable แล้วสิ่งที่เปลี่ยน
🔒 field ใหม่ใน
Decisionไม่ไหลเข้า Summary เอง — ต้องเคาะทุกครั้ง · เขียนกำกับไว้ในตัว schema เพื่อไม่ให้คนถัดไปคิดว่าเป็นความหลงลืม ·consentจงใจไม่อยู่ใน Summary เพราะ event มีconsentของตัวเองที่ระดับบนสุดแล้ว (v1.4.0) ใส่ซ้ำสองที่ในบันทึกเดียวคือ drift ที่รอเกิดไม่ breaking — และ ไม่เข้มขึ้นแม้แต่นิดเดียว
DecisionSummaryไม่มีrequiredเหมือนที่policy_resultเดิมไม่มี · ชุด property และrequiredของDecisionเท่าเดิมทุกตัว — ย้ายที่ประกาศ ไม่ได้ย้ายความหมาย ·guaranteesไม่ขยับ ·semantics_versionยัง"1.1"ตรวจแล้ว
drift_check.py→passed=20 FAIL=0 WARN=0· payload จริง 13 เคส ตรงตามคาดทั้งหมดDecisionพฤติกรรมต้องไม่เปลี่ยนจากก่อนallOfeffect· ขาดevaluated_at·effect/authorityนอก enumpolicy_resultรูปที่ยอมรับต้องเหมือนเดิม{}ว่างเปล่าpolicy_resultค่าผิดeffect·authority·action_riskนอก enumผลต่อ consumer
ไม่มีใครต้องทำอะไร — ไม่มีใครใช้
policy_resultและรูปที่ยอมรับไม่เปลี่ยน🤖 Generated with Claude Code
https://claude.ai/code/session_01LHv7HRmnnGAoKT5BvxDWHs