Skip to content

Commit 8c9d572

Browse files
docs: update README, commands, and architecture for new CLI flow
1 parent 391c9e1 commit 8c9d572

3 files changed

Lines changed: 200 additions & 234 deletions

File tree

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,23 @@ Requires Python 3.11+. [uv](https://github.com/astral-sh/uv) recommended.
3838
## Quick Start
3939

4040
```bash
41-
STUDY=runs/congestion-tax && DB=$STUDY/study.db && mkdir -p $STUDY
41+
cd runs/congestion-tax # study folder with study.db
4242

43-
# Build population + network
44-
extropy spec "500 Austin TX commuters" -o $STUDY/base.yaml -y
45-
extropy extend $STUDY/base.yaml -s "Response to $15/day congestion tax" -o $STUDY/population.yaml -y
46-
extropy sample $STUDY/population.yaml --study-db $DB --seed 42
47-
extropy network --study-db $DB -p $STUDY/population.yaml --seed 42
43+
# Build population + scenario
44+
extropy spec "Austin TX commuters" -o population.v1.yaml -y
45+
extropy scenario -s "Response to $15/day congestion tax" -o scenario/congestion-tax -y
46+
extropy persona -s congestion-tax -y
47+
48+
# Sample + network
49+
extropy sample -s congestion-tax -n 500 --seed 42
50+
extropy network -s congestion-tax --seed 42
4851

4952
# Run simulation
50-
extropy scenario -p $STUDY/population.yaml --study-db $DB -o $STUDY/scenario.yaml -y
51-
extropy simulate $STUDY/scenario.yaml --study-db $DB -o $STUDY/results --seed 42
53+
extropy simulate -s congestion-tax --seed 42
5254

5355
# Results
54-
extropy results --study-db $DB
55-
extropy results --study-db $DB --segment income
56+
extropy results
57+
extropy results --segment income
5658
```
5759

5860
## How It Works

docs/architecture.md

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
Extropy has three phases, each mapping to a package under `extropy/`.
44

5+
## CLI Pipeline
6+
7+
```
8+
extropy spec → extropy scenario → extropy persona → extropy sample → extropy network → extropy simulate → extropy results
9+
```
10+
11+
All commands operate within a **study folder** — a directory containing `study.db` and scenario subdirectories. Data is keyed by `scenario_id` rather than `population_id`.
12+
513
---
614

715
## Phase 1: Population Creation (`extropy/population/`)
@@ -242,22 +250,44 @@ All Pydantic v2:
242250

243251
## Storage (`extropy/storage/`)
244252

245-
Canonical store: `study.db` (SQLite)
253+
Canonical store: `study.db` (SQLite) in the study folder root.
254+
255+
### Study Folder Structure
256+
257+
```
258+
my-study/
259+
├── study.db # Canonical data store
260+
├── population.v1.yaml # Base population spec
261+
├── scenario/
262+
│ └── my-scenario/
263+
│ ├── scenario.v1.yaml # Scenario spec (references base_population)
264+
│ ├── persona.v1.yaml # Persona rendering config
265+
│ └── network-config.yaml # Optional custom network config
266+
└── results/
267+
└── my-scenario/ # Simulation outputs
268+
```
246269

247270
### Tables
248271

249-
| Table | Contents |
250-
|-------|----------|
251-
| `agents` | Sampled agent attributes (JSON) |
252-
| `network_edges` | Social graph edges with weights and types |
253-
| `agent_states` | Current simulation state per agent |
254-
| `exposures` | Exposure records with source and channel |
255-
| `memory_traces` | Agent memory entries |
256-
| `timeline` | Simulation events (JSONL-style) |
257-
| `timestep_summaries` | Per-timestep aggregates |
258-
| `simulation_runs` | Run metadata and status |
259-
| `simulation_metadata` | Checkpoint state |
260-
| `chat_sessions` | Post-sim agent chat sessions |
272+
| Table | Contents | Key |
273+
|-------|----------|-----|
274+
| `agents` | Sampled agent attributes (JSON) | `scenario_id` |
275+
| `network_edges` | Social graph edges with weights and types | `scenario_id` |
276+
| `agent_states` | Current simulation state per agent | `run_id` |
277+
| `exposures` | Exposure records with source and channel | `run_id` |
278+
| `memory_traces` | Agent memory entries | `run_id` |
279+
| `timeline` | Simulation events (JSONL-style) | `run_id` |
280+
| `timestep_summaries` | Per-timestep aggregates | `run_id` |
281+
| `simulation_runs` | Run metadata and status | `run_id` |
282+
| `simulation_metadata` | Checkpoint state | `run_id` |
283+
| `chat_sessions` | Post-sim agent chat sessions | `session_id` |
284+
285+
### Scenario-Centric Keying
286+
287+
Agents and network edges are keyed by `scenario_id`, not `population_id`. This allows:
288+
- Multiple scenarios to share a base population spec
289+
- Each scenario to have its own extended attributes merged at sample time
290+
- Clear association between agents/network and their scenario context
261291

262292
---
263293

0 commit comments

Comments
 (0)