EXH-074-A Rev 0.2 · 2 Aug 2026

Cane Agency · Exhibit of PROP-074 — an implementation study, binding nothing. Seven concerns, seven patterns, six patterns deliberately refused, one decision that precedes all of them — and two words the specification has to decide.สถาบันอ้อย · นิทรรศการของ PROP-074 — การศึกษาเชิงการนำไปสร้าง ไม่ผูกพันสิ่งใด เจ็ดประเด็น เจ็ดแบบอย่าง หกแบบอย่างที่จงใจไม่ใช้ และหนึ่งการตัดสินที่มาก่อนทั้งหมด

The capacity mechanism as code — which design patterns carry PROP-074's Section 8, and which would quietly destroy itกลไก capacity ในรูปของโค้ด — แบบอย่างการออกแบบใดที่รองรับข้อ 8 ของ PROP-074 และแบบใดที่จะทำลายมันอย่างเงียบ ๆ

Documentเอกสาร
EXH-074-A · exhibit ofนิทรรศการของ PROP-074
Originที่มา
Client direction, 2 Aug 2026: "For the capacity, we can have a base class as capacity and then our PersonCapacity and TenantCapacity will inherit from it. Then we can use the design pattern… I'm thinking the Facade pattern (but you will have to help me research and think extra hard on what is the best pattern to use) — that way we can reuse many of our capacity logic based on Section 8." Catalogue referenced: refactoring.guru — Design Patterns in C#.คำสั่งลูกค้า 2 ส.ค. 2569: ให้มีคลาสฐาน Capacity แล้ว PersonCapacity กับ TenantCapacity สืบทอด และใช้แบบอย่างการออกแบบ — เสนอ Facade พร้อมขอให้ค้นคว้าและคิดให้หนักว่าแบบใดดีที่สุด เพื่อนำตรรกะ capacity ตามข้อ 8 กลับมาใช้ซ้ำได้มาก
Answer in one lineคำตอบบรรทัดเดียว
Both instincts are right, and neither is the answer. The base class is right for behaviour and wrong for storage; Facade is the right pattern at the service boundary but is not what produces the reuse. The reuse comes from a decision that precedes every pattern: the eleven capacities of PROP-074 Section 8 are DATA, not classes — and once that is fixed, five small patterns carry the rest.สัญชาตญาณทั้งสองถูก และไม่มีข้อใดเป็นคำตอบ คลาสฐานถูกสำหรับพฤติกรรม และผิดสำหรับการจัดเก็บ; Facade เป็นแบบอย่างที่ถูกที่ขอบของบริการ แต่ไม่ใช่สิ่งที่ทำให้เกิดการใช้ซ้ำ การใช้ซ้ำมาจากการตัดสินที่มาก่อนทุกแบบอย่าง: capacity สิบเอ็ดตัวในข้อ 8 ของ PROP-074 คือข้อมูล ไม่ใช่คลาส
Bindsผูกพัน
Nothing. apps/ is unscaffolded by project rule and stays that way until the specification is finalised. This exhibit exists so that the shape of the code is decided while it is still free to decide, and so that PROP-074's rules can be written in a form an implementation can actually honour.ไม่ผูกพันสิ่งใด apps/ ยังไม่ถูกสร้างตามกฎโครงการ นิทรรศการนี้มีไว้เพื่อให้รูปของโค้ดถูกตัดสินในขณะที่ยังตัดสินได้ฟรี

1. The decision that precedes every pattern1. การตัดสินที่มาก่อนทุกแบบอย่าง

Before choosing a pattern, one question has to be answered: where does the variation live? Patterns exist to absorb variation, and the wrong pattern absorbs variation that was never there.

ก่อนเลือกแบบอย่าง ต้องตอบคำถามหนึ่งก่อน: ความแตกต่างอยู่ตรงไหน แบบอย่างมีไว้เพื่อรองรับความแตกต่าง และแบบอย่างที่ผิดจะรองรับความแตกต่างที่ไม่เคยมีอยู่

The findingผลค้นพบPROP-074 Section 8 is a table, not eleven algorithms. Read the applied capacity nodes and the difference between mill and bank is entirely a difference of values: class, admission, requiredLevel, holder_kind, exclusive, verification, and (Rev 0.4) requires. There is not one capacity in the applied graph that needs a line of code the others do not. The grant procedure for a bank is the grant procedure for a grower with different parameters — which is why the graph could already express all eleven as JSON nodes without anybody noticing a gap.ข้อ 8 ของ PROP-074 คือตาราง ไม่ใช่อัลกอริทึมสิบเอ็ดตัว อ่านโหนด capacity ที่ apply แล้ว ความต่างระหว่าง mill กับ bank เป็นความต่างของค่าล้วน ๆ ไม่มี capacity ตัวใดในกราฟที่ต้องการโค้ดสักบรรทัดที่ตัวอื่นไม่ต้องการ ขั้นตอนการให้ capacity แก่ธนาคารคือขั้นตอนเดียวกับของผู้ปลูก เพียงแต่พารามิเตอร์ต่างกัน
Therefore the one refactoring that must never happenการรีแฟกเตอร์ข้อเดียวที่ต้องไม่เกิดขึ้นNever Replace Type Code with Subclasses on the capacity id. A MillCapacity : Capacity, BankCapacity : Capacity hierarchy is the most natural-looking mistake available here, and it is fatal: eleven classes that differ only in constructor arguments, a twelfth capacity requiring a code change and a deploy where today it requires a graph row, and the CapacityCompatibility matrix — which is versioned and effective-dated data — forced into a type system that cannot be versioned at all. Refactoring.guru files this under Speculative Generality and Lazy Class; the graph has already avoided it for eleven capacities and four proposals, and the code must not reintroduce it.ห้ามทำ Replace Type Code with Subclasses กับรหัส capacity เด็ดขาด ลำดับชั้น MillCapacity : Capacity เป็นความผิดพลาดที่ดูเป็นธรรมชาติที่สุดและร้ายแรงที่สุด: สิบเอ็ดคลาสที่ต่างกันแค่อาร์กิวเมนต์ของคอนสตรัคเตอร์ · capacity ตัวที่สิบสองต้องแก้โค้ดและ deploy ทั้งที่วันนี้ต้องการเพียงแถวในกราฟ · และตารางความเข้ากันได้ซึ่งเป็นข้อมูลที่มีเวอร์ชันและวันมีผล ถูกยัดเข้าไปในระบบชนิดข้อมูลที่ทำเวอร์ชันไม่ได้เลย

