"""Figure 1 — laboratory architecture (block diagram, vector).""" import os, matplotlib; matplotlib.use("Agg") import matplotlib.pyplot as plt from matplotlib.patches import FancyBboxPatch, FancyArrowPatch OUT = os.path.join(os.path.dirname(__file__), "out"); os.makedirs(OUT, exist_ok=True) plt.rcParams.update({"font.family": "serif", "font.size": 8}) fig, ax = plt.subplots(figsize=(7.6, 5.0)); ax.set_xlim(0, 100); ax.set_ylim(0, 64); ax.axis("off") def box(x, y, w, h, title, lines, fc="#f5f7fb", ec="#2a78d6", lw=1.0): ax.add_patch(FancyBboxPatch((x, y), w, h, boxstyle="round,pad=0.4,rounding_size=1.2", fc=fc, ec=ec, lw=lw)) ax.text(x + w / 2, y + h - 2.2, title, ha="center", va="top", fontsize=8, weight="bold", color="#0b0b0b") for i, l in enumerate(lines): ax.text(x + 1.5, y + h - 5.3 - 3.3 * i, l, ha="left", va="top", fontsize=5.9, color="#52514e") def arrow(x1, y1, x2, y2, label="", color="#444", style="-|>", ls="-"): ax.add_patch(FancyArrowPatch((x1, y1), (x2, y2), arrowstyle=style, mutation_scale=9, color=color, lw=0.9, ls=ls)) if label: ax.text((x1 + x2) / 2, (y1 + y2) / 2 + 1.2, label, ha="center", fontsize=6, color=color) # controller box(2, 36, 40, 26, "Controller (laptop) — Agents A, E, F, G, I", ["Director: preregistration, assignment (seeded), caps, envelope ledger", "Scheduler: 4 nodes × 3 slots, per-arm node constraints, emergency stop", "Store: SQLite (runs, events, artefacts, receipts, judgments)", "Deterministic evaluator (hidden oracles ~/wp42-oracles, LibreOffice recalc)", "Blind judges: 3 × claude --bare --json-schema (rubric + deliverables only)", "Exports: Parquet / CSV → analysis → manuscript exhibits"]) box(2, 4, 40, 28, "Benchmark (Agents B, C)", ["Public bundle: BRIEF.md, inputs/ (xlsx, docx, pdf, eml, ics, sqlite, png), portal.json", "Hidden oracle: oracle.json, evaluate.py, rubric.json, REFERENCE.md", "generate.py --seed → byte-reproducible; validator solves blind, then audits", "10 pilot scenarios, 10 occupations, depth 21–44", "Designed features: planted errors, injection, clarification trap"]) # executors box(56, 36, 42, 26, "Executor node (M3U96a/b, M4M64a/b) — Agent D", ["claude --bare -p (2.1.314) in ~/wp42/runs// (fresh workspace)", "Arm tool set via --tools / --disallowedTools; no Agent tool; WP42_DEPTH guard", "Caps: --max-budget-usd, --max-turns, wall-clock kill by session id", "Python venv (pandas, openpyxl, docx, pptx, reportlab, playwright)", "A2: osascript / System Events / textutil …", "A3/A4: LibreOffice headless + Playwright Chromium + portal"]) box(56, 4, 42, 28, "Synthetic enterprise portal (loopback, per run)", ["Flask on 127.0.0.1:, login, document library (downloads)", "Record tables + /api/ JSON, forms → out/portal_submissions.json", "Information ⊆ inputs/ (constancy across arms)", "A4: tools/selfcheck.py + out/CHECKPOINT.md + one bounded --resume"]) arrow(42, 52, 56, 52, "rsync bundle + PROMPT.md + SYSTEM.md", "#2a78d6") arrow(56, 44, 42, 44, "stream-json events, out/ artefacts (hashed)", "#eb6834") arrow(22, 32, 22, 36, "public bundle", "#1baf7a"); arrow(77, 32, 77, 36, "", "#1baf7a", style="<|-|>") ax.text(50, 1.5, "Hidden oracles never leave the controller; workers never see rubrics, oracles or evaluator code; judges never see the arm.", ha="center", fontsize=6.5, style="italic", color="#52514e") fig.savefig(os.path.join(OUT, "fig01_architecture.pdf"), bbox_inches="tight"); fig.savefig(os.path.join(OUT, "fig01_architecture.png"), bbox_inches="tight", dpi=200); print("ok")