Skip to content

docs(simulation): continuous organism ecology design note (Phase 3, PR 1/5) - #92

Merged
CodeByBryant merged 1 commit into
mainfrom
docs/organism-ecology-policy
Sep 27, 2026
Merged

CodeByBryant merged 1 commit into
mainfrom
docs/organism-ecology-policy

Conversation

@CodeByBryant

Copy link
Copy Markdown
Owner

Summary

Design note first, matching how Phase 2 handled RNG/update-order changes and per the discipline doc's own trigger list ("changing the world update order", "adding a new resource or hazard model" analog, "changing the random-number strategy" analog). Locks the Phase 3 design before any engine code.

  • ADR 0005: organism model additions (parentIds, birthTick, reproductionCooldownRemaining, lastTurnMagnitude); life stages as a pure, never-stored function of age; the extended metabolism formula (turningCost + sensorCost now, learningCost/environmentalCost deferred to Phases 5/6); full reproduction economics and the ReproductionSystem algorithm (partner required, no asexual fallback; only 'no-partner'/'population-cap' failure reasons, since ineligible organisms silently don't "attempt"); bounded historical-organism records via a new HistoryStore (mirrors EventLog); a second, organism-indexed SpatialHash; new invariants; HASH_SCHEMA_VERSION 1 -> 2.
  • docs/simulation/update-order.md: Reproduction's real reads/writes/emits, the "spatial" stage now covers two indices, a new "Life stages" section, the three-writer organism.energy note (gain/metabolic cost/reproductive cost).
  • docs/simulation/determinism.md: a versioned "7.3 Canonical stream, schema versions" section - v1 kept verbatim for history, v2 appends the new organism fields (incl. parentIds as a length-prefixed id array) and the three reproduction metrics.

Two behavioral forks were resolved with the project owner before this PR: reproduction requires a partner (no asexual fallback), and the metabolism formula gets turningCost/sensorCost now but not learningCost/environmentalCost (their systems don't exist yet).

Simulation impact

  • Changes determinism (policy only; no engine code yet)

Determinism

  • Not applicable yet (spec only); the next PRs implement it

Testing

Not applicable - documentation only, no code changed. pnpm format:check passes on the touched files.

Review notes

  • Deliberately scoped out (see ADR "Alternatives considered"): no genomeId/health/alive fields, no species-aware "compatibility", no extinction policies beyond 'stop'. Each is a real absence, not a stub, consistent with how ReproductionSystem itself was left a genuine no-op rather than fake behavior.
  • Golden hashes get regenerated twice in this phase (once for the metabolism/life-stage PR, once for the reproduction PR) since both change actual trajectories, not just the hash layout.

🤖 Generated with Claude Code

Locks the Phase 3 design before any engine code: organism model
additions (parentIds, birthTick, reproductionCooldownRemaining,
lastTurnMagnitude), derived (never stored) life stages, extended
metabolism formula (turningCost, sensorCost; learningCost and
environmentalCost deferred to their own phases), reproduction
economics and the full ReproductionSystem algorithm (partner-required,
no asexual fallback), the extended ReproductionAttemptedEvent, bounded
historical-organism records via a new HistoryStore, an organism
spatial index, new invariants, and HASH_SCHEMA_VERSION 1->2.

Updates docs/simulation/update-order.md (reproduction's real
reads/writes/emits, the two-index spatial stage, a new Life stages
section) and determinism.md (schema version 2 table, keeping v1 for
history).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 27, 2026 02:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CodeByBryant
CodeByBryant merged commit 533162a into main Sep 27, 2026
11 checks passed
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