2. The client's two proposals, assessed2. ประเมินข้อเสนอสองข้อของลูกค้า

Proposalข้อเสนอVerdictผลReasoningเหตุผล
A base Capacity class that PersonCapacity and TenantCapacity inheritคลาสฐาน Capacity ที่ PersonCapacity และ TenantCapacity สืบทอดADOPT for behaviour
REFUSE for storage
รับ สำหรับพฤติกรรม
ปฏิเสธ สำหรับการจัดเก็บ
Right instinct — the four standings genuinely do share one contract (PROP-074 Section 7.2: strike the holder key and every remaining attribute is identical). An abstract Standing with the shared lifecycle, evidence fields and append-only history is exactly correct, and is the Extract Superclass refactoring applied to behaviour. The danger is what happens next in EF Core: a class hierarchy maps by default to Table-Per-Hierarchy — one table, a discriminator column, and both holder foreign keys made nullable so the rows can share it. At that moment the database can no longer state "a TenantCapacity has a tenant": the one column that matters most loses its NOT NULL and its foreign key, and an invariant moves out of the schema into application code that has to remember it. That is R-ONEKEY's objection reproduced one level down. Keep the base type; keep four tables.สัญชาตญาณถูก — สี่สถานะใช้สัญญาเดียวกันจริง (ข้อ 7.2: ตัดคีย์ผู้ถือออก แล้วแอตทริบิวต์ที่เหลือเหมือนกันทุกตัว) คลาสนามธรรม Standing ที่ถือวงจรชีวิต ฟิลด์หลักฐาน และประวัติแบบเพิ่มอย่างเดียว ถูกต้องพอดี อันตรายอยู่ที่ขั้นถัดไปใน EF Core: ลำดับชั้นคลาสจะถูกแมปเป็น Table-Per-Hierarchy โดยปริยาย — ตารางเดียว มีคอลัมน์ตัวแยกชนิด และคีย์ผู้ถือทั้งสองต้องยอมให้ว่างได้ ณ จุดนั้นฐานข้อมูลจะพูดไม่ได้อีกต่อไปว่า "TenantCapacity ต้องมี tenant" เก็บคลาสฐานไว้ เก็บสี่ตารางไว้
FacadeFacadeADOPT
but not for
this purpose
รับ
แต่ไม่ใช่เพื่อ
จุดประสงค์นี้
The pattern is warranted and the placement is right; the expectation is not. Facade "provides a simplified interface to a complex set of classes" — and the federation context is exactly that: it owns twenty-odd entities and is the declared producer of roughly forty events. A caller that wants to grant a capacity must otherwise touch IdentityCheck, Invitation, CapacityCompatibility, the standing row, the downstream grant suspension and the event publication. One IFederationService in front of all of it is correct. But Facade hides complexity; it does not share it. It gives every caller one door — it does not give bank and grower one implementation. It is the front door, not the machine room, and the reuse the direction is asking for happens in the machine room.แบบอย่างนี้สมควรใช้ และวางถูกที่ แต่ความคาดหวังไม่ตรง Facade "ให้อินเทอร์เฟซที่เรียบง่ายแก่กลุ่มคลาสที่ซับซ้อน" — และ context ของ federation เป็นแบบนั้นพอดี: เป็นเจ้าของเอนทิตียี่สิบกว่าตัวและเป็นผู้ผลิตเหตุการณ์ราวสี่สิบตัว IFederationService ตัวเดียวหน้าทั้งหมดนั้นถูกต้อง แต่ Facade ซ่อนความซับซ้อน ไม่ได้แบ่งปันมัน มันให้ประตูเดียวแก่ผู้เรียก ไม่ได้ให้ bank กับ grower ใช้การทำงานเดียวกัน มันคือประตูหน้า ไม่ใช่ห้องเครื่อง

3. What actually carries the reuse — seven concerns, seven patterns3. สิ่งที่ทำให้เกิดการใช้ซ้ำจริง — เจ็ดประเด็น เจ็ดแบบอย่าง

