PROP-045 · SCOPE-OVERLAP PREDICATE Rev 1.0 · 23 Jul 2026

Cane Agency · Change proposal PROP-045 · spun out of PROP-022 (ex-OQ-15…18; relocated from the PROP-019 Q1 gate, Q-22)สถาบันอ้อย · ข้อเสนอการเปลี่ยนแปลง PROP-045 · แยกจาก PROP-022 (เดิม OQ-15…18; ย้ายมาจากด่าน Q1 ของ PROP-019 ข้อ Q-22)

The scope-overlap predicate — scope axes, priority, enforcement timingpredicate การทับซ้อนของ scope — แกน scope, ลำดับความสำคัญ, จังหวะการบังคับ

Documentเอกสาร
PROP-045
Statusสถานะ
ACCEPTED & APPLIED — spec v0.22.0อนุมัติและปรับใช้แล้ว — spec v0.22.0
Originที่มา
Client direction (19 Jul 2026) in the PROP-022 review: spin each remaining topic out as its own comprehensive proposal — this completes the set (after PROP-042/043/044). Carries PROP-022's scope-overlap-predicate family wholesale (ex-OQ-15…OQ-18, itself relocated from the PROP-019 Q1 gate's Q-22 on 15 Jul 2026). OQ numbering is preserved.แนวทางลูกค้า (19 ก.ค. 2569) ในการทบทวน PROP-022: แยกแต่ละหัวข้อที่เหลือเป็นข้อเสนอฉบับเต็มของตัวเอง — ฉบับนี้ทำให้ชุดครบ (ต่อจาก PROP-042/043/044) ถือตระกูล predicate การทับซ้อนของ PROP-022 ทั้งชุด (เดิม OQ-15…OQ-18 ซึ่งย้ายมาจาก Q-22 ของด่าน Q1 PROP-019 เมื่อ 15 ก.ค. 2569) คงเลข OQ เดิม
Depends onพึ่งพา
PROP-019 Q-22 (the origin gap) · FR-80 + WF-31/35 + str.err.overlap (the enforcement points whose predicate is undefined) · PROP-009 StrategicAgreement (mode/counterparty/season — today the only scope carriers) · A-19 calc_basis cascade (the most-specific-wins precedent) · PROP-022 plan designer & analytics attribution (the second consumer of the resolver) · NFR-22 append-only discipline.PROP-019 Q-22 (gap ต้นทาง) · FR-80 + WF-31/35 + str.err.overlap (จุดบังคับที่ predicate ยังไม่ถูกนิยาม) · StrategicAgreement ของ PROP-009 (mode/คู่สัญญา/ฤดูกาล — ผู้ถือ scope เพียงอย่างเดียวในปัจจุบัน) · ลำดับชั้น calc_basis ตาม A-19 (แบบอย่างเฉพาะเจาะจงที่สุดชนะ) · เครื่องมือออกแบบแผนและการ attribute งานวิเคราะห์ของ PROP-022 (ผู้ใช้ resolver รายที่สอง) · วินัย append-only ตาม NFR-22
Dateวันที่
19 Jul 202619 ก.ค. 2569

1. Why1. เหตุผล

Concurrent strategic agreements are legal but "must not overlap scope" — enforced at save so each accrual resolves to exactly one agreement — yet the predicate is undefined and StrategicAgreement carries nothing beyond mode/counterparty/season to evaluate. Every accrual, every plan publish and every analytics attribution silently depends on this definition. The four decisions below were first expanded inside PROP-022; on the client's one-proposal-per-topic direction (19 Jul 2026) they ride here as their own draft, completing the spin-off set. Verdicts close the relocated PROP-019 Q-22 gap via this proposal's acceptance.

