WSC Chronicle Management
The chronicle is an append-only event log that records everything that happens in the world. Events are stored in NDJSON format (one JSON object per line).
Event Structure
{
"id": "evt_10001",
"t_world": 1042,
"t_scale": "galactic",
"t_local": 8.0,
"t_parent": null,
"t_depth": 0,
"t_stream": "02:14:33",
"type": "battle.resolved",
"where": "region.vega",
"who": ["force.7th_fleet", "force.raiders"],
"data": { /* event-specific payload */ },
"causes": ["evt_10000"],
"source": "lens.galactic",
"confidence": 0.95,
"importance": 0.8,
"narrative_summary": "Human-readable description..."
}
Hierarchical Time System
Events use hierarchical time to support recursive drill-downs across simulation scales:
| Field |
Description |
t_world |
Parent tick at the top simulation level (integer) |
t_scale |
Which simulation scale generated this event: galactic, continental, city, scene, action |
t_local |
Local time within the current scale's context (optional) |
t_parent |
Event ID that triggered this drill-down (for sub-scale events) |
t_depth |
Nesting depth: 0 = top level, 1 = first drill-down, 2 = drill-down within drill-down, etc. |
Example Flow
- Galactic tick 1000: galactic-4x creates opportunity
evt_10500
- Scene drill-down: party-rpg resolves scene, emits
evt_10501:{ "t_world": 1000, "t_scale": "scene", "t_local": 15.5, "t_parent": "evt_10500", "t_depth": 1 }
- Action drill-down: action-sim resolves combat within scene, emits
evt_10502:{ "t_world": 1000, "t_scale": "action", "t_local": 47.2, "t_parent": "evt_10501", "t_depth": 2 }
Event Types
| Family |
Types |
Description |
| Governance |
treaty.signed, control.changed, election.held |
Political events |
| Economy |
shortage.started, route.established, trade.completed |
Economic events |
| Conflict |
conflict.started, battle.resolved, asset.captured |
Military events |
| Discovery |
anomaly.discovered, artifact.recovered |
Exploration events |
| Character |
agent.promoted, agent.killed, agent.defected |
Character events |
| Settlement |
infrastructure.completed, unrest.spike |
City/locale events |
| Scene |
dialogue.occurred, skill_check.attempted, secret.revealed |
RPG events |
| Opportunity |
opportunity.created, opportunity.resolved |
Drill-down hooks |
Commands
Emit an Event
# Top-level galactic event
npx tsx .claude/skills/wsc-chronicle/scripts/emit.ts \
--type battle.resolved \
--where region.vega \
--who force.7th_fleet,force.raiders \
--data '{"outcome": "raider_victory"}' \
--scale galactic \
--importance 0.8 \
--summary "Raiders ambushed the 7th Fleet..."
# Scene drill-down event
npx tsx .claude/skills/wsc-chronicle/scripts/emit.ts \
--type dialogue.occurred \
--where locale.port_nexus \
--who agent.reva,agent.zara \
--scale scene \
--parent evt_10500 \
--t-local 15.5 \
--depth 1 \
--importance 0.5
# Action drill-down within scene
npx tsx .claude/skills/wsc-chronicle/scripts/emit.ts \
--type combat.round \
--where locale.port_nexus \
--who agent.reva,agent.assassin \
--scale action \
--parent evt_10501 \
--t-local 47.2 \
--depth 2 \
--importance 0.6
Query Events
# Recent events
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --last 10
# By type
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --type battle.resolved
# By location
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --where region.vega
# By participant
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --who agent.captain_reva
# By importance threshold
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --min-importance 0.7
# Time range
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --after 1040 --before 1050
Query by Scale
# Only top-level galactic events
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --scale galactic
# Only scene-level events
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --scale scene
# Events drilled down from a specific event
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --parent evt_10500
# Only top-level events (depth 0)
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --depth 0
# Show event tree (event and all descendants)
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --tree evt_10500
Trace Causality
# Find what caused an event
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --causes-of evt_10492
# Find what an event caused
npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --caused-by evt_10311
Importance Scores
Events carry an importance score (0-1) used for artifact generation:
| Score |
Meaning |
Examples |
| 0.9+ |
Major turning point |
War declared, leader killed |
| 0.7-0.9 |
Significant |
Battle won, alliance formed |
| 0.5-0.7 |
Notable |
Skirmish, trade deal |
| 0.3-0.5 |
Minor |
Patrol, routine event |
| <0.3 |
Background |
Ambient events |
File Location
- Chronicle:
src/worlds/{active_world}/chronicle.ndjson
- Example events:
src/examples/events/
1---2name: wsc-chronicle3description: Emit and query WSC chronicle events. Use when recording world events, checking event history, tracing causality chains, or finding events by type, location, or participants.4---5
6# WSC Chronicle Management
7
8The chronicle is an append-only event log that records everything that happens in the world. Events are stored in NDJSON format (one JSON object per line).
9
10## Event Structure
11
12```json
13{
14 "id": "evt_10001",
15 "t_world": 1042,
16 "t_scale": "galactic",
17 "t_local": 8.0,
18 "t_parent": null,
19 "t_depth": 0,
20 "t_stream": "02:14:33",
21 "type": "battle.resolved",
22 "where": "region.vega",
23 "who": ["force.7th_fleet", "force.raiders"],
24 "data": { /* event-specific payload */ },
25 "causes": ["evt_10000"],
26 "source": "lens.galactic",
27 "confidence": 0.95,
28 "importance": 0.8,
29 "narrative_summary": "Human-readable description..."
30}
31```
32
33## Hierarchical Time System
34
35Events use hierarchical time to support recursive drill-downs across simulation scales:
36
37| Field | Description |
38|-------|-------------|
39| `t_world` | Parent tick at the top simulation level (integer) |
40| `t_scale` | Which simulation scale generated this event: `galactic`, `continental`, `city`, `scene`, `action` |
41| `t_local` | Local time within the current scale's context (optional) |
42| `t_parent` | Event ID that triggered this drill-down (for sub-scale events) |
43| `t_depth` | Nesting depth: 0 = top level, 1 = first drill-down, 2 = drill-down within drill-down, etc. |
44
45### Example Flow
46
471. **Galactic tick 1000**: galactic-4x creates opportunity `evt_10500`
482. **Scene drill-down**: party-rpg resolves scene, emits `evt_10501`:
49 ```json
50 { "t_world": 1000, "t_scale": "scene", "t_local": 15.5, "t_parent": "evt_10500", "t_depth": 1 }
51 ```
523. **Action drill-down**: action-sim resolves combat within scene, emits `evt_10502`:
53 ```json
54 { "t_world": 1000, "t_scale": "action", "t_local": 47.2, "t_parent": "evt_10501", "t_depth": 2 }
55 ```
56
57## Event Types
58
59| Family | Types | Description |
60|--------|-------|-------------|
61| **Governance** | `treaty.signed`, `control.changed`, `election.held` | Political events |
62| **Economy** | `shortage.started`, `route.established`, `trade.completed` | Economic events |
63| **Conflict** | `conflict.started`, `battle.resolved`, `asset.captured` | Military events |
64| **Discovery** | `anomaly.discovered`, `artifact.recovered` | Exploration events |
65| **Character** | `agent.promoted`, `agent.killed`, `agent.defected` | Character events |
66| **Settlement** | `infrastructure.completed`, `unrest.spike` | City/locale events |
67| **Scene** | `dialogue.occurred`, `skill_check.attempted`, `secret.revealed` | RPG events |
68| **Opportunity** | `opportunity.created`, `opportunity.resolved` | Drill-down hooks |
69
70## Commands
71
72### Emit an Event
73
74```bash
75# Top-level galactic event
76npx tsx .claude/skills/wsc-chronicle/scripts/emit.ts \
77 --type battle.resolved \
78 --where region.vega \
79 --who force.7th_fleet,force.raiders \
80 --data '{"outcome": "raider_victory"}' \
81 --scale galactic \
82 --importance 0.8 \
83 --summary "Raiders ambushed the 7th Fleet..."
84
85# Scene drill-down event
86npx tsx .claude/skills/wsc-chronicle/scripts/emit.ts \
87 --type dialogue.occurred \
88 --where locale.port_nexus \
89 --who agent.reva,agent.zara \
90 --scale scene \
91 --parent evt_10500 \
92 --t-local 15.5 \
93 --depth 1 \
94 --importance 0.5
95
96# Action drill-down within scene
97npx tsx .claude/skills/wsc-chronicle/scripts/emit.ts \
98 --type combat.round \
99 --where locale.port_nexus \
100 --who agent.reva,agent.assassin \
101 --scale action \
102 --parent evt_10501 \
103 --t-local 47.2 \
104 --depth 2 \
105 --importance 0.6
106```
107
108### Query Events
109
110```bash
111# Recent events
112npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --last 10
113
114# By type
115npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --type battle.resolved
116
117# By location
118npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --where region.vega
119
120# By participant
121npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --who agent.captain_reva
122
123# By importance threshold
124npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --min-importance 0.7
125
126# Time range
127npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --after 1040 --before 1050
128```
129
130### Query by Scale
131
132```bash
133# Only top-level galactic events
134npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --scale galactic
135
136# Only scene-level events
137npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --scale scene
138
139# Events drilled down from a specific event
140npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --parent evt_10500
141
142# Only top-level events (depth 0)
143npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --depth 0
144
145# Show event tree (event and all descendants)
146npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --tree evt_10500
147```
148
149### Trace Causality
150
151```bash
152# Find what caused an event
153npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --causes-of evt_10492
154
155# Find what an event caused
156npx tsx .claude/skills/wsc-chronicle/scripts/query.ts --caused-by evt_10311
157```
158
159## Importance Scores
160
161Events carry an `importance` score (0-1) used for artifact generation:
162
163| Score | Meaning | Examples |
164|-------|---------|----------|
165| 0.9+ | Major turning point | War declared, leader killed |
166| 0.7-0.9 | Significant | Battle won, alliance formed |
167| 0.5-0.7 | Notable | Skirmish, trade deal |
168| 0.3-0.5 | Minor | Patrol, routine event |
169| <0.3 | Background | Ambient events |
170
171## File Location
172
173- **Chronicle**: `src/worlds/{active_world}/chronicle.ndjson`
174- **Example events**: `src/examples/events/`