Skip to content

Agents must beat unmanaged baseline #6

Open

Description

@jkbennitt

The Problem

First paired benchmark against a live RimWorld colony shows agents are not helping:

Agent:    0.801 ± 0.03
Baseline: 0.830 ± 0.00
Delta:    -0.029 (p = 0.37)

The unmanaged colony (RimWorld's built-in pawn AI) scores higher than our 6-agent team. The agents are net-negative — they issue actions that fail or disrupt colonist routines.

Why Agents Are Losing

1. High action failure rate

  • set_growing_zone → RIMAPI 500 every time (fork bug, tracked separately)
  • place_blueprint → agent doesn't include x,z coordinates
  • toggle_power → agent sends building_id=0 (no valid IDs in state)
  • haul_resource → RIMAPI rejects the job assignment

Agents propose ~14 actions per tick but only ~6 execute. The rest fail silently. Failed actions waste the tick without benefit.

2. Agents disrupt productive colonist behavior

  • RimWorld's built-in AI already assigns colonists to work, eat, sleep, haul
  • Our agents override work priorities, draft colonists away from tasks, reassign researchers
  • If the override is wrong or the action fails, the colonist is worse off than if we'd done nothing

3. No understanding of what's already working

  • Agents see a snapshot of colony state but don't know what colonists are currently doing
  • They propose "set_work_priority growing=1" but the colonist is already growing
  • The action succeeds but adds no value — and may disrupt the colonist's current task queue

4. 10-second tick interval means minimal game progression

  • Colony runs for 10 seconds between deliberation cycles
  • Not enough time for actions to have measurable impact before the next override

What Needs to Change

Fix action reliability first

  • Fix set_growing_zone RIMAPI fork bug
  • Teach agents to include coordinates for blueprints
  • Expose building IDs in filtered state for toggle_power
  • Get execution rate from 43% to 90%+

Make agents aware of current colonist activity

  • Add current_activity or current_job to colonist state (if RIMAPI exposes it)
  • Agents should propose NO_ACTION when colonists are already doing the right thing
  • Penalize unnecessary overrides in the scoring

Increase tick interval for meaningful progression

  • Test with 30-60 second tick intervals so colony state actually changes between ticks
  • Fewer but higher-quality interventions > many disruptive ones

Add "do no harm" principle to agent prompts

  • System prompt: "Only propose actions that improve on the colony's current trajectory. If colonists are already productive, propose NO_ACTION."
  • Weight NO_ACTION higher in the conflict resolver when no crisis exists

Success Criteria

The benchmark answer should be:

Agent:    0.85 ± 0.05
Baseline: 0.75 ± 0.03
Delta:    +0.10** (p < 0.05)

Agents must demonstrably improve colony outcomes. Until then, the benchmark is failing honestly.

How to Reproduce

# Requires: RimWorld running, RIMAPI mod, LM Studio with Nemotron Nano 4B
# Save a Crashlanded colony as "rle_crashlanded_v1"

python scripts/run_scenario.py crashlanded_survival \
  --provider openai --model nvidia/nemotron-3-nano-4b \
  --base-url http://localhost:1234/v1 \
  --no-think --ticks 10

python scripts/run_scenario.py crashlanded_survival --no-agent --ticks 10

Compare the two final scores. Agent must be higher.

Activity

  1. jkbennitt commented on Mar 25, 2026

    @jkbennitt
    MemberAuthor

    Implementation complete

    All checklist items addressed in commit b1393c6:

    Fix action reliability

    Make agents aware of current colonist activity

    • current_job exposed in all 6 agent filters (was missing from DefenseCommander, SocialOverseer, ConstructionPlanner)
    • Agents propose NO_ACTION when colonists are productive — "Do No Harm" principle added to shared system prompt
    • Unnecessary overrides prevented at two levels: prompt instructs agents to check current_job before acting, and resolver prefers NO_ACTION during peacetime

    Increase tick interval

    • --tick-interval CLI flag added to both run_scenario.py and run_benchmark.py (use --tick-interval 30 for live game)

    "Do no harm" principle

    • System prompt: "Only propose actions that IMPROVE on the colony's current trajectory. If colonists are already productive, respond with no_action."
    • Resolver: NO_ACTION wins pawn conflicts during peacetime (no raid, no medical emergency). During crises, regular actions take priority as before.

    Testing

    • 3 new resolver tests (peacetime NO_ACTION wins, raid override, medical emergency override)
    • Updated executor tests for NO_ACTION exclusion from totals
    • 265 tests pass, lint clean, dry-run benchmark 100% parse rate

    What's needed to verify success criteria

    Run a live paired benchmark with --tick-interval 30 --runs 4 against a real RimWorld colony to confirm agent score exceeds baseline. The code-level changes are complete — actual score improvement depends on LLM compliance with the new prompt guidance.

    🤖 Generated with Claude Code

  2. jkbennitt commented on Mar 26, 2026

    @jkbennitt
    MemberAuthor

    Progress: Agents now beat unmanaged baseline

    Three fixes flipped the delta from negative to positive:

    Fix 1: Work priority endpoint (f4609da)

    The bulk endpoint POST /api/v1/colonists/work-priority had a deserialization bug (Priorities list always null). Switched to the singular endpoint POST /api/v1/colonist/work-priority which works. This was the #1 reason colonists wandered — every work assignment was silently failing.

    Fix 2: "Do no harm" principle (b1393c6)

    Agents were disrupting productive colonists every tick. Now they default to NO_ACTION when things are stable and only intervene during crises, starvation risk, or mood emergencies.

    Fix 3: Unpause at speed 3 (eb13e5c)

    At speed 1, colonists barely start a task in the 10-second tick interval. Speed 3 gives ~3x more game time for work priorities to take effect.

    Results (Crashlanded Survival, Nemotron Nano 4B, 2 paired runs)

    Version Agent Baseline Delta
    Before fixes 0.801 ± 0.03 0.830 ± 0.00 -0.029
    After "do no harm" 0.824 ± 0.00 0.830 ± 0.00 -0.006
    After speed 3 0.799 ± 0.03 0.781 ± 0.00 +0.018

    Cohen's d = 1.0 (large effect). Not yet statistically significant (p = 0.45, N=2) — need N=4+ runs for significance.

    Remaining from issue checklist

    • Fix action reliability (work priorities working, growing zones fixed in RIMAPI PR fix: raw-grok Windows .cmd argv via RLE_GROK_ARGV_JSON #60)
    • "Do no harm" principle in prompts + resolver
    • Speed 3 unpause for meaningful game progression
    • Run N=4 for statistical significance
    • Test harder scenarios (First Winter, Raid Defense) where baseline should struggle more
    • Increase tick interval to 30-60s for longer-horizon impact
    • Expose current_activity from RIMAPI so agents know what colonists are doing
  3. jkbennitt commented on Mar 30, 2026

    @jkbennitt
    MemberAuthor

    N=4 Paired Results: Nemotron 30B-A3B (OpenRouter, paid tier)

    Crashlanded Survival, speed 3, 30s tick interval, detailed colonist data.

    Run Agent Baseline Delta
    1 0.764 0.796 -0.032
    2 0.730 0.776 -0.046
    3 0.782 0.785 -0.003
    4 0.770 0.770 +0.000
    Agent:    0.762 ± 0.02
    Baseline: 0.782 ± 0.01
    Delta:    -0.021 (p = 0.11, Cohen's d = -1.19)
    

    Trend is improving but not there yet

    Runs 3 and 4 are near-even. The agents are learning to back off (do no harm working) but still net-negative overall.

    Comparison across all runs to date

    Config Model Delta p
    Speed 1, no fixes Nano 4B (local) -0.029 0.37
    Speed 1, do no harm Nano 4B (local) -0.006 —
    Speed 3, do no harm Nano 4B (local) +0.018 0.45
    Speed 3, detailed data, N=4 30B-A3B (OpenRouter) -0.021 0.11

    The local Nano 4B at speed 3 got +0.018 but only N=2. The 30B-A3B at N=4 got -0.021. Model matters — the 30B may be less compliant with do-no-harm prompts.

    Next steps

    Two paths to positive delta:

    1. Harder scenarios (Create benchmark save files for all 6 scenarios #7) — Crashlanded is too easy, baseline colony does fine alone. First Winter and Raid Defense would stress-test the baseline and give agents room to help.
    2. Model comparison — re-run with Nano 4B on OpenRouter (if available) or local LM Studio to confirm the +0.018 result holds at N=4.
  4. jkbennitt commented on Mar 31, 2026

    @jkbennitt
    MemberAuthor

    Status Update — Post #10

    With MapAnalyst + terrain constraints (#10 closed), agent scores are now in the 0.79-0.81 range:

    • Best: 0.808 (survival 1.0, wealth 1.0, food 0.95, efficiency 0.75)
    • Latest: 0.794 (with unforbid fix, efficiency 0.89)
    • Baseline: 0.782-0.835 (from previous paired runs)

    Delta is borderline positive (+0.012 to +0.026 vs lower baseline).

    Remaining work to consistently beat baseline

    1. Mood (0.40-0.44) — agents don't prioritize beds + cooking fast enough. Colonists get major break risk by day 3-5. Need stronger early-game prompt enforcement for shelter completion.
    2. Research (0.226) — research bench rarely placed in first 10 ticks. Bootstrap playbook mentions it at tick 3 but agents prioritize other actions.
    3. Prompt tuning — tighten the bootstrap playbook to ensure beds + campfire are placed in tick 2, not deferred.
  5. jkbennitt commented on Jun 9, 2026

    @jkbennitt
    MemberAuthor

    Status update (June 9): Phase A observability floor is merged (PRs #19, #20). Relevant to this issue:

    • Per-action failure feedback now works in practice. ActionOutcome catches RIMAPI errors with clean reasons and broadcasts "DO NOT REPEAT" to agents via CentralPost next tick. Whether this reduces repeated-error rate is the next empirical test.
    • The "active intervention hurts" finding replicated in a partial live run (Nemotron 120B, 5 ticks): the only tick where actions executed dropped composite −0.103; passive ticks drifted ~−0.013/tick from natural decay. New per-action observability now tells us which actions degraded the score.
    • Next: Phase B — calibrate a pinned per-scenario baseline (N=4 --no-agent runs to colony death, persisted as a .baseline.json scenario property), then run agents against the pinned trajectory. That replaces ad-hoc paired runs with a rigorous lift metric, which is what this issue actually needs to be judged against.
  6. jkbennitt commented on Jun 12, 2026

    @jkbennitt
    MemberAuthor

    v0.3.0 validation spread update (2026-06-11, 11 models, N=1): only z-ai/glm-5.1 beat the no-agent baseline (+0.028 mean, above on 7/10 ticks). Every other model — including the repeat champion grok-4.3 — landed slightly below it.

    What glm-5.1 did differently was restraint: it repeatedly declined low-value actions with explicit justification (e.g. "drafting would be counterproductive" for phantom threats) instead of issuing something every tick. The failure mode it avoided is the one this issue describes: net-negative actions disrupting colonist routines.

    Two implications:

    1. Cheap experiment before N=4 (N=4 validation milestone: top-4 roster vs static baseline #46): one N=1 grok-4.3 run with a restraint prompt variant — "no_action must be justified; any action must argue it beats doing nothing." If grok-4.3 + restraint clears baseline, the fix to this issue is partly prompt-level, not just harness-level. ~$0.50 to find out.
    2. Run length matters for measuring this: at 10 ticks (day 2–5) most of the composite is the opening decay curve. The baseline's mean time-to-end is 8 days — beating it needs runs long enough for management decisions to compound. N=4 should run 20–30 ticks.

    Harness-side contributors fixed since the original report: growing-zone 500s (upstream #76 + overlap guard), stockpile overlap/priority (#41), action-error feedback to agents (DO-NOT-REPEAT broadcasts), parse-retry token billing (#44).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions