Skip to content
68 changes: 45 additions & 23 deletions docs/CURRENT-STATE.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
# Current State

**As of:** 2026-07-28 · **Branch:** `fix/m0-audit-corrections` (branched from reviewed PR-#1 head `beb9289`)
**Milestone:** M0 — Headless Service Lab. **Status:** bounded audit-correction pass COMPLETE; awaiting
independent re-review + owner-run human playtests.
**As of:** 2026-07-29 · **Branch:** `fix/m0-price-forecast-integrity` (continues the audit-correction line)
**Milestone:** M0 — Headless Service Lab. **Status:** SECOND bounded correction (strategy integrity +
forecast) COMPLETE; awaiting independent re-review + owner-run human playtests.

**Independent audit** (PR #1: Conditional-Pass / Defer) found 3 High + 5 Medium. The bounded correction pass
addressed them (no M1, no new features):
- **H1** causal autopsy now attributes the primary loss by measured lost contribution (two-tier report),
removing the 88%-util flip; validated against covers-served response.
- **H2** menu-coherence lever defuses the discovered dominant hybrid (goldens byte-identical); dominance is
now SEARCHED. Residual **NEW-1** (uniform-overprice exploit) disclosed, deferred to M0.5.
- **H3** forecast de-biased (demand-opportunity vs expected-completed vs low-confidence range); band
coverage 0% -> 61% (stated 55%).
- **M4** exact integer-cents CLI price parsing; **M5** direct FIFO + labor tests; **M6** no-float guard now
scans static fields + properties; **M7** cross-OS determinism claims corrected to "verified same-env only."
**Second correction (2026-07-29)** closed the two findings the first pass left open, inside M0:
- **H2 / NEW-1 (strategy integrity) — RESOLVED.** Credible single-service **price elasticity** (`PriceModel`)
anchors willingness-to-pay to each dish's own suggested price and makes overpricing cost real demand this
service. A **frontier search** shows **no cross-market dominator**: the value lunch's best plan is
fair-priced/high-capacity while the enthusiast's is premium/lean — distinct, opposed regimes, so no single
plan wins everywhere. Premium pricing stays viable but **contextual** (Premium Craft wins only enthusiast,
restoring hypothesis H1). See `docs/design/PRICING-CONTRACT.md`, DECISION-LOG D-020/D-022/D-023/D-024.
- **H3 (forecast) — CORRECTED.** Per-station kitchen bottleneck + over-acceptance waste stop the forecast
from **reversing** the seat decision (was 46→66 seats: forecast +$483 / actual −$377). Held-out
seat-direction agreement **11/12**; band coverage 66%/73% vs stated 55%. See
`docs/design/FORECAST-CONTRACT.md`, DECISION-LOG D-021.
- Golden checksums were **deliberately re-baselined** (prices recentered ~+40%, sensitivities retuned); this
is the golden policy working as intended, documented in D-022 — not a silent change.

See `../reports/m0/M0-CORRECTION-REPORT.md` and `../reports/m0/PRE-FIX-AUDIT-EVIDENCE.md`.
**First correction (2026-07-28)** — the audit (PR #1: Conditional-Pass / Defer) found 3 High + 5 Medium.
**H1** causal autopsy attributes the primary loss by measured lost contribution (removed the 88%-util flip).
**H2** menu-coherence lever defused the value-chassis hybrid. **H3** forecast de-biased. **M4** exact
integer-cents parsing; **M5** FIFO + labor tests; **M6** widened no-float guard; **M7** determinism claims
corrected to same-env-only.

See `../reports/m0/M0-CORRECTION-2-REPORT.md`, `../reports/m0/M0-CORRECTION-REPORT.md`,
`../reports/m0/PRE-FIX-2-EVIDENCE.md`, `../reports/m0/PRE-FIX-AUDIT-EVIDENCE.md`.

## What is complete
- Repository initialized; full structure; license; determinism/architecture/design/product/risk/commercial/
Expand All @@ -25,22 +35,29 @@ See `../reports/m0/M0-CORRECTION-REPORT.md` and `../reports/m0/PRE-FIX-AUDIT-EVI
FNV-1a state checksum. Fixtures: 3 segments, 12 recipes, 8 employees, 3 market scenarios, 9 named strategies.
- **CLI** (`src/RestaurantSim.Cli`): inspect → plan → forecast → commit → autopsy → revise → run again.
- **Harness** (`src/RestaurantSim.Harness`): distribution/dominance/determinism analysis → `reports/`.
- **Tests:** 74 passing across 3 projects (invariants, determinism, golden scenarios, balance properties).
- **Tests:** 117 passing across 3 projects (invariants, determinism, golden scenarios, balance properties).
- **Evidence** (200 seeds/cell) committed under `reports/`.

## Latest test status
`dotnet test` → **103 passed, 0 failed** (Core 54, Determinism 31, Scenario 18) after the correction pass.
New tests lock each fix: attribution (5), forecast calibration (3), dominance regression (2), FIFO order,
labor value, exact price parse, widened no-float guard. Re-run to confirm.
`dotnet test` → **117 passed, 0 failed** (Core 54, Determinism 31, Scenario 32) after the second correction.
The second pass adds `PriceElasticityTests` (7: WTP/resistance smoothness, overprice unprofitability,
per-dish anchoring, segment ordering, dominator beaten), `ForecastDirectionTests` (4: seat/cook/pricing
directionality), and `DominanceFrontierTests` (3: opposed regimes, no near-optimal-everywhere plan, the
searched champion is not a dominator), plus updated calibration and re-baselined goldens. Re-run to confirm.

## Latest determinism status
Harness determinism check: **PASS** for the sampled matrix (same seed ⇒ identical checksum). Golden
checksums locked in `tests/RestaurantSim.Scenario.Tests`. Cross-OS CI comparison is an OPEN item.

## Balance status
Distinct winning strategies across 3 markets: **2 of 3** → no single dominant strategy. Poor strategies all
post negative medians and are legibly diagnosed. See `reports/balance/distribution.md` and
`docs/design/M0-BALANCE-HYPOTHESES.md`.
Among the nine named strategies, distinct winners across 3 markets: **2 of 3** → no single dominant strategy.
The rigorous check is a **frontier search**: the best generalist plan is **~$1170 below the per-market
frontier in its worst market**, and the per-market optima are distinct, structurally-opposed regimes (value
lunch → fair-priced/high-capacity; enthusiast → premium/lean) — so **no cross-market dominator** (the first
pass's residual NEW-1 exploit is resolved, not deferred). Caveat (disclosed): the named strategies are
illustrative and under-optimized versus the frontier; enriching them and reviewing labor/throughput economics
are M0.5 items (DECISION-LOG D-024). See `reports/balance/distribution.md`,
`reports/balance/dominance-search.md`, and `docs/design/M0-BALANCE-HYPOTHESES.md`.

## What is partially complete / not started
- **Human playtests:** NOT gathered. The Builder cannot fabricate them. Plan/script/consent are ready in
Expand All @@ -51,8 +68,13 @@ post negative medians and are legibly diagnosed. See `reports/balance/distributi

## Known defects / caveats
- None blocking. Known limitation (by design, not a defect): in a single service with no repeat visits,
throughput dominates profit and quality has limited economic teeth — see DECISION-LOG D-012. This is a
finding for M1, not a bug.
price and quality have no *durable* teeth — a customer can decline an overpriced meal this service (now
modeled), but there is no remembered reputation across services. Single-service elasticity closes the
in-service exploit; durable price/quality feedback is an M1 system (reputation/repeat visits). See
DECISION-LOG D-012 / D-020.
- The forecast's expected-covers point estimate is a coarse pre-service approximation (per-station cap) and
can under-predict for some plans; it is directionally correct and honestly banded, not exact. See
`docs/design/FORECAST-CONTRACT.md`.

## Scope audit
Clean. No item from the M0 hard non-goals list was built (no graphics/engine/pathfinding/inventory/
Expand Down
76 changes: 71 additions & 5 deletions docs/DECISION-LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,79 @@ consequences, owner, and conditions to revisit. Newest first.

---

### 2026-07-29 · D-024 · Dominance is tested against a searched FRONTIER, not the named strategies
- **Status:** locked · **Owner:** Builder
- **Decision:** The dominance search now builds a strong per-market **frontier** (random search + a principled
archetype sweep, 80 seeds/market) and asks whether any single plan is within $150 of the frontier in ALL
three markets. It no longer merely checks whether a candidate beats the nine **named** strategies.
- **Why:** an independent adversarial verifier showed the old test was low-power and used a weak bar — the
named strategies are under-optimized (e.g. Focused Value makes ~$450 in the lunch rush where a fair-priced,
fully-staffed Burger+Ribeye+Fish plan makes ~$2350). A plan can beat every named winner without being a
cross-market optimum, so "beats all named winners" is the wrong dominance signal.
- **Result:** No cross-market dominator. The best generalist plan is **~$1170 below the frontier in its worst
market**; the per-market optima are distinct regimes (lunch: fair/high-capacity; enthusiast: premium/lean).
Locked in `DominanceFrontierTests`; reported in `reports/balance/dominance-search.md`.
- **Follow-ups (M0.5, disclosed not hidden):** (a) the named strategy set should be enriched with
frontier-competitive archetypes so the distribution reflects skilled play; (b) lean strategies underperform
heavily — labor/throughput economics may over-reward staffing up and deserve a calibration review.

### 2026-07-29 · D-023 · Premium is now genuinely contextual: it wins only the enthusiast market
- **Status:** locked · **Owner:** Builder
- **Decision:** After single-service price elasticity, Premium Craft wins **only** the enthusiast evening and
loses both the value lunch rush (−$151 median) and the social dinner to Focused Value. This restores the
pre-registered hypothesis H1 (a value lunch rush rewards a lean value operation and punishes premium
pricing). Distinct winners across the three markets stay at **2/3**; no single strategy dominates.
- **Consequence:** The lunch rush is a **thin market** where only one strategy (Focused Value) clears the
+$150 "profitable" bar. That is realistic for a price-led, high-volume market, and is a within-market
observation, not a violation of the cross-market non-dominance bar. Locked as `Premium_is_not_always_best`
and the lunch-winner assertion in `ScenarioTests`. See [[D-020]], `M0-BALANCE-HYPOTHESES.md`.

### 2026-07-29 · D-022 · Suggested prices recentered and segment sensitivities retuned; goldens re-baselined
- **Status:** locked · **Owner:** Builder
- **Decision:** All 12 recipe suggested prices were recentered (~+40%) to give the WTP model credible absolute
anchors, and segment price sensitivities were retuned (Value 8000→10000, Social 5000→5500, Enthusiast
3500→3000) so the three segments span a clear elasticity range. Because the simulated order mix changes,
the three **golden checksums were deliberately re-baselined** (Focused Value/lunch `0x290EB112568926A4`,
Premium Craft/enthusiast `0xC9AEF12F9CD876DA`, Balanced Competent/social `0x8BC9E9401D27E91B`).
- **Rationale:** This is the golden policy working as intended — a checksum changes when behavior
intentionally changes, documented here rather than preserved by contorting the model. The elasticity
constant `PriceResistScaleBp` itself does **not** change any golden (no golden plan prices above its
segment's WTP), so the re-baseline is attributable solely to the price/sensitivity recentering.
- **Revisit:** M0.5 economic calibration.

### 2026-07-29 · D-021 · Second correction: forecast per-station bottleneck + over-acceptance waste (H3)
- **Status:** locked · **Owner:** Builder
- **Decision:** The forecast's kitchen capacity is now the **per-station** bottleneck (min over stations),
realization is keyed off **kitchen** throughput only, and covers seated past the kitchen wall incur an
**over-acceptance waste** cost. Together these make seats past the kitchen bind add zero/negative predicted
contribution, so the forecast no longer **reverses** the seat decision (was: 46→66 seats forecast +$483 /
actual −$377). Held-out seat-direction agreement **11/12**; band coverage 66% in-harness / 73% held-out vs
a stated 55%. Forecaster stays pre-service only; the sim and checksum are untouched. See
`FORECAST-CONTRACT.md`, `reports/balance/forecast-calibration.md`.

### 2026-07-29 · D-020 · Second correction: single-service price elasticity resolves NEW-1 (H2)
- **Status:** locked · **Owner:** Builder · **Supersedes:** [[D-019]] deferral
- **Decision:** Willingness-to-pay is anchored to each dish's **own** calibrated suggested price (not the menu
median), widened by segment tolerance and dish quality; above WTP, order probability decays **smoothly**
(hyperbolic), scaled by segment price sensitivity. No hard cap, no name branch, no single-threshold cliff,
no fixture-targeted penalty. `PriceResistScaleBp = 450` is chosen from an elasticity target (a maximally
price-sensitive diner retains ~1/3 of demand at ~8% over WTP), not from the dominance result — every value
in [350,600] already defeats the dominator.
- **Result:** The uniformly-overpriced coherent menu is defeated, and pricing becomes context-dependent:
a **frontier search** (see [[D-024]]) finds the value lunch's best plan is FAIR-priced/high-capacity while
the enthusiast's best plan is premium/lean — distinct, structurally-opposed regimes, so **no single plan
is near-optimal in all three markets**. Premium pricing stays viable **contextually** (wins the enthusiast
market). Goldens byte-identical to before this constant. See `PRICING-CONTRACT.md`, `PriceModel.cs`.
- **Revisit:** M1 adds reputation/repeat-visits, which give price/quality *durable* teeth beyond one service.

### 2026-07-28 · D-019 · NEW-1 residual dominator (uniform overprice) disclosed, deferred to M0.5
- **Status:** open finding · **Owner:** owners
- **Decision:** The dominance search still finds one cross-market dominator: a uniformly-overpriced coherent
- **Status:** RESOLVED by [[D-020]] (fixed in-M0, not deferred) · **Owner:** owners
- **Decision:** The dominance search found one cross-market dominator: a uniformly-overpriced coherent
menu. It stems from M0 having no repeat-visit/reputation teeth on price/quality (same root as [[D-012]]).
Strengthening price elasticity would change the Focused Value golden, so it is NOT fixed in the bounded
pass. Disclosed in `reports/balance/dominance-search.md`; recommended for M0.5 calibration.
- **Revisit:** M0.5 (price elasticity) or M1 (reputation/repeat visits).
The first bounded pass judged that strengthening price elasticity would change the Focused Value golden, so
it deferred the fix. The **second** correction (D-020) implemented credible single-service elasticity and
resolved it inside M0. Disclosed in `reports/balance/dominance-search.md`.
- **Revisit:** M1 (reputation/repeat visits) for *durable* price/quality teeth beyond one service.

### 2026-07-28 · D-018 · Audit correction: docs corrected to "same-environment determinism verified"
- **Status:** locked · **Decision:** DETERMINISM-CONTRACT and ADR-002 no longer assert cross-OS byte-identity
Expand Down
25 changes: 16 additions & 9 deletions docs/NEXT-ACTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,24 @@
> **FIRST: re-confirm the repository's actual current state before trusting this document.**
> Run `git status`, `git log --oneline -8`, `dotnet test`, and
> `dotnet run -c Release --project src/RestaurantSim.Harness -- --seeds 200 --out /tmp/verify`.
> Confirm 74 tests pass, determinism reports PASS, and distinct winners = 2/3. Any commit hash or number in
> a doc is a timestamp, not a contract — verify against reality first.
> Confirm 117 tests pass, determinism reports PASS, distinct winners = 2/3, and the dominance search reports
> no cross-market dominator (best generalist well below frontier in its worst market). Any commit hash or
> number in a doc is a timestamp, not a contract — verify against reality first.

## The single next authorized action
**Independent reviewer RE-CHECKS the bounded correction pass** (branch `fix/m0-audit-corrections`), then
owners run the human playtests. Re-check specifically: (1) the causal autopsy no longer flips on the 88%
util boundary and attributes the primary loss correctly (see `AttributionTests` + `PRE-FIX-AUDIT-EVIDENCE`);
(2) the forecast band coverage meets its stated confidence and labels are honest; (3) the coherence lever
kept the three golden checksums byte-identical and the hybrid is no longer a cross-market dominator; (4) the
**NEW-1** residual (uniform-overprice exploit) is disclosed, not hidden, and the owner accepts deferring it
to M0.5; (5) M4/M5/M6/M7 fixes; (6) determinism, accounting, and scope remain intact. Then:
**Independent reviewer RE-CHECKS the second correction** (branch `fix/m0-price-forecast-integrity`), then
owners run the human playtests. Re-check specifically: (1) **price elasticity is principled, not a
fixture-targeted patch** — WTP is anchored to each dish's own suggested price (not the menu median), the
curve is smooth (no cliff), there is no hard cap or name branch, and `PriceResistScaleBp` is justified by an
elasticity target rather than the dominance outcome (see `PRICING-CONTRACT.md`, `PriceElasticityTests`);
(2) **no cross-market dominator** reproduces under the reviewer's own FRONTIER search (not just a comparison
to the under-optimized named strategies) — the per-market optima are distinct regimes and the uniformly-
overpriced menu is genuinely beaten while premium stays viable in the enthusiast market; (3) **the forecast no longer
reverses the seat decision** — seats past the kitchen wall do not raise the prediction, and seat-direction
agreement holds on held-out seeds (see `FORECAST-CONTRACT.md`, `ForecastDirectionTests`,
`forecast-calibration.md`); (4) the **golden re-baseline** is the deliberate, documented consequence of the
price recentering (D-022), not an accident; (5) the first correction's fixes (H1, M4–M7) and determinism,
accounting, and scope all remain intact. Then:

1. **Independent reviewer** (not the Builder): clone fresh, run the tests and the harness with their own
tooling, try to break determinism, and confirm M0 stayed in scope (nothing from the non-goals list, no
Expand Down
Loading