Genemap is twelve discrete layers that compose into one rank page. Each layer ships in its own source file, has one job, and is independently inspectable. This page documents the architecture in the order data flows — from the moment a producer uploads a breed-society catalogue to the moment a per-trait dollar weight resolves on the live rank page.
How the engine reads any breed-society's evaluation in any country and turns it into a canonical trait vocabulary the rest of the engine consumes.
Decides between a hand-written native parser (Tier 1, fast, deterministic) and the AI-translator fallback (Tier 2, planned — Claude-backed via Edge Function). The registry holds 21 Tier 1 native ingestors across 11 countries; everything else is currently routed back to the producer with a "use the generic CSV mapper" message. The Tier 2 eval-translate Edge Function is on the API roadmap (see /api.html).
MGT_EVAL_AI.translate() · isNative() · tier() · listNativeSystems()core/js/eval-system-translator.js
supabase/functions/eval-translate/index.ts (planned)
Per-system parser functions that handle the specific CSV/Excel export format each breed society publishes. Each has a detect() function that recognises distinctive header signatures, plus trait_aliases and meta_aliases maps that normalise per-system column names into Genemap canonical trait codes. 14 cattle parsers (TACE, Hereford BREEDPLAN, IGS Red Angus, Zoetis Inherit, ANCP Nelore, KAPE Hanwoo, AAA Angus, AHA Hereford, ICBF, NAV Nordic, Logix Beef, Wagyu AGE, Signet BeefBreeder, World Angus). 7 sheep parsers (LAMBPLAN, MERINOSELECT, SIL, Signet Sheepbreeder, Sheep Ireland, NSIP, Fjárvís).
Detection supports multilingual signatures: Hangul (KAPE 근내지방도/도체중), Portuguese (ANCP Nome/Sexo/Pai/Mãe/DEP_), Swedish (NAV Far/Mor/Klass+Vikt), Icelandic (Fjárvís nafn/kyn/faðir), Spanish (Argentine cabaña terms — planned).
parseTACE() · parseAncpNelore() · parseKapeHanwoo() · parseAAAAngus() · parseAHAHereford() · parseICBF() · parseNAV() · parseLogixBeef() · parseWagyuAGE() · parseSignetBeef() · parseWorldAngus() · parseSIL() · parseLambplan() · parseMerinoselect() · parseSignetSheep() · parseSheepIreland() · parseNSIP() · parseFjarvis()core/js/catalogue-parsers.js
core/js/catalogue-parsers-sheep.js
One central registry of every country the platform covers, with each country's currency code, units system (metric vs imperial), preferred grading scheme, native breed-evaluation system, default production system, and a country-specific vernacular profile. Used by every downstream layer to resolve "what currency does this producer trade in", "what's the canonical grading axis on their kill grid", and "what vocabulary should the UI use".
MGT_COUNTRY_REGISTRY.getCountry() · getCurrency() · getGrading() · getProductionSystemsForCountry()core/js/country-registry.js
The closed-form bioeconomic engine that turns canonical EBVs/EPDs/DEPs into per-trait dollar weights for the producer's specific operation.
The load-bearing layer. For each trait i, computes the marginal effect of one EBV unit on the producer's gross margin per head — the Hazel (1943) selection-index formulation, derived from the producer's farm profile (breeding system, calving time, joining length, retention, target grid, gross margin). The output is a per-trait dollar weight that the rank page consumes.
MGT_CATTLE.computeWeights() · MGT_SHEEP.computeWeights() · deriveWeight(trait, profile, country, system)core/js/engine.js (cattle)
core/js/engine-sheep.js (sheep)
Each breeding value expresses across a lifetime — directly in the animal, in its progeny, in subsequent generations. The platform values the full pathway with NPV discounting (default 5% p.a. over 10 years). Maternal traits get the weight they actually deserve in self-replacing systems; terminal-only traits get nothing of the daughter-pathway return.
discountedGeneFlow(trait, system, { horizon: 10, rate: 0.05 })Two implementations: an offline Gibbs sampler with reaction-norm γ (for full re-fits across seasons) and an online recursive Normal-Inverse-Gamma conjugate-prior update (for daily nudges as new cohorts close out). Both regress the producer's realised slaughter $/head against the animal's EBV vector to produce a producer-specific multiplier β̂ that adjusts each industry-default weight. λ chosen by leave-one-out CV; bootstrap CI on each multiplier surfaces on the rank-page tooltip.
fitProducerCalibration(producerId, traits) · updatePosterior(state, newCohorts) · summarise(state)core/js/calibration-online.js (CB.2 — daily online update)
core/js/calibration-bayesian.js (offline Gibbs)
22 system-specific multiplier tables that re-weight the bioeconomic objective for the producer's actual operation — and the frontier signals that extend the system.
12 beef + 10 sheep production-system codes, each with a multiplier table that amplifies, dampens or zeroes individual trait weights for the producer's specific operation. Hanwoo intensive multiplies MARB ×3.5; AU Merino multiplies CFW ×2.7 and FD ×−2.2; pelt-primary Gotland multiplies Pälskvalitet ×4.0 and dampens carcass; US feedyard multiplies MARB ×3.4 and RFI ×1.8; Argentine pampas multiplies YW ×1.4 and dampens MW ×0.55. The full catalogue with multiplier tables is at /systems.html.
MGT_PRODUCTION_SYSTEM.apply(baseResult, species, { productionSystem: code }) · getLabel() · listForSpecies()core/js/production-system-modifier.js
Computes per-animal residual methane intensity from GreenFeed / SF6 / respiration-chamber / microbiome-proxy measurements, converts to CO2-equivalent via IPCC AR6 GWP=27, multiplies by the country's current carbon-market spot (ETS / ACCU / J-Credit / K-ETS), and discounts the gross-margin anchor by the resulting per-head cost. The full extension is in active Q3 2026 build per the roadmap.
applyMethaneEconomics(grossMargin, animal, country) · inventoryCH4(animal, system)core/js/methane-sustainability.js (CH4.1)
Optional evaluation axes the engine consumes where data is available: DNA methylation at stress-response loci (HSP70, NR3C1, IGF2), rumen 16S microbiome composition (heritable component as a feed-conversion + methane proxy), drought severity from BoM SILO / NOAA / SMHI / NIWA, nutrition supplementation tracking, and live weights for growth-curve fitting. Each is a sibling module that hooks into the bioeconomic engine when its source data is present.
core/js/epigenetics-calibration.js
core/js/drought-cattle-bridge.js
core/js/nutrition-bridge.js
core/js/live-weights-bridge.js
Once the per-trait dollar weights are derived, calibrated, system-modified and methane-adjusted, the rank page renders them in the producer's currency, units, and vernacular.
Every dollar weight resolves to the producer's local currency (AUD, USD, GBP, EUR, BRL, ARS, NZD, KRW, JPY, SEK, DKK, NOK, ZAR, CHF, ISK, INR). The currency-engine module is shipped; the daily ECB FX-rates refresh Edge Function is on the API roadmap. Today FX is loaded from a static fallback table; the daily nightly refresh ships when the fx-rates-refresh function is deployed (tracked on /api.html).
MGT_CURRENCY.toUSD() · fromUSD() · format()core/js/currency-engine.js
supabase/functions/fx-rates-refresh/index.ts (planned)
The UI vocabulary tracks the producer's country. "Stud" in AU/NZ becomes "seedstock operation" in US/CA, "pedigree breeder" in GB/IE, "cabaña" in AR/UY. "Paddock" in AU/NZ becomes "pasture" in US, "field" in GB. "EBV" in AU becomes "EPD" in US, "DEP" in BR/AR. The resolver scans the DOM for data-vt spans and rewrites them on page load based on the user's resolved country.
MGT_VERNACULAR.term('stud', 'US') · localise() · listKeys()core/js/vernacular-resolver.js (VR.1)
The platform's intended nervous system. The plan: every 24 hours, every country's climate source pulls overnight, every market feed refreshes (USDA-AMS, MLA NLRS, AHDB, Bord Bia, EU MMO, Jordbruksverket, CEPEA, AgriHQ, CanFax, KAPE), FX rates refresh from the ECB, anonymised regional anchors recompute across the producer network (minimum 5-producer bucket), and the global recalibration cron pushes the new model state to every account before sunrise.
Today the deployed Edge Functions include sheep-ai-ask, cattle-ai-ask, create-checkout-session, error-ingest, stripe-webhook, the derive-* pipeline (animal insights, breed system, bull purchase, heifer selection, mating plan, nutrition plan, sire performance, lifetime profitability), ssgblup-solve, data-export, eval-translate and invite-member. buyer-notification-email is built and awaiting Gmail SMTP secrets before deploy. The climate-pull, market-pull and global-recalibrate functions are designed but not deployed — tracked on /api.html.
daily-global-recalibrate Edge Function · pg_cron schedule (planned)core/js/forage-climate.js (priority-chain client; falls back to NASA POWER browser fetch)
core/js/market-pricing*.js (hardcoded reference values today)
Every layer ships in source. Every coefficient is overridable on the rank page. Every dollar value can be traced back through the layered stack — from the kill grid that drove the producer-fit β̂ multiplier, through the system overlay, through the closed-form bioeconomic derivation, back to the EBV/EPD/DEP the breed society published.
For deeper documentation: methodology (closed-form maths + 8 equations), systems catalogue (22 production-system multiplier tables), for-researchers (academic-collaboration inbound), research bibliography (34 citations).