Commit graph

6 commits

Author SHA1 Message Date
jedarden
e7a60894ac test(acb-map-evolver): add comprehensive tests for weekly schedule
Added tests for:
- TestNextScheduledTime: verifies correct calculation of next scheduled
  run time across various scenarios (same-day future, same-day past,
  different weekdays, edge cases around midnight)
- TestWeeklyScheduleEnvParsing: validates environment variable parsing
  for the WEEKDAY:HH:MM format, including valid and invalid inputs

These tests ensure the weekly automated map evolution ticker (§14.6)
correctly schedules evolution runs at the configured time.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 09:32:51 -04:00
jedarden
b31c306013 feat(acb-map-evolver): add weekly automated run wiring per plan §14.6
- Implement runWeeklyLoop() function that waits for scheduled time and
  runs evolution for all player counts (2, 3, 4, 6) weekly
- Add --weekly flag to enable weekly mode (default: Sunday 03:00 UTC)
- Add --weekly-schedule flag for custom schedule (WEEKDAY:HH:MM format)
- Add ACB_WEEKLY_SCHEDULE env var for configuration

feat(acb-evolver): add weekly map evolution ticker

- Add MapEvolutionEnabled and MapEvolutionSchedule to RunConfig
- Add --enable-map-evolution flag to acb-evolver run subcommand
- Add startMapEvolutionTicker() goroutine that runs weekly
- Ticker executes acb-map-evolver --once to trigger map breeding
- Configurable via ACB_MAP_EVOLUTION_ENABLED and ACB_MAP_EVOLUTION_SCHEDULE

This integrates map evolution into the bot evolver's deployment,
allowing weekly automated map evolution based on engagement scores
as specified in plan §14.6.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 09:15:19 -04:00
jedarden
90431344e8 fix(map-evolver): add missing --once flag parsing
The --once mode was implemented but the command-line flag was not being
parsed. This commit adds the flag parsing and help text for --once, which
enables the weekly automated map evolution run from the evolver.

The evolver's weekly ticker (run.go) calls acb-map-evolver --once to
trigger map evolution on Sundays at 03:00 UTC as specified in plan §14.6.
2026-05-04 03:31:33 -04:00
jedarden
42e9561e46 feat(map-evolver): bias energy toward center, carve corridors to force contact
Energy node placement now uses a tiered radius distribution: 30% in the
contested central zone (0.05-0.20 from center), 40% in the mid-zone
(0.20-0.40), and 30% in the home zone (0.40-0.60). Previously nodes were
placed uniformly at 0.20-0.70, letting bots farm their home quadrant
indefinitely without crossing the midline.

After cellular automata wall generation, a 3-wide corridor is carved from
each core straight to the map center, plus a 5x5 open arena at the center
tile. This creates lanes that funnel bots into contact — replicating the key
mechanic that drove frequent fights in the original AI Challenge Ants game,
where symmetric food spawning near the midfield forced both colonies to
expand outward and collide.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 18:56:39 -04:00
jedarden
181e846d8a feat(map-evolver): bootstrap empty maps table and containerize
- Add seedIfEmpty: idempotent startup seeding (20 maps per player count,
  ON CONFLICT DO NOTHING) using cellular-automata generation + validate()
- Add continuous evolution loop across all player counts (2/3/4/6)
- ACB_MIN_SEED_COUNT and ACB_EVOLUTION_PERIOD configurable via env vars
- Add Dockerfile (lean Alpine build, no language runtimes)
- Add acb-map-evolver to acb-build.yml CI pipeline
- Add staging K8s Deployment manifest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 08:05:51 -04:00
jedarden
a5859df795 Add map evolution pipeline (cmd/acb-map-evolver)
Phase 9 implementation: Map Evolution (§14.6)
- Parent selection weighted by engagement × vote multiplier
- Crossover with sector-based wall inheritance
- Symmetry-preserving mutation (wall flips, energy node shifts)
- Validation: connectivity, wall density bounds, energy node access
- Smoke test validation (simplified: connectivity + energy count checks)
- PostgreSQL maps, map_votes, map_fairness tables for lifecycle management
- Maps stored with status: active, probation, retired, classic

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 02:35:33 -04:00