Skip to content

Commit e965f36

Browse files
rlundeen2Copilot
andauthored
FIX: Correct red_teaming_attack notebook (microsoft#1779)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0c485cb commit e965f36

3 files changed

Lines changed: 721 additions & 638 deletions

File tree

.github/instructions/docs.instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ When making changes:
4444
- Variable names and values
4545
4. After editing, verify the changes are truly equivalent
4646

47+
4748
## Jupytext Usage Reference
4849

4950
### Critical pre-execution checklist
@@ -73,7 +74,7 @@ to surface in review; don't paper over it by committing an output-less notebook.
7374

7475
### Commands
7576

76-
Generate .ipynb from .py (with execution — preferred):
77+
Generate .ipynb from .py (with execution — if it fails it means there are errors):
7778
```bash
7879
jupytext --to ipynb --execute doc/path/to/your_notebook.py
7980
```
@@ -83,10 +84,9 @@ Generate .py from .ipynb:
8384
jupytext --to py:percent doc/path/to/notebook.ipynb
8485
```
8586

86-
Sync structure only without executing (rarely correct — outputs will be empty):
87-
```bash
88-
jupytext --to ipynb doc/path/to/your_notebook.py
89-
```
87+
If a `doc/**/*.py` notebook fails during `jupytext --execute` with errors that look like uninitialized state (missing env vars, undefined names, `initialize_pyrit_async` apparently not run, failing cell shows `Cell In[1]` despite earlier code), **check the `# %%` cell separators in the .py file first**.
88+
89+
A missing `# %%` between a `# %% [markdown]` block and the following code causes jupytext to silently absorb the code into the markdown cell, so it never executes. Symptoms in isolation (small repro scripts) will work fine — the bug is purely in the cell structure of the .py file. Do not chase env-loading or runtime issues until cell markers are verified.
9090

9191
## Summary
9292
- **Default strategy**: Update both files inline for simple changes

0 commit comments

Comments
 (0)