ข้อตกลงกลยุทธ์พร้อมกันหลายฉบับทำได้ แต่ "ห้ามทับซ้อน scope" — บังคับตอน save เพื่อให้ accrual แต่ละครั้ง resolve ไปที่ข้อตกลงเดียวพอดี — ทว่า predicate ไม่เคยถูกนิยาม และ StrategicAgreement ไม่มีอะไรนอกจาก mode/คู่สัญญา/ฤดูกาลให้ประเมิน ทุก accrual ทุกการ publish แผน และทุกการ attribute งานวิเคราะห์พึ่งนิยามนี้โดยเงียบ สี่การตัดสินด้านล่างถูกขยายครั้งแรกใน PROP-022; ตามแนวทางลูกค้าหนึ่งข้อเสนอต่อหัวข้อ (19 ก.ค. 2569) จึงมาอยู่ในร่างของตัวเอง ทำให้ชุดการแยกฉบับครบ คำวินิจฉัยปิด gap Q-22 ของ PROP-019 ผ่านการรับข้อเสนอนี้

2. The four decisions (OQ-15…OQ-18)2. สี่การตัดสิน (OQ-15…OQ-18)

Concurrent agreements are legal but "must not overlap scope", enforced at save (FR-80, WF-31/35, str.err.overlap) so each accrual resolves to exactly one agreement — yet the predicate is undefined and StrategicAgreement carries nothing beyond mode/counterparty/season to evaluate. Four decisions:

ข้อตกลงพร้อมกันหลายฉบับทำได้ แต่ "ห้ามทับซ้อน scope" บังคับตอน save (FR-80, WF-31/35, str.err.overlap) เพื่อให้ accrual แต่ละครั้ง resolve ไปที่ข้อตกลงเดียวพอดี — แต่ predicate ไม่เคยถูกนิยาม และ StrategicAgreement ไม่มีอะไรนอกจาก mode/คู่สัญญา/ฤดูกาลให้ประเมิน สี่การตัดสิน:

OQ-15 Scope axes on the agreementแกน scope บนข้อตกลง

What can an agreement's scope even declare? Candidate axes: checkpoint set (a checkpoint agreement's own rates) · distance bands · plots or zones · delivery-date windows · volume brackets · "everything else" (a fixed_price catch-all). Does StrategicAgreement gain explicit scope attributes (checkpoint_ids / plot_ids / date_range / distance_band) so the predicate is machine-evaluable — or does scope stay implicit in mode + counterparty + season (in which case two same-mode agreements for one counterparty are simply forbidden)?

scope ของข้อตกลงประกาศอะไรได้บ้าง? แกนที่เป็นไปได้: ชุด checkpoint (อัตราของข้อตกลง checkpoint เอง) · ช่วงระยะทาง · แปลงหรือโซน · ช่วงวันส่งมอบ · ช่วงปริมาณ · "ที่เหลือทั้งหมด" (fixed_price แบบเหมารวม) StrategicAgreement ควรมี attribute scope ชัดเจน (checkpoint_ids / plot_ids / date_range / distance_band) ให้ predicate ประเมินโดยเครื่องได้ — หรือ scope คง implicit ใน mode + คู่สัญญา + ฤดูกาล (แปลว่าห้ามสองข้อตกลง mode เดียวกันต่อคู่สัญญาเดียว)?

Recommendation:ข้อเสนอแนะ: explicit scope attributes — implicit scope cannot support the PROP-022 plan designer's targeting anyway.attribute scope ชัดเจน — scope แบบ implicit รองรับการเล็งเป้าของเครื่องมือออกแบบแผน PROP-022 ไม่ได้อยู่แล้ว

Client verdict · 23 Jul 2026คำวินิจฉัยลูกค้า · 23 ก.ค. 2569DECIDED — add explicit coverage fields. StrategicAgreement gains scope attributes (checkpoint_ids / plot_ids / date_range / distance_band) declaring which deliveries the agreement covers, making the overlap predicate machine-evaluable and enabling layered same-season agreements per counterparty. Recommendation adopted as proposed.ตัดสินแล้ว — เพิ่ม field ความครอบคลุมชัดเจน StrategicAgreement ได้ attribute scope (checkpoint_ids / plot_ids / date_range / distance_band) ประกาศว่าข้อตกลงครอบคลุมการส่งมอบใด ทำให้ predicate ประเมินโดยเครื่องได้ และเปิดทางข้อตกลงซ้อนชั้นต่อคู่สัญญาในฤดูเดียวกัน รับข้อเสนอแนะตามที่เสนอ

