File size: 20,593 Bytes
b7a5bab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
---
title: Store Environment Server
emoji: 🛒
colorFrom: green
colorTo: yellow
sdk: docker
pinned: false
app_port: 8000
base_path: /web
tags:
  - openenv
---

# Store Environment

This repository now contains a CSV-backed neighborhood grocery simulation for
OpenEnv. The environment is intentionally rooted in a kirana-store business
loop: manage cash, stock, supplier orders, customer satisfaction, pricing, and
durable operations upgrades over repeated decision windows.

This README documents the current implementation, not the older echo-demo
scaffold and not the earlier narrative plans. The runtime source of truth is:

- `store/data/*.csv`
- `store/models.py`
- `store/server/store_environment.py`
- `store/client.py`
- `store/tests/*.py`

If a note in `plan.md`, `plan2.md`, or `rules.md` conflicts with the code or the
seed CSVs, this document follows the code and the current CSVs.

## At A Glance

- Episode horizon: `30` simulated days by default
- Decision window: `3` committed days per step
- Reward lookahead: `6` simulated days per step
- Action shape: one bundled action containing `orders`, `prices`, and
  `action_ids`
- Observation shape: full store snapshot plus inventory, pending orders, market
  catalog, seller profiles, marketing catalog, and an action guide
- State storage: in-memory per environment instance, seeded from CSV files on
  `reset()`
- Reward form: `0.5 + normalized_difference`

## Seed Data

The environment seeds itself from the CSV files in `store/data/`.

### Current seed snapshot

- `store_state.csv`: 1 row
- `stock.csv`: 30 rows
- `market_offers.csv`: 100 rows
- `seller_profiles.csv`: 4 rows
- `pending_orders.csv`: 0 rows
- `marketing_actions.csv`: 15 rows

The opening store snapshot is currently:

| Field | Value |
|---|---:|
| `day` | `1` |
| `current_daily_expense_inr` | `3000` |
| `bank_balance_inr` | `120000` |
| `customer_satisfaction` | `70` |
| `order_processing_capacity` | `500` |
| `cumulative_profit_inr` | `0` |

The current opening stock value is `237,192 INR`, which sits inside the intended
`220k-260k INR` band.

## Files And Roles

| File | Role |
|---|---|
| `store/models.py` | Action, observation, and data models |
| `store/server/store_environment.py` | Core simulation engine |
| `store/client.py` | Client wrapper for remote HTTP/WebSocket usage |
| `store/server/app.py` | FastAPI app factory entrypoint |
| `store/data/*.csv` | Seed data and catalog source of truth |
| `store/tests/test_seed_csvs.py` | Seed integrity checks |
| `store/tests/test_store_environment.py` | Behavioral simulation tests |

## Action Contract

The agent sends one bundled action per decision window.

```python
from store import OrderRequest, PriceUpdate, StoreAction

action = StoreAction(
    orders=[
        OrderRequest(product="Rice", seller="Seller A", quantity=25),
        OrderRequest(product="Bread", seller="Seller C", quantity=12),
    ],
    prices=[PriceUpdate(product="Milk", price=33)],
    action_ids=[7],
)
```

Passing is:

```python
StoreAction()
```

### Action fields

| Field | Type | Meaning |
|---|---|---|
| `orders` | `list[OrderRequest]` | Supplier orders to place at the start of the step |
| `prices` | `list[PriceUpdate] \| None` | Optional selling-price updates for stocked products |
| `action_ids` | `list[int]` | Durable marketing or operations actions to activate |

### Nested action models

| Model | Fields |
|---|---|
| `OrderRequest` | `product`, `seller`, `quantity` |
| `PriceUpdate` | `product`, `price` |

### Validation rules for actions

