[{"data":1,"prerenderedAt":379},["ShallowReactive",2],{"doc-seo-\u002Fdocs\u002Farchitecture\u002Fbounded-context":3,"content-query-cVCCQe8J8g":6},{"title":4,"description":5},"Bounded Contexts & Rules","Conceptual foundation of Domain-Driven Design (DDD) domain ownership and dependency governance in Septum.",{"_path":7,"_dir":8,"_draft":9,"_partial":9,"_locale":10,"title":4,"description":5,"badge":11,"body":12,"_type":373,"_id":374,"_source":375,"_file":376,"_stem":377,"_extension":378},"\u002Fdocs\u002Farchitecture\u002Fbounded-context","architecture",false,"","Architecture",{"type":13,"children":14,"toc":368},"root",[15,23,36,40,47,66,149,241,244,250,315,318,324,362],{"type":16,"tag":17,"props":18,"children":19},"element","p",{},[20],{"type":21,"value":22},"text","In growing repositories, AI coding agents often fix a bug or implement a feature by importing whatever internal helper or database model is closest at hand. Over time, direct cross-module imports blur module ownership, create circular dependencies, and turn isolated features into tightly coupled monoliths.",{"type":16,"tag":17,"props":24,"children":25},{},[26,28,34],{"type":21,"value":27},"Septum brings ",{"type":16,"tag":29,"props":30,"children":31},"strong",{},[32],{"type":21,"value":33},"Bounded-Context Architecture Governance",{"type":21,"value":35}," into the agent workflow.",{"type":16,"tag":37,"props":38,"children":39},"hr",{},[],{"type":16,"tag":41,"props":42,"children":44},"h2",{"id":43},"theoretical-model",[45],{"type":21,"value":46},"Theoretical Model",{"type":16,"tag":17,"props":48,"children":49},{},[50,52,57,59,64],{"type":21,"value":51},"Drawing from ",{"type":16,"tag":29,"props":53,"children":54},{},[55],{"type":21,"value":56},"Domain-Driven Design (DDD)",{"type":21,"value":58}," and modular architecture principles, Septum models a codebase as a collection of named ",{"type":16,"tag":29,"props":60,"children":61},{},[62],{"type":21,"value":63},"domains",{"type":21,"value":65},", each owning a physical root directory inside the workspace:",{"type":16,"tag":67,"props":68,"children":71},"pre",{"className":69,"code":70,"language":21,"meta":10,"style":10},"language-text shiki shiki-themes github-light github-dark","   ┌────────────────────────┐\n   │  apps\u002Fweb (Consumer)   │ ── allowed ──► [shared]\n   └───────────┬────────────┘\n               │ forbidden\n               ▼\n   ┌────────────────────────┐\n   │  internal-billing      │ ◄── cycle check ──► [orders]\n   └────────────────────────┘\n",[72],{"type":16,"tag":73,"props":74,"children":75},"code",{"__ignoreMap":10},[76,87,96,105,114,123,131,140],{"type":16,"tag":77,"props":78,"children":81},"span",{"class":79,"line":80},"line",1,[82],{"type":16,"tag":77,"props":83,"children":84},{},[85],{"type":21,"value":86},"   ┌────────────────────────┐\n",{"type":16,"tag":77,"props":88,"children":90},{"class":79,"line":89},2,[91],{"type":16,"tag":77,"props":92,"children":93},{},[94],{"type":21,"value":95},"   │  apps\u002Fweb (Consumer)   │ ── allowed ──► [shared]\n",{"type":16,"tag":77,"props":97,"children":99},{"class":79,"line":98},3,[100],{"type":16,"tag":77,"props":101,"children":102},{},[103],{"type":21,"value":104},"   └───────────┬────────────┘\n",{"type":16,"tag":77,"props":106,"children":108},{"class":79,"line":107},4,[109],{"type":16,"tag":77,"props":110,"children":111},{},[112],{"type":21,"value":113},"               │ forbidden\n",{"type":16,"tag":77,"props":115,"children":117},{"class":79,"line":116},5,[118],{"type":16,"tag":77,"props":119,"children":120},{},[121],{"type":21,"value":122},"               ▼\n",{"type":16,"tag":77,"props":124,"children":126},{"class":79,"line":125},6,[127],{"type":16,"tag":77,"props":128,"children":129},{},[130],{"type":21,"value":86},{"type":16,"tag":77,"props":132,"children":134},{"class":79,"line":133},7,[135],{"type":16,"tag":77,"props":136,"children":137},{},[138],{"type":21,"value":139},"   │  internal-billing      │ ◄── cycle check ──► [orders]\n",{"type":16,"tag":77,"props":141,"children":143},{"class":79,"line":142},8,[144],{"type":16,"tag":77,"props":145,"children":146},{},[147],{"type":21,"value":148},"   └────────────────────────┘\n",{"type":16,"tag":150,"props":151,"children":152},"ol",{},[153,164,223],{"type":16,"tag":154,"props":155,"children":156},"li",{},[157,162],{"type":16,"tag":29,"props":158,"children":159},{},[160],{"type":21,"value":161},"Explicit Domain Ownership:",{"type":21,"value":163}," Every source file inside a domain root belongs to that domain (nested domain roots resolve to the most specific matching root).",{"type":16,"tag":154,"props":165,"children":166},{},[167,172,174],{"type":16,"tag":29,"props":168,"children":169},{},[170],{"type":21,"value":171},"Directional Dependency Policies:",{"type":21,"value":173}," Each domain can declare:\n",{"type":16,"tag":175,"props":176,"children":177},"ul",{},[178,197],{"type":16,"tag":154,"props":179,"children":180},{},[181,187,189,195],{"type":16,"tag":73,"props":182,"children":184},{"className":183},[],[185],{"type":21,"value":186},"allowed_dependencies",{"type":21,"value":188},": Which sibling or shared domains it is permitted to import from (enforced when operating in ",{"type":16,"tag":73,"props":190,"children":192},{"className":191},[],[193],{"type":21,"value":194},"strict",{"type":21,"value":196}," mode).",{"type":16,"tag":154,"props":198,"children":199},{},[200,206,208,214,216,221],{"type":16,"tag":73,"props":201,"children":203},{"className":202},[],[204],{"type":21,"value":205},"forbidden_dependencies",{"type":21,"value":207},": Which domains it must never import from (enforced in both ",{"type":16,"tag":73,"props":209,"children":211},{"className":210},[],[212],{"type":21,"value":213},"warn",{"type":21,"value":215}," and ",{"type":16,"tag":73,"props":217,"children":219},{"className":218},[],[220],{"type":21,"value":194},{"type":21,"value":222}," modes).",{"type":16,"tag":154,"props":224,"children":225},{},[226,231,233,239],{"type":16,"tag":29,"props":227,"children":228},{},[229],{"type":21,"value":230},"Cycle Prevention:",{"type":21,"value":232}," Even when individual imports appear locally reasonable, circular domain dependencies (",{"type":16,"tag":73,"props":234,"children":236},{"className":235},[],[237],{"type":21,"value":238},"A → B → A",{"type":21,"value":240},") undermine clean layering and independent testing. Septum runs static cycle detection across resolved domain and file graphs.",{"type":16,"tag":37,"props":242,"children":243},{},[],{"type":16,"tag":41,"props":245,"children":247},{"id":246},"benefits-for-ai-assisted-software-engineering",[248],{"type":21,"value":249},"Benefits for AI-Assisted Software Engineering",{"type":16,"tag":175,"props":251,"children":252},{},[253,279,297],{"type":16,"tag":154,"props":254,"children":255},{},[256,261,263,269,271,277],{"type":16,"tag":29,"props":257,"children":258},{},[259],{"type":21,"value":260},"Predictable Architectural Boundaries:",{"type":21,"value":262}," Before an agent writes a new import, ",{"type":16,"tag":73,"props":264,"children":266},{"className":265},[],[267],{"type":21,"value":268},"septum_boundary(scope: \"file\")",{"type":21,"value":270}," or ",{"type":16,"tag":73,"props":272,"children":274},{"className":273},[],[275],{"type":21,"value":276},"septum hook pre-write",{"type":21,"value":278}," informs the agent whether that dependency crosses a forbidden boundary.",{"type":16,"tag":154,"props":280,"children":281},{},[282,287,289,295],{"type":16,"tag":29,"props":283,"children":284},{},[285],{"type":21,"value":286},"Reviewable Policy Ownership:",{"type":21,"value":288}," Rules live explicitly in ",{"type":16,"tag":73,"props":290,"children":292},{"className":291},[],[293],{"type":21,"value":294},"septum.config.json",{"type":21,"value":296}," (or SQLite), making architectural intent visible to both human engineers and AI coding agents.",{"type":16,"tag":154,"props":298,"children":299},{},[300,305,307,313],{"type":16,"tag":29,"props":301,"children":302},{},[303],{"type":21,"value":304},"Frozen Pre-Commit Gate:",{"type":21,"value":306}," Running ",{"type":16,"tag":73,"props":308,"children":310},{"className":309},[],[311],{"type":21,"value":312},"septum check --staged",{"type":21,"value":314}," evaluates the exact Git index snapshot rather than relying on unstaged working-tree files.",{"type":16,"tag":37,"props":316,"children":317},{},[],{"type":16,"tag":41,"props":319,"children":321},{"id":320},"boundaries-of-domain-rules",[322],{"type":21,"value":323},"Boundaries of Domain Rules",{"type":16,"tag":175,"props":325,"children":326},{},[327,337],{"type":16,"tag":154,"props":328,"children":329},{},[330,335],{"type":16,"tag":29,"props":331,"children":332},{},[333],{"type":21,"value":334},"Import Topology, Not Runtime Contracts:",{"type":21,"value":336}," Domain rules govern static import edges between mapped roots; they do not govern HTTP calls, shared database tables, or runtime event buses.",{"type":16,"tag":154,"props":338,"children":339},{},[340,345,347,353,355,360],{"type":16,"tag":29,"props":341,"children":342},{},[343],{"type":21,"value":344},"Policy Accuracy Depends on Configuration:",{"type":21,"value":346}," Auto-discovered domains from ",{"type":16,"tag":73,"props":348,"children":350},{"className":349},[],[351],{"type":21,"value":352},"septum init",{"type":21,"value":354}," are heuristic starting points. Reviewing and curating ",{"type":16,"tag":73,"props":356,"children":358},{"className":357},[],[359],{"type":21,"value":294},{"type":21,"value":361}," ensures rules match your real architectural intent.",{"type":16,"tag":363,"props":364,"children":365},"style",{},[366],{"type":21,"value":367},"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":10,"searchDepth":98,"depth":98,"links":369},[370,371,372],{"id":43,"depth":89,"text":46},{"id":246,"depth":89,"text":249},{"id":320,"depth":89,"text":323},"markdown","content:docs:architecture:bounded-context.md","content","docs\u002Farchitecture\u002Fbounded-context.md","docs\u002Farchitecture\u002Fbounded-context","md",1795576106763]