Skip to content

docs: genetics and inheritance design (ADR 0006, Phase 4, PR 1/5) - #97

Merged
CodeByBryant merged 1 commit into
mainfrom
docs/genetics-and-inheritance
Oct 24, 2026
Merged

CodeByBryant merged 1 commit into
mainfrom
docs/genetics-and-inheritance

Conversation

@CodeByBryant

Copy link
Copy Markdown
Owner

Summary

First of five Phase 4 PRs. Design only; no code or behavior changes. Records the genetics design before implementation, as ADR 0005 did for Phase 3.

  • ADR 0006: per-organism immutable Genome (physical, sensory, metabolic, behavioral, reproduction, brain, learning); table-driven per-kind mutation (gaussian, point, bit-flip, circular, trait-shift, learning-parameter, brain-weight); explicit recombination (blend crossover for continuous genes, per-block single-point crossover for neural weights so both parents' brains contribute); validateGenome / repairGenome / genomeDistance; a LineageStore that outlives organisms; learning inheritance (baldwinian / partial / lamarckian) as a pure function wired in Phase 5.
  • docs/genetics/genome.md: gene table with baselines, ranges, rates and stds; derived quantities; brain weight block layout; operators; validation rules; lineage API; config surface.
  • determinism.md: hash schema v3 layout (appends nextGenomeId and each organism's genome); v2 stays documented.
  • update-order.md: systems read the organism's own genes; reproduction builds the child genome on the genetics stream; death marks the lineage record.
  • configuration.md: field table brought up to date. It was missing the Phase 3 fields; this adds those plus the Phase 4 genetics section, and marks organisms.* / reproduction.* as the founder baseline.

Decisions made with the owner

  • Brain and learning genes are carried now (inherited, mutated, validated, compared) but unread until Phase 5.
  • All phenotype groups are live, with capability coupled to cost so no gene is a free lunch.
  • Learning inheritance is a pure function now; no runtime brain state is added before a brain exists.

Notes for review

  • reproduction.energyCost / offspringEnergy will be replaced by offspringInvestment + overheadFraction (baseline values reproduce Phase 3's 20 paid / 25 to child). No external users, so no compatibility shim.
  • Remaining Phase 4 PRs: (2) genome contracts + genetics config + pure genetics engine, (3) organisms carry genomes (behavior-preserving, with an equivalence gate against Phase 3's pinned scenarios), (4) heritable genomes + lineage store (with a stability gate), (5) hardening tests.

Test plan

  • pnpm format:check clean in a fresh clone
  • pnpm check green in a fresh clone (docs-only, no code touched)

🤖 Generated with Claude Code

Record the Phase 4 design before any code: a per-organism immutable genome
(physical, sensory, metabolic, behavioral, reproduction, brain, learning),
table-driven per-kind mutation, explicit recombination (blend crossover for
continuous genes, per-block segment crossover for neural weights so both
parents' brains contribute), validate/repair/compare operations, a lineage
store that outlives organisms, and learning inheritance as a pure function
wired in Phase 5.

Capability is coupled to cost (body-size-derived energy capacity and basal
cost, sensor cost scaling with sensor radius, reproduction cost scaling with
offspring investment) so no gene is a free lunch; at the baseline genome every
quantity equals its Phase 3 value, which lets the behavior-preserving PR prove
it changes nothing.

Also adds docs/genetics/genome.md (gene tables, ranges, operators, weight
layout, lineage API), hash schema v3 layout in determinism.md, the
genome-reading pipeline notes in update-order.md, and brings the
configuration.md field table up to date (it was missing the Phase 3 fields).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 24, 2026 01:30

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 insufficient remaining quota.

@CodeByBryant
CodeByBryant merged commit a308e8a into main Oct 24, 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