- `quantity` must be a positive integer.
- `seller` must be one of `Seller A`, `Seller B`, `Seller C`, or `Seller D`.
- `orders[*].product` must exist in `market_offers.csv`.
- `prices[*].product` must already exist in current stock.
- `prices[*].price` must be positive.
- `action_ids` must exist in `marketing_actions.csv`.
- Duplicate price updates for the same product are rejected.
- Duplicate marketing action IDs in one step are rejected.
- Already-active marketing actions cannot be activated again.

## Observation Contract

`StoreObservation` is the agent-facing state. The OpenEnv transport `State`
still only carries `episode_id` and `step_count`, but the business state lives in
the observation payload.

### Top-level observation fields

| Field | Meaning |
|---|---|
| `store` | Current top-level business snapshot |
| `stock` | Current in-store inventory rows |
| `pending_orders` | In-flight supplier orders |
| `market` | Full supplier catalog with prices and ETAs |
| `seller_profiles` | Seller behavior notes |
| `marketing_actions` | Full action catalog plus active flags |
| `available_action` | Agent guide showing the action shape |
| `summary` | Human-readable step summary |
| `reward` | Reward returned for the step |
| `done` | Whether the episode has terminated |
| `metadata` | Reward breakdown and simulation diagnostics |

### Store snapshot fields

`store` is a `StoreSnapshot` with:

- `day`
- `current_daily_expense_inr`
- `bank_balance_inr`
- `customer_satisfaction`
- `order_processing_capacity`
- `cumulative_profit_inr`
- `active_action_ids`
- `active_recurring_cost_inr`
- `episode_horizon_days`
- `commit_window_days`
- `reward_horizon_days`

### Available action guide

Each observation includes an `available_action` block with:

- `name`: always `action`
- `description`: short instruction about the bundled step contract
- `pass_action`: empty `StoreAction()`
- `example_action`: a concrete non-empty example
- `notes`: quick reminders about pass behavior, stock-only pricing, and durable
  marketing actions

## Step Lifecycle

One call to `step()` performs a full decision-window update.

### High-level order of operations

1. Validate the bundle.
2. Read the current live state.
3. Compute starting capital.
4. Clone the live runtime state into two branches:
   - commit branch for the next `3` days of live state
   - reward branch for the `6`-day reward forecast
5. Apply the same action bundle to both branches once at the start of the
   window.
6. Update customer satisfaction once per decision window.
7. Simulate daily operations on both branches.
8. Commit only the `3`-day branch back to the live environment state.
9. Compute reward from the `6`-day branch.
10. Increment `step_count` and set `done` if the committed state crosses a
    terminal condition.

### What the action does at step start

- Supplier orders are placed immediately and enter the pending queue.
- The store pays the supplier cost immediately when the order is placed.
- Price updates apply immediately to stocked items.
- Marketing actions activate immediately and remain active for the rest of the
  episode.
- Customer satisfaction is recomputed once for the decision window after the
  bundle is applied.

### What happens during simulated days

For each simulated day:

- Active recurring marketing cost is charged.
- Demand is converted into sales.
- Sales revenue is added to bank balance.
- Daily operating expense is charged.
- COGS is tracked in cumulative profit accounting.
- Pending orders are decremented by one day.
- Arriving orders are received into stock.
- The day counter advances by one.

## Simulation Formulas

The formulas below reflect the current implementation in
`store/server/store_environment.py`.

### Starting capital

```text
starting_capital = starting_bank_balance + total_inventory_value
```

`total_inventory_value` is the sum of `stock_value_inr` across current stock
rows.

### Effective daily orders

```text
effective_daily_orders = order_processing_capacity * (customer_satisfaction / 100)
```

This means the current satisfaction score is treated as a percentage scale.

### Product margin

```text
margin_percent = ((selling_price_inr - buying_price_inr) / selling_price_inr) * 100
```

The implementation uses the current selling price, not the buying price, as the
denominator.

### Product selling score

```text
product_selling_score = max(0, demand_score - margin_percent * 3)
```

This is computed separately for each stocked item with positive on-hand
quantity.

### Total selling score

```text
total_product_selling_score = sum(product_selling_score for each stocked item)
```

