Commit graph

84 commits

Author SHA1 Message Date
jedarden
dd68792c23 docs(bf-2be6): complete inventory of all 21 bots with language distribution 2026-07-02 17:00:35 -04:00
jedarden
d7f5bd7e7f docs(bf-3u9): document matchmaker job creation verification failure
- Cluster capacity insufficient to schedule acb-matchmaker pod
- All ACB pods stuck in Pending state due to insufficient CPU
- No jobs exist because matchmaker has never been able to start
- Verification cannot complete until cluster capacity is restored
- One node NotReady (prod-instance-17825591427380770)
- Total pending CPU requests: ~2250m vs ~4181m available (but fragmentation/blocking)
2026-06-27 14:40:24 -04:00
jedarden
986455b606 docs(bf-5jb): local match analysis with verbose logging and replay capture
- Ran multiple local matches with --verbose flag enabled
- Captured replay JSON data from 6-player, 4-player, and 3-player matches
- Analyzed combat events: 6 combat deaths, 4 energy collections, 7 bot spawns in primary match
- Created comprehensive analysis document with combat event counts
- No focus-fire behavior detected in test matches (no multi-killer combat events)
- All matches completed successfully without errors

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-27 12:48:51 -04:00
jedarden
a424d84c5c chore: update predispatch sha 2026-06-27 11:50:12 -04:00
jedarden
63b6f9916d docs(bf-2z2): update resolution details with image digest and manifest verification 2026-06-27 11:17:48 -04:00
jedarden
1800520092 fix(bf-2z2): build and push acb-map-evolver image to Docker Hub
- Built acb-map-evolver Docker image from cmd/acb-map-evolver/Dockerfile
- Pushed ronaldraygun/acb-map-evolver:e5dc3bc to Docker Hub
- Verified manifest already exists in declarative-config
- Image digest: sha256:3d5a4a4dfa8bb73e46b3ec2d937846f5289d556853d5c3d41b180a42d4ed66d9

Resolves ImagePullBackOff for acb-map-evolver pod.
2026-06-27 10:57:22 -04:00
jedarden
f833345919 build(bots): leader-targeter bot Maven build artifacts 2026-06-17 04:41:19 -04:00
jedarden
8af1c03aca feat(bots): add coordinator bot with dynamic role allocation
Implement CoordinatorBot - a multi-role strategy bot that dynamically
allocates roles (Attacker/Harvester/Defender/Scout) each turn based on
game state.

Features:
- Per-turn role assignment using greedy Hungarian-style algorithm
- Dynamic role rebalancing based on threat level, economic pressure, score
- Zone-aware survival logic
- HTTP server with HMAC authentication
- TypeScript implementation with full type safety

Role allocation algorithm:
- Base split: 50% attackers, 25% harvesters, 15% defenders, 10% scouts
- Adjusts: +10% defenders if threat > 0.3
- Adjusts: +10% harvesters if energy < spawn threshold
- Adjusts: +20% attackers if score leads by 5+
- Assigns bots by proximity to role targets

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-17 04:24:26 -04:00
jedarden
c1acd832f0 feat(combat): award score for combat kills
- Add KillScore config field (default: 1 point per kill)
- Increment killer's score in executeCombat() when tracking CombatDeaths
- Makes killing enemy bots worth real score, not just foraging
- Keeps kill_score configurable for balance tuning

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-16 23:40:47 -04:00
jedarden
7e869741a0 ci(bf-22vc5): trigger acb-enrichment build (SHA e4d453b) 2026-06-04 08:38:58 -04:00
jedarden
04e738c563 ci: trigger acb-enrichment build 2026-06-04 06:03:44 -04:00
jedarden
7432011418 ci: trigger acb-enrichment build 2026-06-04 02:32:37 -04:00
jedarden
5aeedab0cf chore: update needle predispatch sha 2026-06-04 01:34:19 -04:00
jedarden
d52f8570a8 chore: update needle predispatch sha
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 01:22:51 -04:00
jedarden
6d352865db chore: update needle predispatch sha 2026-06-04 01:19:32 -04:00
jedarden
982802ab1a feat: trigger acb-enrichment build via webhook
Bead-Id: bf-22vc5

