1"""Figure 2 — occupational benchmark coverage: the 20 mandate occupations, which are covered by the pilot, with designed depth and caps."""2import os, csv, matplotlib; matplotlib.use("Agg")3import matplotlib.pyplot as plt4REPO = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")); OUT = os.path.join(REPO, "analysis", "figures", "out")5plt.rcParams.update({"font.family": "serif", "font.size": 8, "axes.spines.top": False, "axes.spines.right": False, "axes.grid": True, "grid.color": "#e6e6e6", "grid.linewidth": 0.5})6occ20 = ["Corporate finance", "Accounting", "Banking", "Economics", "Real estate", "Legal services", "Human resources", "Procurement", "Consulting", "Project management", "Marketing", "Business intelligence", "Data science", "Academic research", "Education", "Insurance", "Logistics", "Customer operations", "Journalism", "Records management", "Executive administration*"]7reg = {r["occupation"].lower(): r for r in csv.DictReader(open(os.path.join(REPO, "benchmark", "taxonomy", "registry.csv")))}8alias = {"corporate finance": "corporate finance", "accounting": "accounting", "banking": "banking", "real estate": "real estate appraisal", "legal services": "legal services", "human resources": "human resources", "procurement": "procurement", "business intelligence": "business intelligence", "academic research": "academic research", "executive administration*": "executive administration"}9fig, ax = plt.subplots(figsize=(6.4, 4.4)); y = range(len(occ20))10for i, o in enumerate(occ20):11 r = reg.get(alias.get(o.lower(), "zzz"))12 if r:13 d = int(r["designed_dependency_depth"]); ax.barh(i, d, color="#2a78d6", height=0.6); ax.text(d + 0.6, i, f"{r['task_id']} depth {d}, {r['difficulty']}", va="center", fontsize=7)14 else:15 ax.barh(i, 0.6, color="#c3c2b7", height=0.6); ax.text(1.2, i, "not covered in the pilot (next wave)", va="center", fontsize=7, color="#52514e")16ax.set_yticks(list(y)); ax.set_yticklabels(occ20, fontsize=7); ax.invert_yaxis(); ax.set_xlabel("designed dependency depth (number of dependent operations)"); ax.set_xlim(0, 62)17ax.text(0, len(occ20) + 0.4, "* executive administration (mandate scenario 5) is counted in addition to the 20 listed occupations", fontsize=6, color="#52514e")18fig.savefig(os.path.join(OUT, "fig02_benchmark_coverage.pdf"), bbox_inches="tight"); fig.savefig(os.path.join(OUT, "fig02_benchmark_coverage.png"), bbox_inches="tight", dpi=200); print("ok")19