GEN-1: add vitest suite (worked example, SpSp renorm, wildcards) + erasable-enum fix

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-05 23:43:21 +02:00
parent 2bee5caaa2
commit 3561b435d5
2 changed files with 220 additions and 4 deletions

View File

@@ -1,13 +1,19 @@
/**
* Warning codes emitted by the genetics engine. The engine is language-neutral:
* it emits CODES only. German texts are mapped in de.ts (UI layer).
*
* Modelled as a const object (not a TS `enum`) because the project's tsconfig
* enables `erasableSyntaxOnly`.
*/
export enum GeneticsWarningCode {
export const GeneticsWarningCode = {
/** Schecke × Schecke: SpSp embryos die in utero; ~25% fewer live young. */
ScheckeLethal = 'SCHECKE_LETHAL',
ScheckeLethal: 'SCHECKE_LETHAL',
/** Rex × Rex: ReRe is semi-lethal; reduced viability of homozygous young. */
RexSemiLethal = 'REX_SEMI_LETHAL',
}
RexSemiLethal: 'REX_SEMI_LETHAL',
} as const
export type GeneticsWarningCode =
(typeof GeneticsWarningCode)[keyof typeof GeneticsWarningCode]
export interface GeneticsWarning {
readonly code: GeneticsWarningCode