Closing: Seven Rules for Agent Engineers
Prerequisite: Lesson 32: Architectural hindsight and production considerations, the last technical lesson in this arc. After this lesson, you can: state the seven transferable rules this whole arc was building toward without needing the sovereign-agent codebase in front of you, and describe exactly what a green ticket, a verified manifest, and a completed state transition do and don't tell you about whether an agent's output is true.
Five lessons ago, this arc opened on a code review of functions that didn't exist: add, multiply, divide, produced with every structural guarantee sovereign-agent offers intact. That single fact is the essential idea of everything since: "it ran" is not "it worked." Every silent failure across this arc had a green ticket, a verified manifest, a completed state transition, and was still wrong. Hold that, because it's the one thing worth taking with you if nothing else survives the week.
What you're leaving with, and what you're not
Here's the misconception worth naming directly before the recap: none of this was building toward "go adopt sovereign-agent." The deck's own closing framing says so in plain language. The homework does not ask you to write this framework from scratch, and the last idea on the last slide is that sovereign-agent "is not a product, it's a foundation." The seven rules below are the transferable content. The repository is just where they happen to be demonstrated.
Memory, IPC, state, logs: one path per session, decided in Lesson 29's Decision 1. Isolation by physics, not by query filter.
Retries create new sessions, they never rewind an old one. Decision 2. A retry with different inputs stays explicit instead of hiding inside a mutated field.
Every planner call, executor turn, and tool invocation writes an append-only record. Decision 3. History is never lost because it's never edited, only added to.
Two processes hand off by writing a .tmp file and renaming it. Decision 5. No broker, no half-written file a reader could ever observe.
Not finer, not coarser. Decision 6. Multi-file consistency without deadlocks, because there's exactly one lock to reason about per session.
The LLM is going to wrap its output in fences some percentage of the time no matter what the prompt says: Decision 7's own measurements were roughly 40% for MiniMax-M2.5, 15% for Qwen3, 5% for GPT-4, despite an explicit "no markdown fences" instruction in every case. Assume it, and parse for what the model actually does.
Structural correctness and semantic correctness are different claims. Lesson 31 named this explicitly: tickets prove an operation happened; only a scenario-specific check proves the output used it truthfully.
If you carry these seven into your next job, you will look like someone who has shipped production agent systems, because you will have done the thinking that produces them, on a compressed timeline, with the traces to show for it.
Here's the whole arc in one picture. Not a new idea, just the seven rules pinned to the specific failures that made each one necessary:
That's the central claim of five lessons in one shape: every rule on the left half of this course closes a specific failure on the right, and every one of them was necessary precisely because a green ticket never proved the output was true. Only Rule 7 checks that directly, which is why it's the rule with no exceptions.
The five-week assignment
Released today. Due 2026-05-22, 23:59 UTC-12, five weeks out. Target time: 18-24 hours, spread across those weeks, not compressed into the last one.
The task: extend sovereign-agent into a full hybrid pub-booking system. The loop half researches venues via a real LLM, the same way the demo you watched did. The structured half takes manager callbacks, this time via Rasa CALM plus voice, and enforces a real escalation rule: a deposit over £300 escalates.
"Sort the pub for tonight. 160 people, vegan options, quiet corner for a webinar segment. Deposit max £300. Confirm by 5 PM."
The shape is the same one you've seen all arc: loop half searches, checks weather, estimates cost, picks a candidate; a handoff fires and writes to ipc/; the structured half (now Rasa CALM) handles the manager callback by voice; a rule fires on the deposit threshold, either escalating or committing; memory gets written to sessions/sess_xxx/memory/. All four steps stay visible on disk and debuggable by cat, because that's the whole architectural bet this arc has been making.
You are not being asked to write the framework from scratch. Sovereign-agent is the substrate. Build on top of it.
What to do this week, in order
- Today, after this lesson:
git pull upstream/main && make install && make verify. Get the scaffold running now. Ifmake verifyfails, file an issue tonight; don't sit on it until next week. - By Monday: read
final_assignment/README.mdandASSIGNMENT.mdin full. Skim all five exercises so you know the shape of what's ahead. - Next weekend: finish Exercise 5 (the loop-half scenario) and start Exercise 6 (Rasa integration).
- Weeks 3-4: Exercises 6 through 8.
- Week 5: polish, the Exercise 9 reflection, an end-to-end test,
make check-submit, push.
If you start in the last week, you will not finish. The 18-24 hour estimate assumes the work is spread, not crammed.
Further reading, credited by name
Two lists, and the point of both is the same: sovereign-agent's patterns are not original inventions, they're convergent with a body of existing work. Read the sources instead of trusting the summary.
On the technique side: ReAct (Yao et al., 2022, arXiv:2210.03629) is the pattern the executor implements. Read it once to see how the field arrived here. Reflexion (Shinn et al., 2023, arXiv:2303.11366) is the self-improvement pattern episodic memory enables. SWE-agent (Yang et al., 2024) is the origin of "give the agent a typewriter, not a console": the session-directory pattern descends from this directly. Anthropic's engineering post "Don't Build Multi-Agents" argues why splitting into many agents is usually the wrong call; sovereign-agent's two-halves design is offered as the deliberate, responsible exception to that argument, not a contradiction of it.
On the production side: NanoClaw's src/group-queue.ts is worth two hours of reading to see where several of sovereign-agent's patterns originated. OpenHands (formerly OpenDevin) is the closest open-source production agent system; its Docker runtime code is directly relevant to the container-isolation gap from the previous lesson. Aider keeps per-repo state in a .aider/ directory, the same pattern at a simpler scope. Claude Code's internals carry the sub-agent isolation pattern this course inherits indirectly. Cognition AI's Devin posts are sparser than the academic papers but sharper on what actually breaks in production.
| Source | What it contributes | Descends into sovereign-agent as |
|---|---|---|
| ReAct (Yao et al., 2022) | The reason-act-observe loop | The Executor's core cycle |
| Reflexion (Shinn et al., 2023) | Verbal self-critique as a learning signal | The pattern episodic memory enables |
| SWE-agent (Yang et al., 2024) | "Give the agent a typewriter, not a console" | The session-directory pattern |
| Anthropic, "Don't Build Multi-Agents" | Why splitting into many agents is usually wrong | The exception sovereign-agent argues for, not against |
| NanoClaw | src/group-queue.ts | Several of this course's own queue patterns |
| OpenHands | Docker runtime isolation | The container-isolation gap named last lesson |
| Aider | Per-repo .aider/ state | The same pattern, at a simpler scope |
| Claude Code | Sub-agent isolation internals | Inherited indirectly |
Read two of these and the convergence becomes obvious: different teams, different codebases, the same architectural decisions.
The thing worth remembering after everything else fades
"It ran" is not "it worked."
Every silent failure across this arc had a green ticket, a verified manifest, a completed state transition, and every one of them was wrong — a review of code that didn't exist, a report citing papers that didn't exist, a plan handed to a structured half that didn't exist. Structural correctness is what a framework gives you for free. Semantic correctness is what your scenario has to verify for itself. Don't ship without doing that verification.
Closing
This course does not continue past this lesson. What comes next is yours: the five-week build, and after that, the seven rules applied to whatever you build after this course is a memory. A reasonable next step, once the homework is behind you, is to take your own capstone build and hold it against these seven rules directly: session boundaries, forward-only state, an audit trail, atomic handoffs, the right lock granularity, defensive parsing, and a dataflow check with no exceptions. See how many of the seven your own system can honestly claim.
Five weeks, five lessons a week, closed. Revisit any lesson, or take the seven rules straight to the homework assignment due 2026-05-22.
Reply here and it goes straight to Rod. Same as replying to one of his emails.