Concernประเด็นPatternแบบอย่างWhy this one, and what it buysทำไมต้องอันนี้ และได้อะไร
The eleven capacity definitions + the eight qualifications (PROP-074 Sections 8 and 8.1)นิยาม capacity สิบเอ็ดตัว + qualification แปดตัวRegistry
a versioned catalogue
— not a GoF pattern
Registry
แคตตาล็อกที่มีเวอร์ชัน
The load-bearing decision, and the one that makes the other six small. Definitions load from the graph as an immutable, versioned catalogue; a capacity is a row with admission, requiredLevel, holder_kind, holder (OQ-10), requires and its compatibility cells. Adding a twelfth capacity becomes a data change, exactly as it is today. This is what the applied graph has been doing since v6.0 — the code's job is not to improve on it but to stop losing it.การตัดสินที่รับน้ำหนัก และเป็นเหตุให้อีกหกข้อเล็กลง นิยามโหลดจากกราฟเป็นแคตตาล็อกที่เปลี่ยนไม่ได้และมีเวอร์ชัน การเพิ่ม capacity ตัวที่สิบสองกลายเป็นการแก้ข้อมูล เหมือนที่เป็นอยู่วันนี้
The shared grant / registration skeleton (7.2)โครงร่างการมอบและการลงทะเบียนที่ใช้ร่วมกันTemplate
Method
Template
Method
"Defines the skeleton of an algorithm in the superclass but lets subclasses override specific steps." The skeleton is identical for all four standings — resolve definition → run guards → verify → write append-only row → emit event. Exactly two steps differ, and they differ on the origin axis, not per capacity: a capacity verifies against our own business logic, a qualification verifies against an external issuer and records an expiry (R-EXTERNAL). Two overrides, not eleven."นิยามโครงของอัลกอริทึมในคลาสแม่ แล้วให้คลาสลูกแทนที่บางขั้น" โครงเหมือนกันทั้งสี่สถานะ ต่างกันสองขั้นพอดี และต่างบนแกนต้นกำเนิด ไม่ใช่ต่างราย capacity — สองการแทนที่ ไม่ใช่สิบเอ็ด
Admission guards, each refusing with a stated reasonด่านตรวจการรับเข้า แต่ละด่านปฏิเสธพร้อมเหตุผลChain of
Responsibility
Chain of
Responsibility
It maps one-to-one onto error codes the specification has already applied. FR-357 names acl.err.holder_kind, acl.err.capacity_pair_forbidden and acl.err.capacity_alone_only; the applied rule is that a refusal carries its basis text. A chain of named handlers — identity level → holder kind → compatibility → required qualifications → invitation — gives one handler per error code, evaluated in a fixed order, each able to stop with its own reason. The pattern is not chosen for elegance; it is chosen because the error catalogue already has this shape.มันตรงกันหนึ่งต่อหนึ่งกับรหัสข้อผิดพลาดที่ข้อกำหนด apply ไปแล้ว FR-357 ระบุ acl.err.holder_kind · acl.err.capacity_pair_forbidden · acl.err.capacity_alone_only และกฎที่ apply แล้วคือการปฏิเสธต้องมีข้อความเหตุผลติดมาด้วย โซ่ของตัวจัดการที่มีชื่อจึงให้หนึ่งตัวจัดการต่อหนึ่งรหัสข้อผิดพลาด
The compatibility matrix and the requires predicateตารางความเข้ากันได้ และเงื่อนไข requiresSpecification
composable predicates
Specification
CapacityCompatibility is already versioned, effective-dated, and carries a stated basis per cell — a rule set that is read, not compiled. Specification objects (IsAllowedWith, HasRequiredQualifications, MeetsIdentityLevel) are composable booleans that can be built from those rows at runtime, combined with And/Or, and — critically — explain themselves, which is what the applied "basis text" requirement demands. Each chain link evaluates one specification: the two patterns compose rather than compete.CapacityCompatibility มีเวอร์ชัน มีวันมีผล และมีเหตุผลรายช่องอยู่แล้ว — เป็นชุดกฎที่ถูกอ่าน ไม่ใช่ถูกคอมไพล์ วัตถุ Specification เป็นค่าบูลีนที่ประกอบกันได้ และอธิบายตัวเองได้ ซึ่งเป็นสิ่งที่ข้อกำหนดเรื่อง "ข้อความเหตุผล" ต้องการพอดี
The status lifecycle, shared by all fourวงจรสถานะ ใช้ร่วมกันทั้งสี่StateStatepending → active → suspended → revoked, append-only, revocation never deletes. The legal transitions are the same for a bank capacity and a drone licence, and they are few. State keeps the transition table in one place instead of scattering if (status == …) through the service — and the append-only rule means the object never mutates backwards, which is the easiest form of this pattern to keep correct.สถานะเปลี่ยนได้เหมือนกันทั้ง capacity ของธนาคารและใบอนุญาตนักบินโดรน และมีไม่กี่เส้นทาง State เก็บตารางการเปลี่ยนไว้ที่เดียว แทนที่จะโปรย if (status == …) ทั่วบริการ
The consequence chain on lapse or revocation (R-REQUIRE)ลูกโซ่ของผลเมื่อหมดอายุหรือถูกเพิกถอนObserver
domain events —
already applied
Observer
เหตุการณ์โดเมน
This one is not a choice; the graph already made it. CapacityGranted · CapacitySuspended · CapacityRevoked are declared with producer: federation and an explicit consumer list. R-REQUIRE's chain — qualification lapses → capacities requiring it suspend → their surfaces go dormant — is a publish/subscribe cascade, and writing it as direct calls would couple federation to every consuming context it currently only notifies.ข้อนี้ไม่ใช่ทางเลือก กราฟตัดสินไปแล้ว เหตุการณ์ทั้งสามประกาศไว้พร้อม producer: federation และรายชื่อผู้บริโภค ลูกโซ่ของ R-REQUIRE คือการประกาศ/รับฟัง การเขียนเป็นการเรียกตรงจะผูก federation เข้ากับทุก context ที่วันนี้เพียงแจ้งให้ทราบ
The service boundaryขอบของบริการFacade
the client's pick,
correctly placed
Facade
One IFederationService — RequestCapacity, RegisterQualification, Suspend, Revoke, ResolveEntitlements — in front of the registry, the chain, the specifications, the repositories and the event publisher. Callers (account surface, admin console, mobile) never assemble that themselves. It also enforces a rule the specification already carries: "platform_ops ORCHESTRATES admission but federation stays the sole identity writer" — a single entry point is how that sentence becomes true in code rather than aspirational.IFederationService ตัวเดียวหน้าทะเบียน โซ่ตรวจ specification ที่เก็บข้อมูล และตัวประกาศเหตุการณ์ และมันบังคับกฎที่ข้อกำหนดมีอยู่แล้ว: "platform_ops เป็นผู้ประสานการรับเข้า แต่ federation เป็นผู้เขียนตัวตนแต่ผู้เดียว" — ประตูเดียวคือวิธีทำให้ประโยคนั้นเป็นจริงในโค้ด

4. The composed picture4. ภาพรวมที่ประกอบกันแล้ว

Figure 1 — one call through the stack, with the pattern at each layerแผนภาพ 1 — หนึ่งการเรียกผ่านชั้นต่าง ๆ พร้อมแบบอย่างของแต่ละชั้น callers account surface · admin console · mobile · platform_ops IFederationService RequestCapacity · RegisterQualification · Suspend · Revoke · ResolveEntitlements FACADE the front door GrantStanding — the skeleton resolve → guard → verify → append row → publish 2 overrides: capacity (we verify) / qualification (issuer does) TEMPLATE METHOD admission chain identity → holder_kind → compatibility → requires → invitation each link → one acl.err.* code + its basis text CHAIN OF RESP. standing registry 11 capacities · 8 qualifications loaded from the graph · versioned REGISTRY specifications IsAllowedWith · HasRequiredQualifications composable · self-explaining SPECIFICATION Standing (abstract) + 4 aggregates status transitions = STATE 4 tables · holder FK stays NOT NULL BASE TYPE Adding a twelfth capacity touches the gold box only. No new class, no deploy — a graph row, exactly as today.
Every layer has one job and one pattern. The client's Facade sits at the top, where it belongs — it is what stops four callers each learning the federation model. The reuse the direction asked for happens two layers down, in the skeleton and the registry: the eleven capacities never appear as code at all. Read the diagram bottom-up and the test is simple — a change to PROP-074 Section 8 should stop at the gold box.ทุกชั้นมีหน้าที่เดียวและแบบอย่างเดียว Facade ที่ลูกค้าเสนออยู่บนสุด ซึ่งเป็นที่ของมัน — มันคือสิ่งที่กันไม่ให้ผู้เรียกสี่รายต้องเรียนรู้แบบจำลอง federation กันคนละรอบ ส่วนการใช้ซ้ำที่คำสั่งต้องการเกิดขึ้นต่ำลงไปสองชั้น ที่โครงร่างและทะเบียน: capacity สิบเอ็ดตัวไม่เคยปรากฏเป็นโค้ดเลย อ่านแผนภาพจากล่างขึ้นบน แล้วบททดสอบก็ง่าย — การแก้ข้อ 8 ของ PROP-074 ควรหยุดอยู่ที่กล่องสีทอง

5. The shape in C#5. รูปร่างในภาษา C#

Illustrative only — names and signatures are not binding, and apps/ stays unscaffolded. Shown because the argument of Section 2 is only convincing if the alternative is visible.เพื่อประกอบคำอธิบายเท่านั้น ชื่อและลายเซ็นไม่ผูกพัน และ apps/ ยังไม่ถูกสร้าง

// The base type carries the CONTRACT (PROP-074 Section 7.2) — never the table.
public abstract class Standing {
    public StandingId       Id            { get; }
    public StandingCode   Code          { get; }   // a registry key: "mill", "bot_licence"
    public StandingStatus   Status        { get; }   // STATE — shared transition table
    public Evidence?        Evidence      { get; }
    public DateOnly         GrantedAt     { get; }
    public DateOnly?        ExpiresAt     { get; }   // qualifications lapse; capacities do not
}

// Four aggregates, four tables. The holder key stays NOT NULL — that is the point.
public sealed class TenantCapacity      : Standing { public TenantId TenantId { get; } }
public sealed class PersonCapacity      : Standing { public PersonId PersonId { get; } }
public sealed class TenantQualification : Standing {
    public TenantId TenantId { get; }
    public Issuer   Issuer   { get; }   // the issuer is what makes it a qualification
}
public sealed class PersonQualification : Standing {
    public PersonId PersonId { get; }
    public Issuer   Issuer   { get; }
}

// PROP-074 Section 8 lives HERE — data loaded from the graph, never eleven classes.
public sealed record StandingDefinition(
    StandingCode Code, Origin Origin, Holder Holder,   // granted-by-us | issued-outside ; tenant | person
    Admission Admission, IdentityLevel RequiredLevel,
    HolderKind HolderKind, bool Exclusive,
    IReadOnlyList<StandingCode> Requires,                // R-REQUIRE, generalising required_level
    Confers Confers);                                     // entitlement | evidence-only  (R-QUAL)