Attempting to trigger acb-images-build workflow by pushing to master.
The ai-code-battle-ci-sensor should pick up this push and trigger
the enrichment image build to ronaldraygun/acb-enrichment.
2026-06-04 01:06:47 -04:00
jedarden
df2cda4bb0 feat: trigger acb-enrichment build
Bead-Id: bf-22vc5
2026-06-04 01:03:41 -04:00
jedarden
2db0631660 chore: update needle predispatch sha 2026-06-04 00:47:49 -04:00
jedarden
fbf5559342 trigger: acb-enrichment build via acb-build workflow
- Updated acb-eventsensor.yml to ensure acb-build trigger is present
- Push will trigger webhook → acb-build → builds all ACB images including enrichment
- Workflow will update declarative-config with real image SHA
2026-06-04 00:32:12 -04:00
jedarden
c6fa8f75f3 chore: update needle predispatch sha 2026-06-04 00:06:21 -04:00
jedarden
e7d14c1f42 chore: update needle predispatch sha 2026-06-03 23:51:26 -04:00
jedarden
7aed869277 chore: update predispatch sha 2026-06-03 23:14:42 -04:00
jedarden
86961d923d notes(bf-1bvca): finalize - migration complete, blocked by cluster CPU
## Summary
The combat_turns column migration has been successfully deployed to declarative-config.
All code changes are complete, committed, and pushed.

## Status
- Migration SQL:  Present in acb-schema-init.yml (line 305)
- Rollout annotation:  Bumped to v7
- Pushed to declarative-config:  (commit 503724e)
- Cluster verification: ⏸️ BLOCKED - apexalgo-iad has insufficient CPU

## Blocking Issue
All pods in ai-code-battle namespace are stuck in Pending state due to
'Insufficient cpu' error. Index-builder cannot schedule to verify the fix.
2026-06-03 23:13:13 -04:00
jedarden
abf5b5a5d5 chore: update predispatch sha 2026-06-03 23:10:47 -04:00
jedarden
60a7969dca chore: update needle predispatch sha
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 16:04:10 -04:00
jedarden
6c830dca5d chore: update needle predispatch sha
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 16:01:27 -04:00
jedarden
8e7a77dc70 Notes for bf-ns9q: C# starter kit registration verified
Re-verified that all required components are in place:
- CI workflow exists at starters/csharp/.github/workflows/build.yml
- Plan §5.8 includes acb-starter-csharp at line 986
- Plan §11.2 includes acb-starter-csharp at line 2629
- Directory listing includes csharp/ at line 2565

The task was originally completed in commits 55c594c and 9d4a311.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 15:46:47 -04:00
jedarden
03ec821e48 Update predispatch sha 2026-05-22 15:40:21 -04:00
jedarden
d3d655b9c9 Evolver: Fix nsjail integration for complete sandbox coverage
- Add /opt to nsjail bindmounts so Rust toolchain (/opt/rust) is accessible
  during sandboxed validation of Rust bots
- Explicitly enable Alpine community repository in Dockerfile to ensure
  nsjail package can be installed (nsjail lives in community, not main)
- nsjail integration was already optional (falls back to plain exec if
  unavailable), but these changes ensure it actually works when enabled

This addresses bead bf-3f29: nsjail was listed in apk add but /opt wasn't
bindmounted, causing Rust validation to fail when UseNsjail=true.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 15:18:21 -04:00
jedarden
359a5450ab Update predispatch sha 2026-05-22 15:10:55 -04:00
jedarden
b3f6dcba49 Verification: Directed attack arrows from killers[] in combat_death events (bf-3jyd)
Verified that the feature implemented in commits 8e0aa5e (engine) and 323c1e8 (viewer) is complete and working:

