feat(ecology): F1 — data-driven natural-node species/lifecycle model (pure Shared) #252

Merged
panda merged 6 commits from feat/ecology-f1 into main 2026-08-02 10:32:35 +02:00
Collaborator

Summary

First, pure-Shared layer of the ecology system (epic #250, slice #251): a data-driven natural-node species/lifecycle modelcontent/ecology.txt + its parser + a lazy time-derived stage function. NO World / entity / networking / rendering (those are F2–F5, each its own PR). Design: docs/superpowers/specs/2026-08-02-ecology-harvest-audit.md (recognition audit) + …-ecology-slice-design.md (design + full Invariants Check) + the F1 plan (all committed here).

What's here:

  • StageDef / SpeciesDef (StageAtElapsed — pure, wallclock-seconds growth, provably terminating even on a cyclic lifecycle) / EcologyData / EcologyFormat.Read (validated parser).
  • content/ecology.txt with the two slice species — pine (4-stage) and rock (2-stage): different lifecycles on one generic engine, proving extend-by-type.
  • Content is DATA, not C# subclasses (HARD GATE respected); closed-vocab fields (stage refs, baseline, biomes) validated at parse.

How it was tested

  • 13 unit tests (IsoMmo.Shared.Tests/Ecology): parser happy-path + every error path (dup ids, unknown stage/baseline refs, undeclared species, malformed rows, empty biomes); lazy derivation (boundary, multi-hop chain, terminal stage, cyclic-termination, negative-elapsed, unknown-fromStage passthrough); a committed-content golden test.
  • Whole solution builds 0 warnings; CSharpier clean.
  • Built subagent-driven (TDD per task) with a whole-branch review — no Critical/Important; 3 Minor hardening items (brittle test path → repo IsoMmo.slnx walk-up; reject zero-biome species; +termination/edge tests) all fixed.

Scope & next

F1 only. Next PRs: F2 node entity + baseline-deterministic/delta persistence · F3 deterministic spawner · F4 AoI + NaturalNode* DTOs + protocol bump · F5 client render · then the harvest slice (its own design). Part of #250; first step of #251.

Checklist

  • just lint (CSharpier + analyzers, 0 warnings)
  • just test green
  • Whole solution builds
  • Multi-platform preserved (pure Shared C#, no OS dep)
  • Tests added for this change
  • Linked issue #251 (epic #250)
## Summary First, pure-`Shared` layer of the ecology system (epic #250, slice #251): a **data-driven natural-node species/lifecycle model** — `content/ecology.txt` + its parser + a **lazy time-derived stage** function. NO World / entity / networking / rendering (those are F2–F5, each its own PR). Design: `docs/superpowers/specs/2026-08-02-ecology-harvest-audit.md` (recognition audit) + `…-ecology-slice-design.md` (design + full Invariants Check) + the F1 plan (all committed here). **What's here:** - `StageDef` / `SpeciesDef` (`StageAtElapsed` — pure, wallclock-seconds growth, provably terminating even on a cyclic lifecycle) / `EcologyData` / `EcologyFormat.Read` (validated parser). - `content/ecology.txt` with the two slice species — pine (4-stage) and rock (2-stage): **different lifecycles on one generic engine**, proving *extend-by-type*. - Content is **DATA, not C# subclasses** (HARD GATE respected); closed-vocab fields (stage refs, baseline, biomes) validated at parse. ## How it was tested - **13 unit tests** (`IsoMmo.Shared.Tests/Ecology`): parser happy-path + every error path (dup ids, unknown stage/baseline refs, undeclared species, malformed rows, empty biomes); lazy derivation (boundary, multi-hop chain, terminal stage, cyclic-termination, negative-elapsed, unknown-fromStage passthrough); a committed-content golden test. - Whole solution builds **0 warnings**; CSharpier clean. - Built **subagent-driven** (TDD per task) with a whole-branch review — **no Critical/Important**; 3 Minor hardening items (brittle test path → repo `IsoMmo.slnx` walk-up; reject zero-biome species; +termination/edge tests) all fixed. ## Scope & next F1 only. Next PRs: **F2** node entity + baseline-deterministic/delta persistence · **F3** deterministic spawner · **F4** AoI + `NaturalNode*` DTOs + protocol bump · **F5** client render · then the **harvest slice** (its own design). Part of #250; first step of #251. ## Checklist - [x] `just lint` (CSharpier + analyzers, 0 warnings) - [x] `just test` green - [x] Whole solution builds - [x] Multi-platform preserved (pure Shared C#, no OS dep) - [x] Tests added for this change - [x] Linked issue #251 (epic #250)
fix(docs): drop dead game-design/ecology.md reference in the ecology specs (green check-doc-refs)
All checks were successful
ci / Lua content lint (pull_request) Successful in 9s
ci / Lint & Test (pull_request) Successful in 4m48s
4c545de1db
panda scheduled this pull request to auto merge when all checks succeed 2026-08-02 10:32:01 +02:00
panda merged commit aabf778b7f into main 2026-08-02 10:32:35 +02:00
panda deleted branch feat/ecology-f1 2026-08-02 10:32:35 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo!252
No description provided.