The registry above is where PROP-074 Section 8 lives. Everything below is the machinery that reads it — and it is the same machinery for all nineteen rows.ทะเบียนข้างบนคือที่อยู่ของข้อ 8 ของ PROP-074 ทุกอย่างข้างล่างคือกลไกที่อ่านมัน และเป็นกลไกเดียวกันสำหรับทั้งสิบเก้าแถว

// TEMPLATE METHOD — the skeleton. Two overrides, on the ORIGIN axis, not per capacity.
public abstract class StandingGrantService {
    public async Task<Result<Standing>> Grant(GrantRequest r) {
        var def     = _registry.Resolve(r.Code);              // REGISTRY
        var refusal = await _admission.Evaluate(r, def);      // CHAIN OF RESPONSIBILITY
        if (refusal is not null) return Result.Refused(refusal); // carries acl.err.* + basis text
        var verified = await Verify(r, def);                  // ← the only step that varies
        var standing = Append(r, def, verified);              // append-only; never an update
        await _events.Publish(standing.GrantedEvent());       // OBSERVER
        return Result.Ok(standing);
    }
    protected abstract Task<Verification> Verify(GrantRequest r, StandingDefinition def);
}

public sealed class CapacityGrantService : StandingGrantService {
    // We grant it, so we verify it against our own business logic.
    protected override Task<Verification> Verify(GrantRequest r, StandingDefinition def)
        => _platformRules.Check(r, def);
}

public sealed class QualificationRegistrar : StandingGrantService {
    // R-EXTERNAL: we never grant it — we confirm it with the issuer and record the expiry.
    protected override Task<Verification> Verify(GrantRequest r, StandingDefinition def)
        => _issuers.For(def).Confirm(r.Evidence);
}

// FACADE — the one door. Callers never assemble the above.
public interface IFederationService {
    Task<Result<Standing>> RequestCapacity(TenantId t, StandingCode c);
    Task<Result<Standing>> RegisterQualification(HolderRef h, StandingCode c, Evidence e);
    Task<Entitlements>      ResolveEntitlements(HolderRef h);
    Task                    Suspend(StandingId id, Cause cause);
}

6. Patterns deliberately refused6. แบบอย่างที่จงใจไม่ใช้

Patternแบบอย่างWhy not hereทำไมจึงไม่ใช้ที่นี่
Abstract Factory
Factory Method
Abstract Factory
Factory Method
These produce families of related objects without naming their concrete classes — which presupposes concrete classes worth hiding. There is one concrete class per cell and the cells are fixed at four by R-TWO. A factory would be ceremony around a switch on two enums.แบบอย่างเหล่านี้ผลิตตระกูลของวัตถุโดยไม่ระบุคลาสรูปธรรม ซึ่งสมมติว่ามีคลาสรูปธรรมที่ควรซ่อน ที่นี่มีคลาสเดียวต่อช่อง และช่องถูกตรึงไว้ที่สี่โดย R-TWO
StrategyStrategyTempting for the six switches of PROP-074 Section 7.3 — but five of the six are flags, not algorithms. owns, portable and expires are booleans; compatibility is a matrix lookup; confers is one branch in the entitlement resolver. Wrapping a boolean in a class hierarchy is the Lazy Class smell. Strategy earns its place only if a switch ever grows a second implementation with real behaviour — and the register (PROP-074 Section 8) is where we would see that coming.ชวนใช้กับหกสวิตช์ในข้อ 7.3 ของ PROP-074 แต่ ห้าในหกเป็นธง ไม่ใช่อัลกอริทึม การห่อค่าบูลีนด้วยลำดับชั้นคลาสคือกลิ่น Lazy Class Strategy จะคุ้มก็ต่อเมื่อสวิตช์ใดงอกการทำงานจริงเป็นแบบที่สอง
VisitorVisitorDesigned for a stable object structure with many new operations. Ours is the reverse: the operations are few and settled (grant, suspend, revoke, resolve), while the thing that grows is the data — a twelfth capacity, a ninth qualification. Visitor would make the cheap change expensive.ออกแบบสำหรับโครงสร้างวัตถุที่นิ่งแต่มีการดำเนินการใหม่จำนวนมาก ของเราตรงข้าม: การดำเนินการมีน้อยและนิ่ง ส่วนสิ่งที่งอกคือข้อมูล
Decorator
Proxy
Decorator
Proxy
Both wrap an object to add behaviour transparently. A standing must never behave differently depending on how it was obtained — R-NULL and the audit requirements both depend on the row meaning exactly what it says. Cross-cutting concerns here (audit, caching) belong in the facade or the pipeline, where they are visible.ทั้งคู่ห่อวัตถุเพื่อเพิ่มพฤติกรรมอย่างโปร่งใส สถานะต้องไม่ทำงานต่างกันตามวิธีที่ได้มา เพราะการตรวจสอบย้อนหลังต้องอ่านแถวได้ตรงตัว
BridgeBridgeSplits abstraction from implementation so both can vary independently. Here the two axes are already the two dimensions, and they are data (origin, subject) rather than two class hierarchies. Bridge would rebuild in types what the registry holds in rows.แยกนามธรรมจากการนำไปสร้างเพื่อให้ต่างฝ่ายต่างเปลี่ยนได้ ที่นี่สองแกนเป็นข้อมูลอยู่แล้ว ไม่ใช่ลำดับชั้นคลาสสองชุด
SingletonSingletonThe registry is read-mostly and looks like a candidate — but it is versioned and effective-dated, so two versions must be able to coexist while a matrix version rolls forward. A process-wide single instance makes that impossible. Inject it with a lifetime instead.ทะเบียนอ่านเป็นหลักและดูเหมือนผู้สมัคร แต่มันมีเวอร์ชันและวันมีผล สองเวอร์ชันจึงต้องอยู่ร่วมกันได้ระหว่างเปลี่ยนผ่าน

