Skip to content
AFTER CERTAINTY
Skip to chapter text

CouplingPart III - AI and Structural Entropy

13. Monoliths and Context Collapse

About 9 mins

The Service That Became Everything

Six months into a platform rewrite, a team still refers to the new system as a set of services, but the repository tells a different story. One deployable unit contains billing adjustments, notification templates, fraud heuristics, and an experimental retrieval workflow added to "just get the demo working." Assisted generation made each addition cheap. Shared prompts and copied utility modules made each addition fast.

The architecture diagram still shows boxes and arrows. Operationally, the boxes collapse into one runtime boundary.

You see the same gap in other places. A hospital has separate committees on paper but one shared workaround in practice. A company has different team names in the org chart but one merged incentive in the budget. An AI stack shows neat service boxes while every team queries the same retrieval pile.

On-call engineers cannot tell whether a failure belongs to core policy, integration glue, or model-assisted experimentation. Incident reviews keep ending with the same phrase: "we should split this, but we don't know where to cut without breaking production."

No single decision caused the monolith. Accumulation did. Context that was supposed to stay local leaked across modules, prompts, and tools until the system's effective cohesion matched its largest blob.1

When the System Still Looks Fine

Watch what still works. Code compiles. Prompts run. Retrieval answers sound grounded. Documents look authoritative. Releases go out. Syntax holds longer than meaning.

That is the chapter's pattern in one line: systems collapse context faster than they collapse syntax.

Teams can reason clearly only when they know which rules belong to which problem. Billing rules are not the same as experiment rules. Production policy is not the same as draft policy. Core product behavior is not the same as vendor glue.

Context collapse happens when those boundaries blur together. A retrieval system pulls policy beside experiments beside production logic. A shared prompt folder teaches every service the same retry assumptions. A repository treats one deployable unit as the place where "we'll just add it for now." The output still looks professional. The mixture is harder to see.

People act on mixtures they no longer recognize as mixtures.2 The pain arrives later: long incident calls, tests that boot half the system to check one rule, reviews where nobody can say who should redesign what.

Chapter 11 asked teams to keep the core stable and push outside change to adapters. Context collapse is what happens when that discipline slips under speed. The core becomes a grab bag. Vendor glue starts looking like product policy.

Monoliths by Accumulation

Not every monolith is a mistake. A single system with one clear owner can learn well.

The dangerous kind grows by accumulation. Each piece looked reasonable alone. Refusing it felt expensive in the moment. Assisted generation makes accumulation cheap. A draft is already there. A utility module already works somewhere else. A demo path needs to ship this week.

Without boundary rules, the system does not converge toward modules that share a reason to change together. It converges toward modules that happened to be generated in the same week.

You start to see it in the repo:

  • unrelated reasons to change bundled in one file or service
  • a "utils" folder that becomes undeclared global state
  • experiments embedded in core logic with no sunset plan
  • tests that need the whole runtime to check one behavior

Owners still appear on the roster. Redesign still requires touching everything.3 Bad structure can spread faster than teams notice the structure becoming bad.

The problem is not speed alone. The problem is discovering the damage only after the system has already spread it everywhere.

Hidden Coupling You Never Documented

Integration debt is old. Assisted work adds new places for it to hide.

Two teams may think their services are independent while secretly relying on the same copied prompt assumptions about retries, permissions, or data retention. The code looks different. The failures rhyme. Nobody filed a dependency because nobody wrote the prompt down as a contract.4

Multiple agent workflows may call the same tool endpoint with a loose schema. One tool change breaks four teams. They learn that during an incident, not in design review.

A knowledge base indexed for convenience may hold customer support text beside internal runbooks, draft policy beside live configuration. The answer sounds grounded. The reader cannot tell which world produced the sentence.

Copy-paste from another service is the fastest path to ship. Without adapter discipline, you also copy error handling written for another upstream, identifiers from another bounded context, and authorization written for another threat model.

None of this requires carelessness. It is rational under deadline pressure. The dependency just never made it into a design review because it never looked like a dependency.

When the Repository Becomes Shared State

Git is supposed to show who changed what and why. Generation can turn the repo into one shared workspace instead.

The "helper module" is a familiar trap. It starts as string helpers or prompt wrappers. Then it picks up auth helpers, logging, model clients, and business fallbacks. Each add is small. Soon every team depends on it. Every change scares unrelated callers. Nobody deletes dead paths because usage is hard to trace.

The module becomes a coordination hub. Monoliths are not only a deployment topology problem. They are a coordination and ownership problem expressed as shared state.

Generated test fixtures can mirror production complexity without isolating what actually matters. Coverage rises. When something breaks, you read the fixture graph before you learn anything about the business rule.

These are monoliths in miniature. The tooling rewards reuse over boundary clarity. Fixing them means delete, split, and pay short-term coordination cost so long-term ownership stays visible.5

Same Shock, Different Calendar

