[{"data":1,"prerenderedAt":579},["ShallowReactive",2],{"page-\u002Fv1\u002Fcore\u002Fstrictness-ladder":3},{"id":4,"title":5,"body":6,"description":572,"extension":573,"meta":574,"navigation":72,"path":575,"seo":576,"stem":577,"__hash__":578},"content\u002Fv1\u002Fcore\u002Fstrictness-ladder.md","Strictness ladder",{"type":7,"value":8,"toc":565},"minimark",[9,13,26,31,224,228,329,333,386,411,415,504,508,511,548,552,561],[10,11,5],"h1",{"id":12},"strictness-ladder",[14,15,16,17,21,22,25],"p",{},"Strictness is ",[18,19,20],"strong",{},"not the same for every folder",". It starts hardest at Domain and loosens outward. Runtime request flow goes outside → inside; ",[18,23,24],{},"compile-time dependencies"," point inward.",[27,28,30],"h2",{"id":29},"concentric-rings","Concentric rings",[32,33,38],"pre",{"className":34,"code":35,"language":36,"meta":37,"style":37},"language-mermaid shiki shiki-themes github-light github-dark","flowchart TB\n    subgraph UI_Ring[\"UI — outer delivery\"]\n        CTRL[Controllers \u002F Requests \u002F Resources]\n    end\n\n    subgraph App_Ring[\"Application — orchestration\"]\n        UC[Use Cases]\n        ADTO[Application DTOs]\n        PROV[Providers — wiring only]\n    end\n\n    subgraph Dom_Ring[\"Domain — hardest core\"]\n        ENT[Entities \u002F Enums \u002F Domain DTOs]\n        PIF[Port interfaces]\n        DEVT[Domain Events]\n    end\n\n    subgraph Infra_Ring[\"Infrastructure — outer adapters\"]\n        REPO[Persistence adapters]\n        ACL[ACL adapters]\n        LIST[Event listeners]\n    end\n\n    CTRL --> UC\n    UC --> ENT\n    UC --> PIF\n    PROV -.->|bind Port → Adapter| REPO\n    PROV -.->|bind Port → Adapter| ACL\n    REPO -.->|implements| PIF\n    ACL -.->|implements| PIF\n    LIST --> UC\n","mermaid","",[39,40,41,49,55,61,67,74,80,86,92,98,103,108,114,120,126,132,137,142,148,154,160,166,171,176,182,188,194,200,206,212,218],"code",{"__ignoreMap":37},[42,43,46],"span",{"class":44,"line":45},"line",1,[42,47,48],{},"flowchart TB\n",[42,50,52],{"class":44,"line":51},2,[42,53,54],{},"    subgraph UI_Ring[\"UI — outer delivery\"]\n",[42,56,58],{"class":44,"line":57},3,[42,59,60],{},"        CTRL[Controllers \u002F Requests \u002F Resources]\n",[42,62,64],{"class":44,"line":63},4,[42,65,66],{},"    end\n",[42,68,70],{"class":44,"line":69},5,[42,71,73],{"emptyLinePlaceholder":72},true,"\n",[42,75,77],{"class":44,"line":76},6,[42,78,79],{},"    subgraph App_Ring[\"Application — orchestration\"]\n",[42,81,83],{"class":44,"line":82},7,[42,84,85],{},"        UC[Use Cases]\n",[42,87,89],{"class":44,"line":88},8,[42,90,91],{},"        ADTO[Application DTOs]\n",[42,93,95],{"class":44,"line":94},9,[42,96,97],{},"        PROV[Providers — wiring only]\n",[42,99,101],{"class":44,"line":100},10,[42,102,66],{},[42,104,106],{"class":44,"line":105},11,[42,107,73],{"emptyLinePlaceholder":72},[42,109,111],{"class":44,"line":110},12,[42,112,113],{},"    subgraph Dom_Ring[\"Domain — hardest core\"]\n",[42,115,117],{"class":44,"line":116},13,[42,118,119],{},"        ENT[Entities \u002F Enums \u002F Domain DTOs]\n",[42,121,123],{"class":44,"line":122},14,[42,124,125],{},"        PIF[Port interfaces]\n",[42,127,129],{"class":44,"line":128},15,[42,130,131],{},"        DEVT[Domain Events]\n",[42,133,135],{"class":44,"line":134},16,[42,136,66],{},[42,138,140],{"class":44,"line":139},17,[42,141,73],{"emptyLinePlaceholder":72},[42,143,145],{"class":44,"line":144},18,[42,146,147],{},"    subgraph Infra_Ring[\"Infrastructure — outer adapters\"]\n",[42,149,151],{"class":44,"line":150},19,[42,152,153],{},"        REPO[Persistence adapters]\n",[42,155,157],{"class":44,"line":156},20,[42,158,159],{},"        ACL[ACL adapters]\n",[42,161,163],{"class":44,"line":162},21,[42,164,165],{},"        LIST[Event listeners]\n",[42,167,169],{"class":44,"line":168},22,[42,170,66],{},[42,172,174],{"class":44,"line":173},23,[42,175,73],{"emptyLinePlaceholder":72},[42,177,179],{"class":44,"line":178},24,[42,180,181],{},"    CTRL --> UC\n",[42,183,185],{"class":44,"line":184},25,[42,186,187],{},"    UC --> ENT\n",[42,189,191],{"class":44,"line":190},26,[42,192,193],{},"    UC --> PIF\n",[42,195,197],{"class":44,"line":196},27,[42,198,199],{},"    PROV -.->|bind Port → Adapter| REPO\n",[42,201,203],{"class":44,"line":202},28,[42,204,205],{},"    PROV -.->|bind Port → Adapter| ACL\n",[42,207,209],{"class":44,"line":208},29,[42,210,211],{},"    REPO -.->|implements| PIF\n",[42,213,215],{"class":44,"line":214},30,[42,216,217],{},"    ACL -.->|implements| PIF\n",[42,219,221],{"class":44,"line":220},31,[42,222,223],{},"    LIST --> UC\n",[27,225,227],{"id":226},"allowed-vs-forbidden","Allowed vs forbidden",[229,230,231,250],"table",{},[232,233,234],"thead",{},[235,236,237,241,244,247],"tr",{},[238,239,240],"th",{},"Strictness",[238,242,243],{},"Area",[238,245,246],{},"May import",[238,248,249],{},"Must not",[251,252,253,272,293,311],"tbody",{},[235,254,255,261,266,269],{},[256,257,258],"td",{},[18,259,260],{},"Hardest",[256,262,263],{},[18,264,265],{},"Domain",[256,267,268],{},"Own Domain + Shared kernel ports",[256,270,271],{},"Other modules, own Application, host framework, ORM, facades\u002Fhelpers",[235,273,274,279,285,287],{},[256,275,276],{},[18,277,278],{},"Strict",[256,280,281,284],{},[18,282,283],{},"Application"," (Use Cases, App DTOs)",[256,286,268],{},[256,288,289,290],{},"Facades, ORM, foreign Application\u002FDomain, foreign ",[39,291,292],{},"*ModuleInterface",[235,294,295,300,305,308],{},[256,296,297],{},[18,298,299],{},"Relaxed (wiring)",[256,301,302],{},[18,303,304],{},"Application\u002FProviders",[256,306,307],{},"Container binds, route registration, config merge",[256,309,310],{},"Business rules",[235,312,313,318,323,326],{},[256,314,315],{},[18,316,317],{},"Outer",[256,319,320],{},[18,321,322],{},"Infrastructure & UI",[256,324,325],{},"Framework, ORM, ACL, HTTP clients",[256,327,328],{},"Leaking ORM or foreign Domain types into Domain \u002F Use Cases",[27,330,332],{"id":331},"dependency-rule-vs-runtime-call","Dependency rule vs runtime call",[229,334,335,348],{},[232,336,337],{},[235,338,339,342,345],{},[238,340,341],{},"Concern",[238,343,344],{},"Direction",[238,346,347],{},"Example",[251,349,350,361,372],{},[235,351,352,355,358],{},[256,353,354],{},"Runtime request",[256,356,357],{},"Outside → inside → outside",[256,359,360],{},"Controller → Use Case → port → adapter → DB",[235,362,363,366,369],{},[256,364,365],{},"Compile dependency",[256,367,368],{},"Inner types must not know outer types",[256,370,371],{},"Domain does not reference a concrete persistence adapter",[235,373,374,377,380],{},[256,375,376],{},"Port binding",[256,378,379],{},"Outer implements inner interface",[256,381,382,383],{},"Persistence adapter implements ",[39,384,385],{},"OrderRepositoryInterface",[32,387,389],{"className":34,"code":388,"language":36,"meta":37,"style":37},"flowchart LR\n    UC[Use Case] -->|depends on| IF[OrderRepositoryInterface]\n    IMP[Persistence adapter] -->|implements| IF\n    UC -.->|runtime via container| IMP\n",[39,390,391,396,401,406],{"__ignoreMap":37},[42,392,393],{"class":44,"line":45},[42,394,395],{},"flowchart LR\n",[42,397,398],{"class":44,"line":51},[42,399,400],{},"    UC[Use Case] -->|depends on| IF[OrderRepositoryInterface]\n",[42,402,403],{"class":44,"line":57},[42,404,405],{},"    IMP[Persistence adapter] -->|implements| IF\n",[42,407,408],{"class":44,"line":63},[42,409,410],{},"    UC -.->|runtime via container| IMP\n",[27,412,414],{"id":413},"worked-examples","Worked examples",[229,416,417,430],{},[232,418,419],{},[235,420,421,424,427],{},[238,422,423],{},"Statement",[238,425,426],{},"Layer",[238,428,429],{},"Verdict",[251,431,432,445,459,473,487],{},[235,433,434,439,442],{},[256,435,436],{},[39,437,438],{},"use …Ordering\\Domain\\Entities\\OrderEntity",[256,440,441],{},"Ordering Use Case",[256,443,444],{},"OK",[235,446,447,452,454],{},[256,448,449],{},[39,450,451],{},"use …Ordering\\Infrastructure\\…\\OrderRecord",[256,453,441],{},[256,455,456],{},[18,457,458],{},"Forbidden",[235,460,461,466,468],{},[256,462,463],{},[39,464,465],{},"use …Warehouse\\Domain\\Ports\\Module\\WarehouseModuleInterface",[256,467,441],{},[256,469,470,472],{},[18,471,458],{}," — use local ACL port",[235,474,475,481,484],{},[256,476,477,478],{},"Same ",[39,479,480],{},"WarehouseModuleInterface",[256,482,483],{},"Ordering ACL adapter",[256,485,486],{},"OK (Infrastructure)",[235,488,489,496,499],{},[256,490,491,492,495],{},"Framework ",[39,493,494],{},"DB"," facade",[256,497,498],{},"Ordering Domain Event",[256,500,501,503],{},[18,502,458],{}," — Shared transaction\u002Fdispatcher ports",[27,505,507],{"id":506},"composition-root-exception","Composition root exception",[14,509,510],{},"Providers (or the host’s equivalent) may wire the framework. If a “rule” appears there, move it to a Use Case or Domain service.",[229,512,513,522],{},[232,514,515],{},[235,516,517,519],{},[238,518,426],{},[238,520,521],{},"Persistence wording",[251,523,524,532,540],{},[235,525,526,528],{},[256,527,265],{},[256,529,530],{},[39,531,385],{},[235,533,534,537],{},[256,535,536],{},"Infrastructure",[256,538,539],{},"Persistence adapter implementing the port",[235,541,542,545],{},[256,543,544],{},"Forbidden in Use Cases",[256,546,547],{},"ORM models \u002F query builders \u002F host facades",[549,550],"host-examples",{"topic":551},"persistence",[14,553,554,555,560],{},"Next: ",[556,557,559],"a",{"href":558},"\u002Fv1\u002Fcore\u002Fgolden-flow","golden flow",".",[562,563,564],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":37,"searchDepth":51,"depth":51,"links":566},[567,568,569,570,571],{"id":29,"depth":51,"text":30},{"id":226,"depth":51,"text":227},{"id":331,"depth":51,"text":332},{"id":413,"depth":51,"text":414},{"id":506,"depth":51,"text":507},"Domain hardest, Application strict, composition root relaxed for wiring, Infrastructure and UI outer.","md",{},"\u002Fv1\u002Fcore\u002Fstrictness-ladder",{"title":5,"description":572},"v1\u002Fcore\u002Fstrictness-ladder","CHuTjhvXfQa2tICGRUP7Uaksu89RExyQC4ibdr7LDpo",1786241411541]