# 15.10 Architecture is the control (/building-ai-workers/code-review/architecture-is-the-control)

---
type: Document
title: "15.10 Architecture is the control"
description: "When agents write most of the code, a person governs the shape of the system: the boundaries every change stays inside, the contracts between its parts, the patterns allowed, and a check that blocks any change that crosses them."
status: stable
order: 315.105
ksor:
  owner: team:panaversity
  audience: [ public ]
  approval:
    by: process:panaversity
    at: 2026-12-02T11:11:19Z
chapter: "15"
part: III
expert_status: builder-only
concepts: [ "15.10" ]
last_verified: 2026-12-02
sources:
  - id: burnett-architecture-control
    title: "When AI agents write most of the code, line-by-line review stops being a control (Mark Burnett, LinkedIn post, accessed 2026-12-02)"
    resource: https://www.linkedin.com/posts/markburnett_agentic-ai-agenticai-share-7533490259548893184-xyEG/
generated:
  at: 2026-12-02T11:11:19Z
  by: human:zia
trust_tier: unverified
build_id: sha256:4d11a8dc40855bab1bbd417a651d095bead3286037678d5f3af0464182c9b986
dirty: true
ksor_version: 0.0.60
---

**In everyday life.** A city does not inspect every brick a builder lays. Before anyone builds, it draws the plan: which streets are for homes and which for factories, where a building may connect to the water mains, and which walls must stop a fire. Inspectors check those few things on every building. A builder who crosses one of those lines is stopped, however good the bricks are.

**What you will learn.** How to write down the few boundaries every change must stay inside, give each one a check that blocks, and say who owns them.

**Why it matters.** Tests, review and approval judge one change at a time. When agents send many changes a day, what keeps the system safe is the shape every change has to fit.

### What is left to control when agents write most of the code?

The shape of the system. [15.3](why-review-changes.md) replaced "did someone read every line?" with "which check should catch this?". Those checks still look at one change at a time. This lesson steps up one level, to the decisions that make every change safer before an agent writes it.

Mark Burnett, writing from a Chief AI Officer summit in London, put it in one line: when AI agents write most of the code, line-by-line review stops being a control, and the control that remains is architecture.[^burnett-architecture-control] Inspecting each change harder does not keep up. What keeps up is a short list of rules about the shape, a machine that checks every change against them, and a person who owns them.

**Architecture**, here, means the few decisions that are expensive to change and that every change must respect: what each part of the system is for, what it may touch, and how the parts talk to each other.

### What does an architecture say?

Four things. The examples are from `brightline-ap`, the repository of Lab 15.

| Part | What it says | In `brightline-ap` |
| --- | --- | --- |
| Boundaries | Which part may do what. A **boundary** is a line in the system that only one part may cross | Only `src/ap-client.ts` talks to the AP system. Nothing writes to `data/` |
| Contracts | The shape of what passes from one part to another, checked where it crosses | Outside data becomes an invoice or a vendor only through the schemas in `src/schemas.ts` ([14.4](../structuring-programs/data-models-and-schemas.md)) |
| Permitted patterns | The one approved way to do a common job, so no agent invents a second | Due dates come only from `src/due-date.ts` and its Python twin, `py/brightline_ap/due_date.py`. Amounts are whole cents |
| Blast radius | What a mistake in each part can reach ([12.3](../agentic-coding/permissions-and-plan.md)), which sets how much care a change there needs | Six files import `due-date`, so a mistake there reaches the whole due list. It is high tier ([15.8](approval-scaled-by-risk.md)) |

The contracts are already enforced. The type checker checks every line on every change, and a schema checks outside data where it enters. Types check the code, and Zod checks the data. The boundaries and patterns are not enforced yet, and they are where an agent can do the most damage without breaking a test.

Each row narrows what a change can get wrong. An agent that stays inside the boundaries can still write a wrong line, but the mistake stays small, and the tests near it can catch it.

### Why is a line in `AGENTS.md` not enough?

