Skip to content

Modernise to .NET 8, compile bots in memory, add GitHub Pages site - #1

Merged
EddPorter merged 3 commits into
masterfrom
ccr-827a2223-jxfdy0
Oct 20, 2026
Merged

EddPorter merged 3 commits into
masterfrom
ccr-827a2223-jxfdy0

Conversation

@EddPorter

@EddPorter EddPorter commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Brings the library up to date and adds a landing page for it.

Modernisation

  • Convert both projects to SDK-style net8.0 (Common.Logging 3.4.1, MSTest 3) and regenerate the solution file.
  • Replace CodeDom source and DLL generation with System.Linq.Expressions. Bots are compiled to delegates in memory, so nothing is written to disk and no assemblies leak. This resolves both README TODOs.
  • Remove the dead BotBreeder, the legacy test settings and VS accessor files, and the obsolete serialisation constructors.
  • Add a CI workflow (build, test, pack) and NuGet package metadata.

Bug fixes

  • SimulateGenerations returned an empty list when info logging was disabled, because bestBots was only assigned inside if (_log.IsInfoEnabled).
  • The CrossoverRate, MutationRate and RandomBotPercentage setters validated the previous field value instead of the new value, so out-of-range values were never rejected.

GitHub Pages site

  • docs/index.html is a self-contained landing page with a live, working miniature of the evolutionary loop, an annotated code walkthrough, a settings reference and guidance on when the library is and isn't a good fit.
  • Linked from the README.

Breaking change

The bot class (TBot) must now be concrete with a public parameterless constructor. BaseBot.RunBotLogic is virtual and runs the compiled delegate, instead of being abstract and overridden by a generated subclass. The README is updated.

Testing

  • dotnet test: 54 tests pass, including new end-to-end tests that compile, run and evolve a CounterBot and tests for the rate validation. The suite passed repeatedly (the evolution tests use random seeds).
  • The demo page was checked in headless Chromium at desktop and mobile widths in light and dark schemes, with no console errors or horizontal overflow.
  • The CI workflow has not run yet.

After merging

  • Enable GitHub Pages (Settings, Pages) with source set to the default branch and the /docs folder. The README links to https://eddporter.github.io/GeneCodeCS/.
  • The page's install block uses git clone because no NuGet package is published yet.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PfG6MnHg74EM7ndCo5atss

- Convert to SDK-style projects targeting net8.0; Common.Logging 3.4.1; MSTest 3.
- Replace CodeDom source/DLL generation with System.Linq.Expressions delegates.
  Nothing is written to disk and no assemblies leak. TBot must now be concrete
  with a parameterless constructor; RunBotLogic is virtual and runs the delegate.
- Remove dead BotBreeder, legacy test settings and VS accessor files.
- Fix SimulateGenerations returning no bots when info logging was disabled.
- Add end-to-end tests that compile, run and evolve a CounterBot.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfG6MnHg74EM7ndCo5atss
- docs/index.html: self-contained landing page with an interactive,
  working miniature of the evolutionary loop, annotated code walkthrough,
  settings reference and fit/limitations guidance.
- Fix CrossoverRate, MutationRate and RandomBotPercentage setters, which
  validated the previous field value instead of the new value.
- Link the page from the README.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfG6MnHg74EM7ndCo5atss
@EddPorter EddPorter changed the title Modernise to .NET 8 and compile bots in memory with expression trees Modernise to .NET 8, compile bots in memory, add GitHub Pages site Oct 20, 2026
@EddPorter
EddPorter merged commit bcf9699 into master Oct 20, 2026
1 check passed
@EddPorter
EddPorter deleted the ccr-827a2223-jxfdy0 branch October 22, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants