The book models — a reading view

The book's outline and learning-outcome models, rendered as an alternative way to read the spine. Every heading, topic sentence, and outcome below is projected straight from book-models/outline.json and outcomes.json — regenerated on every commit, so it never goes stale.

31 chapters · 185 sections · 68 learning outcomes (? declared · ? derived · ? gap-recommended)

The program — what you'll be able to do after the whole book

After the program — the reader can
  • understandAfter the book, the reader can situate any governance move on the two thesis axes — constraint-vs-sensor and soft-vs-hard — and reach for the one the failure calls for. declared
  • createAfter the book, the reader can design a governed engineering environment in which a fleet of coding agents produces correct work at bounded risk — choosing the right mechanism, the right model, and the right transformation for each failure class. declared
  • createAfter the book, the reader can model a system as structured, drift-checked views an agent reasons through, rather than leaving the structure in a human's head. declared

Front Matter

0.4-the-books-language 0.4-the-books-language

The book uses a small engineering vocabulary deliberately.

The agents, foundation models, harnesses, and operating limits involved in autonomous software work.

The environment that gives engineering obligations durable authority.

0.5-preface 0.5-preface

This book—Model-Based Agentic Software Engineering (MAGE)—argues that modeling becomes central when implementation becomes abundant.

This book began with one hard engineering problem that emerged over months of building a real production system.

Agents can produce changes much faster than the surrounding environment can understand or govern them.

This book began with DocAble, a production service for remediating inaccessible documents.

MAGE draws on two kinds of evidence.

Two principles organize MAGE:

This book is for software engineers who suspect the ground has moved and want to know where to stand.

Module 1 — The New Engineering Problem

After Module 1 — the reader can
  • evaluateAfter this Part, the reader can judge which engineering tasks warrant the book's machinery — grounded in the founding premise that implementation has become abundant, so judgment is the scarce resource — and read an agent as a loop whose behavior you condition by handing it a model of its world. declared

Lesson1.1-the-printer 1.1-the-printer