7. What this implies for the specification7. สิ่งที่ตามมาสำหรับข้อกำหนด

I-1A candidate rule for PROP-074: R-DATA. A capacity or qualification is a row in the register, never a class, a subclass or a code branch. Adding, removing or re-parameterising one is a graph change and a document change — never a deploy. Without it written down, the first implementer who meets bank's BOT gate will reach for BankCapacity : Capacity, and by the third such class the register will have become decoration.กฎที่เสนอสำหรับ PROP-074: R-DATA capacity หรือ qualification คือแถวในทะเบียน ไม่ใช่คลาส คลาสลูก หรือกิ่งของโค้ด การเพิ่ม ลบ หรือเปลี่ยนพารามิเตอร์คือการแก้กราฟและเอกสาร ไม่ใช่การ deploy
I-2OQ-10's subject key stops being a nicety. The registry record needs origin and subject as first-class fields or the Template Method cannot select its override and the chain cannot evaluate holder_kind. The pattern set is the practical argument for answering that open question yes.คีย์ subject ของ OQ-10 เลิกเป็นเรื่องน่ามี ระเบียนในทะเบียนต้องมี origin และ subject เป็นฟิลด์ชั้นหนึ่ง มิฉะนั้น Template Method เลือกการแทนที่ไม่ได้
I-3The eight verification free-text fields must become structured before code is written, not after. A chain link cannot evaluate "a DBD company extract dated within 12 months, re-attested at season open". This is the practical deadline behind PROP-074 Section 6.2 — the prose is readable by people and invisible to a scheduler.ฟิลด์ verification แปดตัวต้องกลายเป็นข้อมูลมีโครงสร้างก่อนเขียนโค้ด ไม่ใช่หลัง ด่านในโซ่ประเมินประโยคภาษาคนไม่ได้ นี่คือเส้นตายเชิงปฏิบัติที่อยู่เบื้องหลังข้อ 6.2
I-4Persistence guidance belongs in SPEC-DDD-FED, stated as an invariant rather than a technology choice: every standing's holder key is NOT NULL and carries a foreign key. That sentence rules out Table-Per-Hierarchy without the specification ever having to name EF Core — which is the right altitude for a spec document.แนวทางการจัดเก็บควรอยู่ใน SPEC-DDD-FED ในรูปของ invariant ไม่ใช่การเลือกเทคโนโลยี: คีย์ผู้ถือของทุกสถานะเป็น NOT NULL และมี foreign key ประโยคนี้ตัด Table-Per-Hierarchy ออกโดยไม่ต้องเอ่ยชื่อ EF Core เลย

8. Two words this exhibit had to stop and decide8. คำสองคำที่นิทรรศการนี้ต้องหยุดและตัดสิน

Raised by the client, 2 Aug 2026, against Section 5 and the Specification row of Section 3: is "capability" the right word? Is "compatibility"? A capacity could have many of them, and one of them could be used by many capacities. Both questions are well aimed, and they have different answers: the first word was a mistake this exhibit introduced; the second is an inconsistency the applied graph has been carrying since v0.41.0.

ลูกค้าถาม 2 ส.ค. 2569 ว่า "capability" เป็นคำที่ถูกหรือไม่ แล้ว "compatibility" ล่ะ และ capacity หนึ่งอาจมีหลายตัว ส่วนตัวหนึ่งอาจถูกใช้โดยหลาย capacity คำถามทั้งสองเล็งถูก และคำตอบต่างกัน: คำแรกคือความผิดพลาดที่นิทรรศการนี้เพิ่งสร้าง คำที่สองคือความไม่สอดคล้องที่กราฟแบกมาตั้งแต่ v0.41.0

