# `core/worldmodel/types.ts`

<p class="generated-note">Generated from the exports of <a href="https://github.com/altasystem-ai/alta/blob/main/core/worldmodel/types.ts"><code>core/worldmodel/types.ts</code></a> · <code>npm run docs:gen</code></p>

The neutral world model: what exists on the machine, read from the system map (alta.map/1). No universe word lives here: an entity has a neutral kind, and each universe decides how it looks and what it is called.

**Standards that cite this file**: No standard page cites this file yet.

## Exports

### `Provenance` 
```ts
type Provenance = "measured" | "stale" | "declared" | "example" | "mock";
```

### `EntityState` 
```ts
type EntityState =
  | "running" | "building" | "degraded" | "incomplete" | "paused" | "dormant" | "archived"
  | "available" | "declared" | "unknown"
  | "ok" | "error" | "disabled" | "absent";
```

### `ENTITY_KINDS` 
Neutral kinds. Every universe must give each of them a label (tests/universe-contract.test.ts).

```ts
const ENTITY_KINDS = [ "core", // the main agent at the centre (memory, the one you talk to) "agent", // one of the four core agents around …
```

### `EntityKind` 
```ts
type EntityKind = (typeof ENTITY_KINDS)[number];
```

### `AGENT_ROLES` 
```ts
const AGENT_ROLES = ["daemon", "architect", "operator", "reviewer", "guardian"] as const
```

### `AgentRole` 
```ts
type AgentRole = (typeof AGENT_ROLES)[number];
```

### `ELEMENTS` 
```ts
const ELEMENTS: Record<AgentRole, "Earth" | "Wood" | "Fire" | "Metal" | "Water">
```

### `Source` 
```ts
interface Source {
  file?: string;
  key?: string;
  cmd?: string;
  probe?: string;
}
```

### `Entity` 
```ts
interface Entity {
  id: string;
  kind: EntityKind;
  /** The real name on the machine (module id, automation name). Never translated by a universe. */
  name: string;
  state: EntityState;
  prov: Provenance;
  src: Source | null;
  /** Agent role for core/agent entities, or the agent an automation belongs to. */
  role?: AgentRole;
  /** Seconds between runs, for automations. */
  periodS?: number | null;
  enabled?: boolean;
  /** Lines saying what is missing or failing, straight from the map. */
  notes?: string[];
  measuredAt?: string | null;
}
```

### `Balance` 
```ts
interface Balance {
  /** 0 = calm water, 1 = every control pair over its limit. Null when nothing was measured. */
  value: number | null;
  pairs: { who: string; state: string; over: boolean }[];
}
```

### `WorldState` 
```ts
interface WorldState {
  schema: string;
  generatedAt: string | null;
  owner: string | null;
  /** True when the state comes from a demo fixture, not this machine. */
  demo: boolean;
  entities: Entity[];
  balance: Balance;
  counts: { measured: number; declared: number; mock: number; total: number };
}
```
