Skip to content

Add formal trait trade-off registry#4

Open
Spbd1 wants to merge 1 commit into
codex/implement-genotype-to-phenotype-conversionfrom
codex/create-trait-trade-off-system-with-tests
Open

Add formal trait trade-off registry#4
Spbd1 wants to merge 1 commit into
codex/implement-genotype-to-phenotype-conversionfrom
codex/create-trait-trade-off-system-with-tests

Conversation

@Spbd1

@Spbd1 Spbd1 commented May 7, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide a canonical, machine-readable representation of context-dependent trait advantages and costs so simulation fitness models can reason about ecological trade-offs.
  • Ensure no major trait is modeled as universally beneficial by encoding both positive and negative effects and capturing uncertainty via a confidence_level tag.
  • Document the design and separate biology-inspired simulation assumptions from veterinary claims.

Description

  • Add TraitEffect dataclass and TRAIT_TRADEOFFS registry in pishiegen/fitness/tradeoffs.py with the 12 required traits, each listing positive_effects, negative_effects, affected_contexts, biological_rationale, and confidence_level (high | moderate | speculative).
  • Export the trade-off API from pishiegen.fitness by updating pishiegen/fitness/__init__.py to include TRAIT_TRADEOFFS, TraitEffect, and all_trait_effects.
  • Add docs/trait_tradeoff_matrix.md documenting rules, the rationale summary for each trait, and the implementation link.
  • Add tests in tests/test_trait_tradeoffs.py that assert the registry contains the required keys, every trait has at least one benefit and one cost, effect directions are explicit, and metadata fields (affected_contexts, biological_rationale, confidence_level) are present.

Testing

  • Ran python -m pytest, all tests passed (20 passed), including tests/test_trait_tradeoffs.py which verifies the one-benefit/one-cost rule and metadata.
  • Ran python -m compileall pishiegen to verify module byte-compilation succeeded.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant