yxc20098 commited on
Commit
fe84c2d
·
1 Parent(s): 2bc42c5

feat(scenario): expansion-turtle-1-base-fortified — heavy-defense 1-base macro (SC2 fortress / military concentration anchor)

Browse files

Wave-4 Group B TURTLE node of the expansion triple (siblings:
expansion-aggro-3-base-greedy GREEDY arm, tech-balanced-econ-then-
tech BALANCED arm). The agent has a single pre-placed base PLUS a
seed defence line (pre-placed pbox + 1 gun + weap) and must
FORTIFY DENSELY ENOUGH to repel an incoming hunt-bot assault while
reaching a higher defence bar (>=3/>=6/>=8 pbox + >=1/>=2/>=2 gun)
and maintaining >=3 defenders alive, all before tick 5400 with the
conyard still standing.

Expansion is STRUCTURALLY FORBIDDEN: no MCV is provided and
`deploy` is removed from the tools list (double-blocked). The
discrimination is whether the model embraces the deep-defence play
(actively REINFORCES the pre-placed pbox/gun seed against the
hunt's grinding attrition) instead of stalling, pure-army (no pbox
replacement -> defences bleed below the bar), or over-teching
(cash spent on dome/fix research instead of pbox/gun reinforcement).

Real-world anchors:
* SC2 fortress macro / 1-base mass-defence timing
* Risk-averse business: own one market deeply rather than expand thin
* Military fortress doctrine: concentrate force at impregnable site
* Defensive-vs-expansion tradeoff in capital allocation

Pack details:
* map: rush-hour-arena (128x40); hunt-bot opponent at x=95 east
lane; persistent unarmed enemy `fact` marker at x=122 as anti-
DRAW guard so non-winners emit a real reachable LOSS.
* pre-placed seed (medium): fact + tent + 2x powr + proc + harv +
mine WEST of the lane; 5 pbox + 1 gun + weap + 5 e1 + 1 e3
screen at the EAST lane mouth. Agent adds >=1 pbox + >=1 gun +
reinforcement to reach 6/2 bar under attrition.
* starting_cash 6500/8500/9500 funds the entire intended
reinforcement spend (no `harvest` tool -> idle harv = 0 cr/turn).
* within_ticks 5400 / after_ticks 5401, max_turns 62 -> reachable
tick 5583 >= 5401 (deadline bites, non-winner = real LOSS).
* hard tier: 2 spawn_point groups (NORTH y=12 / SOUTH y=28)
round-robined by seed; symmetric hunt bands at BOTH latitudes
so a memorised pbox layout from one spawn does not generalise.

No-cheat validation (deterministic, no model/network):
* stall (Command.observe()) - LOSS every level + every hard seed
(defences bleed below bar, screen wiped below 3).
* pure_army (only train e1, no defence builds) - LOSS every level
+ every hard seed (pbox bar falls below target).
* over_tech (build dome+fix instead of pbox/gun) - LOSS every
level + every hard seed (cash spent on tech, bar unmet).
* intended_fortify (reinforce pbox+gun, train e1) - WIN every
level + every hard seed.

Model smoke: Qwen3.6-Plus on medium seed 1 - LOSS (composite 0.37);
appropriate discrimination, the model did not reach the dense-
fortification bar inside the budget.

Registered in tests/test_hard_tier.py::UPGRADED.
21/21 tests in tests/test_expansion_turtle_1_base_fortified.py pass.