OQ-16 The predicate & concurrent-mode policyตัว predicate และนโยบาย mode พร้อมกัน

Define overlap: two agreements overlap iff same counterparty + same season + their delivery-matching sets intersect. Then the policy choice: may one counterparty hold a checkpoint AND a fixed_price agreement whose sets intersect — hard rejection at save (FR-80 as written), or a priority order (most-specific wins, mirroring the calc_basis cascade: checkpoint beats fixed_price for deliveries matching both)? Priority keeps the exactly-one-agreement guarantee while allowing layered designs.

นิยามการทับซ้อน: สองข้อตกลงทับซ้อนก็ต่อเมื่อ คู่สัญญาเดียวกัน + ฤดูเดียวกัน + เซตการ match การส่งมอบของทั้งคู่ตัดกัน จากนั้นเลือกนโยบาย: คู่สัญญาเดียวถือ checkpoint และ fixed_price ที่เซตตัดกันได้ไหม — ปฏิเสธตอน save (FR-80 ตามที่เขียน) หรือลำดับความสำคัญ (เฉพาะเจาะจงที่สุดชนะ ตามแบบลำดับชั้น calc_basis: checkpoint ชนะ fixed_price เมื่อ match ทั้งคู่)? แบบลำดับยังคงการันตีข้อตกลงเดียวพอดี พร้อมเปิดทางให้ดีไซน์ซ้อนชั้น

Recommendation:ข้อเสนอแนะ: priority order over hard rejection; str.err.overlap fires only on same-specificity ties.ใช้ลำดับความสำคัญแทนการปฏิเสธ; str.err.overlap ยิงเฉพาะเมื่อเสมอกันที่ความเฉพาะเท่ากัน

Client verdict · 23 Jul 2026คำวินิจฉัยลูกค้า · 23 ก.ค. 2569DECIDED — recommendation modified. A counterparty holding both a fixed_price and a checkpoint agreement over the same deliveries is judged impractical in real life — layered same-mode/cross-mode designs are not encouraged. However, overlapping agreements are not hard-forbidden: whether to allow them is a per-mill configuration, and when a mill enables them the resolver's default rule is lowest cost to the factory wins (of the matching agreements, the one producing the smallest payable premium for that delivery), not most-specific-wins. str.err.overlap fires only on exact-cost ties. The overlap definition itself (same counterparty + same season + intersecting delivery-matching sets) is adopted as proposed.ตัดสินแล้ว — ปรับจากข้อเสนอแนะ คู่สัญญาที่ถือทั้ง fixed_price และข้อตกลง checkpoint ทับซ้อนกันถูกมองว่าไม่ practical ในชีวิตจริง — ไม่สนับสนุนดีไซน์ซ้อนชั้น แต่ไม่ถึงกับห้ามเด็ดขาด: การอนุญาตเป็น ค่า config รายโรงงาน และเมื่อโรงงานเปิดใช้ กฎ default ของ resolver คือ ต้นทุนต่ำสุดต่อโรงงานชนะ (ข้อตกลงที่ให้ premium ที่ต้องจ่ายน้อยที่สุดสำหรับการส่งมอบนั้น) ไม่ใช่เฉพาะเจาะจงที่สุดชนะ str.err.overlap ยิงเฉพาะเมื่อต้นทุนเท่ากันพอดี ส่วนนิยามการทับซ้อน (คู่สัญญาเดียวกัน + ฤดูเดียวกัน + เซตการ match ตัดกัน) รับตามที่เสนอ

OQ-17 Enforcement timing & mid-season change safetyจังหวะการบังคับและความปลอดภัยเมื่อแก้กลางฤดู

Checked at save (WF-31/35) — but agreements are amended mid-season, checkpoints added, plots transferred. Re-validate on every mutation of any member of the pair? And when a scope change would create retroactive overlap with already-accrued premiums: block the change, or apply it effective-forward only (the NFR-22 pattern) with accrued rows untouched? Which mutations are even legal on a live agreement?

ตรวจตอน save (WF-31/35) — แต่ข้อตกลงถูกแก้กลางฤดู เพิ่ม checkpoint โอนแปลง ต้อง validate ซ้ำทุกครั้งที่สมาชิกคู่ใดเปลี่ยนไหม? และเมื่อการเปลี่ยน scope จะสร้างการทับซ้อนย้อนหลังกับ premium ที่ accrue แล้ว: block การเปลี่ยน หรือมีผลไปข้างหน้าเท่านั้น (แบบ NFR-22) โดยแถวที่ accrue แล้วไม่แตะ? mutation ใดบ้างที่ทำได้บนข้อตกลงที่ live อยู่?

Recommendation:ข้อเสนอแนะ: re-validate on every mutation; scope changes effective-forward only; accrued rows immutable.validate ซ้ำทุก mutation; การเปลี่ยน scope มีผลไปข้างหน้าเท่านั้น; แถวที่ accrue แล้วแก้ไม่ได้

Client verdict · 23 Jul 2026คำวินิจฉัยลูกค้า · 23 ก.ค. 2569DECIDED — recommendation adopted. Scope changes on a live agreement apply effective-forward only (NFR-22 pattern): already-accrued premium rows are never touched or recomputed; the overlap check is re-run on every mutation of either member of a pair, evaluated from the change's effective date forward.ตัดสินแล้ว — รับตามข้อเสนอแนะ การเปลี่ยน scope บนข้อตกลงที่ live มีผลไปข้างหน้าเท่านั้น (แบบ NFR-22): แถว premium ที่ accrue แล้วไม่ถูกแตะหรือคำนวณซ้ำ; ตรวจการทับซ้อนซ้ำทุก mutation ของสมาชิกคู่ใด ๆ โดยประเมินจากวันมีผลของการเปลี่ยนไปข้างหน้า

OQ-18 Interplay with the plan designerการทำงานร่วมกับเครื่องมือออกแบบแผน

PROP-022 PlanScenario drafts deliberately create overlapping candidate agreements (comparing designs is the point of the sandbox) — the overlap check must fire on publish/activation, never on drafts. Publishing a scenario that would overlap a live agreement: rejected, or does publish supersede (retire the old agreement effective-forward)? The analytics attribution (season-spend by agreement) must use the same resolver as accrual — one predicate, two consumers.

ร่าง PlanScenario ของ PROP-022 สร้างข้อตกลงที่ทับซ้อนโดยตั้งใจ (การเทียบดีไซน์คือหัวใจของ sandbox) — การตรวจทับซ้อนต้องยิงตอน publish/activate เท่านั้น ไม่ใช่ตอน draft การ publish สถานการณ์ที่จะทับซ้อนข้อตกลง live: ปฏิเสธ หรือ publish ทับแทน (เกษียณข้อตกลงเก่าแบบมีผลไปข้างหน้า)? การ attribute ของงานวิเคราะห์ (ค่าใช้จ่ายฤดูตามข้อตกลง) ต้องใช้ resolver เดียวกับ accrual — predicate เดียว ผู้ใช้สองทาง

Recommendation:ข้อเสนอแนะ: check on publish only; publish offers supersede as an explicit choice; single shared resolver.ตรวจเฉพาะตอน publish; publish เสนอ supersede เป็นทางเลือกชัดเจน; resolver เดียวใช้ร่วมกัน