Part II described integration month: many hidden assumptions surfacing at once. Assisted accumulation produces a smaller version of that shock every week. Integration is no longer a phase at the end. It is continuous. That makes it easier to deny until the failure is large.

Waterfall taught that postponing boundary fights postpones learning. AI-era work flips the calendar but keeps the structure. Assumptions stay implicit until production exposes them.

Hexagonal design says: make dependencies explicit and point them outward. Context collapse says: dissolve the distinction faster than anyone documents it.

The real problem is not whether a system is one service or many. The problem is whether anyone can still change part of the system without understanding the entire thing.

When every change touches everything else, ownership becomes ceremonial.6 Tools can hide that drift. Generated code may pass style checks and raise coverage while the next vendor change will still force a painful rediscovery of what was actually coupled.

Knowledge Sprawl Outside Software

Institutions hit the same pattern.

A company puts assisted search over wikis, tickets, and shared drives. Answers arrive faster. Then two departments discover they have been reasoning from corpora that were merged for convenience and should never have been merged at all.

A policy team and an operations team query the same assistant surface. The answer is fluent. Interpretive guidance sits beside procedural steps. Draft language sits beside enacted rules.

The frictionless moment is the answer. The costly moment is acting on it without knowing which context produced it.

Keep separate things separate. When merged contexts cause harm, someone needs to know who approved the corpus, who owns correction, and who can change the structure that produced the mix-up.

Without that, the institution gets faster answers and slower understanding.7

Catching Collapse Early

You do not need to wait for a full monolith culture.

Warning signs are operational:

  • incident reviews that cannot say whether the failure was core, integration, or experiment
  • prompts that grow without an owner
  • module names that no longer predict why code changes
  • small changes that suddenly need many people in the room

Responses are structural, not motivational.

Split ownership before you split repositories. Write prompt and tool contracts with the same care as API contracts. Curate retrieval corpora the way you would curate bounded contexts: explicit about what belongs in and what stays out. Prefer small generated changes with a named intent over large "make it work" requests that smuggle policy into glue code.

If assisted output rises while review hours, revert rates, and "who owns this?" threads rise faster, the system is paying tax for collapsed context. That tax is a signal to redraw boundaries while redraw is still affordable—not a signal to ban tools.

Good boundaries slow people down at the exact moments where hidden assumptions would otherwise spread silently. That delay is useful. It forces teams to decide intentionally what belongs together and what does not.8

Bridge to Chapter 14

This chapter described what accumulates when boundaries fail: blobs nobody can safely change, hidden dependencies nobody documented, and mixed contexts nobody can trace.

Chapter 14 turns to guardrails—checks and escalation paths that make risky coupling visible earlier and return signal to people who can redesign.

When bad structure spreads at machine speed, what can slow the spread down enough for learning to catch up?9

Context collapse is cheap to produce and expensive to unwind. Boundaries are how systems refuse that bill.

Footnotes

  1. Neal Ford, Rebecca Parsons, and Patrick Kua, Building Evolutionary Architectures: Support Constant Change (O'Reilly Media, 2017), on architecture erosion and fitness signals over time.

  2. Eric Evans, Domain-Driven Design: Tackling Complexity in the Heart of Software (Boston: Addison-Wesley, 2003), on bounded contexts and intentional separation of model semantics.

  3. Robert C. Martin, Clean Architecture (Upper Saddle River, NJ: Prentice Hall, 2017), on module cohesion, separation of concerns, and change-reason clustering.

  4. Martin Fowler, "Integration Metadata," https://martinfowler.com/articles/integrationMetadata.html, on implicit integration contracts; and OWASP Foundation, OWASP Top 10 for Large Language Model Applications (2023/2025 versions), on insecure output handling, excessive agency, and supply-chain risks in tool-mediated workflows.

  5. Michael T. Nygard, Release It! Second Edition (Pragmatic Bookshelf, 2018), on stability anti-patterns and operational coupling in large deployable units.

  6. Winston W. Royce, "Managing the Development of Large Software Systems" (1970), on late integration risk; and Alistair Cockburn, "Hexagonal Architecture," on ports and adapters as explicit coupling control.

  7. Herbert A. Simon, Administrative Behavior, on limits of local knowledge and coordination under distributed information; and Emily M. Bender et al., "On the Dangers of Stochastic Parrots" (FAccT 2021), on labor and accountability when large corpora substitute for situated judgment.

  8. Matthew Skelton and Manuel Pais, Team Topologies (IT Revolution Press, 2019), on ownership boundaries and interaction modes that reduce tacit coupling.

  9. National Institute of Standards and Technology, Artificial Intelligence Risk Management Framework (AI RMF 1.0), NIST AI 100-1 (2023), on governance functions for map, measure, manage, and govern; and OWASP Foundation, OWASP Top 10 for Large Language Model Applications, on control categories for LLM deployments.