A recent five-day production average sounds familiar, but the meaning of five days can remain hidden. Reading the risk calculator’s today-minus-four boundary and divisor led me to explain the basis a representative needs to interpret it.

Including today starts four days earlier

The source risk function sums good output from four dates before today through today, then divides by five. Both endpoints are included. The word recent is insufficient without those bounds; adding or removing one date changes the result under the same familiar name.

The new calendar-average function checks that interval using independent dates. Nonexistent dates fail, and future or out-of-window records do not enter the sum. It is a civil-date example without timezone or shift-boundary interpretation, which a real business must define separately.

Empty days stay in the calendar denominator

With ten units on the first and last dates only, total twenty divided by five gives calendar average four. Dividing by the two recorded dates gives ten, a different answer to a different question. Output explicitly states five calendar days and no working-day calendar.

A working-day average may be useful elsewhere, but needs holidays, equipment days or shift policy to determine its denominator. Treating missing logs as holidays would confuse omission with genuine inactivity. The module therefore keeps its scope to calendar dates instead of pretending to know an operating calendar.

Separate no observation from an observed zero

No in-window record returns a null average, while an explicit zero record returns zero. Equal totals can carry different information. Returning zero unconditionally would hide the distinction between confirmed zero output and absent records.

The original risk function has a fallback using cumulative good output and the first recorded date when recent output is absent. This independent average deliberately does not transfer that forecast branch. It isolates the recent observation basis rather than claiming to reproduce the whole risk predictor.

Normal status does not imply a completed forecast

The source risk function can return normal, caution or risk from the remaining deadline even when it cannot derive a rate; expected stays null. Reading normal as proof of a calculated completion date would change the meaning. Status and predictability need separate interpretation.

The new average likewise does not turn null into a forecast number. Integration should keep insufficient-record guidance near the basis. The live demo covers quantity flow, while calendar output is retained in saved execution records. No actual factory forecast interface was verified.

Use small dates to expose interval boundaries

Tests include today-minus-four, the date just outside the window and tomorrow, counting only in-range values. Impossible February dates, empty input and observed zero are separate cases. The denominator contract is inspectable without an actual company calendar or workload.

Multiple rows on one day are summed. The function cannot determine whether they represent distinct work or duplicate collection. A real data integration needs event identity and duplicate policy separately. Passing the average test does not solve input duplication by implication.

Give the representative a reconstructable average

The manufacturing package passed twenty-five tests and fresh extraction. Saved output retains total, average and observation count for the synthetic interval. No operational program or database ran and no all-device review is claimed; this evidence concerns local calculation under a declared calendar basis.

When a representative asks why the average fell, the maker should be able to revisit dates and denominator. Calendar and working-day averages answer different questions rather than one being universally correct. I want the familiar word average to expose its basis before adding the appearance of a more sophisticated prediction.