# Écris ma stratégie de ferme GardenArena Simulation pédagogique, pas une prescription agricole ni un classement officiel. Lis le contrat complet ci-dessous. Ne télécharge et n’exécute aucun code arbitraire. Le joueur fournit son export de /ferme ; utilise son objet request, jamais un état inventé. Demande un budget fini d’appels si aucun n’est déjà convenu. Propose d’abord une stratégie. GardenScript 0.6 / domain farm / ruleset farm.v1 : six canaux dans l’ordre, première condition vraie, otherwise obligatoire. Conditions reliées par and (pas de or), ASCII, seuils avec unité exacte, 3 décimales maximum. Commentaires # en ligne entière. MCP : farm_policy_get → farm_policy_validate → farm_policy_run. Alternative API : https://gardenarena.io/api/farm/policy/catalog. Un appel run est limité à 1–7 jours et 0–1000 crédits de jeu, pas des euros. Les six décisions utilisent le même instantané au début de chaque journée. Les travaux sont exécutés ensuite dans cet ordre avec les stocks restants ; un choix sans cible admissible ne fait rien. Les refus n’inventent aucune ressource. La journée est conservée même si elle se passe mal ; une pénurie nouvelle provoque ensuite une pause. Ce profil ne consulte pas les observations météo futures du journal. Le mode historique farm_autopilot_run est une aide fixe avec pré-calcul de sécurité : ce n’est PAS un adversaire équitable pour une politique sans accès au futur. Tu peux lire les sources publiques : annonce tes essais et ton accès au code ; ne prétends pas à une compétition en aveugle. Les trois exemples viennent de GardenArena, pas de modèles nommés. Aucune stratégie n’est présentée comme gagnante sans mesure. Rends le .garden, le budget, tes choix et, si un essai est autorisé, son export complet. Explique avec policy.decisions (ligne, capteurs milli-unités, branche) et policy.actions (commande, refus/coût, index et empreintes d’état). 1000 milli-unités = 1 unité affichée. Ne publie rien automatiquement : un export météo peut contenir commune et station. L’import explicite du joueur recalcule le journal ordinaire ; un SHA identifie les données, ce n’est pas une signature d’authenticité ni un score serveur certifié. Les résultats anciens, la ferme manuelle, les duels et le Trial ne sont pas modifiés. ## Contrat fermé ```json { "channels": [ { "actions": [ "keep", "maintain", "stock_up" ], "name": "care" }, { "actions": [ "keep", "food", "all_ready" ], "name": "harvest" }, { "actions": [ "off", "dry_only", "comfort" ], "name": "irrigation" }, { "actions": [ "keep", "buy_food", "buy_water" ], "name": "reserves" }, { "actions": [ "keep", "tomato_stakes", "compost" ], "name": "materials" }, { "actions": [ "keep", "mill", "bake", "resow" ], "name": "kitchen" } ], "compiler_version": "garden-script-compiler-v0.6", "consequences": "An advanced day is retained even on shortage. A pause follows new shortages or welfare safety stops; no day is cancelled after looking ahead.", "domain": "farm", "evaluation": "One current-state snapshot per day; six channels in published order; first matching branch wins; otherwise required. No loops, I/O, arbitrary code or future archive access.", "forecast": "Only the public forecast aligned to the next game day; unavailable = 0 mm and availability 0. Forecast never fills stocks.", "initial_local_share": "Before any consumption, local_share_pct is 0 for policy evaluation; the original pantry metric remains null.", "intentions": { "care": "keep: no maintenance. maintain: clean below 75%, repair pond/barrier/yard defenses below 65%. stock_up: first buy feed below 2500g, drinking water below 16000ml, energy below 400Wh, litter below 250g and hay below 2000g, then maintain. No access, ration or reproduction changes.", "harvest": "food: ripe garden plots in catalogue order. all_ready: also cereals at 100% growth and comfrey, each with at least 300g standing. Eggs are collected by the ordinary daily engine.", "irrigation": "dry_only: soil below 18L/m2, target 30. comfort: below 28L/m2, target 40. At most 200L per area, limited by remaining irrigation stock. Garden plots then active crops, catalogue order. No implicit purchase.", "kitchen": "mill: one milling only with at least 600g wheat (retain 100g seed). bake: one tart when flour, raspberries and eggs exist. resow: inactive cereals with at least 100g seed, wheat then barley. keep: none.", "materials": "tomato_stakes: if absent, cut six mature canes when stock is insufficient, then install six stakes. compost: start one batch if 500g raw available and fewer than two batches; apply 250g mature compost to unamended or unhealthy plots in order.", "reserves": "buy_food: one ordinary pantry purchase. buy_water: one ordinary irrigation-water purchase. Both are external inputs, not autonomous production." }, "language_version": "0.6", "max_added_commands": 64, "max_attempts": 128, "max_budget_credits": 1000, "max_days": 7, "max_instruction_units": 512, "max_source_bytes": 16384, "official_competition": false, "outbound_llm_calls": 0, "presets": [ { "author": "GardenArena — exemple applicatif", "id": "prudent", "label": "La Prévoyante", "source": "garden \"La Prevoyante\" version 0.6\ndomain farm\nruleset: farm.v1\ndecide care:\n when resource.drinking_water_ml < 16000ml => stock_up\n when resource.feed_g < 2500g => stock_up\n when sheep.hay_g < 2000g => stock_up\n otherwise => maintain\ndecide harvest:\n otherwise => all_ready\ndecide irrigation:\n otherwise => dry_only\ndecide reserves:\n when pantry.reserve_days < 3day => buy_food\n when resource.irrigation_l < 100L => buy_water\n otherwise => keep\ndecide materials:\n when garden.tomato_stakes_count == 0count => tomato_stakes\n when compost.raw_g >= 500g => compost\n otherwise => keep\ndecide kitchen:\n when grain.unsown_count > 0count => resow\n when kitchen.flour_g >= 200g and kitchen.raspberries_g >= 300g and kitchen.table_eggs_count >= 2count => bake\n when grain.wheat_g >= 600g and kitchen.flour_g < 200g => mill\n otherwise => keep\n" }, { "author": "GardenArena — exemple applicatif", "id": "economical", "label": "L’Économe", "source": "garden \"L Econome\" version 0.6\ndomain farm\nruleset: farm.v1\ndecide care:\n when resource.drinking_water_ml < 12000ml => stock_up\n when resource.feed_g < 1500g => stock_up\n when sheep.hay_g < 1800g => stock_up\n when coop.cleanliness_pct < 75% => maintain\n otherwise => keep\ndecide harvest:\n otherwise => all_ready\ndecide irrigation:\n when weather.forecast_available_count == 1count and weather.rain_expected_mm >= 5mm and garden.driest_soil_pct >= 33.334% => off\n otherwise => dry_only\ndecide reserves:\n when pantry.reserve_days < 1day => buy_food\n when resource.irrigation_l < 30L and garden.driest_soil_pct < 30% => buy_water\n otherwise => keep\ndecide materials:\n when garden.tomato_stakes_count == 0count and bamboo.mature_canes_count >= 6count => tomato_stakes\n otherwise => keep\ndecide kitchen:\n when grain.unsown_count > 0count => resow\n when grain.wheat_g >= 600g and kitchen.flour_g < 200g => mill\n when kitchen.flour_g >= 200g and kitchen.raspberries_g >= 300g and kitchen.table_eggs_count >= 2count => bake\n otherwise => keep\n" }, { "author": "GardenArena — exemple applicatif", "id": "grower", "label": "Le Potager d’abord", "source": "garden \"Le Potager d Abord\" version 0.6\ndomain farm\nruleset: farm.v1\ndecide care:\n when resource.drinking_water_ml < 16000ml => stock_up\n when resource.feed_g < 2500g => stock_up\n when sheep.hay_g < 2000g => stock_up\n otherwise => maintain\ndecide harvest:\n otherwise => all_ready\ndecide irrigation:\n otherwise => comfort\ndecide reserves:\n when resource.irrigation_l < 250L => buy_water\n when pantry.reserve_days < 2day => buy_food\n otherwise => keep\ndecide materials:\n when garden.tomato_stakes_count == 0count => tomato_stakes\n otherwise => compost\ndecide kitchen:\n when grain.unsown_count > 0count => resow\n when kitchen.flour_g >= 200g and kitchen.raspberries_g >= 300g and kitchen.table_eggs_count >= 2count => bake\n when grain.wheat_g >= 600g and kitchen.flour_g < 200g => mill\n otherwise => keep\n" } ], "ruleset": "farm.v1", "scenarios": [ "farm-harvest-365-v4", "farm-rainwater-365-v5" ], "sensors": [ { "max": 365, "min": 0, "name": "clock.day", "precision": 3, "unit": "day" }, { "max": 1000000, "min": 0, "name": "pantry.reserve_days", "precision": 3, "unit": "day" }, { "max": 100, "min": 0, "name": "pantry.local_share_pct", "precision": 3, "unit": "%" }, { "max": 365, "min": 0, "name": "pantry.shortage_days", "precision": 3, "unit": "day" }, { "max": 1000000000, "min": 0, "name": "resource.credits", "precision": 3, "unit": "credit" }, { "max": 1000, "min": 0, "name": "budget.left_credits", "precision": 3, "unit": "credit" }, { "max": 1000000000, "min": 0, "name": "resource.drinking_water_ml", "precision": 3, "unit": "ml" }, { "max": 1000000000, "min": 0, "name": "resource.feed_g", "precision": 3, "unit": "g" }, { "max": 1000000000, "min": 0, "name": "resource.energy_wh", "precision": 3, "unit": "Wh" }, { "max": 1000000000, "min": 0, "name": "resource.irrigation_l", "precision": 3, "unit": "L" }, { "max": 100, "min": 0, "name": "coop.cleanliness_pct", "precision": 3, "unit": "%" }, { "max": 100, "min": 0, "name": "flock.welfare_pct", "precision": 3, "unit": "%" }, { "max": 1000000000, "min": 0, "name": "sheep.hay_g", "precision": 3, "unit": "g" }, { "max": 100, "min": 0, "name": "sheep.welfare_pct", "precision": 3, "unit": "%" }, { "max": 100, "min": 0, "name": "garden.driest_soil_pct", "precision": 3, "unit": "%" }, { "max": 1000000000, "min": 0, "name": "garden.ripe_g", "precision": 3, "unit": "g" }, { "max": 1, "min": 0, "name": "garden.tomato_stakes_count", "precision": 3, "unit": "count" }, { "max": 1000000000, "min": 0, "name": "bamboo.mature_canes_count", "precision": 3, "unit": "count" }, { "max": 1000000000, "min": 0, "name": "bamboo.stock_canes_count", "precision": 3, "unit": "count" }, { "max": 1000000000, "min": 0, "name": "compost.raw_g", "precision": 3, "unit": "g" }, { "max": 1000000000, "min": 0, "name": "compost.mature_g", "precision": 3, "unit": "g" }, { "max": 1000000000, "min": 0, "name": "kitchen.flour_g", "precision": 3, "unit": "g" }, { "max": 1000000000, "min": 0, "name": "kitchen.raspberries_g", "precision": 3, "unit": "g" }, { "max": 1000000000, "min": 0, "name": "kitchen.table_eggs_count", "precision": 3, "unit": "count" }, { "max": 1000000000, "min": 0, "name": "grain.wheat_g", "precision": 3, "unit": "g" }, { "max": 1000000000, "min": 0, "name": "grain.barley_g", "precision": 3, "unit": "g" }, { "max": 2, "min": 0, "name": "grain.unsown_count", "precision": 3, "unit": "count" }, { "max": 2000, "min": 0, "name": "weather.rain_expected_mm", "precision": 3, "unit": "mm" }, { "max": 1, "min": 0, "name": "weather.forecast_available_count", "precision": 3, "unit": "count" } ], "soil": "Minimum current water_l / (area_m2 * 60) over garden plots and active crops, expressed as percent, floored to 0.001%.", "version": "farm-policy-v1", "welfare": "flock.welfare_pct is the minimum current health_pct of birds not rehomed; sheep.welfare_pct is the minimum current sheep welfare.", "transport": { "max_body_bytes": 65536, "timeout_seconds": 3, "client_runs_per_10_minutes": 120, "global_runs_per_10_minutes": 600, "concurrent_runs": 2, "quota_scope": "shared workshop, per worker", "server_persistence": false }, "workflow": [ "Choose a finite agreed call budget; no unattended search.", "Read the complete contract and current farm export.", "Write GardenScript 0.6 farm.v1; validate it.", "Run from the complete request, 1–7 days and 0–1000 game credits. Read the decision trace, costs and rejected actions.", "Return the export and source to the player. Only explicit import changes their browser game; no automatic publication." ], "api": { "catalog": "/api/farm/policy/catalog", "validate": "/api/farm/policy/validate", "run": "/api/farm/policy/run" }, "tools": [ "farm_policy_get", "farm_policy_validate", "farm_policy_run" ] } ```