ThinkingCap
ThinkingCap Research And Development CapCom Tooling Book of Doug: The Sermon Layer

Book of Doug: The Sermon Layer

Published 2026-09-20 Updated 2026-11-09 ThinkingCap
Research And Development

The Need

The Book of Doug is the complete body of law. Its laws are evaluated deterministically, so an agent cannot escape a law simply because the model failed to remember it.

That is necessary for enforcement, but it is not sufficient for good behaviour.

If the AI only discovers a law when its proposed action is rejected, the system is constantly correcting behaviour after the fact. We want the model to enter each turn already understanding the laws most relevant to what it is about to do.

The obvious solution would be to place the entire Book of Doug into context on every turn. That is wasteful, increasingly expensive as the Book grows, and likely counterproductive as relevant guidance becomes buried among laws that have nothing to do with the current situation.

We therefore need a second function: the Sermon.

Each Turn Is a Week

Think of every agent turn as a week in the life of a congregation.

Before the week begins, we can see something about what the flock is about to encounter. We have the user's prompt, the intent envelope, the actors involved, the resources being touched, the tools likely to be used, and other contextual signals.

The system should ask:

What does the flock most need to hear this week?

It then selects the small subset of Doug's laws most relevant to the coming turn and places those laws directly into the AI's context.

That selection is the sermon.

Scripture and Sermon Are Different

The distinction is important.

The Book is law. The sermon is preparation.

A law remains binding whether or not it was included in the sermon. The deterministic evaluator continues to judge proposed actions against the authoritative Book of Doug.

The sermon exists so the AI is less likely to propose an unlawful action in the first place.

This gives us two complementary protections:

  1. Contextual guidance: relevant laws ride with the prompt and

shape the model's reasoning before it acts.

  1. Deterministic enforcement: the resulting action is still

evaluated against the authoritative rules regardless of what was placed in context.

The sermon can miss a law. The judge cannot.

The Sermon Selection Step

The agent pipeline should therefore become:

Prompt -\> Intent Envelope -\> Sermon Selection -\> Agent + Relevant Laws -\> Proposed Action -\> Deterministic Judgment -\> Execute

Sermon selection should inspect the shape of the coming interaction and retrieve laws based on signals such as:

The objective is not to find the absolute minimum number of laws. Missing an applicable law is more expensive than carrying one unnecessary law. Selection should therefore lean toward inclusion near uncertain boundaries while still avoiding the cost of sending the entire Book.

The System Should Learn From Judgment

The deterministic judge creates a particularly valuable feedback signal.

If an action is rejected because of Law 47, but Law 47 was not included in that turn's sermon, the enforcement system has discovered a failure in sermon selection.

That event should be recorded.

Over time, the system can learn that prompts, intents, actors, tools, or situations of that shape should cause Law 47 to be included in future sermons.

Repeated violations can therefore improve not only behaviour, but the system's ability to anticipate which laws matter.

The Result

Every law in the Book of Doug ultimately participates in three different functions:

Retrieval ... deciding when the law should be preached.

Guidance ... allowing the AI to reason with the law already in context.

Enforcement ... deterministically preventing an action that violates the law.

The Book remains sovereign. The judge remains deterministic. But the AI no longer walks blindly toward the courthouse.

We see what is coming up this week, choose the sermon the flock needs, and get them ready for it.

Read this page as Markdown: https://console.thinkingcap.com/guest/Research-and-Development/CapCom/Tooling/book-of-doug-sermon-layer.md
Same content, machine form. The whole corpus: /guest/all.md.