### Daily sales allocation

```text
desired_sales_for_item = effective_daily_orders * product_selling_score / total_product_selling_score
actual_sales = min(quantity_on_hand, desired_sales_for_item)
```

Sales are proportional to selling score across stocked items. Because the model
is proportional and not integer-rounded, `quantity_on_hand` can become
fractional after simulated sales.

### Customer satisfaction update

Before the window is simulated, the environment applies any marketing action
delays to customer satisfaction. Then it recomputes a score-based multiplier.

```text
adjusted_satisfaction = current_satisfaction + sum(customer_satisfaction_delta for activated actions)

if after_score > 0:
    next_satisfaction = (1 + ((after_score - before_score) / after_score)) * adjusted_satisfaction
else:
    next_satisfaction = adjusted_satisfaction

next_satisfaction is then clamped to the range [1, 100]
```

`before_score` is the total selling score before the bundle is applied.
`after_score` is the total selling score after price updates and before the
simulated days begin.

### Order arrival

When a pending order reaches `days_remaining <= 0`:

- If the product already exists in stock, the order is merged into that row and
  the buying price becomes the weighted average of the existing and incoming
  units.
- If the product does not exist in stock, a new stock row is created.
- Newly created stock uses:

```text
selling_price = max(buying_price + 1, ceil(buying_price * 1.18))
```

The `1.18` markup is the implementation default for a newly introduced SKU.

### Reward

Reward is computed from the `6`-day reward branch:

```text
difference =
    (ending_inventory_value + ending_bank_balance)
    - (starting_inventory_value + starting_bank_balance)
    - recurring_costs_paid_over_6_days

normalized_difference = difference / starting_capital
reward = 0.5 + normalized_difference
```

If `starting_capital <= 0`, the implementation falls back to
`normalized_difference = 0`.

### Reward metadata

The step response includes reward diagnostics in `metadata`:

- `reward_breakdown.starting_capital_inr`
- `reward_breakdown.ending_capital_inr`
- `reward_breakdown.difference_inr`
- `reward_breakdown.normalized_difference`
- `reward_breakdown.commit_window_days`
- `reward_breakdown.reward_horizon_days`
- `reward_breakdown.recurring_costs_paid_inr`
- `commit_metrics`
- `reward_metrics`
- `done_reason`

The code rounds the high-level reward breakdown to two decimals, except for
`normalized_difference`, which is kept at six decimal places in metadata.

## Seller Behavior And ETA Sampling

Supplier ETA is deterministic within an episode because the environment seeds
its RNG from the reset count. Different resets get different seeds, but the same
episode run is repeatable once started.

### Seller profiles

| Seller | Behavior | ETA sampling |
|---|---|---|
| Seller A | Overcommits | `quoted + {0, 1, 2}` with delay-heavy weights |
| Seller B | Strict | Uses quoted ETA exactly |
| Seller C | Undercommits | `quoted + {-2, -1, 0}` with early-heavy weights |
| Seller D | Variable | `quoted + {-1, 0, 1, 2}` with mixed weights |

### Actual ETA rules

- The quoted ETA comes from the corresponding seller column in
  `market_offers.csv`.
- Actual ETA is sampled once when the order is placed.
- The sampled ETA is floored at `1`.
- Each simulated day decrements `days_remaining` by `1`.
- When `days_remaining <= 0`, the order is received.

### Exact weights in the current code

- Seller A: offsets `[0, 1, 2]` with weights `[2, 4, 5]`
- Seller B: offset `[0]`
- Seller C: offsets `[-2, -1, 0]` with weights `[5, 4, 2]`
- Seller D: offsets `[-1, 0, 1, 2]` with weights `[2, 4, 3, 2]`

These weights are implementation details, not a business guarantee.

## Data Contract

### `store_state.csv`

Current columns:

- `day`
- `current_daily_expense_inr`
- `bank_balance_inr`
- `customer_satisfaction`
- `order_processing_capacity`
- `cumulative_profit_inr`

