Language guide · GardenScript 0.6 / farm.v1

GardenScript: a strategy you can read, test and replay.

GardenScript is GardenArena’s rule-based strategy language. It describes decisions for a simulated farm: harvesting, irrigation, supplies and materials. A player or their AI assistant writes a policy once. The Rust engine validates and executes it without calling a language model every simulated day.

You can start without programming or an AI subscription. The farm includes three policies and no-code settings. This guide explains the rules underneath them. The playable interface is currently in French; the code and public MCP tools are usable independently of that interface.

Six decisions prepare the day

The farm profile evaluates six channels in this order. All read the same morning snapshot. The resulting work then executes with the resources still available. The first matching condition in each channel wins; otherwise provides its fallback.

Farm policy channels
ChannelDecisionExample intention
careRestock animal supplies?stock_up
harvestCollect available production?all_ready
irrigationWhen should crops be watered?dry_only
reservesBuy food, water, or neither?buy_food
materialsPrepare stakes or compost?tomato_stakes
kitchenMill, cook or prepare the next crop?resow

An intention is not a guaranteed action: the farm may lack a suitable target or the necessary resources. Reports preserve accepted and refused work. Buying water after the irrigation channel has executed does not retroactively water crops that morning.

A complete Rust-validated policy

This is “La Prévoyante”, an included GardenArena policy. Its name and source remain unchanged, including in this English guide. It is not attributed to an AI vendor or presented as optimal. It is exactly policy A in the published irrigation comparison.

garden "La Prevoyante" version 0.6
domain farm
ruleset: farm.v1
decide care:
  when resource.drinking_water_ml < 16000ml => stock_up
  when resource.feed_g < 2500g => stock_up
  when sheep.hay_g < 2000g => stock_up
  otherwise => maintain
decide harvest:
  otherwise => all_ready
decide irrigation:
  otherwise => dry_only
decide reserves:
  when pantry.reserve_days < 3day => buy_food
  when resource.irrigation_l < 100L => buy_water
  otherwise => keep
decide materials:
  when garden.tomato_stakes_count == 0count => tomato_stakes
  when compost.raw_g >= 500g => compost
  otherwise => keep
decide kitchen:
  when grain.unsown_count > 0count => resow
  when kitchen.flour_g >= 200g and kitchen.raspberries_g >= 300g and kitchen.table_eggs_count >= 2count => bake
  when grain.wheat_g >= 600g and kitchen.flour_g < 200g => mill
  otherwise => keep

In reserves, the first rule requests food when the morning food reserve is below three days. If it matches, that channel’s water-purchase rule will not be selected that morning. This is a priority choice, not two independent purchases.

stock_up can group several restocking actions, not just the stock that triggered the rule. The machine-readable policy catalogue describes the intentions, sensors, units and limits.

Why can a changed rule make no immediate difference?

A rule selects an intention; the current state determines the work possible. Replacing dry_only with comfort in our example changes an intention, yet the commands and final state at day 3 are identical. The first different work occurs while preparing day 4.

Follow the trace: one rule, four watering actions and 78 litres.

A bounded language, not arbitrary code

The 0.6 farm profile supports conditions with and and comparisons < <= > >= ==. It has no loops, mutable variables, network calls, file access or embedded Python. Unlike some other GardenScript profiles, this farm profile does not accept or.

Each source is limited to 16 KiB of ASCII, six required channels and a 512-unit virtual-machine budget. The catalogue exposes 29 bounded sensors. A SHA-256 identifies the exact source: changing a comment changes that fingerprint without necessarily changing the compiled policy’s decisions.

A policy run requests one to seven days with a game-purchase ceiling. It may stop earlier after a difficult day or a limit. It cannot read future observations or erase a bad day. The profile does not automate every manual command, such as breeding and selling.

Connect an assistant through MCP

The server is listed in the official MCP Registry (JSON record) as io.gardenarena/gardenscript, version 1.0.0. This is a discoverable connection record, not a certification of the model’s scientific validity.

The public Streamable HTTP endpoint is https://gardenarena.io/mcp. No API Pro key is required. A client that supports remote MCP can register this URL; connection screens vary by client. GET returns the human documentation, while MCP exchanges use POST.

  1. Call farm_policy_get to obtain the actual mission and contract.
  2. Prepare a policy and call farm_policy_validate.
  3. Use farm_policy_run for a bounded trial, or farm_compare_get then farm_compare_run to compare two policies from the same farm.
  4. Explain the recorded actions and export the result. The player explicitly chooses whether to continue a branch.

Read the tool schemas before supplying arguments. The live server card lists tools and status; the registry-format manifest describes the remote connection. The full MCP guide and assistant assignment give detailed limits. Public execution is bounded, not unlimited. Physical Trial submission and organizer approval are separate permissions.

The private API Pro pilot is a different integration path with project keys and jobs. Neither transport supplies a language model. Any fee charged by your assistant’s provider is separate; hosting and Rust computation still have costs.

Download and build the kernel. Plant, coop and bamboo profiles keep their own versions; farm 0.6 does not rewrite historical seasons.