# ericguo202/hackprincetonf26 architecture

> Architecture diagram of the GitHub repository ericguo202/hackprincetonf26, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ericguo202/hackprincetonf26
- Repository: https://github.com/ericguo202/hackprincetonf26

## Overview

Built World Sandbox is a multiplayer browser house-tour game: players explore a real-data neighborhood and scanned homes, furnish rooms by hand or through an AI concierge, search and audit listings, and can switch into foam fights. Offline, worldgen builds the block, house scans, audit data, and furniture catalog into packs; at runtime the web client reads those packs and exchanges shared state with the game server, while the agent reads packs and commits plans through the game API. Relationships among less-sampled subsystems follow README descriptions; source excerpts are limited, so uncertain implementation-level links are omitted.

Main entry points: [`worldgen/pack.py`](https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/pack.py) (Published world packs), [`worldgen/build_block.py`](https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/build_block.py) (World pack builder), [`apps/agent/agent/tools.py`](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/agent/tools.py) (Furnishing and search tools), [`apps/game/src/rooms/NeighborhoodRoom.ts`](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/game/src/rooms/NeighborhoodRoom.ts) (Block room server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_offline["Offline world data"]
  node_worldgen["World pack builder<br/>[build_block.py]"]
  node_blockgen["Neighborhood geometry<br/>[block_combined.py]"]
  node_housegen["Scanned house assets<br/>[build_house.py]"]
  node_cataloggen["Furniture catalog<br/>[build_catalog.py]"]
  node_auditgen["Listing audit<br/>[audit.py]"]
  node_packs[("Published world packs<br/>[pack.py]")]
end

subgraph group_client["Browser experience"]
  node_webapp["Game client<br/>[App.tsx]"]
  node_worldscene["Block and house scene<br/>[World.tsx]"]
  node_packreader["Pack loading and geometry<br/>[pack.ts]"]
  node_player["Player movement and combat<br/>[Player.tsx]"]
  node_manualfurnish["Manual furnishing"]
  node_furnishui["Catalog and agent UI<br/>[FurnishPanel.tsx]"]
  node_listingui["Listing search interface<br/>[ListingsPanel.tsx]"]
  node_clientnet["Game networking<br/>[game.ts]"]
end

subgraph group_server["Multiplayer runtime"]
  node_gamestate[("Shared game state<br/>[game-state.ts]")]
  node_gameserver["Block room server"]
  node_internalapi["Game internal API<br/>[internal.ts]"]
end

subgraph group_agent["Agent and search"]
  node_agentapi["Agent sessions API<br/>[main.py]"]
  node_runner["Concierge orchestration<br/>[runner.py]"]
  node_agenttools["Furnishing and search tools<br/>[tools.py]"]
  node_layout["Plan layout validation<br/>[validate.py]"]
  node_listingsearch["Listing search and ranking<br/>[search.py]"]
  node_agentpacks["Agent pack access<br/>[packs.py]"]
end

node_buyer(("Home buyer"))
node_model(("Language model"))

node_buyer -->|"plays"| node_webapp
node_webapp -->|"renders"| node_worldscene
node_worldscene -.->|"loads packs"| node_packreader
node_worldscene -.->|"renders players"| node_player
node_buyer -->|"places furniture"| node_manualfurnish
node_manualfurnish -.->|"syncs edits"| node_clientnet
node_buyer -->|"requests furnishing"| node_furnishui
node_furnishui -.->|"sends messages"| node_agentapi
node_buyer -->|"searches homes"| node_listingui
node_listingui -.->|"submits query"| node_agentapi
node_webapp -->|"connects"| node_clientnet
node_clientnet -->|"sends messages"| node_gameserver
node_gameserver -->|"updates state"| node_gamestate
node_agentapi -->|"starts turns"| node_runner
node_runner -->|"invokes tools"| node_agenttools
node_agenttools -.->|"validates plans"| node_layout
node_agenttools -.->|"searches listings"| node_listingsearch
node_agenttools -.->|"reads packs"| node_agentpacks
node_agentapi -->|"posts plans"| node_internalapi
node_internalapi -->|"commits changes"| node_gameserver
node_runner -.->|"uses model"| node_model
node_worldgen -.->|"builds block"| node_blockgen
node_worldgen -.->|"builds interiors"| node_housegen
node_worldgen -.->|"builds catalog"| node_cataloggen
node_worldgen -.->|"runs audit"| node_auditgen
node_blockgen -.->|"writes assets"| node_packs
node_housegen -.->|"writes assets"| node_packs
node_cataloggen -.->|"writes catalog"| node_packs
node_auditgen -.->|"writes audit"| node_packs
node_packreader -.->|"loads assets"| node_packs
node_agentpacks -.->|"reads packs"| node_packs
node_gameserver -->|"broadcasts state"| node_clientnet

click node_worldgen "https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/build_block.py"
click node_blockgen "https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/block_combined.py"
click node_housegen "https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/build_house.py"
click node_cataloggen "https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/build_catalog.py"
click node_auditgen "https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/audit.py"
click node_packs "https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/pack.py"
click node_webapp "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/App.tsx"
click node_worldscene "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/world/World.tsx"
click node_packreader "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/world/pack.ts"
click node_player "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/player/Player.tsx"
click node_manualfurnish "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/world/BuildController.tsx"
click node_furnishui "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/ui/FurnishPanel.tsx"
click node_listingui "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/ui/ListingsPanel.tsx"
click node_clientnet "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/net/game.ts"
click node_gamestate "https://github.com/ericguo202/hackprincetonf26/blob/main/contracts/game-state.ts"
click node_gameserver "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/game/src/rooms/NeighborhoodRoom.ts"
click node_internalapi "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/game/src/internal.ts"
click node_agentapi "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/api/main.py"
click node_runner "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/agent/runner.py"
click node_agenttools "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/agent/tools.py"
click node_layout "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/layout/validate.py"
click node_listingsearch "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/agent/search.py"
click node_agentpacks "https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/data/packs.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_worldgen,node_blockgen,node_housegen,node_cataloggen,node_auditgen,node_packs toneBlue
class node_webapp,node_worldscene,node_packreader,node_player,node_manualfurnish,node_furnishui,node_listingui,node_clientnet toneAmber
class node_gamestate,node_gameserver,node_internalapi toneMint
class node_agentapi,node_runner,node_agenttools,node_layout,node_listingsearch,node_agentpacks toneRose
class node_buyer,node_model toneIndigo
```

## Components

### Offline world data

- [World pack builder](https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/build_block.py): `worldgen/build_block.py`
- [Neighborhood geometry](https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/block_combined.py): `worldgen/block_combined.py`
- [Scanned house assets](https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/build_house.py): `worldgen/build_house.py`
- [Furniture catalog](https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/build_catalog.py): `worldgen/build_catalog.py`
- [Listing audit](https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/audit.py): `worldgen/audit.py`
- [Published world packs](https://github.com/ericguo202/hackprincetonf26/blob/main/worldgen/pack.py): `worldgen/pack.py`

### Browser experience

- [Game client](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Block and house scene](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/world/World.tsx): `apps/web/src/world/World.tsx`
- [Pack loading and geometry](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/world/pack.ts): `apps/web/src/world/pack.ts`
- [Player movement and combat](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/player/Player.tsx): `apps/web/src/player/Player.tsx`
- [Manual furnishing](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/world/BuildController.tsx): `apps/web/src/world/BuildController.tsx`
- [Catalog and agent UI](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/ui/FurnishPanel.tsx): `apps/web/src/ui/FurnishPanel.tsx`
- [Listing search interface](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/ui/ListingsPanel.tsx): `apps/web/src/ui/ListingsPanel.tsx`
- [Game networking](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/web/src/net/game.ts): `apps/web/src/net/game.ts`

### Multiplayer runtime

- [Shared game state](https://github.com/ericguo202/hackprincetonf26/blob/main/contracts/game-state.ts): `contracts/game-state.ts`
- [Block room server](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/game/src/rooms/NeighborhoodRoom.ts): `apps/game/src/rooms/NeighborhoodRoom.ts`
- [Game internal API](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/game/src/internal.ts): `apps/game/src/internal.ts`

### Agent and search

- [Agent sessions API](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/api/main.py): `apps/agent/api/main.py`
- [Concierge orchestration](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/agent/runner.py): `apps/agent/agent/runner.py`
- [Furnishing and search tools](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/agent/tools.py): `apps/agent/agent/tools.py`
- [Plan layout validation](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/layout/validate.py): `apps/agent/layout/validate.py`
- [Listing search and ranking](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/agent/search.py): `apps/agent/agent/search.py`
- [Agent pack access](https://github.com/ericguo202/hackprincetonf26/blob/main/apps/agent/data/packs.py): `apps/agent/data/packs.py`

### Other components

- **Home buyer**
- **Language model**

## Connections

- Home buyer → Game client: plays (evidence: `README.md`)
- Game client → Block and house scene: renders (evidence: `apps/web/src/App.tsx`)
- Block and house scene → Pack loading and geometry: loads packs
- Block and house scene → Player movement and combat: renders players (evidence: `README.md`)
- Home buyer → Manual furnishing: places furniture (evidence: `README.md`)
- Manual furnishing → Game networking: syncs edits (evidence: `apps/web/src/world/BuildController.tsx`)
- Home buyer → Catalog and agent UI: requests furnishing (evidence: `README.md`)
- Catalog and agent UI → Agent sessions API: sends messages
- Home buyer → Listing search interface: searches homes (evidence: `README.md`)
- Listing search interface → Agent sessions API: submits query
- Game client → Game networking: connects
- Game networking → Block room server: sends messages (evidence: `apps/web/src/net/game.ts`)
- Block room server → Shared game state: updates state (evidence: `apps/game/src/rooms/NeighborhoodRoom.ts`)
- Agent sessions API → Concierge orchestration: starts turns (evidence: `apps/agent/api/main.py`)
- Concierge orchestration → Furnishing and search tools: invokes tools (evidence: `apps/agent/agent/runner.py`)
- Furnishing and search tools → Plan layout validation: validates plans
- Furnishing and search tools → Listing search and ranking: searches listings
- Furnishing and search tools → Agent pack access: reads packs (evidence: `README.md`)
- Agent sessions API → Game internal API: posts plans (evidence: `apps/agent/api/main.py`)
- Game internal API → Block room server: commits changes (evidence: `README.md`)
- Concierge orchestration → Language model: uses model (evidence: `README.md`)
- World pack builder → Neighborhood geometry: builds block (evidence: `worldgen/block_combined.py`)
- World pack builder → Scanned house assets: builds interiors (evidence: `README.md`)
- World pack builder → Furniture catalog: builds catalog (evidence: `README.md`)
- World pack builder → Listing audit: runs audit (evidence: `README.md`)
- Neighborhood geometry → Published world packs: writes assets (evidence: `README.md`)
- Scanned house assets → Published world packs: writes assets (evidence: `README.md`)
- Furniture catalog → Published world packs: writes catalog (evidence: `README.md`)
- Listing audit → Published world packs: writes audit (evidence: `README.md`)
- Pack loading and geometry → Published world packs: loads assets (evidence: `README.md`)
- Agent pack access → Published world packs: reads packs (evidence: `README.md`)
- Block room server → Game networking: broadcasts state (evidence: `README.md`)