Because a rules file is advice the agent reads, not a lock ([12.4](../agentic-coding/rules-the-agent-reads.md#can-a-rules-file-stop-a-mistake)). `brightline-ap`'s `AGENTS.md` already says "Due dates come only from `src/due-date.ts` and `py/brightline_ap/due_date.py`." Nothing checks it. An agent asked to speed up a script, late in a long session, can work out a date by hand in another file. Every test can pass, and the rule is broken without anyone seeing it.

In [12.4](../agentic-coding/rules-the-agent-reads.md), a setting backed the rule against writing to `data/`. For a rule about the shape of the code, the backing is a check that runs on every pull request and blocks the merge ([15.7](checks-that-block.md)).

So each rule gets three things: a line that says it and why, a check that enforces it, and an owner. Written this way, the rules are **machine-readable guardrails**. A machine can test every change against them, and a person can still read why each one exists.

### How does a machine check a boundary?

With a short script that searches the code for the thing only one place may do, and fails when it finds it anywhere else. Like the tests-unchanged check in [15.7](checks-that-block.md), it reads the code, not what the code does, so it is cheap enough to run on every change.

The rules live in a file a person can read, `ARCHITECTURE.md`, one numbered rule per line, each naming its check:

```text
1. Only src/ap-client.ts and py/brightline_ap/api_client.py call the AP system.   Check: architecture
2. Only src/due-date.ts and py/brightline_ap/due_date.py work out dates.          Check: architecture
3. Files in src/ never import from scripts/.                                      Check: architecture
4. Nothing writes to data/.                                                       Check: architecture, and the setting
```

When a change crosses a line, the check fails, naming the rule, the file and the line:

```text
rule 1: src/due-by-friday.ts:49: const res = await fetch(`${baseUrl}/invoices?status=open`, ...
```

A search has limits, and the script should say them at the top. It finds a call to `fetch`, but not the same call hidden behind another name. It catches the common mistake every time, and review still looks for the rest. Larger teams use tools built for this. They read the import graph ([14.1](../structuring-programs/modules.md#which-files-do-i-read-first)) and fail on any arrow the rules do not allow. The idea is the same.

### Who owns the shape?

A person, by name. An agent can propose a change to a boundary, but moving one is a design decision, like changing a policy. So `ARCHITECTURE.md` and its check are high tier, with a code owner ([15.8](approval-scaled-by-risk.md)). Refuse a pull request that changes a rule and the code the rule governs at the same time. It rewrites the rule it is judged by, which is why the reviewer reads `REVIEW.md` from `main` ([15.5](rules-the-reviewer-reads.md)).

That changes what the person is accountable for. Not every line, which nobody can read at the speed agents write. The person answers for the shape: the boundaries are right, each one has a check that blocks, and every agent works inside them. The agent that writes, the agent that reviews and the agent that writes tests ([12.6](../agentic-coding/many-sessions.md)) all work inside the same lines, and one check judges them all.

**At work.** Ana writes the four rules above into `ARCHITECTURE.md` and makes herself its code owner. Before the check is required, she runs it on `main`, and it passes, so the rules describe the code as it is. Then she tests it. On a practice branch, she asks the agent to call the AP system with `fetch` straight from `src/due-by-friday.ts`. The check fails, naming rule 1 and the line. She throws the edit away.

### Try it

**Predict, then do it in [Lab 15, Task 14](lab.md#task-14-an-architecture-check-25-minutes).** Brightline's `AGENTS.md` says due dates come only from `src/due-date.ts` and its Python twin. In the lab as it stands after Task 13, which check would stop a change that works out a due date in another file: the tests, the type check, the AI review, or no check that blocks? Write your answer, then build the check that would.

**The operating rule:** write down the few boundaries every change must stay inside, give each one a check that blocks and an owner who signs off any change to it, and let agents work freely inside them.

### Other words you will meet

| Word | What it means |
| --- | --- |
| Policy as code | Rules written so that a machine can test every change against them, such as a check script or a ruleset, kept in the repository and reviewed like code |
| Dependency rule | A boundary on the import graph: which folders may import which. Tools built for it fail a change that adds an import the rules do not allow |
| Fail-safe | A check that fails when it cannot run, and never passes, as the tests-unchanged script does when the base branch is missing ([15.7](checks-that-block.md)) |

[^burnett-architecture-control]: When AI agents write most of the code, line-by-line review stops being a control, Mark Burnett.