### `stock.csv`

Current columns:

- `product_name`
- `unit`
- `buying_price_inr`
- `selling_price_inr`
- `demand_score`
- `quantity_on_hand`
- `stock_value_inr`

The seed data includes 30 stocked products and the stored value must equal
`buying_price_inr * quantity_on_hand` on each row.

### `market_offers.csv`

Current columns:

- `product_name`
- `category`
- `unit`
- `demand_score`
- `seller_a_price_inr`
- `seller_a_etd_days`
- `seller_b_price_inr`
- `seller_b_etd_days`
- `seller_c_price_inr`
- `seller_c_etd_days`
- `seller_d_price_inr`
- `seller_d_etd_days`

The current catalog contains 100 products.

### `seller_profiles.csv`

Current columns:

- `seller_name`
- `timeline_behavior`
- `reliability_note`
- `default_etd_days`

### `pending_orders.csv`

Current columns:

- `order_id`
- `product_name`
- `quantity`
- `seller_name`
- `buy_price_inr`
- `days_remaining`
- `status`
- `created_day`

The seed file starts empty.

### `marketing_actions.csv`

Current columns:

- `action_id`
- `description`
- `customer_satisfaction_delta`
- `cost_inr`
- `recurring_cost_inr`
- `order_processing_capacity_delta`

The current catalog contains 15 durable action rows.

## Episode End Conditions

The environment uses a default episode horizon of `30` days, but each step
advances the live state by `3` days, so a full default episode lasts 10
decision windows.

The episode ends when either:

- committed bank balance drops below `0`
- committed day exceeds `30`

The current implementation checks `day > 30` after the commit branch is
applied, so the tenth decision window takes the day counter to `31` and ends
the episode.

## Practical Edge Cases

### Fractional inventory

Sales are proportional, so on-hand inventory can become fractional. The models
use floats for inventory fields for that reason.

### Empty sales mix

If all stocked items have zero selling score or zero quantity, the sales loop
returns zero revenue and zero COGS for that day.

### Zero or negative starting capital

The reward math guards against division by zero by falling back to a zero
normalized difference.

### Already-active marketing actions

Once a marketing action is active, a later step that tries to re-activate it
raises a validation error.

### Product pricing

Price updates only apply to products already in stock. If a product is not in
stock yet, you must wait for a supplier order to arrive before changing its
price.

### New stock rows

If a pending order arrives for a product not currently in stock, the environment
creates a new stock row on arrival. This is rare in the seeded scenario, but the
code supports it.

## How To Run

The project is designed to run through `uv` so the declared dependencies are
available. In this workspace, the global shell does not include `openenv-core`
or `pytest`, so prefer the project environment.

### Install dependencies

```bash
cd store
uv sync
```

### Start the server

```bash
cd store
uv run --project . server --port 8000
```

### Start the Gradio playground

```bash
cd store
uv run --project . gradio
```

By default the Gradio UI launches on `http://127.0.0.1:7860` and runs the
environment in-process, so you do not need the FastAPI server running to play
with the simulation manually.

### Validate the OpenEnv package

```bash
cd store
uv run --project . openenv validate .
```

### Run the tests

```bash
cd store
uv run --project . python -m pytest
```

## How To Play Manually

You can interact with the simulation directly from Python without starting a
network server:

```python
from store import OrderRequest, PriceUpdate, StoreAction
from store.server.store_environment import StoreEnvironment

env = StoreEnvironment()
obs = env.reset()

print(obs.store)
print(obs.summary)

step = env.step(
    StoreAction(
        orders=[OrderRequest(product="Rice", seller="Seller A", quantity=25)],
        prices=[PriceUpdate(product="Milk", price=33)],
        action_ids=[7],
    )
)

print(step.reward)
print(step.done)
print(step.metadata["reward_breakdown"])
print(step.store.day)
```

### Passing a step

```python
env.step(StoreAction())
```

### Using the Gradio UI