openra_bench/scenarios/packs/expansion-turtle-1-base-fortified.yaml ADDED
@@ -0,0 +1,421 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EXPANSION-TURTLE-1-BASE-FORTIFIED — Group B (Mid: TURTLE 1-base
2
+ # fortification, dense static-defence supremacy over expansion).
3
+ #
4
+ # The TURTLE variant of the expansion triple (sister to
5
+ # expansion-aggro-3-base-greedy and tech-balanced-econ-then-tech).
6
+ # The agent has a SINGLE pre-placed base (fact + tent + powr + proc)
7
+ # and NO MCV — `deploy` is removed from the tools list, so expansion
8
+ # is structurally forbidden. The intended play is to accept the
9
+ # 1-base cap and fortify so heavily (≥6 pbox + ≥2 gun + ≥3 defenders)
10
+ # that an incoming hunt-bot assault (6 e1 + 2 e3) is absorbed at the
11
+ # wall and the conyard still stands at the deadline.
12
+ #
13
+ # Why this is the TURTLE mirror of expansion-aggro-3-base-greedy:
14
+ # - AGGRO commits 3 MCVs to 3 distinct regions (growth supremacy,
15
+ # no defence). The hedged "hold one MCV back" play LOSES the
16
+ # third region.
17
+ # - TURTLE commits the entire economy to ONE site (defence
18
+ # supremacy, no growth). The hedged "build an army instead of
19
+ # towers" play gets ground down by the hunt band; the hedged
20
+ # "build towers but skip the army-throughput minimum" play
21
+ # stalls; the hedged "tech up instead of laying defences" play
22
+ # gets razed.
23
+ # - BALANCED (tech-balanced-econ-then-tech) sequences econ-then-
24
+ # tech; defences-only LOSES because the tech chain never
25
+ # finishes.
26
+ # - Together the three packs cover the canonical mid-game
27
+ # allocation trilemma: spread thin (AGGRO), tech deep
28
+ # (BALANCED), turtle wide-and-thick (TURTLE).
29
+ #
30
+ # Benchmark / real-world anchor:
31
+ # - SC2 fortress macro / 1-base mass-defence timing: stay on one
32
+ # base, mass static defence and a minimum army to repel an
33
+ # incoming all-in attack.
34
+ # - Risk-averse business: own one market deeply rather than
35
+ # expand thin — concentrate capital where you already have
36
+ # advantage, fortify the moat.
37
+ # - Military fortress doctrine: concentrate force at one
38
+ # impregnable site rather than disperse across multiple
39
+ # vulnerable outposts.
40
+ # - Defensive-vs-expansion tradeoff in capital allocation: when
41
+ # the threat is concrete (incoming hunt-bot assault) and the
42
+ # incremental return on expansion is uncertain, deep
43
+ # fortification dominates broad expansion.
44
+ #
45
+ # Engine tick/turn alignment (CLAUDE.md, ~90 ticks/turn):
46
+ # within_ticks 5400 / after_ticks 5401, max_turns 62 → reachable
47
+ # tick 93 + 90·61 = 5583 ≥ 5401 ✓ (the deadline bites; a stall
48
+ # emits a real LOSS, not a DRAW). Interrupt steps can run <90
49
+ # ticks/turn, so 62 turns is a comfortable buffer.
50
+ #
51
+ # Economy budget (per level):
52
+ # The pack is "fat war chest" turtle: NO `harvest` tool exposed
53
+ # (the turtle plays pure capex from a fat war chest, not active
54
+ # econ micro — keeps the discrimination cleanly on defence vs
55
+ # tech vs army allocation, not on harvester routing). With no
56
+ # harvest dispatch the pre-placed harv+proc+mine triple yields
57
+ # zero passive income (idle harvester does not auto-cycle
58
+ # without a `Command.harvest` dispatch — engine quirk noted in
59
+ # tests/test_econ_startup_from_scratch.py), so starting_cash
60
+ # must fund the entire intended REINFORCEMENT spend on top of
61
+ # the pre-placed seed defences. Costs (per CLAUDE.md): pbox=600,
62
+ # gun=800, weap=2000, e1=100, powr=300.
63
+ # - easy seed: 1 pbox + weap pre-placed; agent adds ≥2 pbox + 1
64
+ # gun + reinforcement ≈ 2 pbox + 1 gun + 4 e1 ≈ 2400 → cash 6500
65
+ # covers reinforcement under attrition (extra pbox + extra e1).
66
+ # - medium seed: 5 pbox + 1 gun + weap pre-placed; agent adds ≥1
67
+ # pbox + ≥1 gun + reinforcement ≈ 3 pbox + 1 gun + 6 e1 = 3200 →
68
+ # cash 8500 covers reinforcement under heavier attrition.
69
+ # - hard seed: 7 pbox + 1 gun + weap pre-placed; agent adds ≥1
70
+ # pbox + ≥1 gun + reinforcement ≈ 4 pbox + 1 gun + 6 e1 = 3800
71
+ # → cash 9500 covers reinforcement under doubled-flank attrition.
72
+ # The cap is tight enough that an over-tech skip-defence policy
73
+ # (e.g. spending 2000+ on dome / 2500+ on fix instead of pbox
74
+ # reinforcement) busts the defence bar AND gets the fact razed.
75
+ #
76
+ # Engine footguns applied (per CLAUDE.md):
77
+ # - `deploy` removed from tools so expansion is structurally
78
+ # forbidden (the bench advertises only what the agent can do —
79
+ # no MCV is provided either, double-blocked).
80
+ # - Persistent unarmed enemy `fact` MARKER at the far map edge
81
+ # prevents the all-enemies-eliminated auto-`done` so non-winners
82
+ # LOSE on the deadline (never DRAW). The hunt band itself is
83
+ # temporary — once dispatched the marker keeps the run alive
84
+ # until the clock or the fortification predicates resolve.
85
+ # - The agent starts WITH units (the pre-placed harv counts in
86
+ # units_summary) so the `not own_units_gte:1` fail clause is
87
+ # safe on turn 1 (CLAUDE.md unit-less-start footgun does not
88
+ # apply here). Once the harv is killed AND no defenders are
89
+ # trained AND the fact dies, the clause fires.
90
+ # - Pre-placed fact + tent + powr + proc + harv + mine so the
91
+ # intended sequence is: queue pbox + e1 in parallel on turn 1
92
+ # (Defence and Infantry queues), drop pbox at the lane mouth,
93
+ # keep training defenders. No build-radius gymnastics required.
94
+ # - Hard tier: TWO agent spawn_point groups rotate the whole
95
+ # starter base between a north y=12 and a south y=28 latitude.
96
+ # Hunt-bot composition is symmetric (the enemy bands sit at
97
+ # both latitudes; enemies don't honour spawn_point — CLAUDE.md)
98
+ # so the threat ALWAYS arrives from both flanks but the home
99
+ # base flips per seed — single memorised pbox cell cannot
100
+ # generalise.
101
+ # - `has_building` is MONOTONIC (never un-sets after a kill); the
102
+ # "fact still standing" predicate uses `building_count_gte:
103
+ # {type: fact, n: 1}` which iterates the per-tick refreshed
104
+ # own_buildings list and DOES fall to 0 when the fact is razed.
105
+ # - Hunt-bot (`bot_type: hunt`) actively seeks out the nearest
106
+ # agent unit / building; arrives at the base by ~tick 1500
107
+ # from the x=80 spawn given the rush-hour-arena layout.
108
+ # - Map: rush-hour-arena (128×40), validated for the canonical
109
+ # base-at-x=10, threat-at-x=80 hunt-band geometry across
110
+ # defense-rush-survive. All actors within playable bounds
111
+ # (x∈[2,126], y∈[2,38]).
112
+
113
+ meta:
114
+ id: expansion-turtle-1-base-fortified
115
+ title: 'Expansion TURTLE — Fortify 1 Base (Defence Supremacy, No Expansion)'
116
+ capability: reasoning
117
+ real_world_meaning: >
118
+ TURTLE 1-base fortification: the agent has no second MCV and
119
+ no `deploy` tool — expansion is structurally off the menu.
120
+ The only path to win is to take the single pre-placed base
121
+ and harden it so densely (≥6 pillboxes + ≥2 gun turrets + a
122
+ minimum army of 3) that an incoming hunt-bot assault is
123
+ absorbed at the wall, with the home fact still standing at
124
+ the deadline. The discrimination is whether the model
125
+ embraces the deep-defence play (accepts the 1-base cap and
126
+ invests the whole economy in static defence + minimum army)
127
+ instead of defaulting to a "balanced" play that leaves the
128
+ base under-fortified, or a "pure army" play that gets ground
129
+ down without towers to anchor on, or an "over-tech" play
130
+ that builds research while the fact is being razed.
131
+ robotics_analogue: >
132
+ Single-site hardening under known incoming threat: a fixed
133
+ asset (factory, data centre, military outpost) has a known
134
+ incoming attack inside a fixed window, no option to relocate,
135
+ and no reinforcement; the only path is to invest the entire
136
+ budget in passive hardening (walls, turrets, hardened
137
+ bunkers) plus a minimum on-site response force, accepting
138
+ that the asset will be irrelevant outside its own perimeter.
139
+ Same idea in capital allocation (own one market deeply),
140
+ cybersecurity (concentrate WAF + IDS + bastion at the one
141
+ public-facing endpoint instead of spreading thin), and
142
+ military fortress doctrine (concentrate force at one
143
+ impregnable site).
144
+ benchmark_anchor:
145
+ - "SC2 fortress macro / 1-base mass-defense timing"
146
+ - "risk-averse business: own one market deeply"
147
+ - "military fortress doctrine: concentrate force at impregnable site"
148
+ - "defensive-vs-expansion tradeoff in capital allocation"
149
+ author: "openra-bench"
150
+
151
+ base_map: rush-hour-arena
152
+
153
+ # Pack-wide default; each level overrides with the cash needed to
154
+ # fund EXACTLY its intended dense-fortification spend. No income
155
+ # flows (no harvest tool exposed, idle harv = 0 cr/turn — see
156
+ # tests/test_econ_startup_from_scratch.py engine quirk).
157
+ starting_cash: 2500
158
+
159
+ base:
160
+ agent: {faction: allies}
161
+ # Hunt-bot actively seeks the nearest agent unit/building and
162
+ # commits the full band to the agent's centroid (defense-rush-
163
+ # survive uses `rusher` for the same role; `hunt` is the
164
+ # generic-seek bot named in the spec).
165
+ enemy: {faction: soviet, bot_type: hunt}
166
+ # TURTLE tool list per spec: NO `deploy` (expansion structurally
167
+ # forbidden — bench advertises only what the agent can do). NO
168
+ # `harvest` either — the turtle plays pure capex from a fat war
169
+ # chest (starting_cash funds the entire intended reinforcement
170
+ # spend), keeping the discrimination cleanly on defence vs tech
171
+ # vs army allocation rather than on harvester routing.
172
+ tools: [observe, build, place_building, move_units, attack_unit, stop]
173
+ planning: true
174
+ # No interrupts: a step that fires on every enemy spotted /
175
+ # defender lost shortens each step to <90 ticks and the
176
+ # after_ticks fail cannot then be reached inside max_turns,
177
+ # collapsing non-winners to DRAW. Turtle play is also less
178
+ # interrupt-driven than the rusher / harass packs — the
179
+ # decision space is "lay defences and train defenders" and
180
+ # the engine handles the firing automatically.
181
+ termination: {max_ticks: 12000}
182
+ actors: []
183
+
184
+ levels:
185
+ # ── EASY ────────────────────────────────────��────────────────────
186
+ # Degenerate-to-balanced variant: smaller hunt band (4× e1),
187
+ # lower fortification bars (3 pbox, 1 gun). Tests the bare
188
+ # "lay defences AND keep a minimum army" capability. Cash
189
+ # covers 3 pbox + 1 gun + weap (gun prereq) + 3 e1 ≈ 4700,
190
+ # plus a generous buffer for extra defenders.
191
+ # max_turns 62 → reachable tick 93 + 90·61 = 5583 ≥ 5401 ✓
192
+ easy:
193
+ description: >
194
+ TURTLE expansion easy: your single pre-placed base (fact +
195
+ barracks + 2× power plant + refinery + harvester) faces an
196
+ incoming hunt band of 4 rifle infantry. You have no MCV and
197
+ cannot expand. Fortify in place: build at least 3 pillboxes
198
+ (pbox) AND at least 1 gun turret (gun) AND have ≥3 own
199
+ units alive AND keep the construction yard (fact) standing,
200
+ all before tick 5400. A war factory (weap) is required as
201
+ gun's engine prerequisite — that is the only tech allowed
202
+ under the turtle frame. Stalling (no defences → fact razed),
203
+ pure-army-no-towers (e1-spam, gets ground down), and over-
204
+ tech-skip-defence (weap+dome+more before pbox, fact razed
205
+ during research) all LOSE.
206
+ starting_cash: 6500
207
+ overrides:
208
+ actors:
209
+ # West base. fact at (16,20) — eastmost of the base
210
+ # buildings, so the hunt band's centroid-seek targets fact
211
+ # FIRST (and the easy-to-replace defence line in front),
212
+ # not the irreplaceable tent. Tent + 2 powr + proc clustered
213
+ # WEST behind the fact; the screen + pbox lane mouth runs
214
+ # EAST of the fact, where the hunt band actually engages.
215
+ - {type: fact, owner: agent, position: [16, 20]}
216
+ - {type: tent, owner: agent, position: [8, 18]}
217
+ - {type: powr, owner: agent, position: [6, 20]}
218
+ - {type: powr, owner: agent, position: [6, 22]}
219
+ - {type: proc, owner: agent, position: [10, 16]}
220
+ - {type: harv, owner: agent, position: [10, 22]}
221
+ - {type: mine, owner: neutral, position: [2, 20]}
222
+ # Pre-placed seed: 1 pbox + weap (gun prereq) standing.
223
+ # The agent must ADD 2 more pbox + 1 gun to reach the
224
+ # 3 pbox + 1 gun bar — the irreducible turtle build chain
225
+ # under attack pressure. The pre-placed pbox + weap give
226
+ # just enough cushion that the build chain has time to
227
+ # complete; without the seed, the line is built too late
228
+ # and ganged before completion.
229
+ - {type: pbox, owner: agent, position: [22, 20]}
230
+ - {type: weap, owner: agent, position: [10, 24]}
231
+ # Pre-placed starting screen: 4× e1 (so the
232
+ # own_units_gte:3 bar starts satisfied; the discriminator
233
+ # is whether the agent KEEPS ≥3 alive — adds reinforcing
234
+ # pbox + trains replacement infantry as the hunt band
235
+ # grinds the screen).
236
+ - {type: e1, owner: agent, position: [20, 20], stance: 3, count: 4}
237
+ # Smaller hunt band (4× e1) starting far east at x=95.
238
+ # At ~3-4 cells/turn the band needs ~20+ turns (~tick 2000)
239
+ # to reach the lane mouth at x=22, giving the pbox×3+gun
240
+ # chain time to come online.
241
+ - {type: e1, owner: enemy, position: [95, 20], stance: 3, count: 4}
242
+ # Persistent unarmed enemy marker — LOSS-not-DRAW guarantee.
243
+ - {type: fact, owner: enemy, position: [122, 20]}
244
+ win_condition:
245
+ all_of:
246
+ - building_count_gte: {type: pbox, n: 3}
247
+ - building_count_gte: {type: gun, n: 1}
248
+ # Conyard still standing — use building_count_gte (per-tick
249
+ # refreshed) NOT has_building (monotonic set, never un-set
250
+ # after a kill — CLAUDE.md footgun).
251
+ - building_count_gte: {type: fact, n: 1}
252
+ - own_units_gte: 3
253
+ - within_ticks: 5400
254
+ fail_condition:
255
+ any_of:
256
+ - after_ticks: 5401
257
+ - not: {building_count_gte: {type: fact, n: 1}}
258
+ - not: {own_units_gte: 1}
259
+ max_turns: 62
260
+
261
+ # ── MEDIUM ───────────────────────────────────────────────────────
262
+ # The TURTLE challenge proper: full hunt band (6× e1 + 2× e3) +
263
+ # dense fortification bars (≥6 pbox + ≥2 gun + ≥3 defenders +
264
+ # fact standing). Cash covers 6 pbox + 2 gun + weap + 3 e1 ≈
265
+ # 6500, plus buffer for spare defenders.
266
+ # max_turns 62 → reachable tick 5583 ≥ 5401 ✓
267
+ medium:
268
+ description: >
269
+ TURTLE expansion medium: your single pre-placed base (fact +
270
+ barracks + 2× power plant + refinery + harvester) faces an
271
+ incoming hunt band of 6 rifle infantry plus 2 rocket soldiers.
272
+ You have no MCV and cannot expand — you must fortify the one
273
+ site densely. Build at least 6 pillboxes (pbox) AND at least
274
+ 2 gun turrets (gun) AND have ≥3 own units alive AND keep the
275
+ construction yard (fact) standing, all before tick 5400. A
276
+ war factory (weap) is required as gun's engine prerequisite.
277
+ Stalling (no defences → fact razed), pure-army-no-towers
278
+ (e1-spam, ground down without anchors), and over-tech-skip-
279
+ defence (weap+dome before pbox, fact razed during research)
280
+ all LOSE.
281
+ starting_cash: 8500
282
+ overrides:
283
+ actors:
284
+ - {type: fact, owner: agent, position: [16, 20]}
285
+ - {type: tent, owner: agent, position: [8, 18]}
286
+ - {type: powr, owner: agent, position: [6, 20]}
287
+ - {type: powr, owner: agent, position: [6, 22]}
288
+ - {type: proc, owner: agent, position: [10, 16]}
289
+ - {type: harv, owner: agent, position: [10, 22]}
290
+ - {type: mine, owner: neutral, position: [2, 20]}
291
+ # Pre-placed seed: 5 pbox + 1 gun + weap (gun prereq).
292
+ # The agent must ADD ≥1 more pbox + ≥1 more gun (while
293
+ # reinforcing attrition losses) to reach the 6 pbox / 2
294
+ # gun bar under pressure from a hunt band of 6 e1 + 2 e3.
295
+ # Stalling (no build) → defences bleed below 6/2 (the
296
+ # hunt destroys ~1 pbox / 4 turns on average), bar never
297
+ # met. Pure-army (e1 only) → no replacement defences, bar
298
+ # falls below 6 mid-run. Over-tech (weap+dome+research
299
+ # instead of pbox/gun reinforcement) → cash spent
300
+ # elsewhere, bar unmet.
301
+ - {type: pbox, owner: agent, position: [22, 17]}
302
+ - {type: pbox, owner: agent, position: [22, 19]}
303
+ - {type: pbox, owner: agent, position: [22, 21]}
304
+ - {type: pbox, owner: agent, position: [22, 23]}
305
+ - {type: pbox, owner: agent, position: [24, 20]}
306
+ - {type: weap, owner: agent, position: [10, 24]}
307
+ - {type: gun, owner: agent, position: [24, 18]}
308
+ # Heavier starting screen: 5 e1 + 1 e3 to absorb the e3
309
+ # rocket-soldier damage that out-ranges a single pbox.
310
+ - {type: e1, owner: agent, position: [20, 20], stance: 3, count: 5}
311
+ - {type: e3, owner: agent, position: [20, 22], stance: 3, count: 1}
312
+ # Canonical hunt band: 6× e1 + 2× e3 starting far east at
313
+ # x=95.
314
+ - {type: e1, owner: enemy, position: [95, 20], stance: 3, count: 6}
315
+ - {type: e3, owner: enemy, position: [97, 20], stance: 3, count: 2}
316
+ - {type: fact, owner: enemy, position: [122, 20]}
317
+ win_condition:
318
+ all_of:
319
+ - building_count_gte: {type: pbox, n: 6}
320
+ - building_count_gte: {type: gun, n: 2}
321
+ - building_count_gte: {type: fact, n: 1}
322
+ - own_units_gte: 3
323
+ - within_ticks: 5400
324
+ fail_condition:
325
+ any_of:
326
+ - after_ticks: 5401
327
+ - not: {building_count_gte: {type: fact, n: 1}}
328
+ - not: {own_units_gte: 1}
329
+ max_turns: 62
330
+
331
+ # ── HARD ─────────────────────────────────────────────────────────
332
+ # +1 axis: TWO agent spawn_point groups rotate the whole starter
333
+ # base between a NORTH (y=12) and a SOUTH (y=28) latitude.
334
+ # Symmetric enemy hunt bands at BOTH latitudes (enemies don't
335
+ # honour spawn_point — CLAUDE.md), so the threat always arrives
336
+ # from both flanks regardless of which spawn the agent draws;
337
+ # but the home base flips per seed, so a single memorised pbox
338
+ # cell cannot generalise. Higher pbox bar (≥8) reflects the
339
+ # doubled threat surface. Cash 9500 covers 8 pbox + 2 gun +
340
+ # weap + 3 e1 ≈ 7600 plus buffer.
341
+ # max_turns 62 → reachable tick 5583 ≥ 5401 ✓
342
+ hard:
343
+ description: >
344
+ TURTLE expansion hard: your single pre-placed base spawns at
345
+ either the NORTH (y=12) or SOUTH (y=28) latitude depending on
346
+ the seed; symmetric hunt bands arrive from BOTH latitudes
347
+ regardless. Fortify the site you actually got: build at least
348
+ 8 pillboxes (pbox) AND at least 2 gun turrets (gun) AND have
349
+ ≥3 own units alive AND keep the construction yard (fact)
350
+ standing, all before tick 5400. A memorised pbox layout from
351
+ one spawn does not generalise to the other.
352
+ objective_coords: relative
353
+ starting_cash: 9500
354
+ overrides:
355
+ enemy: {faction: soviet, bot_type: hunt}
356
+ actors:
357
+ # North-base spawn (spawn_point 0). y=12 chosen so the
358
+ # WEST-stacked powr/proc/tent stays in-bounds (y∈[2,38]).
359
+ - {type: fact, owner: agent, position: [16, 12], spawn_point: 0}
360
+ - {type: tent, owner: agent, position: [8, 10], spawn_point: 0}
361
+ - {type: powr, owner: agent, position: [6, 12], spawn_point: 0}
362
+ - {type: powr, owner: agent, position: [6, 14], spawn_point: 0}
363
+ - {type: proc, owner: agent, position: [10, 8], spawn_point: 0}
364
+ - {type: harv, owner: agent, position: [10, 14], spawn_point: 0}
365
+ # Pre-placed seed: 7 pbox + 1 gun + weap (NORTH). Agent
366
+ # must add ≥1 pbox + ≥1 gun (plus reinforce attrition)
367
+ # to reach 8/2 bar.
368
+ - {type: pbox, owner: agent, position: [22, 8], spawn_point: 0}
369
+ - {type: pbox, owner: agent, position: [22, 10], spawn_point: 0}
370
+ - {type: pbox, owner: agent, position: [22, 12], spawn_point: 0}
371
+ - {type: pbox, owner: agent, position: [22, 14], spawn_point: 0}
372
+ - {type: pbox, owner: agent, position: [22, 16], spawn_point: 0}
373
+ - {type: pbox, owner: agent, position: [24, 11], spawn_point: 0}
374
+ - {type: pbox, owner: agent, position: [24, 13], spawn_point: 0}
375
+ - {type: weap, owner: agent, position: [10, 16], spawn_point: 0}
376
+ - {type: gun, owner: agent, position: [24, 9], spawn_point: 0}
377
+ - {type: e1, owner: agent, position: [20, 12], stance: 3, count: 5, spawn_point: 0}
378
+ - {type: e3, owner: agent, position: [20, 14], stance: 3, count: 1, spawn_point: 0}
379
+ # South-base spawn (spawn_point 1) — symmetric layout.
380
+ - {type: fact, owner: agent, position: [16, 28], spawn_point: 1}
381
+ - {type: tent, owner: agent, position: [8, 30], spawn_point: 1}
382
+ - {type: powr, owner: agent, position: [6, 28], spawn_point: 1}
383
+ - {type: powr, owner: agent, position: [6, 26], spawn_point: 1}
384
+ - {type: proc, owner: agent, position: [10, 32], spawn_point: 1}
385
+ - {type: harv, owner: agent, position: [10, 26], spawn_point: 1}
386
+ - {type: pbox, owner: agent, position: [22, 24], spawn_point: 1}
387
+ - {type: pbox, owner: agent, position: [22, 26], spawn_point: 1}
388
+ - {type: pbox, owner: agent, position: [22, 28], spawn_point: 1}
389
+ - {type: pbox, owner: agent, position: [22, 30], spawn_point: 1}
390
+ - {type: pbox, owner: agent, position: [22, 32], spawn_point: 1}
391
+ - {type: pbox, owner: agent, position: [24, 27], spawn_point: 1}
392
+ - {type: pbox, owner: agent, position: [24, 29], spawn_point: 1}
393
+ - {type: weap, owner: agent, position: [10, 24], spawn_point: 1}
394
+ - {type: gun, owner: agent, position: [24, 31], spawn_point: 1}
395
+ - {type: e1, owner: agent, position: [20, 28], stance: 3, count: 5, spawn_point: 1}
396
+ - {type: e3, owner: agent, position: [20, 26], stance: 3, count: 1, spawn_point: 1}
397
+ # Two ore patches, one per spawn cluster (engine doesn't
398
+ # filter neutral actors by spawn_point — both placed).
399
+ - {type: mine, owner: neutral, position: [2, 12]}
400
+ - {type: mine, owner: neutral, position: [2, 28]}
401
+ # Doubled hunt bands at BOTH latitudes — enemies place
402
+ # regardless of spawn_point so the threat is symmetric.
403
+ - {type: e1, owner: enemy, position: [95, 12], stance: 3, count: 5}
404
+ - {type: e3, owner: enemy, position: [97, 12], stance: 3, count: 1}
405
+ - {type: e1, owner: enemy, position: [95, 28], stance: 3, count: 5}
406
+ - {type: e3, owner: enemy, position: [97, 28], stance: 3, count: 1}
407
+ # Persistent unarmed enemy marker — LOSS-not-DRAW guarantee.
408
+ - {type: fact, owner: enemy, position: [122, 20]}
409
+ win_condition:
410
+ all_of:
411
+ - building_count_gte: {type: pbox, n: 8}
412
+ - building_count_gte: {type: gun, n: 2}
413
+ - building_count_gte: {type: fact, n: 1}
414
+ - own_units_gte: 3
415
+ - within_ticks: 5400
416
+ fail_condition:
417
+ any_of:
418
+ - after_ticks: 5401
419
+ - not: {building_count_gte: {type: fact, n: 1}}
420
+ - not: {own_units_gte: 1}
421
+ max_turns: 62
tests/test_expansion_turtle_1_base_fortified.py ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """expansion-turtle-1-base-fortified — Wave-4 Group B TURTLE 1-base
2
+ fortification.
3
+
4
+ Scripted-policy no-defect / no-cheat validation. The pack hands the
5
+ agent a SINGLE pre-placed base (fact + tent + 2× powr + proc + harv +
6
+ mine + a SEED defence line of pre-placed pbox + 1 gun + weap) PLUS a
7
+ small starting screen, and asks the agent to FORTIFY it densely
8
+ enough to repel an incoming hunt-bot assault while reaching a higher
9
+ defence bar (≥3/≥6/≥8 pbox + ≥1/≥2/≥2 gun) and maintaining ≥3
10
+ defenders alive, all before tick 5400 with the conyard still standing.
11
+
12
+ Expansion is structurally forbidden: no MCV is provided and `deploy`
13
+ is removed from the tools list. The discrimination is whether the
14
+ model embraces the deep-defence play (actively REINFORCES the
15
+ pre-placed pbox / gun seed against the hunt's grinding attrition)
16
+ instead of stalling, building pure army (no pbox replacement, defences
17
+ bleed below the bar), or over-teching (cash spent on dome/fix
18
+ research instead of pbox/gun reinforcement).
19
+
20
+ The intended bar (CLAUDE.md): every lazy / single-axis / wrong-axis
21
+ policy LOSES on every level and every hard seed (1–4); only the
22
+ defence-reinforcement policy WINS.
23
+
24
+ - stall (only Command.observe()) → LOSS
25
+ - pure_army (only train e1, no defence builds) → LOSS
26
+ - over_tech (build dome+fix instead of pbox/gun) → LOSS
27
+ - intended_fortify (reinforce pbox+gun, train e1) → WIN
28
+ """
29
+
30
+ from __future__ import annotations
31
+
32
+ import pytest
33
+
34
+ pytest.importorskip("openra_train", reason="Rust env wheel not installed")
35
+
36
+ from openra_bench.eval_core import run_level
37
+ from openra_bench.scenarios import load_pack
38
+ from openra_bench.scenarios.loader import PACKS_DIR, compile_level
39
+
40
+ PACK = PACKS_DIR / "expansion-turtle-1-base-fortified.yaml"
41
+ LEVELS = ("easy", "medium", "hard")
42
+ SEEDS = (1, 2, 3, 4)
43
+
44
+ # Per-level (pbox_target, gun_target) — must match the pack YAML.
45
+ PARAMS = {"easy": (3, 1), "medium": (6, 2), "hard": (8, 2)}
46
+
47
+
48
+ # ── helpers ───────────────────────────────────────────────────────────
49
+
50
+
51
+ def _norm_prod(rs):
52
+ """Flatten the production list to item names (the engine emits
53
+ either dicts or bare strings depending on queue/version)."""
54
+ out = []
55
+ for p in (rs.get("production") or []):
56
+ if isinstance(p, dict):
57
+ out.append(p.get("item"))
58
+ elif isinstance(p, str):
59
+ out.append(p)
60
+ return out
61
+
62
+
63
+ def _fact_xy(rs):
64
+ fact = next(
65
+ (b for b in (rs.get("own_buildings") or []) if b.get("type") == "fact"),
66
+ None,
67
+ )
68
+ if fact is None:
69
+ return None
70
+ return int(fact["cell_x"]), int(fact["cell_y"])
71
+
72
+
73
+ def _building_counts(rs):
74
+ own = rs.get("own_buildings") or []
75
+ counts = {}
76
+ for b in own:
77
+ counts[b.get("type")] = counts.get(b.get("type"), 0) + 1
78
+ return counts
79
+
80
+
81
+ # ── scripted policies ────────────────────────────────────────────────
82
+
83
+
84
+ def stall(rs, C):
85
+ """Observe-only — pre-placed pbox / gun get bled down by the
86
+ hunt band; defences fall below the bar, screen wipes below 3."""
87
+ return [C.observe()]
88
+
89
+
90
+ def pure_army(rs, C):
91
+ """Only ever train e1, never reinforce defences. Pre-placed pbox
92
+ bleeds below the bar; bar unmet at the deadline."""
93
+ prod = _norm_prod(rs)
94
+ if "e1" not in prod:
95
+ return [C.build("e1")]
96
+ return [C.observe()]
97
+
98
+
99
+ def over_tech(rs, C):
100
+ """Build research buildings (dome, fix) instead of defence
101
+ reinforcement. Cash spent on tech; pbox bar bleeds below target."""
102
+ own = rs.get("own_buildings") or []
103
+ types = {b.get("type") for b in own}
104
+ prod = _norm_prod(rs)
105
+ xy = _fact_xy(rs)
106
+ if xy is None:
107
+ return [C.observe()]
108
+ fx, fy = xy
109
+ cmds = []
110
+ if "dome" not in types and "dome" not in prod:
111
+ cmds.append(C.build("dome"))
112
+ if "dome" not in types:
113
+ cmds.append(C.place_building("dome", fx - 6, fy + 6))
114
+ elif "fix" not in types and "fix" not in prod:
115
+ cmds.append(C.build("fix"))
116
+ cmds.append(C.place_building("fix", fx - 8, fy + 6))
117
+ if not cmds:
118
+ cmds.append(C.observe())
119
+ return cmds
120
+
121
+
122
+ def make_intended(pbox_target: int, gun_target: int):
123
+ """Intended fortification policy: continuously REINFORCE the
124
+ pre-placed pbox seed against the hunt band's grinding attrition,
125
+ cap with the gun bar once pbox is at target, and train a stream
126
+ of replacement infantry to maintain own_units_gte:3 as the
127
+ starting screen takes damage.
128
+
129
+ Defence queue is SERIAL (Defense), Infantry queue is PARALLEL —
130
+ both held continuously full. The pbox_target+3 buffer keeps the
131
+ queue requesting reinforcement even when attrition holds the
132
+ count at target (so any single pbox kill is replaced before the
133
+ count dips below the bar).
134
+ """
135
+
136
+ placed = set()
137
+
138
+ def policy(rs, C):
139
+ own = rs.get("own_buildings") or []
140
+ occupied = {(b["cell_x"], b["cell_y"]) for b in own}
141
+ pbox_count = sum(1 for b in own if b.get("type") == "pbox")
142
+ gun_count = sum(1 for b in own if b.get("type") == "gun")
143
+ weap_count = sum(1 for b in own if b.get("type") == "weap")
144
+ prod = _norm_prod(rs)
145
+ n_pbox = prod.count("pbox")
146
+ n_gun = prod.count("gun")
147
+ n_e1 = prod.count("e1")
148
+ xy = _fact_xy(rs)
149
+ if xy is None:
150
+ return [C.observe()]
151
+ fx, fy = xy
152
+ units = rs.get("units_summary") or []
153
+ n_units = sum(
154
+ 1
155
+ for u in units
156
+ if str(u.get("type", "")).lower() in ("e1", "e3")
157
+ )
158
+ cmds = []
159
+ # Candidate placement cells: east of fact (lane mouth), in
160
+ # bounds (y∈[2,38] on rush-hour-arena, x∈[2,126]).
161
+ cells = []
162
+ for dx in (6, 8, 10, 12, 14, 4, 16, 5, 7, 9, 11, 13, 15):
163
+ for dy in (-3, -1, 1, 3, -2, 2, 0, -4, 4):
164
+ cells.append((fx + dx, fy + dy))
165
+
166
+ # Defence queue (Serial): prioritise gun once pbox at target
167
+ # and weap is online, otherwise reinforce pbox up to
168
+ # target+3 buffer to absorb attrition.
169
+ if n_pbox + n_gun == 0:
170
+ if (
171
+ gun_count < gun_target
172
+ and weap_count >= 1
173
+ and pbox_count >= pbox_target
174
+ ):
175
+ cmds.append(C.build("gun"))
176
+ elif pbox_count < pbox_target + 3:
177
+ cmds.append(C.build("pbox"))
178
+ elif gun_count < gun_target and weap_count >= 1:
179
+ cmds.append(C.build("gun"))
180
+
181
+ # Place any in-flight defence at the next free east cell.
182
+ if n_pbox >= 1:
183
+ for cx, cy in cells:
184
+ if (
185
+ 2 <= cy <= 38
186
+ and 2 <= cx <= 126
187
+ and (cx, cy) not in occupied
188
+ and (cx, cy) not in placed
189
+ ):
190
+ cmds.append(C.place_building("pbox", cx, cy))
191
+ placed.add((cx, cy))
192
+ break
193
+ if n_gun >= 1:
194
+ for cx, cy in cells:
195
+ if (
196
+ 2 <= cy <= 38
197
+ and 2 <= cx <= 126
198
+ and (cx, cy) not in occupied
199
+ and (cx, cy) not in placed
200
+ ):
201
+ cmds.append(C.place_building("gun", cx, cy))
202
+ placed.add((cx, cy))
203
+ break
204
+
205
+ # Infantry queue (Parallel): keep training replacements so
206
+ # own_units_gte:3 holds through screen attrition.
207
+ if n_units < 6 and n_e1 == 0:
208
+ cmds.append(C.build("e1"))
209
+
210
+ if not cmds:
211
+ cmds.append(C.observe())
212
+ return cmds
213
+
214
+ return policy
215
+
216
+
217
+ # ── scenario-shape invariants ─────────────────────────────────────────
218
+
219
+
220
+ def test_pack_compiles_with_three_levels_and_hunt_bot():
221
+ pack = load_pack(PACK)
222
+ assert pack.meta.id == "expansion-turtle-1-base-fortified"
223
+ assert pack.meta.capability == "reasoning"
224
+ assert set(pack.levels) == {"easy", "medium", "hard"}
225
+ anchors = pack.meta.benchmark_anchor
226
+ assert any("fortress" in a.lower() or "1-base" in a for a in anchors), anchors
227
+ assert any("market" in a.lower() or "deeply" in a for a in anchors), anchors
228
+ assert any("fortress doctrine" in a.lower() or "impregnable" in a.lower() for a in anchors), anchors
229
+ for lvl in LEVELS:
230
+ c = compile_level(pack, lvl)
231
+ assert c.map_supported
232
+ enemy = c.scenario.enemy
233
+ bot = getattr(enemy, "bot_type", None) or getattr(enemy, "bot", None)
234
+ assert str(bot).lower() == "hunt", (lvl, bot)
235
+
236
+
237
+ def test_deploy_not_in_tools():
238
+ """TURTLE contract: `deploy` is structurally absent so the agent
239
+ cannot expand (the bench advertises only what the agent can do)."""
240
+ pack = load_pack(PACK)
241
+ for lvl in LEVELS:
242
+ c = compile_level(pack, lvl)
243
+ tools = [str(t).lower() for t in c.scenario.tools]
244
+ assert "deploy" not in tools, f"{lvl}: deploy must not be in tools"
245
+
246
+
247
+ def test_no_mcv_provided():
248
+ """Belt-and-suspenders TURTLE contract: no MCV pre-placed either,
249
+ so even if the deploy tool sneaks back the agent cannot deploy
250
+ what does not exist."""
251
+ pack = load_pack(PACK)
252
+ for lvl in LEVELS:
253
+ c = compile_level(pack, lvl)
254
+ mcvs = [a for a in c.scenario.actors if a.type == "mcv"]
255
+ assert mcvs == [], f"{lvl}: no MCV must be pre-placed; got {mcvs}"
256
+
257
+
258
+ @pytest.mark.parametrize("level", LEVELS)
259
+ def test_every_level_has_a_reachable_timeout_fail(level):
260
+ """Non-win must be a real LOSS: the `after_ticks` fail must be
261
+ strictly below the tick reachable at max_turns."""
262
+ c = compile_level(load_pack(PACK), level)
263
+ assert c.fail_condition is not None
264
+ fc = c.fail_condition.model_dump(exclude_none=True)
265
+ deadline = None
266
+ for clause in fc.get("any_of", []) or []:
267
+ if "after_ticks" in clause:
268
+ deadline = int(clause["after_ticks"])
269
+ assert deadline is not None, f"{level}: no after_ticks fail clause"
270
+ reachable = 93 + 90 * (c.max_turns - 1)
271
+ assert deadline < reachable, (
272
+ f"{level}: deadline {deadline} unreachable within "
273
+ f"{c.max_turns} turns (max tick {reachable}) → DRAW degeneracy"
274
+ )
275
+
276
+
277
+ def test_hard_has_two_spawn_point_groups():
278
+ """Hard-tier contract: ≥2 distinct seed-driven spawn_point groups
279
+ so the home base latitude flips per seed (anti-memorisation)."""
280
+ c = compile_level(load_pack(PACK), "hard")
281
+ groups = {
282
+ a.spawn_point
283
+ for a in c.scenario.actors
284
+ if a.owner == "agent" and a.spawn_point is not None
285
+ }
286
+ assert groups == {0, 1}, groups
287
+ # All actors must be inside the rush-hour-arena playable bounds.
288
+ for a in c.scenario.actors:
289
+ x, y = a.position
290
+ assert 2 <= x <= 126 and 2 <= y <= 38, (a.type, a.position)
291
+
292
+
293
+ def test_win_uses_per_tick_fact_count_not_monotonic_has_building():
294
+ """CLAUDE.md footgun: `has_building` is monotonic (never un-sets
295
+ after the fact dies), so the "conyard still standing" clause
296
+ must use `building_count_gte:{type:fact,n:1}` (per-tick
297
+ refreshed) — otherwise an in-progress razed-conyard run still
298
+ "passes" the predicate."""
299
+ for lvl in LEVELS:
300
+ c = compile_level(load_pack(PACK), lvl)
301
+ win = c.win_condition.model_dump(exclude_none=True)
302
+ clauses = win.get("all_of", []) or []
303
+ fact_keep = any(
304
+ isinstance(cl.get("building_count_gte"), dict)
305
+ and cl["building_count_gte"].get("type") == "fact"
306
+ for cl in clauses
307
+ )
308
+ assert fact_keep, (
309
+ f"{lvl}: 'fact still standing' clause must use "
310
+ f"building_count_gte (per-tick refreshed), not has_building "
311
+ f"(monotonic)."
312
+ )
313
+
314
+
315
+ # ── solvency: intended WINS every level + every hard seed ────────────
316
+
317
+
318
+ @pytest.mark.parametrize("level", LEVELS)
319
+ def test_intended_fortify_policy_wins_every_level_and_seed(level):
320
+ c = compile_level(load_pack(PACK), level)
321
+ pbox_t, gun_t = PARAMS[level]
322
+ for seed in SEEDS:
323
+ r = run_level(c, make_intended(pbox_t, gun_t), seed=seed)
324
+ assert r.outcome == "win", (
325
+ f"{level} seed{seed}: intended dense-fortification "
326
+ f"reinforcement policy must WIN; got {r.outcome} "
327
+ f"(tick={r.signals.game_tick}, "
328
+ f"kills={r.signals.units_killed}, "
329
+ f"lost={r.signals.units_lost}, "
330
+ f"buildings={r.signals.own_buildings})"
331
+ )
332
+
333
+
334
+ # ── no-cheat: every lazy / single-axis policy LOSES (not draws) ──────
335
+
336
+
337
+ @pytest.mark.parametrize("level", LEVELS)
338
+ @pytest.mark.parametrize(
339
+ "policy_name,policy",
340
+ [
341
+ ("stall", stall),
342
+ ("pure_army", pure_army),
343
+ ("over_tech", over_tech),
344
+ ],
345
+ )
346
+ def test_lazy_and_single_axis_policies_lose_every_level_and_seed(
347
+ level, policy_name, policy
348
+ ):
349
+ """Stall (defences bleed below bar), pure-army (no defence
350
+ replacement → pbox falls below bar), over-tech (cash spent on
351
+ dome/fix → no pbox reinforcement, bar unmet) must ALL LOSE on
352
+ every level + every seed — a real reachable LOSS, never a draw."""
353
+ c = compile_level(load_pack(PACK), level)
354
+ for seed in SEEDS:
355
+ r = run_level(c, policy, seed=seed)
356
+ assert r.outcome == "loss", (
357
+ f"{level} seed{seed} {policy_name}: must LOSE (real fail, "
358
+ f"not a draw); got {r.outcome} "
359
+ f"(tick={r.signals.game_tick}, "
360
+ f"kills={r.signals.units_killed}, "
361
+ f"buildings={r.signals.own_buildings})"
362
+ )
363
+
364
+
365
+ # ── determinism ───────────────────────────────────────────────────────
366
+
367
+
368
+ def test_intended_run_is_deterministic_on_easy():
369
+ c = compile_level(load_pack(PACK), "easy")
370
+ pbox_t, gun_t = PARAMS["easy"]
371
+ a = run_level(c, make_intended(pbox_t, gun_t), seed=3)
372
+ b = run_level(c, make_intended(pbox_t, gun_t), seed=3)
373
+ assert (a.outcome, a.turns) == (b.outcome, b.turns), (
374
+ "same seed must be deterministic"
375
+ )
tests/test_hard_tier.py CHANGED
@@ -192,6 +192,14 @@ UPGRADED = [
192
  # flips per seed and no memorised "retreat west on y=20" opening
193
  # generalises.
194
  "combat-kite-jeep-vs-tank",
 
 
 
 
 
 
 
 
195
  ]
196
 
197
  # Consciously NOT spawn-varied, with the reason (keeps the curation
 
192
  # flips per seed and no memorised "retreat west on y=20" opening
193
  # generalises.
194
  "combat-kite-jeep-vs-tank",
195
+ # Wave-4 Group B TURTLE node of the expansion triple (SC2 fortress
196
+ # macro / 1-base mass-defence; military fortress doctrine; risk-
197
+ # averse single-market deep-investment anchor). Hard tier defines
198
+ # two agent spawn_point groups (NORTH y=12 / SOUTH y=28) round-
199
+ # robined by seed; symmetric hunt bands arrive at BOTH latitudes
200
+ # regardless (enemy actors don't honour spawn_point — CLAUDE.md),
201
+ # so a memorised pbox layout from one spawn does not generalise.
202
+ "expansion-turtle-1-base-fortified",
203
  ]
204
 
205
  # Consciously NOT spawn-varied, with the reason (keeps the curation