You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dashboard: hen-day lay rate shows over 100% (108%) #943
On the Dashboard's Lay rate card, the hen-day figure reads 108.3% on main and 107.5% on PR #940's branch. Both come from the sim fixture's default farm (101 flocks, all days partial), in the #940 before/after captures (1280 dark, "orders and Lay rate" frame). A hen lays at most one egg a day, so a hen-day rate above 100% cannot be correct.
It was already present before #940, which only changed the window it is computed over.
Where to look
The rate comes from the production report (GET /reports/production, spec §19.3). See IReportQueries.cs: HenDayPct = RatedEggs / RecordedHenDays. Its comments describe numerator/denominator matching rules: "the eggs of exactly the flocks whose birds are in RecordedHenDays".
Candidates:
(a) the numerator and denominator cover different flocks or days (for example, partial days);
(b) bird counts in the fixture are lower than the eggs recorded;
(c) the Dashboard's window join over two report calls double-counts.
Done when
The cause is found and stated: a calculation defect, or unrealistic fixture data.
A calculation defect is fixed, with a test using literal values, including a partial-day case.
If the cause is the fixture, the simulation seed is corrected so the Dashboard shows a plausible rate, and the report either caps or flags an impossible rate instead of displaying it silently.
Cause, amended after Codex gpt-6-sol review round 1 of #959: the figures in this issue come from fixture data (Sim House B recorded 380+ eggs a day from at most 350 birds; demo House 1 430+ from 420), but there was also a calculation gap. The exposure walk applied every bird movement dated D after counting D's birds, so a same-day addition (a negative Adjustment correcting a miscount) was missing from D's hen-days: 10 birds plus 10 added on D laying 20 eggs rated 200%. Fixed in 7ac891c on #959: additions count toward the day they are dated, removals keep taking effect the next day, and the over-100 flag decides from the unrounded halves.
Cause, final after Codex gpt-6-sol review round 2 of #959: the figures in this issue come from fixture data (Sim House B recorded 380+ eggs a day from at most 350 birds; demo House 1 430+ from 420). The calculation itself keeps the #92 convention: every bird movement, addition or removal, takes effect from the next day. A same-day addition can therefore legitimately read above 100% for that day, and the over-100 flag on Reports and the Dashboard surfaces it instead of capping the figure. A split rule counting same-day additions on the day was tried in round 1 and reverted by owner decision after round 2 showed it inflated exposure on a day whose mortality was corrected and double-counted paired same-day transfers between flocks. Regression tests pin all four scenarios.
Activity
mforce commentedon Sep 26, 2026
Cause, amended after Codex gpt-6-sol review round 1 of #959: the figures in this issue come from fixture data (Sim House B recorded 380+ eggs a day from at most 350 birds; demo House 1 430+ from 420), but there was also a calculation gap. The exposure walk applied every bird movement dated D after counting D's birds, so a same-day addition (a negative Adjustment correcting a miscount) was missing from D's hen-days: 10 birds plus 10 added on D laying 20 eggs rated 200%. Fixed in 7ac891c on #959: additions count toward the day they are dated, removals keep taking effect the next day, and the over-100 flag decides from the unrounded halves.
mforce commentedon Sep 26, 2026
Cause, final after Codex gpt-6-sol review round 2 of #959: the figures in this issue come from fixture data (Sim House B recorded 380+ eggs a day from at most 350 birds; demo House 1 430+ from 420). The calculation itself keeps the #92 convention: every bird movement, addition or removal, takes effect from the next day. A same-day addition can therefore legitimately read above 100% for that day, and the over-100 flag on Reports and the Dashboard surfaces it instead of capping the figure. A split rule counting same-day additions on the day was tried in round 1 and reverted by owner decision after round 2 showed it inflated exposure on a day whose mortality was corrected and double-counted paired same-day transfers between flocks. Regression tests pin all four scenarios.