% Harness-Bench grouped bar chart with speed annotations
% Requires: \usepackage{pgfplots}
% Requires: \pgfplotsset{compat=1.18}
% Requires: \usepackage{pgfplotstable}
\begin{tikzpicture}
\begin{axis}[
    ybar,
    width=11cm,
    height=7cm,
    bar width=14pt,
    enlarge x limits=0.2,
    ymin=0,
    ymax=115,
    ylabel={Score (\%)},
    ylabel style={font=\small},
    symbolic x coords={Harness, Claude Code, OpenCode, pi-mono},
    xtick=data,
    xticklabel style={font=\small},
    yticklabel style={font=\small},
    ytick={0, 20, 40, 60, 80, 100},
    legend style={
        at={(0.5, 1.03)},
        anchor=south,
        legend columns=2,
        font=\small,
        draw=black!30,
        fill=white,
    },
    nodes near coords,
    every node near coord/.append style={font=\tiny, yshift=2pt},
    grid=major,
    grid style={gray!20},
    axis lines*=left,
    clip=false,
]

% Opus bars (blue)
\addplot[
    fill=blue!55,
    draw=blue!70,
] coordinates {
    (Harness, 88)
    (Claude Code, 88)
    (OpenCode, 88)
    (pi-mono, 88)
};

% GPT-5.2 bars (orange)
% Claude Code has no GPT-5.2 data — use 0 height and mark as N/A
\addplot[
    fill=orange!55,
    draw=orange!70,
] coordinates {
    (Harness, 100)
    (Claude Code, 0)
    (OpenCode, 88)
    (pi-mono, 100)
};

\legend{Opus, GPT-5.2}

% N/A label for Claude Code GPT-5.2
\node[font=\scriptsize, text=gray!70, rotate=90, anchor=south]
    at (axis cs:Claude Code, 5) {N/A};

% Hatched overlay for the missing bar (visual indicator)
\fill[pattern=north east lines, pattern color=gray!40]
    ([xshift=7.5pt]axis cs:Claude Code, 0) rectangle ++(14pt, 4pt);

% === Speed annotations below x-axis ===
\node[below=0.6cm of current axis.south, font=\footnotesize\bfseries,
      text=blue!60!black, anchor=north] (speedtitle)
    {Avg.\ time per task (seconds)};

\node[font=\tiny, text=gray!70!black, below=0.18cm of speedtitle.south,
      anchor=north, text width=10cm, align=center]
    {%
    Harness: \textbf{12.5}s\,(Opus)\,/\,\textbf{6.4}s\,(GPT-5.2)
    \quad
    Claude Code: \textbf{16.4}s\,(Opus)
    \quad
    OpenCode: \textbf{10.1}s\,/\,\textbf{10.7}s
    \quad
    pi-mono: \textbf{10.0}s\,/\,\textbf{14.5}s%
    };

\end{axis}
\end{tikzpicture}
