> }
From e4e25e40dc2265e23e0faa60d94878824ecf80c5 Mon Sep 17 00:00:00 2001
From: Copilot <223556219+Copilot@users.noreply.github.com>
Date: Sat, 1 Aug 2026 22:12:55 -0700
Subject: [PATCH 18/18] DOC Widen mermaid diagrams via notebook cell metadata
only
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The inner `:::{div}` with `:class: col-page-right` is a no-op inside a
notebook markdown cell: MyST renders it as ``
whose parent is the notebook block wrapper (`display: block`), so the
`grid-column` rule never applies. Verified in a rendered build — with the
cell metadata removed, the diagram falls back to body width (662px vs
1014px). Only direct children of the article grid honor the class, which
is why the pattern still works in the `.md` files.
Drop the redundant div from the five notebooks and split the class
hierarchy diagram in 0_scoring into its own cell so the heading and
surrounding prose stay at body width instead of running under the
CONTENTS control.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6cef7ed3-4e13-48ee-9289-09e1acc8a29c
---
doc/code/executor/2_multi_turn.ipynb | 6 +--
doc/code/executor/2_multi_turn.py | 4 --
doc/code/scenarios/0_attack_techniques.ipynb | 6 +--
doc/code/scenarios/0_attack_techniques.py | 4 --
doc/code/scenarios/0_scenarios.ipynb | 6 +--
doc/code/scenarios/0_scenarios.py | 4 --
doc/code/scoring/0_scoring.ipynb | 43 ++++++++++++--------
doc/code/scoring/0_scoring.py | 10 ++---
doc/code/scoring/3_combining_scorers.ipynb | 6 +--
doc/code/scoring/3_combining_scorers.py | 4 --
10 files changed, 36 insertions(+), 57 deletions(-)
diff --git a/doc/code/executor/2_multi_turn.ipynb b/doc/code/executor/2_multi_turn.ipynb
index e2d2d552a7..99fe3afc97 100644
--- a/doc/code/executor/2_multi_turn.ipynb
+++ b/doc/code/executor/2_multi_turn.ipynb
@@ -29,9 +29,6 @@
"class": "col-page-right"
},
"source": [
- "\n",
- ":::{div}\n",
- ":class: col-page-right\n",
"\n",
"```{mermaid}\n",
"flowchart LR\n",
@@ -41,8 +38,7 @@
" scoreResp --> decision[\"Objective met
or turn limit?\"]\n",
" decision -- Yes --> done(\"Done\")\n",
" decision -- No --> getPrompt\n",
- "```\n",
- ":::"
+ "```"
]
},
{
diff --git a/doc/code/executor/2_multi_turn.py b/doc/code/executor/2_multi_turn.py
index 60c2cb6b8a..c3e498f66b 100644
--- a/doc/code/executor/2_multi_turn.py
+++ b/doc/code/executor/2_multi_turn.py
@@ -28,9 +28,6 @@
# %% [markdown] class="col-page-right"
#
-# :::{div}
-# :class: col-page-right
-#
# ```{mermaid}
# flowchart LR
# start("Start") --> getPrompt["Adversarial model
generates a prompt"]
@@ -40,7 +37,6 @@
# decision -- Yes --> done("Done")
# decision -- No --> getPrompt
# ```
-# :::
# %% [markdown]
#
diff --git a/doc/code/scenarios/0_attack_techniques.ipynb b/doc/code/scenarios/0_attack_techniques.ipynb
index 708e59ed87..556a1fca40 100644
--- a/doc/code/scenarios/0_attack_techniques.ipynb
+++ b/doc/code/scenarios/0_attack_techniques.ipynb
@@ -621,9 +621,6 @@
"class": "col-page-right"
},
"source": [
- "\n",
- ":::{div}\n",
- ":class: col-page-right\n",
"\n",
"```mermaid\n",
"flowchart LR\n",
@@ -632,8 +629,7 @@
" S -->|name / tag / composite| Sc[\"Scenario\"]\n",
" R -->|create with target + scorer| T[\"AttackTechnique
(attack + seeds)\"]\n",
" Sc --> T\n",
- "```\n",
- ":::"
+ "```"
]
},
{
diff --git a/doc/code/scenarios/0_attack_techniques.py b/doc/code/scenarios/0_attack_techniques.py
index 220979eb3a..41a149fc7f 100644
--- a/doc/code/scenarios/0_attack_techniques.py
+++ b/doc/code/scenarios/0_attack_techniques.py
@@ -190,9 +190,6 @@
# %% [markdown] class="col-page-right"
#
-# :::{div}
-# :class: col-page-right
-#
# ```mermaid
# flowchart LR
# I["TechniqueInitializer"] -->|registers factories| R["AttackTechniqueRegistry"]
@@ -201,7 +198,6 @@
# R -->|create with target + scorer| T["AttackTechnique
(attack + seeds)"]
# Sc --> T
# ```
-# :::
# %% [markdown]
# ## Relationship to single-turn attacks
diff --git a/doc/code/scenarios/0_scenarios.ipynb b/doc/code/scenarios/0_scenarios.ipynb
index c26939bb1e..c25cd3481b 100644
--- a/doc/code/scenarios/0_scenarios.ipynb
+++ b/doc/code/scenarios/0_scenarios.ipynb
@@ -487,9 +487,6 @@
"class": "col-page-right"
},
"source": [
- "\n",
- ":::{div}\n",
- ":class: col-page-right\n",
"\n",
"```{mermaid}\n",
"%%{init: {\"flowchart\": {\"subGraphTitleMargin\": {\"bottom\": 40}, \"wrappingWidth\": 260}}}%%\n",
@@ -548,8 +545,7 @@
" class RETRY_TARGET,RETRY_SCORE,RETRY_ATTACK,RESUME,NEXT_ATTACK retry;\n",
" class SUCCESS,FAILURE,UNDETERMINED,COMPLETE,SCENARIO_COMPLETE complete;\n",
" class RUNTIME_ERROR,EXEC_ERROR,ERROR_ROW,INCOMPLETE,PARTIAL,SCENARIO_FAILED incomplete;\n",
- "```\n",
- ":::"
+ "```"
]
},
{
diff --git a/doc/code/scenarios/0_scenarios.py b/doc/code/scenarios/0_scenarios.py
index 1b0c70b73f..db143ed444 100644
--- a/doc/code/scenarios/0_scenarios.py
+++ b/doc/code/scenarios/0_scenarios.py
@@ -217,9 +217,6 @@ async def _build_atomic_attacks_async(self, *, context):
# %% [markdown] class="col-page-right"
#
-# :::{div}
-# :class: col-page-right
-#
# ```{mermaid}
# %%{init: {"flowchart": {"subGraphTitleMargin": {"bottom": 40}, "wrappingWidth": 260}}}%%
# flowchart TB
@@ -278,7 +275,6 @@ async def _build_atomic_attacks_async(self, *, context):
# class SUCCESS,FAILURE,UNDETERMINED,COMPLETE,SCENARIO_COMPLETE complete;
# class RUNTIME_ERROR,EXEC_ERROR,ERROR_ROW,INCOMPLETE,PARTIAL,SCENARIO_FAILED incomplete;
# ```
-# :::
# %% [markdown]
#
diff --git a/doc/code/scoring/0_scoring.ipynb b/doc/code/scoring/0_scoring.ipynb
index e9d35f4ba4..851f9ce320 100644
--- a/doc/code/scoring/0_scoring.ipynb
+++ b/doc/code/scoring/0_scoring.ipynb
@@ -135,18 +135,21 @@
{
"cell_type": "markdown",
"id": "4",
- "metadata": {
- "class": "col-page-right",
- "lines_to_next_cell": 0
- },
+ "metadata": {},
"source": [
"## The class hierarchy\n",
"\n",
"Every scorer derives from the abstract `Scorer` class through one of three intermediate\n",
- "bases: `TrueFalseScorer`, `FloatScaleScorer`, or `ConversationScorer`.\n",
- "\n",
- ":::{div}\n",
- ":class: col-page-right\n",
+ "bases: `TrueFalseScorer`, `FloatScaleScorer`, or `ConversationScorer`."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5",
+ "metadata": {
+ "class": "col-page-right"
+ },
+ "source": [
"\n",
"```mermaid\n",
"classDiagram\n",
@@ -170,8 +173,16 @@
" TrueFalseScorer <|-- SelfAskCategoryScorer\n",
" TrueFalseScorer <|-- TrueFalseCompositeScorer\n",
" TrueFalseScorer <|-- FloatScaleThresholdScorer\n",
- "```\n",
- ":::\n",
+ "```"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6",
+ "metadata": {
+ "lines_to_next_cell": 0
+ },
+ "source": [
"\n",
"`ConversationScorer` is never instantiated directly. `create_conversation_scorer()`\n",
"builds a subclass that mixes it with a `TrueFalseScorer` or `FloatScaleScorer` so the\n",
@@ -181,7 +192,7 @@
},
{
"cell_type": "markdown",
- "id": "5",
+ "id": "7",
"metadata": {
"lines_to_next_cell": 0
},
@@ -195,7 +206,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "6",
+ "id": "8",
"metadata": {},
"outputs": [
{
@@ -221,7 +232,7 @@
},
{
"cell_type": "markdown",
- "id": "7",
+ "id": "9",
"metadata": {
"lines_to_next_cell": 0
},
@@ -238,7 +249,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "8",
+ "id": "10",
"metadata": {},
"outputs": [
{
@@ -303,7 +314,7 @@
},
{
"cell_type": "markdown",
- "id": "9",
+ "id": "11",
"metadata": {
"lines_to_next_cell": 0
},
@@ -318,7 +329,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "10",
+ "id": "12",
"metadata": {},
"outputs": [
{
diff --git a/doc/code/scoring/0_scoring.py b/doc/code/scoring/0_scoring.py
index d3e373dba6..a9f3eb4f04 100644
--- a/doc/code/scoring/0_scoring.py
+++ b/doc/code/scoring/0_scoring.py
@@ -59,14 +59,13 @@
pd.set_option("display.max_rows", None)
print(df.to_string(index=False))
-# %% [markdown] class="col-page-right"
+# %% [markdown]
# ## The class hierarchy
#
# Every scorer derives from the abstract `Scorer` class through one of three intermediate
# bases: `TrueFalseScorer`, `FloatScaleScorer`, or `ConversationScorer`.
-#
-# :::{div}
-# :class: col-page-right
+
+# %% [markdown] class="col-page-right"
#
# ```mermaid
# classDiagram
@@ -91,7 +90,8 @@
# TrueFalseScorer <|-- TrueFalseCompositeScorer
# TrueFalseScorer <|-- FloatScaleThresholdScorer
# ```
-# :::
+
+# %% [markdown]
#
# `ConversationScorer` is never instantiated directly. `create_conversation_scorer()`
# builds a subclass that mixes it with a `TrueFalseScorer` or `FloatScaleScorer` so the
diff --git a/doc/code/scoring/3_combining_scorers.ipynb b/doc/code/scoring/3_combining_scorers.ipynb
index b06425b7ad..04fd8385aa 100644
--- a/doc/code/scoring/3_combining_scorers.ipynb
+++ b/doc/code/scoring/3_combining_scorers.ipynb
@@ -37,9 +37,6 @@
"class": "col-page-right"
},
"source": [
- "\n",
- ":::{div}\n",
- ":class: col-page-right\n",
"\n",
"```mermaid\n",
"flowchart LR\n",
@@ -82,8 +79,7 @@
" class TF,FS input;\n",
" class COMP,INV,THRESH,CONV wrapper;\n",
" class TFOUT,FSOUT output;\n",
- "```\n",
- ":::"
+ "```"
]
},
{
diff --git a/doc/code/scoring/3_combining_scorers.py b/doc/code/scoring/3_combining_scorers.py
index 1a5ecd8881..e665e2b58e 100644
--- a/doc/code/scoring/3_combining_scorers.py
+++ b/doc/code/scoring/3_combining_scorers.py
@@ -28,9 +28,6 @@
# %% [markdown] class="col-page-right"
#
-# :::{div}
-# :class: col-page-right
-#
# ```mermaid
# flowchart LR
# subgraph inputs["Supported inputs"]
@@ -73,7 +70,6 @@
# class COMP,INV,THRESH,CONV wrapper;
# class TFOUT,FSOUT output;
# ```
-# :::
# %% [markdown]
#