Client verdict · 23 Jul 2026คำวินิจฉัยลูกค้า · 23 ก.ค. 2569DECIDED — recommendation adopted with a refinement. (1) The overlap check fires at publish only, never on drafts. (2) When publish collides with a live agreement, publish offers supersede as an explicit choice under two-act approval (proposer confirms, approver ratifies — the PROP-025 two-act pattern): the old agreement ends today, the new one takes effect the next day, forward-only — no same-day double coverage, accrued rows untouched. (3) One shared resolver for accrual and analytics attribution — the code is shared, never duplicated.ตัดสินแล้ว — รับข้อเสนอแนะพร้อมข้อปรับ (1) ตรวจการทับซ้อนเฉพาะตอน publish เท่านั้น ไม่ตรวจบน draft (2) เมื่อ publish ชนกับข้อตกลง live ให้เสนอ supersede เป็นทางเลือกชัดเจน ภายใต้การอนุมัติสองขั้น (ผู้เสนอยืนยัน ผู้อนุมัติรับรอง — แบบสองขั้นของ PROP-025): ข้อตกลงเก่าสิ้นสุดวันนี้ ฉบับใหม่มีผลวันถัดไป ไปข้างหน้าเท่านั้น — ไม่มีความครอบคลุมซ้ำในวันเดียว แถวที่ accrue แล้วไม่แตะ (3) resolver เดียวใช้ร่วมทั้ง accrual และงานวิเคราะห์ — ใช้ code ร่วมกัน ไม่ทำซ้ำ

3. Decided model impact3. ผลกระทบต่อ model ตามคำวินิจฉัย

Per the four verdicts (23 Jul 2026), the shape to apply: explicit scope attributes on StrategicAgreement (checkpoint_ids / plot_ids / date_range / distance_band); the normative overlap definition (same counterparty + same season + intersecting delivery-matching sets); overlapping agreements allowed only under a per-mill configuration (default off), and when enabled the resolver's default rule is lowest cost to the factory wins, with str.err.overlap firing only on exact-cost ties — FR-80 rewritten accordingly; one shared resolver consumed by accrual (WF-32) and analytics attribution; re-validation on every mutation with scope changes effective-forward only (NFR-22 pattern), accrued rows immutable; the publish-time-only check for plan scenarios, with supersede under two-act approval (old agreement ends today, new effective next day) as an explicit publish choice.

ตามคำวินิจฉัยทั้งสี่ (23 ก.ค. 2569) รูปที่จะปรับใช้: attribute scope ชัดเจนบน StrategicAgreement (checkpoint_ids / plot_ids / date_range / distance_band); นิยามการทับซ้อนเชิงบรรทัดฐาน (คู่สัญญาเดียวกัน + ฤดูเดียวกัน + เซตการ match ตัดกัน); ข้อตกลงทับซ้อนทำได้เฉพาะภายใต้ config รายโรงงาน (default ปิด) โดยเมื่อเปิด กฎ default ของ resolver คือ ต้นทุนต่ำสุดต่อโรงงานชนะ และ str.err.overlap ยิงเฉพาะต้นทุนเท่ากันพอดี — แก้ FR-80 ตาม; resolver เดียวใช้ร่วมโดย accrual (WF-32) และการ attribute งานวิเคราะห์; validate ซ้ำทุก mutation โดยการเปลี่ยน scope มีผลไปข้างหน้าเท่านั้น (แบบ NFR-22) แถวที่ accrue แล้วแก้ไม่ได้; ตรวจเฉพาะตอน publish สำหรับสถานการณ์แผน โดย supersede แบบอนุมัติสองขั้น (ฉบับเก่าสิ้นสุดวันนี้ ฉบับใหม่มีผลวันถัดไป) เป็นทางเลือก publish ชัดเจน

4. Revision history4. ประวัติการแก้ไข

