Governance decision interface — decision เป็น record ไม่ใช่ flag (#5) - #18
Merged
Merged
Conversation
`Decision` เป็น frozen dataclass ที่บังคับ 4 field ตาม RFC-0002 (decision · reason · decided_at · authority) และ serialize เป็นรูป approval/v1 ของ agent-platform · `Job._approved: bool` กลายเป็น `Job._approval: Decision | None` — ข้อห้าม "execution ก่อน APPROVED" จึงผูกกับ record จริงแทน flag ที่ใครก็ตั้งได้ REQUIRE_CHANGES: vocabulary มีครบ 3 ค่าตามสัญญา แต่ engine ปฏิเสธค่านี้ด้วย UnmappedDecision เพราะไม่มีเอกสารไหนบอกว่า job ไปสถานะไหนต่อ — approval/v1 บอกแค่ว่า "ไม่ใช่ REJECT · งานยังมีชีวิต" และ GOVERNANCE_ANALYSIS มีทางออก แค่ APPROVED/REJECTED · ไม่เดาปลายทาง ไม่เพิ่ม edge ไม่เพิ่ม state ที่ 14 ถามไว้ที่ agent-platform#22 แล้ว รอ RFC ก่อนค่อยเปิดใช้ ทุก APPROVE/REJECT emit GOVERNANCE_DECISION คู่กับ STATE_TRANSITION เสมอ ไม่ว่าจะเข้าผ่าน decide() หรือ transition() ทั่วไป — guarantee ผูกกับ state ไม่ใช่กับ method known gap: approval/v1 บังคับให้ "อ้างใบเดิม" แต่ schema ไม่มี field ให้ ใส่ supersedes_decision_id ไปก่อนและลงทะเบียนใน gaps: → agent-platform#22 pytest 350 passed (เดิม 302) · payload_check 13 passed 0 fail Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
monthop-gmail
force-pushed
the
feat/governance-decision-interface
branch
from
August 19, 2026 12:12
53e961b to
801ee9a
Compare
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.
ปิด #5 · decision กลายเป็น record ที่ตรวจสอบได้ ไม่ใช่ flag ที่ใครก็ตั้งได้
แกนของการเปลี่ยน
Job._approved: bool→Job._approval: Decision | Noneข้อห้าม "execution ก่อน APPROVED" เดิมผูกกับ boolean ที่ตั้งเป็น
Trueได้โดยไม่มีใครรับผิดชอบตอนนี้ผูกกับ record ที่บังคับ 4 field ตาม RFC-0002 —
decision·reason·decided_at·authorityถ้าไม่มีใบอนุมัติจริง งานเดินต่อไม่ได้ และ "ใครอนุมัติ" ตอบได้เสมอ
Decisionเป็น frozen dataclass · serialize เป็นรูปapproval/v1ของagent-platformตรง ๆ(
decision_id→approval_idตาม RFC-0005 Rule 1) · self-approval ของ agent ถูกปฏิเสธตาม invariant ที่สัญญาเขียนไว้ ("no agent has total authority")
REQUIRE_CHANGES— รับเป็นคำ แต่ยังใช้ไม่ได้ โดยตั้งใจvocabulary มีครบ 3 ค่าตามสัญญา (ชุดปิด ขาดไม่ได้) แต่ engine ปฏิเสธ
REQUIRE_CHANGESด้วย
UnmappedDecisionเพราะ ไม่มีเอกสารไหนบอกว่างานไปสถานะไหนต่อ:approval/v1guarantee บอกแค่ว่า "ไม่ใช่ REJECT — งานยังมีชีวิตและกลับมายื่นใหม่ได้"GOVERNANCE_ANALYSISมีทางออกแค่APPROVEDกับREJECTEDทางเลือกทั้งสามทาง (เพิ่ม edge →
DRAFT· ใช้REJECTED· เพิ่ม state ที่ 14) เป็น lifecycle changeที่ต้องมี RFC ก่อนตาม
CONTRIBUTING.md· PR นี้จึงไม่เลือกให้ — ถามไว้ที่agent-platform#22 แล้ว
audit trail
ทุก
APPROVE/REJECTemitGOVERNANCE_DECISIONคู่กับSTATE_TRANSITIONเสมอไม่ว่าจะเข้าผ่าน
decide()หรือtransition()ทั่วไป — guarantee ผูกกับ state ไม่ใช่กับ methodจึงไม่มีทางเข้า
APPROVEDแบบข้ามการบันทึกได้known gap ที่ลงทะเบียนไว้
approval/v1บังคับว่า "การเปลี่ยนใจคือ approval ใบใหม่ที่อ้างใบเดิม" แต่ schema ไม่มี field ให้อ้าง· ใส่
supersedes_decision_idฝั่งเราไปก่อน (schema ไม่ได้ปิดadditionalProperties)และลงใน
gaps:ของplatform-contract.yamlชี้ไป agent-platform#22 · ถ้าเขาตั้งชื่อ field เองงานที่เหลือคือ rename ไม่ใช่ออกแบบใหม่
ผลตรวจ
pytest350 passed (เดิม 302 · เทสใหม่ 48 ตัวในtest_decisions.py)conformance/payload_check.py13 passed · 0 fail — validate decision จริงกับapproval/v1และ probe ว่า
REQUIRE_CHANGESถูกปฏิเสธจริงsemantics_version· ไม่แตะบล็อกfrozenbreaking ระดับ in-repo
approve()/reject()คืนDecisionแทนEvent— call site ในเรโปแก้ครบแล้วที่ยังไม่ทำในนี้
REQUIRE_CHANGES→ รอ agent-platform#22 แล้วค่อยออก RFCstate-machine.md§Open questions ถ้าจะขยายให้ครอบคลุมคนต้องเป็น RFCCloses #5