Skip to content

fix(anatomy): per-mouth intake, sniffer over grown kinds, and ADR 0026 on diets (hard diets measured, not kept) - #143

Merged
CodeByBryant merged 4 commits into
mainfrom
feature/hard-diets
Nov 13, 2026
Merged

CodeByBryant merged 4 commits into
mainfrom
feature/hard-diets

Conversation

@CodeByBryant

Copy link
Copy Markdown
Owner

Summary

The owner's observation: predators have one food source, and herbivore mouths do not really matter (grazers and fungus-scrapers eat carcasses). Both true, measured (tests/probe/diet.probe.ts, default world, 4 seeds x 20,000 ticks, intake credited to the eater's mouth form): jaws got 5 percent of all carrion (mandibles 71, sprouts 12, proboscis 9, radula 2); a sprout took about a fifth of its intake from fungus and nectar; a proboscis ate as much grass as fruit. The cause is the specification (a mouth form is a 0.5 to 1.5x yield multiplier and only an exact 0 stops eating; carcasses were given every form a positive yield), not a code bug.

Three real fixes, kept (commit 1):

  1. A bite takes in the yield of the mouth that bites, not the blend over all the body's mouths (a sprout beside a jaw took grass at half its yield). One-mouth bodies keep their exact old value.
  2. A sniffer's selectivity is spread over the food kinds a world grows, not over the carcass kind predation appends last: the nectar sipper's selectivity (0.875 = nectar with 4 kinds) landed on carrion with 5, so in every default world its nose was tuned to carcasses.
  3. Validation: predation.carcass.yields may be 0; with food kinds on, every form must list a yield for every kind (an unlisted kind used to be edible by everyone).

Goldens: 18 of 52 entries move, all evolving-body worlds (the intake fix moves 16, the sniffer fix 2). With both fixes reverted all 52 reproduce, so the rest of the commit is behaviour-inert.

