# Retail availability: completed teaching case and assessment brief

**Status:** original synthetic teaching case, pending instructor review. This is not a client engagement, observed NeuraPath outcome or claim that a production intervention succeeded.

## Business request and bounded decision

The fictional operations manager asks: “Why are we losing sales, and what should we fix first?” The available data contain daily availability snapshots and daily sales for two products over four days. They do not contain unconstrained demand, competitor activity, intraday stock transitions or an intervention.

The defensible first decision is whether the team can reliably measure availability and which observed zero-stock snapshots need investigation. Lost sales and causal explanations remain outside the evidence.

## Data contract

- Scope: products A and B, January 1–4, 2026, one scheduled observation per product/date.
- Grain: one product-date availability snapshot. Eight expected observations, declared independently of received rows.
- Availability: `known` with a nonnegative integer quantity, or `unknown` with no quantity. Zero means a confirmed zero-stock snapshot.
- Sales: nonnegative daily units. Daily sales do not establish stock state at every instant.
- Duplicate product-date records, out-of-scope records and contradictory coverage values fail validation.
- Missing rows remain in the expected denominator as unknown observations.
- Dataset: [availability.csv](../labs/domain-operations/availability.csv). All data are synthetic.

## Reproduction

From `11-Blog-Programme/labs/domain-operations`, run `python capstone.py` with Python 3.12 or a compatible later version. The standard-library script validates input, constructs the expected grid, computes results, runs five reference/mutation checks and writes `capstone-result.json` with input and code hashes.

Review [the code](../labs/domain-operations/capstone.py) and [the generated result](../labs/domain-operations/capstone-result.json). The broader fixture generator is `python build_and_verify.py`; it creates the CSV datasets before this capstone script runs.

## Findings and decision memo

Eight observations were scheduled. Six have known availability, two are unknown and two known observations show zero stock. Coverage is 75%. The stockout rate among known snapshots is 2/6, approximately 33.3%.

Across all scheduled snapshots, the stockout rate is bounded by 25% and 50% without assumptions about the two unknown observations. These are missing-data bounds, not confidence limits. Six zero-sales days do not imply six stockouts.

**Recommended next action:** repair the two unknown observations' collection path and inspect the two confirmed zero-stock snapshots against replenishment records. Do not estimate lost revenue from this extract. To address lost demand, specify and collect additional demand/availability evidence and a suitable evaluation design.

**What would change the recommendation:** verified source recovery that resolves the missing observations; evidence that the availability field represents physical rather than sellable stock; or intraday transitions showing that the snapshot misses substantial outages. Any such change requires a revised contract or result version.

## Assessment rubric

| Dimension | Weight | Evidence required |
|---|---:|---|
| Decision and metric contract | 20 | Bounded question, grain, expected population, cutoff and limits |
| Data quality | 25 | Missing-row detection, duplicate rejection, unknown/zero distinction |
| Reproducibility | 25 | Executable script, supplied data, expected results, hashes and readable output |
| Interpretation | 20 | Correct coverage and bounds; no unsupported lost-sales or causal claim |
| Communication | 10 | Concise decision memo and specific next evidence request |

A submission that treats unknown availability as zero, shrinks the denominator when rows disappear, or claims measured lost sales from this extract fails the relevant correctness criteria regardless of presentation quality. The weights are proposed instructional assessment criteria, not a guarantee of employment or course completion.

## Extension tasks

1. Remove a known observation and verify that the scheduled denominator stays eight while coverage falls.
2. Add an expected product with no received observations; update the declared scope and report its complete coverage gap.
3. Add intraday stock-state events and define a separate duration measure, including assumptions for missing intervals.
4. Design an evaluation of a replenishment change. State the intervention, comparison, outcome horizon and guardrails before looking at results.

This project aligns with SQL population design, Python validation, descriptive statistics and decision communication in the [Data Analytics with Generative AI course](https://www.neurapath.in/courses/da). It is a proposed detailed assessment resource for review, not an added public delivery promise.
