CHAPTER 12 · SOURCE MAP

How 79 Workspace Members Form a Product

The root Cargo.toml lists 79 members, of which crates/codegen/ accounts for 62. To understand this system, read along five main axes: composition entry, interaction layer, Agent host, domain capabilities, and inference state.

Learning Objective
Be able to locate the product's main axes from the root workspace manifest, and distinguish the binary composition entry, TUI library, Shell Agent host, and session state components.
Core Visual · Teaching Architecture Diagram
pager-binComposition Entry xai-grok-pagerTUI & Interaction xai-grok-shellAgent Host agent / toolsworkspace domain xai-grok-samplerModel requests & streaming events xai-chat-stateconversation / token / persistence compaction spans Agent strategy, Shell session flow, and token estimation
79

Workspace members

The actual member count in the root manifest. The first line of the root file notes that it is an auto-generated workspace root.

62

Codegen members

The bulk is concentrated in crates/codegen/, plus build, common, prod, and third_party.

5

Reading Axes

Composition entry, TUI, Shell host, domain capabilities, inference and state — avoid projecting a fictitious four-layer directory structure.

Real Source Code Evidence
Cargo.toml
# Auto-generated workspace root.
[workspace]
resolver = "2"
members = [
  "crates/build/xai-proto-build",
  "crates/codegen/xai-grok-pager-bin",
  "crates/codegen/xai-grok-shell",
  ...
]
crates/codegen/xai-grok-pager-bin/Cargo.toml
# Composition-root binary for the Grok Build TUI.
[[bin]]
name = "xai-grok-pager"
path = "src/main.rs"

# Agent runtime + leader/stdio/headless entry points.
xai-grok-shell = { workspace = true }
Source Code Snapshot Note: This page is verified against a locally synced copy. That copy has no .git metadata, so no specific commit version is claimed.
Classroom Exercise
01

Trace Dependencies to Responsibilities

Starting from xai-grok-pager-bin/Cargo.toml, identify the TUI library and Agent host dependencies. Then go to xai-grok-sampler/src/actor/mod.rs and xai-chat-state/src/actor/mod.rs and note the state owned by each.

Takeaway: 79 members is a workspace fact; 62 codegen members is a count fact. The product's runtime axis extends from the pager-bin composition entry through pager, shell, domain crates, sampler, and chat-state.