Revรุ่นDateวันที่Changesการเปลี่ยนแปลง
1.02026-07-23Accepted & applied as spec v0.22.0 — graph-first: StrategicAgreement +5 scope attributes (draft plot_ids landed as scope_field_ids per PROP-001 field naming); +MillStrategicConfig entity/aggregate (overlap_allowed default false · resolver_rule lowest_cost); FR-80/81/145 amended, +FR-185/FR-186, +NFR-58; WF-31/35 guards re-grounded; mill-str / mill-settings / mill-str-plan screen deltas +3 copy keys. Mirrored: SPEC-PRD/PWF-MILL 0.12.0 · SPEC-ERD-MILL 0.13.0 · SPEC-DDD/UIX-MILL 0.11.0 · SPEC-INDEX 0.2.10.อนุมัติและปรับใช้เป็น spec v0.22.0 — เริ่มที่ graph: StrategicAgreement เพิ่ม attribute scope 5 ตัว (plot_ids ในร่างลงเป็น scope_field_ids ตามการตั้งชื่อ field ของ PROP-001); +MillStrategicConfig; แก้ FR-80/81/145, เพิ่ม FR-185/FR-186, NFR-58; ปรับ guard WF-31/35; ส่วนต่างหน้าจอ + copy key 3 ตัว mirror ครบห้าเอกสาร MILL + SPEC-INDEX
0.52026-07-23OQ-18 client verdict registered: publish-only check; supersede under two-act approval (old ends today, new effective next day, forward-only); single shared resolver. All four OQs decided — draft ready for approval.บันทึกคำวินิจฉัยลูกค้า OQ-18: ตรวจเฉพาะตอน publish; supersede แบบอนุมัติสองขั้น (ฉบับเก่าสิ้นสุดวันนี้ ฉบับใหม่มีผลวันถัดไป); resolver เดียว OQ ครบทั้งสี่ข้อ — ร่างพร้อมอนุมัติ
0.42026-07-23OQ-17 client verdict registered: effective-forward only — accrued rows untouched; re-validation on every mutation. OQ-18 remains open.บันทึกคำวินิจฉัยลูกค้า OQ-17: มีผลไปข้างหน้าเท่านั้น — แถวที่ accrue แล้วไม่แตะ; validate ซ้ำทุก mutation OQ-18 ยังเปิดอยู่
0.32026-07-23OQ-16 client verdict registered: overlap definition adopted; layered cross-mode agreements judged impractical but allowed as a per-mill configuration; when enabled, the default resolver is lowest cost to the factory wins (not most-specific-wins); str.err.overlap only on exact-cost ties. OQ-17–18 remain open.บันทึกคำวินิจฉัยลูกค้า OQ-16: รับนิยามการทับซ้อน; ข้อตกลงซ้อนข้าม mode เป็น config รายโรงงาน โดย default คือต้นทุนต่ำสุดต่อโรงงานชนะ OQ-17–18 ยังเปิดอยู่
0.22026-07-23OQ-15 client verdict registered: explicit scope attributes adopted (checkpoint_ids / plot_ids / date_range / distance_band on StrategicAgreement). OQ-16…18 remain open.บันทึกคำวินิจฉัยลูกค้า OQ-15: รับ attribute scope ชัดเจน (checkpoint_ids / plot_ids / date_range / distance_band บน StrategicAgreement) OQ-16…18 ยังเปิดอยู่
0.12026-07-19First draft — the scope-overlap predicate relocated wholesale from PROP-022 Rev 0.17 (ex-OQ-15…OQ-18, numbering preserved; originally PROP-019 Q-22) on the client's one-proposal-per-topic direction, completing the spin-off set (PROP-042/043/044/045); all recommendations carried verbatim; candidate model impact sketched. Binds nothing until approved and applied.ร่างแรก — ย้าย predicate การทับซ้อนทั้งชุดจาก PROP-022 Rev 0.17 (เดิม OQ-15…OQ-18 คงเลขเดิม; ต้นทางคือ Q-22 ของ PROP-019) ตามแนวทางลูกค้าหนึ่งข้อเสนอต่อหัวข้อ ทำให้ชุดการแยกฉบับครบ (PROP-042/043/044/045); ยกข้อเสนอแนะมาทั้งหมด; ร่างผลกระทบ model ไม่มีผลผูกพันจนกว่าจะอนุมัติและปรับใช้