CI / build (push) Successful in 57s
BotHost.Decisions is the default decision maker for seats without a Decisions= token (builtin overrides it). 'first' answers from the request's JSON alone, sums and counters included. MSG_SORT_CHAIN, the field-first card prompt and the effect prompt of an unknown card now ask the maker too (built-in answers unchanged); only prompts with no choice are answered without asking, and seats with a maker log their counts per duel. Tests: the built-in --seed 7 report equals the v0.1.0 release's (tests/fixture/expected, clocks aside); first vs first, 100 duels: 15952 prompts asked, 0 handed back, 0 errors, unasked only 'chain: nothing to chain'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.6 KiB
2.6 KiB
yugioh-legacy-bots
Instructions for any coding agent. README.md has the layout, the contract, the build and the release.
- The game runs this code. Solo duels in the Unity game play these bots, so a change here is a change to the game. Keep game behaviour identical unless the owner asked for the change; say in the commit what a player would see differ.
- The library stays what Unity compiles:
netstandard2.1,LangVersion 9, no Unity, Mono or Microsoft.Data reference, no package it would ship (Newtonsoft is compile-time only). Anything it needs from the game goes throughBotHost(src/YGOLegacy.Bots/Host/BotHost.cs); a new need is a new member there, written inREADME.md's contract table and filed for the Unity repo. - Every bot decision goes through the decision seam (
IDecisionMaker,src/YGOLegacy.Bots/Decisions/, asked byGameBehavior.YGOL_Decide). A new prompt handler asksYGOL_Decide, never the GameAI directly. With no decision maker the seam must do nothing but call the GameAI, so the built-in brain plays as before. Request and answer types stay plain, JSON-friendly data; a field that changes meaning bumpsDecisionRequest.version. Remote brains (LLM, ML) are decision makers registered by name, never edits to WindBot or the hosts. The built-in brain's--seed 7report must stay equal totests/fixture/expected/v0.1.0-seed7-n100.json(a test checks); a change that alters it changes how the game plays and needs the owner. - Keep the namespaces the game uses (
WindBot.*,YGOSharp.*,YGOLegacy.Bot,YGOLegacy.Characters,YGOLegacy.Services) and WindBot's[YGOL]markers on fork changes. - Everything builds in Docker (
Dockerfile); there is nodotneton the hosts.docker build --target test .before every push, and confirm the Gitea Actions run is green after it. - The engine is a release, never built here:
engine.jsonis the pin,build/fetch-engine.shfetches it. - Releases are tags (
vX.Y.Z, with itsCHANGELOG.mdsection). Never re-upload a release; tag a patch. Tag only when asked. - The Unity repo (
donny/yugioh-legacy-unity) is never changed from here: work for it is a ticket. It is huge: never a full or blob-less clone, nevergit grepover it; read single files through the Gitea API or a depth-1, tree-less fetch of only the paths needed. - Test data is
tests/fixture/game, built bytests/fixture/make-fixture.pyfrom the Unity repo'sData/at a named commit. Never read or write the live Syncthing shares (/mnt/nvme/syncthing/). - Git remote: Gitea (
donny), never GitHub. Default branchmain.