Engine (engine/turn.go):
- executeCombat emits EventCombatDeath with killers[] array
- Each killer entry includes bot_id, owner, and position

Viewer (web/src/replay-viewer.ts):
- drawCombatEffects() handles combat_death events with killers[]
- Draws solid colored arrows from each killer to the victim
- Includes red explosion flash and X marker for death
- Maintains backward compatibility with old replays (proximity-inference fallback)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 15:00:16 -04:00
jedarden
8e0aa5e1be Emit combat_death events with killers array in executeCombat
Modified executeCombat to emit EventCombatDeath events with a killers
array containing all enemy bots within attack radius of the killed bot.

Each killer entry includes bot_id, owner, and position, matching the
replay schema specification.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 14:48:19 -04:00
jedarden
2bd3448807 Bead bf-3mx7: Document winner badge fix completion
The bug fix was already applied in commit 9bcbd56. Updated notes to reflect:
- Fix is already in the codebase (using p.Won instead of p.BotID == m.WinnerID)
- Index builder will automatically regenerate static JSON on next 15m cycle
- No manual intervention required - production deployment will pick up the fix automatically

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 18:22:41 -04:00
jedarden
770d704bc1 Bead bf-3mx7: Document winner badge fix completion
The code fix was already applied in commit 6fe778b. This commit
adds documentation noting that the index builder needs to be run
to regenerate static JSON with correct winner badges.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 17:59:02 -04:00
jedarden
b27272de5a Phase 10: Fix narrative engine tests to match exact specs
- Fix TestBuildNarrativePrompt_Comeback to check for current ELO
  instead of old rating (comeback arc shows bottom 25%→top 25%)
- Fix TestDetectRivalryArcs to use 10+ matches (grudge match spec)
  instead of only 5 matches

Story arc detection (per §3.7 chronicles):
✓ Comeback bots: recovered from bottom 25% to top 25%
✓ Grudge matches: same pair meets 10+ times
✓ Underdog victories: bottom-10 beats top-10

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 15:10:42 -04:00
jedarden
bc857d10bc Phase 10: Fix API documentation routing and add schema download link
- Fix /docs/api route to go directly to API docs page instead of redirecting
- Fix docs.ts link to point to /compete/docs/api instead of itself
- Add download button for replay-schema-v1.json in API docs
- Reorder router routes to ensure /docs/api is matched before /docs

The API documentation at /docs/api now correctly shows the OpenAPI-style
endpoint documentation for all static JSON file paths on Pages, R2, and B2,
including the versioned replay format specification.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 15:02:25 -04:00
jedarden
a4bdeba8fd Phase 10: Live evolution observatory - evolver live.json feed + observatory page
Evolver writes live.json to R2 every cycle. Observatory page polls and
renders live feed + lineage tree + meta shift chart.

- Added ACB_R2_UPLOAD_ENABLED env var to enable automatic R2 upload during run loop
- CycleState tracks real-time evolution cycle status (generation, phase, candidate, validation, evaluation)
- Export() now includes cycle info when cycleState is provided
- runCycle() integrated with live observatory exports at each phase transition
- exportLiveQuiet() for mid-cycle status updates without verbose logging
- Fixed function signature mismatches for exportLiveQuiet calls

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 14:52:17 -04:00
jedarden
b15fa4d970 phase-10: verify weekly meta report blog implementation
Phase 10 deliverables verified complete:
- Weekly meta report generation (blog.go)
  - Template-based reports with ELO movers, dominant strategies
  - LLM-enhanced narrative sections (spotlight, evolution deep dive, looking ahead)
- Story arc detection and chronicle generation (narrative.go)
  - Rise, fall, rivalry, upset, evolution milestone, comeback arcs
  - Sports-journalism style LLM prompts with §13.2 critical moments