Hard diets, measured, not kept (ADR 0026). 16 seeds x 30,000 ticks: today 0 extinct, population 56.8, 0 of 16 worlds with a jaw at the end; carrion for the jaw only: 0 extinct, 50.3, 1 of 16, carrion share of intake 5.3 -> 0.7 percent (the carcasses rot, there are almost no jaws); hard plant diets with fallbacks: 1 of 16 extinct; hard plant diets with boosted specialists: 7 of 16 extinct; the first cut: 3 of 8 extinct (the specialist starts). At 100,000 ticks, carrion for the jaw only (owner's seed + seeds 1 to 7): no extinct, a jaw alive in 2 of 8 (1 of 8 before), one world 21 of 29 creatures are jaws (186 predation deaths in the last window), the owner's seed 224 predation deaths with one jaw left. The criteria stated before the runs (jaw alive in at least 4 of 8, never above 40 percent of a population, two mouth forms in at least 70 percent of worlds, no extinct world) were missed by every variant, so no diet table is shipped. The honest reading: the carrion flux is about 3.5 energy a second world-wide (feeds about four creatures), so exclusivity cannot be what keeps jaws alive; the jaw needs a second, richer, findable source (eggs and nests, the next project).

Open decision for the owner: whether to make carcasses jaw-only anyway for realism, at the measured cost (population about 11 percent lower, a predator boom in some worlds). It is a one-line config change (predation.carcass.yields to 0 for sprout, proboscis, mandible, radula) and the numbers are in the ADR.

Also in the PR: tests/probe/diet.probe.ts (who eats what), and starts.probe.ts no longer overwrites an override's anatomy section (its first hard-diet run was therefore not hard; found and fixed, and the numbers above come from longrun.probe.ts).

Type of change

  • Feature
  • Bug fix
  • Refactor
  • Performance improvement
  • Tests
  • Documentation
  • Build/CI
  • Breaking change

Simulation impact

  • No simulation behavior changed
  • Changes organism behavior
  • Changes genetics or inheritance
  • Changes learning
  • Changes ecology or resources
  • Changes persistence or save compatibility
  • Changes determinism

Determinism

  • Uses the seeded random source
  • Does not use Math.random() in simulation code
  • Does not use wall-clock time for simulation behavior
  • Determinism tests were added or updated
  • Not applicable

No hash schema bump (the hash layout is unchanged); 18 golden entries regenerated in the commit that causes them, with the attribution proof above.

Testing

Commands run:

fresh clone of this branch:
pnpm install --frozen-lockfile
pnpm format:check
pnpm check   (typecheck + lint + all tests)
pnpm build
node tools/check-pages-artifact.mjs apps/web/dist
node --test tools/*.test.mjs
golden suite: 18 moved entries regenerated; with both fixes reverted 52 of 52 reproduce

Additional tests:

tests/anatomy/diet-fixes.test.ts (sniffer mapping with and without the carcass kind, negative: the old mapping lands on carrion), a two-mouth bite test (sprout beside a jaw takes the sprout's yield, not the blend), config tests (carcass yield 0 accepted, negative rejected, unlisted kind is an error, kinds off needs nothing listed). Fixtures that make up food kinds get yields through a shared eats() helper.
Probes: diet.probe.ts, longrun.probe.ts, starts.probe.ts; numbers in the ADR.

Performance impact

  • No expected performance impact
  • Improves performance
  • May reduce performance
  • Benchmark included

Save compatibility

  • No save-format impact
  • Save format changed
  • Migration added
  • Existing saves tested

Screenshots or recordings

Not applicable (no UI change; the planned "Eats" line in the Anatomy tab was dropped with the diet table).

Review notes

  • Fourth measured null result in this arc (jaw inheritance, capacity, place memory, now diets), and this one produced three real bug fixes. The pattern in the ADRs: the world's energy economy, not creature cognition or mouth rules, limits carnivory.
  • Noticed, not changed: a second mouth doubles the body's bite size (it sums over mouths) even when the second mouth is a jaw that takes nothing from a plant.
  • tests/species/exit-criteria.test.ts "more mutation gives more species" takes about 59 to 64 seconds locally against a 60 second default (it also fails locally on unmodified main); it passed in the fresh-clone gate. A budget from CI evidence would be the fix if CI ever flags it.

Generated by Claude Code

…lds may be zero (ADR 0026)

Three fixes found while planning hard diets, none of which changes the default
diet table:
- A bite takes in the yield of the mouth that bites, not the blend over all the
  body's mouths (a sprout beside a jaw took half the sprout's yield). A body with
  one mouth keeps the exact value it had.
- A sniffer's selectivity is spread over the food kinds a world grows, not the
  carcass kind that predation appends last: the nectar sipper's 0.875 landed on
  nectar with four kinds and on carrion with five.
- predation.carcass.yields may be zero (a form that cannot digest meat), and with
  food kinds on every mouth form must list a yield for every kind (an unlisted
  kind used to be edible by everyone).

Goldens: 18 of 52 entries move, all evolving-body worlds (the intake fix moves 16,
the sniffer fix 2). With both fixes reverted all 52 reproduce, so the rest of the
commit is behaviour-inert.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8
…e diet probe, fixed starts probe

Records the owner's observation with numbers (jaws get 5 percent of the carrion,
herbivore mouths eat every kind), the three fixes kept, and four diet variants
measured over 16 seeds and 30,000 ticks plus carrion-for-the-jaw-only at 100,000
ticks: hard plant diets raise extinction (7 of 16 worlds with boosted specialists)
and exclusive carrion does not feed the jaw (jaw alive in 2 of 8, one world 72
percent jaws, population about 11 percent lower). The stated criteria were missed
by every variant, so no diet table is shipped; the owner decides on jaw-only carrion.

tests/probe/diet.probe.ts is committed (who eats what by mouth form and kind);
starts.probe.ts no longer overwrites an override's anatomy section.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8
Copilot AI balanced review requested due to automatic review settings November 13, 2026 16:49

This comment was marked as resolved.

@CodeByBryant

This comment was marked as low quality.

Co-authored-by: CodeByBryant <191651927+CodeByBryant@users.noreply.github.com>

Copilot AI commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@copilot make carcasses jaw-only

Done in 675773d. Carcasses are now jaw-only by default (predation.carcass.yields set to 0 for sprout/proboscis/mandible/radula), and I updated predation tests accordingly.

@CodeByBryant
CodeByBryant merged commit aed927b into main Nov 13, 2026
17 of 21 checks passed

Copy link
Copy Markdown
Owner Author

Done: carcasses are the jaw's alone. predation.carcass.yields is now 0 for sprout, proboscis, mandible and radula and 1.2 for the jaw, so only a jaw bites a carcass or sees one as food (commit 97cd92d).

What it costs, measured before you chose it and unchanged by shipping it (same config as the "carrion for the jaw only" variant in ADR 0026): population about 11 percent lower (56.8 to 50.3 over 16 seeds x 30,000 ticks), the carrion share of intake 5.3 to 0.7 percent (the carcasses mostly rot), and at 100,000 ticks a jaw alive in 2 of 8 worlds instead of 1 of 8, with one world flipping to 21 of 29 creatures being jaws.

What moved with it:

  • 4 golden entries (the predation worlds), regenerated in that commit; the other 48 do not touch a carcass.
  • ecology-stability floor 15 to 8, re-pinned from a measurement (12 held-out seeds: means 37.7 to 77.2, minimum 10 on seed 6 and 17 next, maximum 118, no world extinct); means and the ceiling hold. brain-long-run-1/-2, anatomy-long-run and ecology-stability-1 pass locally.
  • Tests: only the jaw bites or sees carrion and a mandible does neither (negatives), and the old table is still expressible; docs and ADR 0026/0023 updated.
  • Main was merged in (it carries the chunking time budget from docs(learning): ADR 0025, place memory and brain capacity were tried and made no difference #142).

The other determinism files (species, replay, chunking, validity) only check that a run is the same stepped, chunked or in one go; they timed out locally when I ran three shards at once, so CI is the real check for them.


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Correction to my last comment: my push was rejected at the time (the branch had moved), so the work was not yet on GitHub when I wrote it. It is now.

What happened: the branch had two other commits on it, the copilot-swe-agent[bot] commit 675773d ("make carcasses jaw-only by default", the same one-line config change but without the goldens, the re-pinned floor, the tests with negatives or the docs) and a merge of main from your account. I merged them into my branch (no history rewritten) and kept my versions of the three files both of us had touched; the result is a superset of the bot's change. Local checks after the merge: config 153 of 153, predation tests 58 of 58, format clean.

So the PR now has: the three fixes, ADR 0026, the jaw-only carcasses with its 4 regenerated goldens, and the ecology-stability floor 15 to 8 (measured). CI will run on the merged head.


Generated by Claude Code

CodeByBryant added a commit that referenced this pull request Nov 13, 2026
…hat go with it (ADR 0026) (#144)

PR #143 merged with the one-line carcass change from the Copilot bot but without
the parts that make it pass: 4 predation goldens regenerated, the ecology-stability
floor 15 to 8 (measured over 12 held-out seeds: means 37.7-77.2, minimum 10 on seed
6, maximum 118, none extinct), tests with negatives (only the jaw bites or sees
carrion, a mandible does neither, the old table is still expressible) and the doc
updates. Main's determinism shards 1 and 2 failed on both OSes at aed927b for exactly
this reason (stale goldens; seed 6 under the floor).


Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8

Co-authored-by: Claude <noreply@anthropic.com>
CodeByBryant added a commit that referenced this pull request Nov 13, 2026
* fix(predation): carcasses jaw-only, goldens and the stability floor that go with it (ADR 0026)

PR #143 merged with the one-line carcass change from the Copilot bot but without
the parts that make it pass: 4 predation goldens regenerated, the ecology-stability
floor 15 to 8 (measured over 12 held-out seeds: means 37.7-77.2, minimum 10 on seed
6, maximum 118, none extinct), tests with negatives (only the jaw bites or sees
carrion, a mandible does neither, the old table is still expressible) and the doc
updates. Main's determinism shards 1 and 2 failed on both OSes at aed927b for exactly
this reason (stale goldens; seed 6 under the floor).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8

* feat(life-cycle): sexes, carried clutches, eggs and hatching behind switches, hash schema 13 (ADR 0027)

Two sexes (founders alternate, a newborn's sex is one reproduction draw), a female carries a
conceived clutch for reproduction.eggs.incubation and pays carryCost, lays an egg, and the egg
hatches after reproduction.eggs.hatch into a creature that keeps the stored genome, parents and
the mother's species. Eggs and clutches count against maxPopulation; a carrying mother who dies
loses the clutch (clutch-lost). Everything is off by default: sexes.enabled and eggs.enabled
false take the old code path exactly.

Hash schema 13 appends the egg counters, each creature's sex and carried clutch and the egg store
after the version 12 tail. Switch-off proof: nine scenarios (field, instant eating, noise food,
clusters, one cluster, lush, no predation, no ecology, reflex) with founder brains equal to the
prior and mutation frozen give snapshots, events and records identical to the previous commit; the
header and sample digests match the independent Python hasher. All 50 golden entries regenerated
here only (the header carries the new version).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8

* feat(life-cycle): guarding and egg predation (ADR 0027)

A parent within reproduction.eggs.guardRadius of its egg guards it and pays guardCost a second
per egg. A bite at a guarded egg is stopped: the egg stays and the biter takes guardDamage,
counted as the guard's bite for the death label. An unguarded egg is eaten whole by any mouth
with a flesh yield (the gut takes what it can, at the trophic yield; a full gut refuses it), never
by a mandible or a parent. Eggs are prey in the senses of a body that bites creatures, and a parent
senses the way back to its own egg through the existing home inputs (present beyond the guard
radius, full at three times it), so no observation or weight changes. Switches are still off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8

* feat(life-cycle): ageing (decline and a rising chance of dying), eggs drawn, life probe (ADR 0027)

Ageing, off by default (ageing.enabled): past its own senescenceAge a creature burns more
(metabolismRise), is slower (speedLoss) and needs more energy to breed (fertilityLoss), and instead
of the hard cutoff at maxAge it faces a chance of dying per second that rises with how far past
senescenceAge it is (hazard x s), with certain death at ceiling x maxAge. One draw per old creature
per tick from the world stream, none in prime or with ageing off. The snapshot's lifeStage now uses
the creature's own senescence genes instead of the world's baseline.

Eggs are drawn as flat pale discs that fill as they near hatching, with a ring when a parent
guards them, on an Eggs layer (default on); tests/probe/life.probe.ts measures the life cycle.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8

* feat(life-cycle): mate choice, two heritable genes and mutual acceptance (ADR 0027)

reproduction.mateChoice (off by default, needs two sexes): a creature looks at the nearest few ready
partners of the other sex and takes the first that both accept. It scores a candidate
(1 - preference) x condition + preference x difference (condition: spare energy over what the
candidate needs to be ready; difference: genomic distance against the species threshold) and
accepts if the score reaches choosiness x threshold; turning every candidate down costs searchCost
energy and a retryDelay wait (failure reason 'rejected'). choosiness and preference are two new
reproduction genes appended to the table (Genome.version 5), so they mutate and recombine like any
other. A creature with choosiness 0 accepts anyone and the world is bit for bit the one without mate
choice (tested).

The gene table grows by two, so every founder's later genetics draws shift and every golden entry is
regenerated here. With the life cycle off, nine scenarios (field, instant eating, noise food, one
cluster, lush, no predation, no ecology, reflex) give snapshots identical to the code before the
life-cycle work; a multi-cluster layout differs only through the shifted genetics stream (its
founders differ, so the blend of their children depends on the draws).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8

* feat(life-cycle): switch the life cycle on by default, measured (ADR 0027)

Sexes, eggs, mate choice and ageing are on in the default world. 16 seeds x 30,000 ticks: no
extinct world, mean population 51 (lowest 16 to 21), starved 60 to 64 percent of deaths, old age
about a third, 98 to 99 percent of eggs hatch, a jaw lineage alive in 7 of 16 worlds. Reaching it
took four breeding numbers: minEnergy 75 to 65, cooldown 45 to 30, search radius 50 to 75 and
mating signal 250 to 350 (with half the creatures the wrong sex, the old values let 2 of 8 worlds
go extinct); ageing hazard 0.02 (0.04 cost a world) and mate choice choosiness 0.8, preference 0.5,
threshold 0.4, search cost 0.2 (the 0.3 tastes never turned anyone down).

Every pinned golden entry now says what it was measured with (one sex, an instant birth, the old
breeding numbers and gene baselines, ageing off) and all 50 reproduce their hashes unchanged: the
proof that the flip is config only. Three new entries pin the new default world. The Classic and
Clusters presets keep the old breeding and a hard lifespan; tests that pin numbers measured before
the life cycle use the BEFORE_LIFE helper. The Statistics panel shows the egg totals once an egg
has been laid, and the observatory counts an egg as flesh intake.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8

* fix(life-cycle): species are not state, so an egg's species is not hashed; re-pin two Phase 3 gates (ADR 0027)

An egg and a carried clutch kept the mother's species, and the hash covered it, which made species
part of the state: turning species off changed the 50,000-tick hash (species-long-run caught it).
The species an egg will hatch into is still stored, and no longer hashed, as for every other use of
species. The three golden entries of the new default world are regenerated for it; the 50 older
entries never carried an egg and are unchanged.

Two Phase 3 pins moved only because mate choice added two genes (every later mutation draw
shifts): the scarce world of long-run-extinction goes extinct at 27,182 (was 19,582, seed 6), and
long-run-population's seed 1 back half is 55 to 89 (was 25 to 46; seeds 2 to 6 stay at 25 to 48),
so its limit is 100 against a maxPopulation of 1,000.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8

* docs(life-cycle): ADR 0027 results and pointers from ADRs 0005, 0006 and 0010

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8

* docs(life-cycle): wording

* test: remove two imports the test typecheck flags

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8

* test(probe): lint-clean the life probe

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn5qp4xBHxLnTrwReNXcf8

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

4 participants