amogus/docs/development.md
Antigravity 071906df59 feat: Complete LLM agent framework with fog-of-war, meeting flow, and prompt assembly
- Core engine: simulator, game mechanics, triggers (138 tests)
- Fog-of-war per-player state tracking
- Meeting flow: interrupt, discussion, voting, consolidation
- Prompt assembler with strategy injection tiers
- LLM client with fallbacks for models without JSON/system support
- Prompt templates: action, discussion, voting, reflection
- Full integration in main.py orchestrator
- Verified working with free OpenRouter models (Gemma)
2026-02-01 00:00:34 -05:00

1.6 KiB

Development Guide

Running Tests

# All tests
python3 -m unittest discover -v tests/

# Specific test file
python3 -m unittest tests/test_game.py -v

# Specific test
python3 -m unittest tests.test_game.TestKill.test_successful_kill

Adding New Triggers

  1. Add trigger type to src/engine/triggers.py:
class TriggerType(Enum):
    NEW_TRIGGER = auto()
  1. Add to appropriate category:
STANDARD_TRIGGERS = {..., TriggerType.NEW_TRIGGER}
  1. Fire trigger in game engine:
self._fire_trigger(TriggerType.NEW_TRIGGER, agent_id, {"data": "value"})

Adding New Actions

  1. Add action handler in src/engine/game.py:
def _handle_new_action(self, player_id: str, params: dict) -> dict:
    # Validate + execute
    return {"success": True, "action": "NEW_ACTION"}
  1. Add to _execute_action switch.

  2. Add to priority order in resolve_actions.

Adding New Maps

Create JSON in data/maps/:

{
  "rooms": [
    {
      "id": "room_id",
      "name": "Display Name",
      "tasks": [{"id": "task_id", "name": "Task Name", "duration": 3.0}],
      "vent": {"id": "vent_id", "connects_to": ["other_vent"]}
    }
  ],
  "edges": [
    {"id": "edge_id", "room_a": "room1", "room_b": "room2", "distance": 5.0}
  ]
}

Environment Variables

Variable Purpose
OPENROUTER_API_KEY LLM API authentication

Code Style

  • Python 3.10+ features (type hints, dataclasses)
  • JSON for all config (YAML optional, falls back to JSON)
  • Tests mirror source structure (src/engine/game.pytests/test_game.py)