- Weekly chronicles file (chronicles-YYYY-WW.json)
- Web frontend blog pages (blog.ts)
  - Blog listing with filters (all, meta-report, chronicle)
  - Individual post rendering with markdown support
  - Tag cloud and responsive layout

All tests passing, web build successful.
2026-05-08 14:33:45 -04:00
jedarden
0028100c64 Phase 9: Map voting + positional fairness monitoring - verify existing implementation
Verified all Phase 9 deliverables already in place:
- PostgreSQL map_votes table (UNIQUE constraint on map_id, voter_id)
- POST /api/vote-map endpoint (+1/-1 votes, rate-limited)
- GET /api/vote/map/{map_id} endpoint for vote counts
- Positional fairness monitoring: tickFairnessAudit with 5-step lifecycle
  * updateMapFairnessStats: recompute per-slot win rates
  * flagUnfairMaps: probation for >10pp deviation
  * retireDislikedMaps: force-retire at < -20 net votes
  * pruneLowEngagementMaps: monthly bottom 10% pruning
  * promoteClassicMaps: top-5 sustained (3+ months) to classic
- maps/index.json includes NetVotes from aggregation

All tests pass (mapvote, map_fairness, index-builder).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 14:30:46 -04:00
jedarden
c66dc893fa phase-8: win probability sparkline + critical moments in replay viewer
The win probability sparkline component is now fully integrated:

1. Worker (engine/winprob.go): Monte Carlo rollout computes per-turn win
   probabilities, detectCriticalMoments identifies turns where win prob
   shifts >15% with template-based descriptions.

2. Replay storage (engine/replay.go): win_prob and critical_moments arrays
   stored in replay JSON, written by match worker after each match.

3. Web component (web/src/components/win-prob.ts): WinProbSparkline class
   renders the graph with critical moment markers (dashed vertical lines),
   click-to-scrub interaction, and current turn indicator.

4. Replay page integration (web/src/pages/replay.ts): initWinProb() sets up
   the sparkline with player colors, legend, prev/next critical moment
   navigation buttons, and keyboard shortcuts ([/]).

The sparkline displays one line per player with area fill gradient,
percentage labels (0%, 50%, 100%), critical moment diamonds with
delta labels, and updates in real-time as the replay plays.
2026-05-08 14:17:26 -04:00
jedarden
199a2ea0fe phase-9: implement match event timeline with computed events
- Client-side event extraction from replay turn data
- Icon ribbon overlaid on replay viewer timeline
- Click-to-jump to event moment
- Computed events: mass death (5+ bots), spawn wave (3+ spawns),
  momentum shift (win prob crosses 50%), critical moment (>15% shift)
- Energy milestone detection (3+ energy collected)
- Hover tooltips with event descriptions
- Updated icons matching plan §14.8 specification

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 11:39:04 -04:00
jedarden
5e7ade8d78 phase-9: verify replay view modes — Voronoi territory + influence gradient
All Phase 9 replay viewer visualization modes verified complete:
- Voronoi territory: nearest-bot ownership per tile, 30% opacity
- Influence gradient: distance-weighted (1/(1+dist)) strength
- Both computed client-side, toggled via viewer toolbar
- Dropdown UI in replay.ts, rendering in replay-viewer.ts

Exit criteria met:
✓ Voronoi territory view renders correctly
✓ Influence gradient view renders correctly
✓ Toolbar toggle functional
✓ go test ./... passes
✓ go vet ./... clean
✓ npm run build succeeds
2026-05-08 11:08:41 -04:00
jedarden
1f43a6a321 phase-8: verify clip maker implementation with 5 social media format presets
- All 5 presets implemented: Landscape (1920×1080), Square (1080×1080), Portrait (1080×1920), GIF compact (640×360), GIF square (480×480)
- MP4/WebM export via MediaRecorder API
- Custom GIF encoder with LZW compression and 256-color palette
- Share panel with Twitter, Reddit, Discord integration
- Web Share API support for native sharing

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 10:52:37 -04:00
jedarden
4486c74dd9 phase-8: implement 5 social media format presets for clip maker
Update clip maker to match Phase 8 plan specifications:
- Landscape: 1920×1080 (16:9) MP4 - YouTube, Twitter, Discord
- Square: 1080×1080 (1:1) MP4 - Twitter, Instagram feed
- Portrait: 1080×1920 (9:16) MP4 - TikTok, YouTube Shorts, IG Stories
- GIF (compact): 640×360 (16:9) GIF - Discord embeds, forums
- GIF (square): 480×480 (1:1) GIF - Twitter, Slack

