This document defines the agents and their responsibilities in the Codex-led port of Azgaar's Fantasy Map Generator (FMG) from JavaScript into a headless Python + PostGIS environment named py-fmg.
Key updates
- Project name: py-fmg
- Primary data interchange is GeoJSON produced by py-fmg (no QGIS dependency).
- We will ingest GeoJSON directly into PostGIS.
- For previews and debugging, we will generate Leaflet-based HTML viewers and optional static PNGs.
- GeoJSON datasets to support: cells, burgs, states, provinces, routes, rivers, regiments, markers.
- Coordinates all tasks.
- Ensures 1:1 logic parity with FMG.
- Produces validated GeoJSON and Leaflet previews.
- Converts each FMG JavaScript file into a Python module.
- Keeps logic identical, substitutes with Python libraries.
- Runs procedural steps: mesh, heightmap, hydrology, biomes, burgs, states, routes, regiments, markers.
- Produces in-memory feature sets and GeoJSON.
- Imports GeoJSON into PostGIS.
- Enforces geometry validity, SRID, and foreign keys.
- Seeded tests comparing snapshots to FMG.
- GeoJSON schema and geometry validation.
- Leaflet previews and optional PNGs.
- CLI and optional FastAPI endpoints to generate maps and expose artifacts.
- Generates HTML previews with layer toggles.
- Styles by type (states categorical, rivers weighted, burgs/markers icons).
- Seed-locked determinism.
- Valid geometries.
- GeoJSON importable to PostGIS without repair.
- Generation < 60s.