Skip to content

Commit e006cf0

Browse files
vosesoftclaude
andcommitted
Fix all 10 demo-gallery live-test findings (0.3.9)
Every finding from the end-to-end live test of the demo gallery against real Excel + ModelRisk, fixed and re-verified live (8/8 previously failing flows now pass): HIGH - Array functions CSE-entered: create_copula, create_time_series and fit_all_data_and_wire's copula U-block now array-enter over the full range via new audit-logged safe_write_array_formula (FormulaArray). Single-cell writes errored or - worst case - left U-slots empty so wired marginals SILENTLY sampled uncorrelated. Re-verified: Clayton wire now induces Spearman ~0.72 in simulated inputs. - Merged-cell writes raise: COM silently discards writes into merged non-anchor cells (an object 'written' under a merged note row vanished -> all-zero simulation, no error). write_cell + array writes now guard and raise an actionable message. MEDIUM - Text cells no longer scanned as live formulas (phantom outputs/ distributions, summary duplicates, audit noise): centralised starts-with-'=' rule in list_inputs/outputs/distributions + audit engine (extends bug #27's get_workbook_summary fix). - Catalogue: phantom 'OutputSize' param stripped (extraction artifact on array functions; real VoseTimeGBM sig starts at mu - verified live both ways). - Cross-sheet support: fit_all_data_and_wire gains target_sheet; fit_tail/fit_and_rank/fit_copula_to_data accept qualified Sheet!range data ranges (no more 'Model'!Data!D5:D44 COM blowups). - fit_distribution_to_data gains as_object (FitObject form for compute_distribution); params keyed off the spec's own names. - generate_executive_summary: outputs deduped; true P80 (0.80 added to default percentile set - previously fell back to P95). LOW - Chart names cleaned (Histogram_<output>, CDF_<output>). - read_range orientation: values/formulas now agree for single-column ranges (_as_2d_shaped reshapes by the range's true shape). - _params_dict accepts positional {value}-only entries. Demo gallery corrections: 02 asks for the OBJECT form in step 3; 09 steers helper objects to unmerged B30/B31; 10's named range renamed to Revenue2030 (Rev2030 is a valid cell address). All 12 workbooks re-verified: real-Excel recalc zero errors, format/path checks clean. New: ExcelBridge.write_array_formula/clear_range/_guard_merged_cell, ModelRiskBridge.safe_write_array_formula, _ChangeSet.write_array with block rollback. 20+ new/updated unit tests; 635 green; ruff+mypy clean. Version 0.3.8 -> 0.3.9. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6edac8d commit e006cf0

30 files changed

Lines changed: 535 additions & 51 deletions

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ All notable changes to ModelRisk MCP. Follows [Keep a Changelog](https://keepach
44

55
## [Unreleased]
66

7+
## [0.3.9] — 2026-07-05
8+
9+
### Fixes from the demo-gallery live test (10 findings, all addressed)
10+
11+
Every demo scenario was executed end-to-end against real Excel + ModelRisk; the run surfaced 10 product findings, all fixed here and re-verified live (8/8 previously-failing flows now pass):
12+
13+
- **Array functions are now CSE-entered** (high). `create_copula`, `create_time_series`, and `fit_all_data_and_wire`'s copula U-block are array-entered over the full target range via a new audit-logged `safe_write_array_formula` (`Range.FormulaArray`). Previously a single-cell write errored ('output array must contain N cells') or — worst case — left U-slots empty so wired marginals **silently sampled uncorrelated**. Re-verified: wired inputs now show Spearman ≈0.72 from a Clayton fit.
14+
- **Writes into merged cells now raise** (high). COM silently discards `.Formula` writes into a merged region's non-anchor cells — a distribution object 'written' under a merged note row vanished and the downstream aggregate simulated all-zero with no error. `write_cell`/array writes now detect merged targets and raise an actionable message.
15+
- **Text cells are no longer treated as live formulas.** Instructional text like `wrap as VoseOutput("NPV")` registered as a real output (xlwings returns text content via `.formula`), producing phantom outputs/distributions in `plan_risk_model`/`list_*`, duplicate rows in summaries, and audit noise. Centralised the starts-with-`=` rule across scanners and the audit engine.
16+
- **Phantom `OutputSize` parameter stripped from the catalogue.** An extraction artifact on array functions (`VoseTime*`, `VoseCopulaMulti*Fit`, …): the real signatures start at the first true argument (verified live: `=VoseTimeGBM(mu,sigma,lastvalue)` CSE-entered works; with a size argument it errors). `create_time_series` now builds correct formulas.
17+
- **Cross-sheet ranges supported.** `fit_all_data_and_wire` gains `target_sheet` (data on `Data`, wired model on `Model` — the realistic layout); `fit_tail`/`fit_and_rank_distributions`/`fit_copula_to_data` accept already-qualified `Sheet!range` data ranges instead of double-prefixing into an opaque COM exception.
18+
- **`fit_distribution_to_data` gains `as_object`** — writes `Vose<Family>FitObject(...)` so `compute_distribution` can answer analytic questions against the cell (the sampling form remains the default for model inputs). Parameters are keyed off the spec's own names (the Object variants capitalise `Data` differently).
19+
- **Executive summary fixes:** outputs deduplicated by name (no more triplicated rows), and the P80 column now reports the true P80 — `0.80` added to the default percentile set (it silently fell back to P95 before).
20+
- **Chart names cleaned** (`Histogram_Profit`, `CDF_Profit` — no more doubled prefixes) and **`read_range` orientation fixed** (values and formulas now agree for single-column ranges).
21+
- MCP tool `parameters` now also accept positional `{"value": …}` entries (previously only named entries).
22+
23+
### Demo gallery corrections (from the same test)
24+
Demo 02's step 3 now asks for the distribution **object** form; demo 09 steers helper objects to unmerged cells (`Model!B30/B31`); demo 10's named range is `Revenue2030` (`Rev2030` is a valid cell address, which Excel rejects as a name). All 12 workbooks re-verified: zero formula errors in a real-Excel recalculation, formatting and no-path checks clean.
25+
726
### Demo gallery (`examples/demos/`)
827

928
Twelve identically-formatted demo workbooks (index + eleven demos), one per feature area, each a simple real-life use case: store-expansion NPV via `build_model_from_brief`, bakery demand fitting, correlated construction costs via `fit_copula_to_data`/`fit_all_data_and_wire`, data-centre `reverse_stress_test`, simulation + histogram/CDF/tornado charts, model audit + undo, insurance aggregate loss + tail capital, SaaS pricing `run_scenarios`, op-risk GPD tails, GBM time series, and a one-prompt board pack. Each workbook's README sheet gives the exact prompt to type to Claude at every step. Shared house formatting (navy bands, blue inputs, yellow Vose-target cells, green key metrics); no live Vose formulas (the agent builds them during the demo); fixed-seed synthetic data; all files recalculate error-free in Excel.

examples/demos/00_START_HERE.xlsx

-17 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
17 Bytes
Binary file not shown.
5 Bytes
Binary file not shown.
4 Bytes
Binary file not shown.
-1 Bytes
Binary file not shown.

examples/demos/06_audit_model.xlsx

7 Bytes
Binary file not shown.
3 Bytes
Binary file not shown.
3 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)