---
title: "One folder, one bounded context"
description: The answer to the bounded-context study.
source: index.dh.md
---
<!-- Made by dh llm from the source; nobody edits this file. -->

# One folder, one bounded context

**Yes, it is possible, in all four languages. One folder is one plugin: a project with everything inside. The kernel finds it, wires it and holds the shared engines.**

1. **No merge queue is needed.** Names come from the folder, so most clashes cannot happen and the rest show as git conflicts. Four rare kinds remain, and our own small merge bot caught all four. MEASURED
2. **.NET changes the most, as you said. Go changes the least.** MEASURED counts, REASONED order
3. **You do not need multi-region, Logto or shared services first.** All four swaps changed 0 files inside contexts (MEASURED, in Bun). Four small shapes and a cluster-like test harness must exist from day 0.
4. **The top-level workspace waits for Hypermedia, docs and the UL only.** It does not wait for Logto or multi-region. FROM DOCS (your rulings)
5. **The biggest gap is paperwork:** today's standards and house checks say layers first and tests outside, the opposite of your model. FROM DOCS
6. **The engines: yes to all seven, writing little.** Fork 2, run 3 as they are, build billing's thin core and the flag glue. REASONED
7. **A folder does not fix a wrong boundary.** alcohol.zinc's 25 modules are really about 8 contexts. REASONED from a measured map

## One pull request, from the folder to main

Animation, 4 steps. Starts with: person dev "you"; box folder "one context folder"; box ci "its own CI"; box bot "merge bot"; cylinder main. Connected: dev -> folder, folder -> ci, ci -> bot, bot -> main. Families, one colour each: you (dev, folder); tool "our tools" (bot); gh "GitHub" (ci, main).

1. You change one folder. Its code, tests, docs, flags and alerts are all in it.
   dev -> folder: edit
2. The pull request runs its own tests. The kernel's contract test runs over every context.
   folder -> ci: pull request
3. You add the merge label. The bot joins it with the newest main and runs the fast whole-repo check.
   ci -> bot: label
4. Green: the bot pushes exactly what it tested. Red: it says why, and main stays green.
   bot -> main: tested

## Your questions
Each answer's evidence and tag is in the section it points to.

| You asked | Answer | Where |
|---|---|---|
| How does it work without a merge queue? | the folder makes the names; a small bot checks main plus the pull request | [read](merge.md) |
| One folder = one bounded context, all languages? | yes, built and run in all four | [read](context.md) |
| Is that possible? Project, not library: do you understand? | yes to both: one project per context, layers as folders inside | [read](context.md) |
| One whole folder with docs, MCP, policies, tests, right? | yes: everything, plus a small contract project for others to use | [read](context.md) |
| This changes .NET the most, right? | yes | [read](context.md) |
| Can this even be possible? | yes; two real zinc modules were moved: same unit results, identical database model | [read](context.md) |
| The kernel wires them and generates the shared things? | yes, at build time, with a contract test over every context | [read](kernel.md) |
| Will CX, marketing, analytics and feedback show our blind spots? | yes: a generated table of every context against every engine | [read](kernel.md) |
| Can we scan diene for what is missing? | done: 86 points checked, the gaps that matter are listed | [read](gaps.md) |
| Do we need multi-region, Logto and shared services first? | no: they are slots | [read](first.md) |
| All this blocks the top-level workspace, right? | half: Hypermedia, docs and UL do; the others do not | [read](gaps.md) |
| This needs a lot decided first, right? | less than it looks: 4 day-0 shapes, a test harness and the 5 picks below | [read](first.md) |
| Our own auth service, forked from Logto? | yes, a thin fork, after a lawyer reads the terms | [read](services.md) |
| Billing like Lago? | build a thin engine; providers move the money | [read](services.md) |
| CX like Chatwoot? | Libredesk now, build later | [read](services.md) |
| A marketing engine? | listmonk | [read](services.md) |
| Analytics like Plausible? | yes, but fork Umami instead | [read](services.md) |
| Voting and feedback like Canny? | Fider | [read](services.md) |
| Feature flags, front and back end? | yes, per context, with the switch made by the kernel | [read](services.md) |
| What do you think? | do it: the layout first, engines as empty ports, then fill them | below |

## What I think
- **Do it.** It is the right shape for many pull requests at once.
- The layout alone lifts zinc's "change inside one folder" from 6% to 22% of changes; generated wiring makes it 24% (these touch nothing else at all). Better boundaries and contracts give the rest. MEASURED
- **The gain depends on the app.** In alcohol.neon (Flutter) the same move lifts it only from 5.4% to 6.8%, and that app had 0 real conflicts in 90 merges. MEASURED
- **So expect this:** the folder removes clashes in shared files. It does not by itself make changes small. REASONED
- Do not build seven platforms first. Build seven ports first. REASONED

## The 5 real trade-offs for you
Everything else is [decided, with reasons](decided.md). Recommendations are REASONED; prices are FROM DOCS.

| Trade-off | A (I recommend) | B |
|---|---|---|
| 1. Keep main green on private repos | Free: the bot by habit, CI on main catches a skip | [Team](https://github.com/pricing), 4 dollars a person a month: only the bot can update main |
| 2. .NET database models | a DbContext per context: no shared snapshot to fight over | one DbContext: one history, but a file most schema pull requests edit |
| 3. Auth | a thin Logto fork, if the lawyer agrees | buy Logto's self-hosted plan, 249 dollars a month for each deployment |
| 4. Customer support | Libredesk now, build on DurianCloud later | build on DurianCloud now |
| 5. Analytics | fork Umami: MIT, Postgres only, has funnels | fork Plausible or build |

- **1:** A costs nothing and can be skipped by anyone who can push. Move to B the first time a skip hurts.
- **2:** A changes two earlier lines: one DbContext, and one migration table per service. The snapshot was the hottest file in zinc (21 of 75 changes).
- **3:** A needs a lawyer before it ships, and about 15 days of upkeep a year. How many paid deployments B needs was NOT CHECKED, so B may be several times 249.
- **4:** A changes the earlier plan. It is 4 to 6 days instead of a build. **Risk:** the project is young, has one main author, and the version studied is a release candidate. The port keeps it swappable.
- **5:** A changes which project is forked, not the shape.
