--- pretty_name: Phase 1 Cold-Chain Warehouse Dispatch language: - en size_categories: - 1K`; original product references are retained for lineage. Wave times are relative to the cohort's earliest date with time scale 1.0. The batch increments the template seed by the zero-based cohort index. 4. **Assign synthetic initial remaining life.** Ordinary cases draw uniformly from 50–100% of each product's full reference lifetime. The near-expiry variant redraws ages uniformly from 0.01–0.8%. These are synthetic ages, not receiving dates or measured source quality. FIFO uses assumed arrival time (default 0) and pallet ID to break ties. 5. **Attach the cached grid and create four variants per cohort.** | Variant | Count | Construction | | --- | ---: | --- | | `normal` | 1,000 | Ordinary stock; no fault | | `near_expiry` | 1,000 | Same workload; synthetic aged stock; no fault | | `sensor_drift` | 1,000 | Ordinary stock; seeded negative sensor bias | | `disruption` | 1,000 | Even cohort indices replay the saved Ollama event; odd indices alternate procedural cooling failure and stuck door | Procedural random seed is `config.seed * 1009 + cohort_index`, plus 1 for sensor drift or 2 for the disruption variant. A random zone is selected; start time is uniform from 0 to `min(30, 0.2 * horizon)` minutes, and duration is uniform from 30 to 90 minutes, capped by the remaining horizon. Parameters are rounded to three decimals. Sensor bias is uniform from −2 to −0.4 °C; cooling availability is uniform from 0 to 0.15; a stuck door has value 1. Events must satisfy the disruption schema and horizon constraints. Totals are **2,000 controls, 1,500 procedural-fault cases and 500 recorded-model replays**. Fault kinds total 1,000 sensor-bias, 750 cooling-failure and 250 stuck-door cases. 6. **Generate the ground truth using exhaustive simulation search.** Enumerate pallet permutations within each SKU and all allowed static zone setpoints: chilled `[0, 1]`, cool `[2, 3]`, temperate `[4, 5]` °C. Put-away is fixed by the existing greedy rule, wave arrival order is fixed, and idling/relocation are excluded. The default per-case exact-search budget is 2,000 candidates; this build used 105,696 candidate evaluations in total. Minimize: ```text expired_kg + 2.0 * unfilled_kg + 0.1 * compressor_kwh + 0.1 * grid_kg_co2 - 0.001 * dispatched_life_kg_hours ``` Simulate the chosen plan and matched FIFO/FEFO baselines. The exported food-saving target is `FIFO expired_kg - chosen_plan expired_kg` under the same initial stock, demand, disruptions and horizon. All 4,000 exported records are labeled `optimal_in_declared_domain`; this means exact within this finite domain, not globally optimal warehouse control. 7. **Construct prompt/answer pairs.** The system message defines a cold-chain coordinator. The user message contains the state, known disruption/grid schedules, decision domain and objective weights. The assistant target contains put-away assignments, pallet priorities, chiller adjustments, alerts, execution events, optimization status, food saved and metrics. Labels come from the solver/simulator, not from the scenario-generating LLM. Metadata stores provenance, configurations and baseline results for replay. 8. **Split by source cohort, then export.** `base_case_id` fingerprints the source archive hash and sorted selected wave IDs. Calculate `int(sha256(base_case_id.encode()).hexdigest()[:8], 16) % 100`: buckets 0–79 are train, 80–89 validation, and 90–99 test. All four variants stay together. This produces 3,192/380/428 examples rather than enforcing exact row-level 80/10/10 quotas. Each split is provided as JSONL and CSV. 9. **Verify the export.** The recorded build replay-verified all 4,000 JSONL records: checksums, layout identity, actions, execution events, metrics, matched-FIFO food savings and source-cohort split isolation. Its manifest records 49 passing tests. These are historical build results; they do not certify later local edits. Checkpoints and historical run logs were removed after the final export; the input files and per-example replay metadata remain. ## Regenerate or verify Run from the repository root with a Python environment that can run this project: ```bash python3 -m warehouse_sim.stage1 batch-build \ --dataset 'Order Picking Dataset from a Warehouse of a Footwear Manufacturing Company.zip' \ --template examples/paper-template.json \ --scenario data/generated-42.json \ --grid data/grid-2023-01-05.json \ --variant-suite standard --cases 1000 --resume \ --output runs/phase1-regenerated ``` This uses the preserved scenario without calling Ollama or downloading weights. Add `--dry-run` for a preflight. Use a fresh output directory for a new run; `--resume` applies to checkpoints created there, not the deleted original run. The command rebuilds the simulation pairs; the final CSV packaging is separate from the JSONL batch exporter. ```bash python3 -m warehouse_sim.stage1 verify \ --dataset 'Order Picking Dataset from a Warehouse of a Footwear Manufacturing Company.zip' \ --export dataset ``` The replay verifier checks JSONL. CSV checksums must be compared separately against `manifest.json`. ### Preserved input SHA-256 values | Input | SHA-256 | | --- | --- | | Footwear source ZIP | `0de6901d639cae782e661ee63d479360b6942b31072e53d07bbde8313cbe9880` | | Zou supplement DOCX | `fd56de4d5ea43d55aabe331461e1d33d7b7864db8052e273919253b56387a43a` | | `examples/paper-template.json` | `b8b432185772aeebeae4b575f568e8655baf2ceaf0a6b6a436c61375f7cdc8cd` | | `data/generated-42.json` | `6539033bf12ab82c541a656fa714229cff7bb38cc18f301f3621a86c48358216` | | `data/grid-2023-01-05.json` | `e2c6a0e3311f8b57779b28666c68fb425ac9e34e7d07aa30f6cc70c17f5d047f` | ## Using the records and interpreting ground truth For JSONL training, use `messages`; for CSV use `system`, `input` and `output`. `metadata` / `metadata_json` contain solver controls and replay information and must not be appended to model inputs. For evaluation, hold back the assistant answer and compare it with the model's response. [EDA.py](../EDA.py) prints a small zero-shot pick-order exercise and its reference answer separately. The full benchmark evaluates a model-conditioned planning task. It does not establish microbiological safety, measured food savings, or independent validation on real cold-chain batches. Only 192 examples have positive simulated food savings; the other 3,808 have zero. Replaying one model scenario and creating four variants per workload does not create 4,000 independent operational samples. See [the expansion report](../docs/scale-to-4000.md) and [simulation methods](../docs/simulation-methods.md) for further detail. ## Bias, risks and limitations The source workload represents one footwear warehouse, while the cold-chain behavior is synthetic. Results may not transfer to other layouts, product cultivars, equipment, operators or demand distributions. Only three produce profiles and four standard variants are represented; the decision space is small and static. Parameters and objective weights encode project choices. The 1,000 cohorts share the facility, grid day, parameter template and one recorded model scenario. Cohort isolation prevents wave variants leaking across splits, but does not test generalization to a new facility or unseen physical model. Positive savings occur in 192/4,000 examples (4.8%); a model predicting zero everywhere would match that scalar target on 95.2% of examples. Evaluate plan feasibility, action quality and simulator outcomes as well as scalar error. Full future disruption schedules and cached grid intensities are disclosed in the inputs. This can overstate performance relative to an operational setting with uncertain forecasts. Reference labels are optimal only in the declared finite search domain. Human review of every generated example is not documented. ## Personal and sensitive information Prompts retain warehouse slot IDs; audit metadata retains source wave IDs, product references, timestamps and file hashes for lineage. The conversion does not intentionally add names or contact details, but this project has not performed a comprehensive privacy or re-identification audit of the original archive or generated export. Source operational identifiers should be treated as provenance rather than evidence of produce observations. ## Licensing and distribution MIT License see LICENSE