Agent products and foundation models will continue to change.[note: Engineering predates machine learning in its use of model to mean a purposeful representation of a system.

The Printer suggests a useful diagnostic rule: suspect the engineered setup before inferring a machine limit.

After this section — the reader can
  • applyAfter this section, the reader can adopt the posture that an agent is a printer, not a stapler — so when it produces the wrong thing, the first suspect is the instructions, and the models can build anything one can explain. derived

Lesson1.2-mage-by-example 1.2-mage-by-example

The explicit problem is the scale of inaccessible documents.

From the user's perspective, DocAble is simple: upload an inaccessible document; receive a remediated document and an evidence record.

Building DocAble well is not one engineering problem.

Before Parts II and III represent DocAble through different engineering models, we need enough common territory to know what those models refer to.

DocAble is the book's deepest worked example because its engineering can be shown at the resolution the method requires.

Lesson1.3-the-agentic-substrate 1.3-the-agentic-substrate

A foundation model supplies broad, inexpensive semantic reasoning.

Scale creates a reasoning problem before an agent ever enters the picture.

Seen this way, the reasoning horizon is not an exotic property of language models.

The second problem is not that agents make mistakes while human programmers do not.

Agentic work occurs through observable interfaces.

Lesson1.4-the-new-engineering-problem 1.4-the-new-engineering-problem

A broad reasoner can operate on abstractions, but its active reasoning state is finite and large systems contain far more detail than any one engineering question needs.

Autonomous work can be locally constrained and checked without a comprehensive model.

The two problems are related but neither is reducible to the other.

Module 2 — Modeling

After Module 2 — the reader can
  • createAfter this Part, the reader can model a system as the small set of models it needs, choosing from five classes of model — behavioral, structural, decision, measurement, and documentation — rather than completing a fixed taxonomy, each a structured model kept honest by a drift check, and can join them around a scenario. declared

Lesson2.1-context-is-the-first-modeling-problem 2.1-context-is-the-first-modeling-problem

A **model** is a purposeful reduction of a system.

The suppressed detail has a realization-side consequence.

This distinction also separates a tacit obligation from a genuinely free choice.

Externalizing knowledge saves reconstruction only if a machine can read it back.

Structured representations can support progressively different capabilities: externalized knowledge, typed relationships, explicit semantics, stated properties, derivation, generation, traceability, and checking.

(no topic sentence — opens on a non-paragraph block)

The class names a model's purpose.

Each of the next six chapters takes one class through one production model from DocAble:

Lesson2.7-provenance 2.7-provenance

Recording history is not the same as modeling it.

DocAble's edit record has an unusual property for a provenance model: it runs.

Lesson2.8-system-knowledge 2.8-system-knowledge

DocAble's models differ in shape on purpose.

Multiple models create a correspondence problem: represented facts can diverge from the system or from one another.

The model is a projection of the code, reconciled at build time.

Where neither side can be fully derived from the other, the move is **traceability plus drift checking**.

Mechanical correspondence has a declared surface.

A model does not govern the system merely by existing.

Module 3 — Alignment

After Module 3 — the reader can
  • createAfter this Part, the reader can construct a governed engineering environment: place a control at the right layer of the agent stack, split ex-ante from ex-post, write lifecycles and runbooks, and measure one level deeper. declared

Lesson3.1-where-authority-can-act 3.1-where-authority-can-act

The first location is **reasoning input** — the context, representations, examples, and instructions put in front of the reasoner.

The four boundaries do not form a monotonic scale from weak to strong.

The boundaries also decide where feedback can return.

Lesson3.2-models-and-the-semantic-gap 3.2-models-and-the-semantic-gap

A drift check can establish a declared correspondence between two artifacts.

A second problem is placement.

After this section — the reader can
  • knowAfter this section, the reader can define the semantic gap — enforcing a property at the wrong level of abstraction — and identify the level where it becomes legible. derived

The agent-return check is one instance of a rule that runs under the whole of this Part:

Lesson3.3-constraints-sensors-validators-gates 3.3-constraints-sensors-validators-gates

On the work-facing side of the loop, the two complementary moves are prevention and observation; [ref:constraint-vs-sensor] draws the split.

A modeled obligation does not imply one particular enforcement technology.

The other two roles act at the loop's closing door.

The four roles are not stages of maturity.

Constraints are often introduced as prohibitions: this code must not call that library.

Keep **policy**, **guidance**, and **governance mechanism** separate.

Lesson3.4-governance-conversion 3.4-governance-conversion

Start with obligations you can state before the work begins and that are consequential, recurrent, or reusable enough to make durable.

The harder half begins when the system surprises you.

A merge automation drained a backlog of agent worktrees into the mainline each tick.

Governance conversion motivates a useful accounting concept: **engineering capital**.

Not every quality goal should end in authoritative enforcement.

Lesson3.5-when-guardrails-collide 3.5-when-guardrails-collide

Start by giving each control a stable identity: the event or boundary at which it acts, the resources it reads or changes, the obligation or failure class that justifies it, and its authority role or roles.

Two collisions from the case study make it concrete.

Interactions are only half of governing the control estate.

Governance conversion and coverage auditing work in opposite directions.

Module 4 — The MAGE Method

After Module 4 — the reader can
  • applyAfter this Part, the reader can put the method to work: run the MAGE workflow loop, induce models from an existing codebase, deploy the self-operate / self-govern / self-communicate skills, hold the result with generative validation, and convert a recurring failure into a durable mechanism. declared

Lesson4.1-the-mage-workflow 4.1-the-mage-workflow

**Need.** A turn begins with something you want to learn, change, preserve, or make true.

**When judgment repeats, ask what future work should inherit from it.** The answer may be a model, invariant, sensor, validator, constraint, gate, runbook, or skill.

Keep one distinction sharp.

Prefer structural prevention when the legitimate action space can be closed.

Not every agent task deserves the full apparatus of governed autonomy.

Lesson4.2-brownfield 4.2-brownfield

Survey the estate before designing the replacement.

Brownfield models need not begin with an engineer inventing the right abstraction in advance.

The immediate goal is a **trusted map** over the parts that matter now: important claims have known anchors, important implementation regions have explanatory homes, and agents can navigate the join without rediscovering it.

A valid future invariant is not always a valid present admission rule.

Brownfield modeling has a bootstrapping problem.

The same method could conclude that no new model was warranted.

Models expose what they contain more readily than what they omit.

Recovering a model is only the first step.

A recurring gap does not automatically deserve machinery.

Lesson4.3-validating-change 4.3-validating-change

To validate a change is to assemble evidence that bears on its obligations and decide what consequence that evidence should have.

An **oracle** is whatever supplies the judgment against which the observed result is evaluated.

Let the engineering claim choose the search.

Coverage answers a question about a population; the population must be named before the percentage has engineering meaning.

Generative validation adds an honesty question that a small example suite can often avoid: **did the campaign search the semantic region the claim is about?** Code coverage answers where execution went.

Validation may report or gate.

Part III gave a placement rule for authority: **evaluate an obligation at the earliest boundary where it becomes legible and enforceable.** That catches a problem close to its cause.

None of these techniques is new.

Lesson4.4-operating-mage 4.4-operating-mage

Start with the healthy path of a recurring activity: how a bug moves from reported to fixed, how a feature moves from designed to shipped, how an agent moves from dispatched to landed.

A lifecycle model says which states matter.

A runbook preserves how an experienced engineer reasons through a recurring situation, including which steps are mechanical and which require judgment.

Operational control fails easily when it acts on a proxy that only sometimes tracks the property that matters.

Requirements-based coverage is one example of measuring at the semantic unit that matters.

Doc-derived tests mark the other end of the spectrum.

An executable model earns more than documentation value when tools consume it directly.

Put the pieces together and operation becomes a recurring rhythm.

Lesson4.5-packaging-the-method-as-skills 4.5-packaging-the-method-as-skills

The three examples share a construction pattern, drawn in [ref:skill-recipe].

A reusable procedure helps only if the actor reaches it when it matters.

Self-governance packages Modeling and Alignment as a procedure the agent can apply to its own engineering work.

Governance mechanisms and other durable engineering assets can become capital when their continuing value exceeds their carrying cost; they can also depreciate.

Self-operate packages the previous chapter's lifecycles, recovery paths, runbook step types, and operating heuristics.

Self-communicate packages a different craft: engineer-facing prose and technical drawing.

Module 5 — The Evidence

After Module 5 — the reader can
  • analyzeAfter this Part, the reader can trace how the method grew from a single reviewer to a multi-agent engineering organization in one real system, and relate each governance move to the problem that forced it. declared

Lesson5.1-the-problem-and-the-bar 5.1-the-problem-and-the-bar

The Americans with Disabilities Act requires a public university to communicate with people who have disabilities as effectively as it communicates with everyone else.

The cost is easiest to see in one deck.

A document is a visual and semantic artifact: text, figures, tables, reading order, hierarchy, emphasis — the small tricks by which humans convey meaning to other humans.

Lesson5.2-the-build 5.2-the-build

The project began in a committee meeting about the very deadline the last chapter described.

The build moved through seven recognizable stages, visible only in retrospect.

The growing engineered environment is visible in one especially easy-to-count class of artifacts: project-specific lints and gate scripts.

Another coarse measure shows where the engineering effort accumulated.

The feature list is less revealing than where engineering judgment went: defining what *accessible* meant operationally; discovering abstractions for unfamiliar formats and workflows; distinguishing local defects from missing representation or authority; building independent evidence; coordinating the fleet; and operating failures that crossed code, infrastructure, and deployment boundaries.

Lesson5.3-the-road-to-mage 5.3-the-road-to-mage

A user uploads a file.

MAGE applies at two scales in this case.

Not every consequential structure was born from failure.

I made one useful decision about DocAble early, and came to a second only much later.

The balance changed as the pipeline grew.

By then the way the passes composed had become too complicated to understand comfortably from the implementation alone, and the computation graph gave us a way to reduce it.

The episode changed how I think about degrees of freedom.

The five rungs are retrospective names for the changing center of gravity of my work—co-coder, QA, review lead, tech lead, architect—not a prescribed career ladder.

Explicit models changed what could be established mechanically.

Lesson5.4-failures-that-became-infrastructure 5.4-failures-that-became-infrastructure

**Problem.** By April the system had reached roughly 300,000 lines.

**Problem.** The service cost tens of dollars a day while idle on a Kubernetes cluster.

**Problem.** My merge-train cron kept stalling when two agents edited the same file.

**Problem.** Two incidents, close together, made "done is a claim" non-negotiable.

**Problem.** Late in the same stretch, an agent wrote me a content-free detector: if an image's pixels barely vary, skip the vision model and mark it decorative.

The failures so far were about operating the fleet.

**Problem.** A corrupted document once took four cross-file hops to trace back to the pass that wrote it.

**Problem.** A document's repair stalled in silence.

One conversion is small enough to state in a sentence.

Some useful structures were designed from known obligations rather than produced by incidents.

Step back from the individual incidents and one pattern does recur.

Lesson5.5-mage-in-the-wild 5.5-mage-in-the-wild

The organizations begin with different problems.

Across the six sources, four moves recur strongly enough to form a shared baseline.

The differences are as informative as the commonalities.

One difference is stark.

The industrial reconstructions show something the single-engineer origin cannot: how these moves operate across an organization.

The six organizations do not converge on one stack, one degree of autonomy, or one modeling discipline.

Module 6 — The Profession

After Module 6 — the reader can
  • evaluateAfter this Part, the reader can evaluate the method's implications for the discipline — where the judgment moved, what stays human, and where models become a common language of mature engineering. declared

Lesson6.1-toward-a-theory-of-mage 6.1-toward-a-theory-of-mage

[ref:mage-dynamic-model] puts the theory on one diagram.

Apparatus quantity is not a proxy for environment quality.

A theory of agentic engineering should distinguish activity from progress.

Three predictions form the core of the theory.

The Representation-Leverage prediction rests on the scale problem introduced in Part I.

The amortization prediction depends on what durable structure gives later work.

Modeling and Alignment are distinct engineering activities.

Not every unmodeled choice is a degree of freedom.

Lesson6.2-scope-conditions 6.2-scope-conditions

**Does the investment earn a return?** Recurrence is the usual source of return.

MAGE's return varies by engineering surface within a system.

MAGE becomes a bad bargain in two broad ways.

Lesson6.3-what-the-theory-predicts 6.3-what-the-theory-predicts

Brownfield software raises the first problem immediately: can a useful engineering model be recovered from a system that was never built around one?

Governance conversion remains primarily an act of judgment.

The economic predictions are the least settled of the three families.

The hypotheses do not require eight unrelated studies.

This design should vary or observe engineered-environment quality while tracking durable throughput, defect escape, and human-attention burden over weeks or months.

It should compare engineering surfaces that differ in representation and governance while holding as much surrounding repository context constant as possible.

It should follow one failure class through its whole life: first occurrence, repeat exposure, structural recognition, local repair, any durable conversion, propagation to later work, later recurrence, and eventual maintenance or retirement of the resulting asset.

All three designs require credible measures of durable throughput, human-attention burden, environment quality, and engineering-capital return.

Lesson6.4-reorganization-of-se 6.4-reorganization-of-se

A reasonable objection begins with a fact: **software engineers do not spend most of their workweek typing code.** This result predates generative AI.

The first generation of agentic software-engineering research inherited the engineering object already in front of it: a repository and a software-development task.

The dream is older than the present substrate.

One important professional competence is **representation engineering**: choosing, creating, maintaining, and connecting the artifacts through which humans and machines reason about a system.

A useful model changes the grain of work.

Agentic environments also make semantic inconsistency more expensive.

Dynamic context injection (Section 4.5) provides a concrete example.

Implementation shifts; responsibility does not.

Code review does not disappear when agents produce the code.

Lesson6.5-software-rejoins-engineering 6.5-software-rejoins-engineering

Older engineering disciplines had stronger reasons to separate representation from realization.

The Siemens reconstruction illustrates what this looks like in a model-first engineering culture.

Software's economics differed from those of older engineering disciplines.

Models are the language of engineering because engineers rarely reason about every relevant property directly from the realized artifact.

A useful model need not be "equal to the code." It must maintain the **correspondence it claims**.

Models already earn value by helping engineers and agents reason about a system and by organizing claims and evidence for assurance.

Neither frontier should be confused with a destination for software engineering as a whole.

Part V left an economic question hanging.

The obvious answer — the agents made the programmer more productive — is not wrong so much as incomplete.

Software engineering has asked related questions before.

With that boundary in place, the conjecture can be stated plainly.

MAGE adds a cost category that source-centric measures make easy to miss: the governed engineering environment itself.

This reframes the apparent DocAble paradox.

MAGE does not claim to have discovered models, constraints, verification, external memory, structured reasoning, or autonomous software agents.

Lesson6.6-education-research-open-problems 6.6-education-research-open-problems

MAGE increases both the leverage of engineering knowledge and the consequences of getting it wrong.

Imagine an agentic system in which the fleet constructs most of the implementation, maintains selected engineering representations, runs validators, and assembles evidence for the claims the design is supposed to satisfy.

If engineers increasingly review systems through representations and evidence rather than reconstructing every property from implementation, education should shift accordingly.

Most of the foundations remain.

Less educational effort may need to go toward producing routine implementation by hand, and more toward selecting abstractions, specifying properties, measuring systems, validating claims, reasoning about quality attributes, and governing autonomous work.

A capstone should therefore demonstrate more than a working artifact.

A harder workforce implication is best stated as a risk rather than a forecast.

Module 7 — Part 7

Lesson7.1-the-part-that-stays-yours 7.1-the-part-that-stays-yours

In the Preface, we asked:

Strip MAGE to three engineering moves and this is what remains.

We began with a machine capable of building almost anything you describe—and only what you describe.