中文 Books

Source Atlas

Reading Contract: Use this atlas after the narrative is clear. Open pinned links to verify owners, boundaries, and evidence classes, not to reconstruct the story from scratch.

Pinned source evidence atlas mapping chapter claims to verified owners, public source anchors, and audit rules
Use the atlas after the prose has made a claim: it maps narrative statements to subsystem owners, pinned source lines, and audit classes.

This atlas is the book’s source-audit index. All Codex links point to public GitHub code pinned to commit 569ff6a1c400bd514ff79f5f1050a684dc3afde3. The chapters should be readable without opening these links; the atlas exists so a reader can verify the book’s claims without hunting through the repository.

Audit rule: use an anchor to classify a claim. Direct type, function, constant, workflow, or test behavior counts as verified source. A boundary that emerges from several anchors counts as surrounding contract inference and should stay abstract in prose and figures. Anything that depends on private service internals is not visible and is intentionally absent from this atlas.

Chapter Anchors

Chapter 1: The Architectural Bet: Agent as a Bounded Operating System

Chapter 2: From Distribution Wrapper to Rust Router

Chapter 3: Configuration, Authentication, and Managed Requirements

Chapter 4: The Protocol Boundary

Chapter 5: Threads, Sessions, and Durable State

Chapter 6: The Turn Loop: Where the Agent Becomes an Agent

Chapter 7: Model Providers, Streaming, and Backend Tasks

Chapter 8: Observability: Capture Facts Before You Interpret Them

Chapter 9: Tool Specifications, Routing, and Dispatch

Chapter 10: Shell, Exec Server, and Filesystem Tools

Chapter 11: Patches as a First-Class Editing Protocol

Chapter 12: Hooks and Human Approval

Hook Surfaces

Runtime Hook Outcomes

Approval, Sandbox, and Guardian Boundaries

Chapter 13: Sandboxes, Network Policy, and Platform Boundaries

Chapter 14: The App-Server Contract

Chapter 15: SDKs, Daemons, and Remote Control

Use this group as a surface map, not as proof that every client exposes the same contract. Transport, Python SDK, TypeScript process wrapper, daemon lifecycle, and remote control each own a different edge of the app-server boundary.

  • Transport modes, listen URL parsing, transport events, and connection origin: transport/mod.rs
  • Python SDK public facade, initialize metadata normalization, and generated thread_start: api.py
  • Python SDK one-reader routing, response waiters, turn queues, pending turn replay, and fail_all: _message_router.py
  • Python SDK run-result projection from stream notifications: _run.py
  • TypeScript SDK Codex public API: codex.ts
  • TypeScript SDK event parsing and run() collection: thread.ts
  • TypeScript SDK process wrapper, resume, stdin input, stdout lines, and exit errors: exec.ts
  • Daemon constants, lifecycle commands, start/restart/stop/version, bootstrap, readiness polling, and operation lock: app-server-daemon/src/lib.rs
  • Daemon control-socket probe and app-server version extraction: client.rs
  • PID backend reservation lock, process start, pid-file state reads, stale cleanup, and reservation lock acquisition: backend/pid.rs
  • Remote-control start config, handle, initial status, and websocket runner: remote_control/mod.rs
  • Remote-control client/server envelopes, chunk events, ack cursor, and URL normalization: protocol.rs
  • Remote-control client tracker, stream-id fallback, remote-control connection origin, and outbound task: client_tracker.rs
  • Remote-control websocket state, outbound buffer, connect/reconnect, writer replay, sequence assignment, chunk splitting, and sequence/segment ack handling: websocket.rs
  • Remote-control segment limits, reassembly, out-of-order rejection, and invalid chunk drops: segment.rs

Chapter 16: The TUI as an Event Renderer

Chapter 17: MCP: External Tools Without Runtime Entanglement

Chapter 18: Skills, Plugins, Connectors, and Typed Extensions

Chapter 19: External Migration and Backward Compatibility

Chapter 20: Multi-Agent Coordination

Chapter 21: Cloud Tasks, Identity, and Remote Work

Chapter 22: Memories and User-Level State

Chapter 23: Build Systems and Generated Contracts

Chapter 24: Packaging, Release, and Native Dependencies

Chapter 25: CI, Policy, and Architectural Governance

Epilogue: What to Steal

Reading Order

If you only have one hour for source audit, read in this order:

  1. Submission, Op, Event, and EventMsg to learn the runtime vocabulary.
  2. Codex, CodexThread, and ThreadManager to understand ownership.
  3. session/turn.rs to see the turn loop, hook ordering, sampling, continuation, and completion.
  4. Tool planning, routing, registry, and orchestration to see why tools are governed side effects rather than callbacks.
  5. App-server message processing and TUI rendering to see how clients share the runtime.
  6. Sandbox management, cloud tasks, memory write phases, and release workflows for the advanced subsystems.

Audit Rule

When a chapter and this atlas disagree, treat it as a book bug. The atlas is not a replacement for chapter narrative; it is the compact map that lets the narrative remain source-grounded without turning every chapter into a file listing.