The Gradio frontend lives in `store/gradio_app.py` and is designed as a local
playground for the same bundled action contract:

- `Orders JSON`: JSON array of `{product, seller, quantity}` objects
- `Price Updates JSON`: JSON array of `{product, price}` objects
- `Action IDs`: either a JSON array like `[7, 12]`, a single integer, or a
  comma-separated string like `7, 12`

UI controls:

- `Reset Episode`: creates a fresh `StoreEnvironment` instance and resets it
- `Submit Step`: validates the current inputs and executes one step
- `Pass Step`: executes a real pass action immediately
- `Load Example`: fills the inputs using the observation's bundled example action

The UI displays:

- current store snapshot
- stock table
- pending orders
- market catalog
- marketing action catalog
- reward breakdown
- raw observation metadata

Invalid JSON or action validation errors are shown in the UI while preserving
the current episode state so you can correct the inputs and try again.

### Inspecting the current state

The most useful fields to inspect after each step are:

- `obs.store`
- `obs.stock`
- `obs.pending_orders`
- `obs.marketing_actions`
- `obs.metadata["reward_breakdown"]`
- `obs.metadata["done_reason"]`

## OpenEnv Client Usage

If you want to connect to a running server, use `StoreEnv`:

```python
from store import OrderRequest, PriceUpdate, StoreAction, StoreEnv

with StoreEnv(base_url="http://localhost:8000") as client:
    reset_result = client.reset()
    print(reset_result.observation.store)

    step_result = client.step(
        StoreAction(
            orders=[OrderRequest(product="Rice", seller="Seller A", quantity=10)],
            prices=[PriceUpdate(product="Milk", price=33)],
            action_ids=[7],
        )
    )

    print(step_result.reward)
    print(step_result.observation.summary)
```

The client serializes the action bundle to JSON and reconstructs typed
observations from the server response.

## Tests

The current test suite includes:

- `store/tests/test_seed_csvs.py`
- `store/tests/test_store_environment.py`

These tests cover:

- CSV shape and seed integrity
- opening store values
- market catalog completeness
- marketing action rows
- reset behavior
- 3-day commit semantics
- 6-day reward forecasting
- ETA sampling
- customer satisfaction changes
- durable marketing actions
- episode termination
- client serialization and parsing

### Useful test command

```bash
cd store
uv run --project . python -m pytest store/tests/test_seed_csvs.py store/tests/test_store_environment.py
```

## Known Limitations

- The simulation is deterministic aside from seller ETA sampling, which is
  seeded per reset.
- Demand is not a full market model; it is based on stock-level selling score
  proportions.
- There is no spoilage, shrinkage, theft, or seasonality model.
- There is no supplier cancellation workflow.
- Sales can become fractional because the simulation allocates demand
  proportionally.
- The environment exposes the full market and marketing catalogs every step, so
  observations are intentionally verbose.
- Reward is unbounded and can be greater than `1.0` or less than `0.0`.
- `plan.md` and `plan2.md` are useful design notes, but the code and CSVs are
  the authoritative implementation.

## Assumptions

- The agent-facing state is the observation payload, not the OpenEnv transport
  `State`.
- CSV seed files are runtime truth and are re-read on every reset.
- The bundled action is the only supported step input.
- Marketing actions are durable and stay active once activated.
- A 30-day horizon with 3-day windows is the intended default episode shape.
- Current seed values in `store_state.csv` are intentional and should not be
  replaced with the older numbers from the narrative docs unless the code and
  tests are updated together.

## Packaging Notes

The OpenEnv manifest is `store/openenv.yaml`, and the server entry point is
`store.server.app:app` with the script entry point `server = "store.server.app:main"`.

The current package also declares:

- `openenv-core[core]>=0.2.2`
- `pydantic>=2.0.0`

## Further Reading

- `store/models.py`
- `store/server/store_environment.py`
- `store/tests/test_store_environment.py`
- `store/tests/test_seed_csvs.py`