One folder, one bounded contextLLM view

One folder, one bounded context, in each language

Yes, one bounded context can be one folder with its own project, in all four languages. Each was built and run with 2 to 3 contexts, a kernel and tests inside the folder, then scaled to 25 or more. You meant project, and that is what was built: a standard project, not one library per layer.

The folder, as files

Explorer
  • context.yamlid, owner, needs, uses
  • what others may use
  • registerthe one function the kernel calls
  • URLs, controllers, request and response models
  • MCP tools
  • model, service, ports
  • data model, repository, migrations
  • policies.yamlauth policies
  • its own settings
  • flags.yamlrequired
  • segments.yamloptional
  • events.yamloptional
  • contract, alerts, runbooks
  • its own docs
  • finds and wires every context
  • dependency.yamlone per service

What each language allows

LanguageWhat a context isFiles outside the folder when you add oneWhat blocks another context's internals
Goone package tree, one Go module1 generated wiring filethe compiler
Bunone workspace package and a contract package1: bun.lockTypeScript; our checker for relative paths
.NETa project, a contract project, a test project0, with no lock file in the hostthe compiler
Flutterthree packages: contract, src, tests0 trackedonly our checker

All MEASURED.

Can tests, docs and observability live inside?

LanguageTests inside runPlanted failing test failsTest files in the shipped build
Goyesyes0
Bunyes, with SITyes0
.NETyesyes0
Flutteryesyes0
  • Docs and runbook files were kept out of every shipped build. MEASURED
  • The obs tool ran on a context's own folder in Bun and Flutter. MEASURED. Go and .NET: NOT TESTED.
  • The docs framework was not run on these folders: it is not finished. NOT TESTED
  • SIT ran only in Bun. Flutter device tests were NOT TESTED.

Guarding the layers inside one project

The compiler no longer does it. A check does, and each was proven with a planted breach. MEASURED

LanguageCheckWhen it fails
Godepguard and our generatorlint, generate
Bunour 150-line boundary checkercheck
.NETour analyzerbuild
Flutterour boundary checkercheck

Speed with 25 contexts

LanguageFrom cleanAfter one editOne context's tests
Go43 s2.2 to 4.3 s0.75 s
Bun5.5 s (type check)3.7 s0.21 s
.NET, the app77 s10 s2.8 s
.NET, with every test project161 s11.7 s2.8 s
Flutter, 27 contexts43 s (generate, analyze)8.3 s6.8 s

MEASURED on a busy 32-core box. Compare within a language, not between languages.

Does this change .NET the most? Yes. Is it possible? Yes.

RankLanguageTemplate files that moveWhat really changes
1, most.NET64 of 428 (API template)the four layer projects and the solution file go; the shared DbContext; a new layer check
2Flutter0 of 559 (template has no features); 180 in alcohol.neonpackages per context; two generated files; a boundary check
3Bun42 of 409 (consumer template)packages per context; 6 root configs; a boundary check
4, leastGo4 of 248about 10 config files; one generated file per context
  • Counts: MEASURED, except Flutter's 0, which is REASONED. The order is REASONED from structure, because the templates differ in size.
  • One page each: Go, Bun, .NET, Flutter.

What each language cannot do cleanly

  • Go: no src/ folder and no module per context. Two new libraries on neighbouring lines conflict in go.mod.
  • Bun: two new contexts conflict in bun.lock, one hunk, fixed by bun install. merge=union is unsafe there.
  • .NET: a lock file in the host conflicts on every new context. Keep none there, as the template does today.
  • Flutter: one shared package map, so an undeclared import compiles. Stale generated files break every command until task gen. Two new libraries can conflict in pubspec.lock.
  • All of these lock-file clashes are git conflicts, so none breaks main silently.