1
Observe
Code reads the simulation and writes what Jev needs into one JSON object: its troops and gold, each neighbor's strength and attitude, who could be finished off this step, and a short memory of its goal and what its last actions achieved.
It also prunes the options. Jev only ever chooses among actions the simulation would accept right now.
{
"me": { "land_share": 0.24, "troop_status": "healthy",
"gold": 412000 },
"players": {
"P3": { "kind": "nation", "troops_vs_mine": 0.58,
"attacking_me": false,
"conquest": { "share_of_my_troops_to_finish_them": 0.41 } }
},
"memory": { "goal": "conquer_neighbor",
"recent_actions": ["expand: +1,204 tiles"] }
}
2
Ask, once
Call A is a single request. It asks which of the 8 routes to take and which of 5 goals fits, and in the same request, every side decision: what to buy, whether to accept an alliance, how dangerous each neighbor is.
3
Arguments, asked before they're needed
Jev answers who to attack and how hard before it has picked a route, so a step never needs a second round trip. Troop amounts are scores on a scale, and code turns the expected level into a share of the army.
4
Pick a tile
Only builds, naval landings and nukes need a concrete tile. Code ranks the legal sites and Jev picks one in Call B. This step is a land attack, so it skips Call B.
5
The weakest link
Jev's confidence in a step is its lowest confidence among the answers that matter: the route and its target. Below 0.35 the step holds. When the top route comes back with no good target, Jev falls through to the next route that drew at least 15%.
Troop amounts, structures and sites are preferences. They're logged but never gated, so a close call between two good options doesn't stop Jev from acting.
6
Guard, then act
Code has the last word on troops. It keeps a reserve at home against the strongest neighbor, trims any push that would empty the army, and resizes an attack that can finish its target, up to 75% of troops. Side decisions go out in the same step. Code checks every intent against the simulation again right before sending it.