8.1 — capability is already taken, three times over, and this exhibit used it anyway8.1 — capability ถูกใช้ไปแล้วสามความหมาย และนิทรรศการนี้ยังใช้ซ้ำThe word is applied, load-bearing, and means something else entirely: FieldCapabilityProfile (ศักยภาพของแปลง) — the nine-factor machine-suitability reading of a field — with capability_band, the events FieldCapabilitySurveyed and FieldCapabilityProfiled, requirements FR-239 and FR-246, its own glossary entry, and a versioned recompute rule. WF-92 adds a second applied sense — "grant capability down the hop: credit line, inputs, machinery access" — and NFR-03 a third, in the ordinary-English sense. Section 5's CapabilityCode and CapabilityDefinition were therefore a fourth sense, introduced by the very document arguing that one object must have one noun. Corrected in this revision to StandingCode and StandingDefinition, which reuse the vocabulary R-TWO and PROP-074 Section 7.6 already established. The lesson is worth more than the fix: the PROP-073 disease reproduced itself inside its own cure, in one working day, because a neutral-sounding umbrella word was reached for without checking the census. That is precisely the failure R-GUARD exists to catch, and it argues for extending the validator to new nouns and not only retired ones.คำนี้ apply แล้ว รับน้ำหนัก และหมายถึงสิ่งอื่นโดยสิ้นเชิง: FieldCapabilityProfile (ศักยภาพของแปลง) — การอ่านความเหมาะสมต่อเครื่องจักรของแปลงจากเก้าปัจจัย พร้อม capability_band เหตุการณ์สองตัว ข้อกำหนดสองข้อ และรายการอภิธานศัพท์ของตัวเอง WF-92 เพิ่มความหมายที่สอง และ NFR-03 ความหมายที่สาม ข้อ 5 จึงสร้างความหมายที่สี่ ในเอกสารที่กำลังโต้แย้งว่าหนึ่งวัตถุต้องมีหนึ่งคำนาม แก้ในฉบับนี้เป็น StandingCode และ StandingDefinition บทเรียนมีค่ามากกว่าการแก้: โรคของ PROP-073 ผลิตซ้ำตัวเองในยาของมันเอง ภายในวันทำงานเดียว
8.2 — compatibility names a binary, holds a ternary, and competes with a word the graph already prefers8.2 — compatibility ตั้งชื่อแบบสองค่า แต่ถือสามค่า และชนกับคำที่กราฟชอบใช้อยู่แล้วThree names for one concept are already applied. The requirement is FR-357, titled "Capacity classification and composition"; the event it fires is CapacityComposition​Refused; the entity it writes is CapacityCompatibility; and its error codes say capacity_pair_forbidden and capacity_alone_only. Composition is already the applied verb — in the requirement title and the event name, the two places a reader meets the concept first. Separately, the name misdescribes its own contents: the enum is allowed | allowed_with_disclosure | forbidden, and the middle value is not a compatibility state at all — it is permission carrying an obligation. An entity named after a yes/no holds a three-valued rule with a stated basis, a version and an effective date. That is a regulatory instrument, not a property.สามชื่อสำหรับแนวคิดเดียวถูก apply ไปแล้ว ข้อกำหนดคือ FR-357 ชื่อว่า "Capacity classification and composition"; เหตุการณ์คือ CapacityCompositionRefused; เอนทิตีคือ CapacityCompatibility; และรหัสข้อผิดพลาดพูดว่า pair และ alone composition คือคำกริยาที่ apply แล้ว อีกทั้งชื่อยังบรรยายเนื้อในตัวเองผิด: enum มีสามค่า และค่ากลางไม่ใช่สถานะความเข้ากันได้ แต่คือการอนุญาตที่มีภาระผูกพัน นั่นคือตราสารเชิงกำกับ ไม่ใช่คุณสมบัติ

And the client's structural point holds — the reusable thing is the rule, not the pair. Read the applied bases and roughly thirty forbidden or conditional cells are generated by three principles. Today each cell carries its own basis_en and basis_th, so one principle's wording is stored many times and amending it means editing every cell that shares it.และประเด็นเชิงโครงสร้างของลูกค้าถูกต้อง — สิ่งที่ใช้ซ้ำได้คือกฎ ไม่ใช่คู่ ราวสามสิบช่องถูกสร้างจากสามหลักการ วันนี้แต่ละช่องถือ basis ของตัวเอง การแก้ถ้อยคำหนึ่งหลักการจึงต้องแก้ทุกช่อง

The principle (stated once)หลักการ (ระบุครั้งเดียว)Capacities it governscapacity ที่มันคุมCells todayช่องวันนี้Remarkหมายเหตุ
Alone-only — supervisory, fiduciary or administrative neutrality: a body that judges, lends or runs the platform does not also trade on itถือเดี่ยว — ความเป็นกลางในการกำกับ การให้กู้ หรือการบริหารbank · ocsb · board · ocsf · operator · group~50Six capacities × every other capacity. One sentence, restated in every cell it generates. PROP-040 D-10 already calls this "one row pattern, recorded verbatim and re-decided nowhere" — the pattern is acknowledged in prose but not modelled.หกตัวคูณกับตัวอื่นทั้งหมด ประโยคเดียว เขียนซ้ำในทุกช่องที่มันสร้าง D-10 เรียกมันว่า "รูปแบบแถวเดียวที่บันทึกตามตัวอักษรและไม่ตัดสินใหม่ที่ใด"
Buyer is never seller — the conflict sits in intake, classification and CCS, where a mill would grade its own caneผู้ซื้อไม่เป็นผู้ขาย — ความขัดแย้งอยู่ที่การรับ การจัดชั้น และ CCSmill × grower · quota · lead3Added at v0.41.0 as three new cells (D-9). As a rule it is one statement; as data it is three rows that must be kept in step — and a twelfth market capacity would silently need a fourth.เพิ่มที่ v0.41.0 เป็นสามช่อง ในฐานะกฎคือข้อความเดียว ในฐานะข้อมูลคือสามแถวที่ต้องคงเส้นคงวา
Dual role, disclosed — permitted, but the marketplace must say soบทบาทคู่ที่เปิดเผย — อนุญาต แต่ตลาดต้องแสดงmill × contractor1The value that breaks the name: this cell is neither compatible nor incompatible. It is allowed and carries a standing obligation — which a rule can express and a compatibility flag cannot.ค่าที่ทำให้ชื่อพัง: ช่องนี้ไม่ใช่ทั้งเข้ากันและไม่เข้ากัน แต่อนุญาตพร้อมภาระผูกพัน
Recommendation — ACCEPTED by the client, 2 Aug 2026 (PROP-074 OQ-13)ข้อเสนอแนะ — ลูกค้ารับแล้ว 2 ส.ค. 2569 (PROP-074 OQ-13)Rename the entity CompositionRule, make the rule first-class, and derive the pair matrix from it. A composition rule is named, versioned, effective-dated, and carries its basis once; a capacity declares which rules govern it. That is the client's many-to-many exactly — a capacity is governed by many rules; a rule governs many capacities — and it costs nothing to adopt, because the compiled pairwise matrix stays as the enforcement artifact, evaluated at grant exactly as today (PROP-040 P-9). Three gains: the basis is stated once instead of thirty times; a twelfth capacity joins by naming its rules rather than by authoring ten new cells, which is the same economy R-DATA buys elsewhere; and composition replaces compatibility with a word FR-357 and CapacityCompositionRefused already use, so the vocabulary shrinks by one word rather than growing. Compatible survives as ordinary prose for the question a rule answers — never as an entity name.เปลี่ยนชื่อเอนทิตีเป็น CompositionRule ทำให้กฎเป็นวัตถุชั้นหนึ่ง และให้ตารางคู่เป็นสิ่งที่อนุมานจากมัน composition rule มีชื่อ มีเวอร์ชัน มีวันมีผล และถือเหตุผลไว้ครั้งเดียว ส่วน capacity ประกาศว่ากฎใดคุมมัน นั่นคือความสัมพันธ์หลายต่อหลายที่ลูกค้าอธิบายพอดี และรับมาได้โดยไม่มีต้นทุน เพราะตารางคู่ที่คอมไพล์แล้วยังเป็นตัวบังคับใช้เหมือนเดิม ได้สามอย่าง: เหตุผลระบุครั้งเดียวแทนสามสิบครั้ง · capacity ตัวที่สิบสองเข้ามาด้วยการอ้างกฎ ไม่ใช่เขียนสิบช่องใหม่ · และ composition แทน compatibility ด้วยคำที่ FR-357 ใช้อยู่แล้ว คำศัพท์จึงลดลงหนึ่งคำแทนที่จะเพิ่ม

9. Revision history9. ประวัติการแก้ไข

RevฉบับDateวันที่Changeการเปลี่ยนแปลง
0.22 Aug 2026Client review, two terminology questions, new Section 8. (a) capability is already applied in three distinct senses — FieldCapabilityProfile / ศักยภาพของแปลง with its band, two events, FR-239/FR-246 and a glossary entry; WF-92's "capability grants" down the lead hop; and the ordinary-English sense in NFR-03. Section 5's CapabilityCode/CapabilityDefinition were a fourth sense introduced by this exhibit and are corrected to StandingCode/StandingDefinition. (b) compatibility names a binary while holding a ternary (allowed_with_disclosure is permission with an obligation, not a compatibility state), and competes with a word the graph already prefers: FR-357 is titled "classification and composition" and the applied event is CapacityCompositionRefused, while the entity says Compatibility and the error codes say pair and alone — four names, one concept. The client's structural point is upheld with evidence: ~54 cells are generated by three principles, each cell today restating the same basis_en/basis_th. Recommends CompositionRule as a first-class, versioned, reusable rule that carries its basis once, with the pairwise matrix derived from it — a capacity governed by many rules, a rule governing many capacities.ลูกค้าทบทวน คำถามคำศัพท์สองข้อ เพิ่มข้อ 8 (ก) capability ถูกใช้แล้วสามความหมาย ข้อ 5 สร้างความหมายที่สี่ แก้เป็น StandingCode/StandingDefinition (ข) compatibility ตั้งชื่อสองค่าแต่ถือสามค่า และชนกับคำว่า composition ที่ FR-357 และเหตุการณ์ที่ apply แล้วใช้อยู่ ยืนยันประเด็นของลูกค้าด้วยหลักฐาน: ราว 54 ช่องถูกสร้างจากสามหลักการ เสนอ CompositionRule
0.12 Aug 2026Created on client direction the same day, against the refactoring.guru C# catalogue. Assesses the two proposals — the base class is adopted for behaviour and refused for storage (a class hierarchy maps by default to Table-Per-Hierarchy, which forces both holder keys nullable and moves "a TenantCapacity has a tenant" out of the schema); Facade is adopted at the service boundary but identified as the front door rather than the machine room. Establishes the decision that precedes every pattern — PROP-074 Section 8 is a table, not eleven algorithms — and names Replace Type Code with Subclasses as the one refactoring that must never be applied to the capacity id. Seven concerns mapped to Registry, Template Method, Chain of Responsibility, Specification, State, Observer and Facade; six patterns refused with reasons. Four implications for the specification, including a candidate R-DATA rule and a persistence invariant for SPEC-DDD-FED stated without naming a framework.สร้างตามคำสั่งลูกค้าในวันเดียวกัน เทียบกับแคตตาล็อก C# ของ refactoring.guru ประเมินข้อเสนอสองข้อ — คลาสฐานรับสำหรับพฤติกรรมและปฏิเสธสำหรับการจัดเก็บ; Facade รับที่ขอบของบริการแต่ไม่ใช่แหล่งของการใช้ซ้ำ ตั้งการตัดสินที่มาก่อนทุกแบบอย่าง — ข้อ 8 ของ PROP-074 คือตาราง ไม่ใช่อัลกอริทึมสิบเอ็ดตัว เจ็ดประเด็นจับคู่กับเจ็ดแบบอย่าง หกแบบอย่างถูกปฏิเสธพร้อมเหตุผล และสี่ข้อที่ตามมาสำหรับข้อกำหนด