Skip to content

resource

AI Agent Code Ownership and Learner Construction

Distinguish code you construct from supplied runtime and test infrastructure. Track chapter ownership so a working demonstration does not become a false from-scratch claim.

Updated: 2026-09-29 · Status: DRAFT

The teaching target is one cumulative learner-owned agent. The current draft contains a mixture of code constructed in the chapters and supplied reference infrastructure. A checkpoint importing a finished helper demonstrates that helper's behavior; it does not establish that the reader built the helper.

The book keeps its promise: every chapter's checkpoint runs only your code, the standard library and the course's locked dependencies. The table below shows what each checkpoint builds on.

The current executable boundary

Chapter 1 is a direct model-request example with an offline response fixture. Chapter 2 constructs tool arguments, handlers and dispatch in learner/profrod_sovereign_agent_ch02_pydantic_shop_tools_learner.py, reusing Chapter 1's shop data. Chapter 3 constructs the model/tool loop and parsing in learner/profrod_sovereign_agent_ch03_agent_loop_learner.py, and its killable HTTP transport in the chapter's transport learner file. The saved learner files are completed comparison implementations; use your own checkout to construct and change them.

The course gate runs every chapter's checkpoint with sovereign_agent and reference_organizations refused on import, which covers every file it loads, including child processes' learner files. It also fails on any import line naming those packages in a chapter's checkpoint or learner files, including code paths the checkpoint never runs. make test has reported all 21 chapters since 2026-09-30, and a new chapter must pass the same check.

ChapterStable lesson identityWhat the checkpoint builds on (supplied runtime imports: none)
1first-model-callNone: the standard library and the chapter's learner file
2shop-toolsNone: the learner's tool call, dispatcher and shop tools, on Chapter 1's fixture
3agent-loopNone: the learner's loop and killable HTTP transport, on the Chapter 2 learner file
4durable-stateNone: the learner builds the store; the checkpoint imports only the standard library and the learner file
5memoryNone: the learner's memory on their Chapter 4 store, run through the Chapter 2 and 3 learner code
6embeddingsNone: the standard library and the chapter's learner files
7skillsNone: the learner's skill registry, evaluated activation and three-case evaluator, on their Chapter 5 memory, Chapter 3 loop and Chapter 2 dispatcher
8durable-workNone: the learner builds the queue on their Chapter 4 store; the checkpoint runs the learner files for Chapters 2, 3, 4 and 8
9messagingNone: the learner's Telegram channel on their Chapter 8 queue, Chapter 7 context and Chapter 3 loop and transport
10schedulingNone: the learner's clock jobs, stock episodes and unattended serve, on their Chapter 9 channel, Chapter 8 queue and Chapter 4 store
11approvalNone: the learner's approvals, spending ledger and supplier process, on their Chapter 4 store, Chapter 8 queue and Chapter 3 transport
12ambiguous-orderNone: the learner's Chapter 11 send check and supplier process, with this chapter's proxy that loses a committed order's reply
13worker-recoveryNone: the learner's leases, fencing and recovery turn, on their Chapter 11 ledger, Chapter 8 queue and Chapter 4 store
14mcpNone: the chapter's learner client and teaching server, and the standard library
15isolationNone: the learner's untrusted-content tools and MCP catalog on their Chapter 10 worker and Chapter 14 client, and model-written Python under Seatbelt or bubblewrap
16evaluationNone: the learner's evaluation harness on the Chapter 2 dispatcher, Chapter 3 loop and Chapter 7 skills
17improvementNone: the learner's proposals and evaluated changes, on their Chapter 16 harness and Chapter 7 skills
18delegationNone: the learner's delegation contract, role-separated claims and fenced, billed model calls, on their Chapter 13 worker, Chapter 3 loop and Chapter 2 tools
19operationNone: the learner's backup, restore, account recovery and systemd unit, on their Chapter 11 orders and a supplier with account epochs
20acceptanceNone: every earlier chapter's learner store opened as one, with the day's worker and report
21contextNone: the chapter's learner file and the standard library

The intended cumulative construction contract

Every authored chapter must name four categories before the first implementation: definitions consumed from previous learner work, definitions constructed here, standard/third-party infrastructure, and supplied test-only fixtures. A field or helper not introduced earlier must be explained when first used.

The new Chapter 4 builds the store and transaction boundary. Chapter 5 adds memory tables and context selection; Chapter 7 adds versioned skill selection. Chapter 8 builds admission, basic work state and atomic terminal reports. Chapters 9 and 10 become adapters into that same queue. Chapter 13 adds ownership generations and recovery. Chapter 14 builds the bounded MCP connection before Chapter 15 applies separate OS containment.

The finished sovereign_agent and reference_organizations packages remain comparison material. They may not execute essential learner behavior in any chapter's acceptance, and the gate enforces that for every checkpoint. The chapter notebooks carry their own embedded runtimes; this check covers the checkpoints.

Proof that the learner implementation is connected

Start with an empty learner workspace and the declared environment. Follow the printed save/import instructions, then trace an authenticated request through learner admission, context, loop, tools, state, completion and report delivery. The test must observe actual input reaching the learner's function and persisted results leaving it.

For each chapter, deliberately remove or corrupt one essential learner function. An independent behavior check must fail. A test whose expected answer comes from the same function, or whose finished reference runtime silently takes over, cannot prove construction. Keep fixtures and observer queries separate from expected-result generation.

The final day must reconcile the learner's result against the independent controlled supplier ledger. Live Telegram, container and Linux observations have additional explicit facilities and evidence; portable fixture success is recorded separately. See the construction roadmap for remaining deliverables and release conditions.

Keep building with Prof Rod

Found this material through a colleague, classroom or shared download? Get the complete book at profrod.ai/book and join the Prof Rod learner community. Bring one result, one question or one failure you learned from. Share this resource with another learner and keep its source links with it so they can find the full course and future updates.