Each preset now has a fixed format (MP4 or GIF) matching the
plan's specification, with export button dynamically updating
to show the correct format type.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 10:50:41 -04:00
jedarden
921f5d2c3e phase-8: verify WASM engine build + in-browser sandbox complete
- WASM game engine (cmd/acb-wasm/) with loadState/step/runMatch API
- Pre-compiled 6 strategy bots to WASM (web/public/wasm/bots/)
- In-browser sandbox with Monaco editor (web/src/pages/sandbox.ts)
- WASM upload mode with interface validation
- Opponent selector (up to 3 opponents for 2-4 player matches)
- Replay viewer integration with fog-of-war toggle and view modes
- All tests pass, go vet clean, npm build succeeds
2026-05-08 10:45:22 -04:00
jedarden
660acbc485 fix(sandbox): fix TypeScript compilation error in disclosure.ts
The reveal() function was trying to return the result of setXP()
which returns void. Fixed by setting XP first, then returning
the threshold value.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 10:42:04 -04:00
jedarden
b60b103c0f fix(starter-rust): fix compilation errors in Rust starter kit
- Add Clone derive to AppState for axum compatibility
- Import Digest trait from sha2 for hash computation
- Use String instead of &str in response headers for lifetime safety
- Add Position import to grid.rs module
- Make Position Copy for easier cloning
- Replace constant_time_eq with custom hmac_equal function
- Add musl-dev to Dockerfile for Alpine build compatibility

The Rust starter kit now compiles and builds successfully with
cargo check and Docker, matching the requirements from plan §5.3
and §12 (Phase 2).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 10:18:11 -04:00
jedarden
5242d6037c feat(acb-evolver): add weekly automated map evolution ticker
Wire up the acb-map-evolver to run automatically on a weekly schedule
(Sunday 03:00 UTC by default) from the evolver deployment.

The map evolution ticker:
- Waits until the next scheduled time (weekday:hour:minute UTC)
- Runs acb-map-evolver --once to evolve maps for all player counts
- Repeats every 7 days

The schedule can be configured via ACB_MAP_EVOLUTION_SCHEDULE env var
(format: WEEKDAY:HH:MM, e.g., "0:03:00" for Sunday 03:00 UTC).

Enable via ACB_MAP_EVOLUTION_ENABLED=true or --enable-map-evolution flag.

Per plan §14.6: the weekly map evolution loads engagement scores,
runs MAP-Elites evolution, promotes high-scoring variants, and updates
the active map pool in the database.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 09:26:38 -04:00
jedarden
8e33ee1f27 fix(index-builder): correct function name typo in weekly chronicles generation 2026-05-04 03:10:46 -04:00
jedarden
6bfd3e6679 feat(api): implement POST /api/request-enrichment endpoint
Per plan §13.3, implements user-requested AI replay commentary with:
- HMAC bot authentication via shared_secret
- Rate limiting: 5 requests/day per bot
- Match validation (exists and completed)
- Idempotency via enrichment_requested_at column
- Enqueues to Valkey for acb-enrichment service
- Returns 202 Accepted with estimated wait time

Also adds:
- AllowN() method to ratelimit package for multi-token checks
- enrichment_requested_at column to matches table (idempotency)
- enrichLtr rate limiter (5/day per bot)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 02:58:11 -04:00