Mean-variance optimization is easy to write and easy to break. With nearly as many assets as observations the sample covariance is near-singular; caps and a starting book can make the constraints impossible to satisfy in one rebalance; solvers stop at "almost solved"; and real inputs have missing values. A textbook optimizer either crashes or, worse, returns weights that look fine and are not.
This library makes each of those cases explicit:
w, report = robust_optimize(inputs)
report.level # 0 solver, 1 fallback, 2 caps relaxed, 3 held
report.reasons # one line per step down
report.frozen # assets frozen for bad data, and why