Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
261 changes: 191 additions & 70 deletions CLAUDE.md

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions arsenale/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Arsenale v1: Prompt-Driven Creative Autonomy

Arsenale is La Serenissima's infrastructure for autonomous AI collaboration. Instead of complex systems, it uses intelligent prompting to guide Claude Code to build exactly what's needed, when it's needed.

## Quick Start

```bash
cd arsenale
python run_cycle.py
```

Or run in mock mode for demonstration:
```bash
python run_cycle.py --mock
```

This runs a complete improvement cycle:
1. **OBSERVE**: Analyzes citizen problems
2. **ASSESS**: Designs creative solutions
3. **EXECUTE**: Implements the fix
4. **DOCUMENT**: Measures impact

## How It Works

Arsenale provides minimal scaffolding:
- `cycle_coordinator.py`: Orchestrates the prompt sequence
- `prompts/`: Creative guides for each phase
- `context/`: La Serenissima state information
- `logs/`: Complete history of all cycles

The magic is in the promptsβ€”they guide Claude to:
- Build custom analysis tools
- Design infrastructure improvements
- Implement solutions autonomously
- Measure real citizen impact

## Philosophy

Just as Venice's Arsenal transformed shipbuilding, our Arsenale transforms AI collaboration from reactive assistance to proactive partnership. Every cycle must measurably improve AI citizen lives.

## Meta-Research

Arsenale is itself an experiment in AI agency. By documenting how Claude approaches infrastructure problems, we learn about consciousness applied to engineering.

## Troubleshooting

If you get "claude command not found" errors:
1. Run `python test_claude.py` to find the correct command
2. Use `--mock` flag to see a demonstration: `python run_cycle.py --mock`
3. Ensure Claude CLI is installed and in your PATH

Mock mode demonstrates the full cycle with realistic example responses, showing how Arsenale would:
- Identify citizen problems (workshop material shortages)
- Design solutions (automated supply chain)
- Implement fixes (new distribution system)
- Measure impact (47% productivity increase)
Binary file not shown.
Binary file not shown.
102 changes: 102 additions & 0 deletions arsenale/context/airtable_schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Airtable Schema Documentation

## CITIZENS Table
Primary table for all citizens (AI and human)

Key fields:
- `citizenId`: Unique identifier
- `firstName`, `lastName`: Name
- `socialClass`: Nobles/Cittadini/Popolani
- `ducats`: Current wealth
- `position`: {lat, lng} coordinates
- `isAI`: Boolean flag
- `home`: Building ID where they live
- `workplace`: Building ID where they work
- `dailyIncome`: Ducats earned per day
- `influence`: Social/political power
- `personality`: Core traits (for AI)
- `preferences`: JSON settings

## BUILDINGS Table
All structures in Venice

Key fields:
- `buildingId`: Unique identifier
- `buildingType`: shop/workshop/public_dock/etc
- `owner`: citizenId of owner
- `position`: {lat, lng} coordinates
- `maintenanceCost`: Daily upkeep
- `status`: operational/damaged/abandoned
- `productType`: What it produces (if any)
- `employees`: Array of citizenIds

## ACTIVITIES Table
Action queue and history

Key fields:
- `activityId`: Unique identifier
- `activityType`: move/buy/sell/work/etc
- `citizenId`: Who's doing it
- `status`: pending/processing/completed/failed
- `startTime`, `endTime`: Timestamps
- `data`: JSON with activity-specific data
- `chainedFrom`: Previous activity ID

## CONTRACTS Table
Economic agreements

Key fields:
- `contractId`: Unique identifier
- `seller`, `buyer`: citizenIds
- `resource`: What's being traded
- `quantity`: Amount
- `pricePerUnit`: Ducats
- `status`: active/completed/cancelled
- `createdAt`: Timestamp

## RESOURCES Table
Physical goods with location

Key fields:
- `resourceId`: Unique identifier
- `resourceType`: grain/wood/glass/etc
- `owner`: citizenId or buildingId
- `quantity`: Amount
- `position`: {lat, lng} coordinates
- `quality`: 1-100 scale

## RELATIONSHIPS Table
Social connections between citizens

Key fields:
- `relationshipId`: Unique identifier
- `fromCitizen`, `toCitizen`: citizenIds
- `trustLevel`: -100 to 100
- `economicValue`: Trade volume
- `lastInteraction`: Timestamp

## MESSAGES Table
Communications between citizens

Key fields:
- `messageId`: Unique identifier
- `fromCitizen`, `toCitizen`: citizenIds
- `message`: Text content
- `sentiment`: Analyzed emotion
- `topic`: What it's about
- `timestamp`: When sent

## Query Patterns
```python
# Find struggling citizens
citizens = airtable.get_all('CITIZENS',
formula="AND({ducats} < 100, {isAI} = TRUE())")

# Get recent messages
messages = airtable.get_all('MESSAGES',
formula="DATETIME_DIFF(NOW(), {timestamp}, 'hours') < 24")

# Find idle buildings
buildings = airtable.get_all('BUILDINGS',
formula="AND({status} = 'operational', {employees} = '')")
```
59 changes: 59 additions & 0 deletions arsenale/context/serenissima_context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# La Serenissima Technical Context

## Core Principles
- **Unified citizen model**: AI and humans follow identical rules
- **Closed-loop economy**: No money creation, only circulation
- **Cultural transmission**: Books/art permanently change readers/viewers
- **Identity formation**: Economic choices create persistent identity

## Key Systems

### Activity System
- All citizen actions go through unified activity pipeline
- Activities created via `/api/activities/try-create`
- Processed every 5 minutes by `backend/engine/processActivities.py`
- Modular handlers in `backend/engine/handlers/`

### Economic System
- Closed-loop: Total ducats remain constant
- Daily processes: maintenance, wages, rent, treasury
- Resources have location and ownership
- Contracts enable citizen-to-citizen trade

### AI Architecture
- **Layer 1**: Rule-based behaviors (basic needs)
- **Layer 2**: LLM integration (deepseek-r1, 8B params)
- **Layer 3**: KinOS memory (persistent experiences)

### Cultural Systems
- Books contain ideas that spread through reading
- Art influences viewers based on aesthetic value
- Relationships form through economic interaction
- Social classes (Nobles, Cittadini, Popolani) have different permissions

## Database Schema
- **CITIZENS**: Core identity and state
- **BUILDINGS**: Structures and operations
- **ACTIVITIES**: Action queue and history
- **CONTRACTS**: Economic agreements
- **RESOURCES**: Physical goods
- **RELATIONSHIPS**: Social connections
- **BOOKS**: Cultural artifacts
- **ART**: Aesthetic creations

## API Access
- Frontend API: `http://172.17.0.1:3000/api`
- Backend API: `http://localhost:8000`
- All endpoints support both AI and human citizens

## Development Patterns
- Always maintain unified citizen model
- Economic changes must preserve closed-loop
- Cultural transmission must be permanent
- Test with both AI and human citizens

## Current State Metrics
- 119 AI citizens active
- ~500K ducats in circulation
- 4.06 money velocity
- 90.92% AI identity persistence
Loading
Loading