🌟 Nova: Jupyter Notebook Exporter#1089
Conversation
Implemented `JupyterExporter` behind the `jupyter-export` feature flag. This exporter allows operators to translate trajectory artifacts into a structured `.ipynb` Jupyter Notebook with markdown cells for interactive exploration. Updated the registry, CLI routing fallback list, and conformance docs. Included a test that verifies the schema output. All redaction invariants apply. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new jupyter-export feature to export trajectories to the Jupyter Notebook (.ipynb) format, including documentation updates, the JupyterExporter implementation, and unit tests. The review feedback suggests improving compliance with the Jupyter Notebook format specification (nbformat) by splitting multiline cell sources into arrays of single-line strings using split_inclusive('\n') to prevent potential parsing or validation issues in strict environments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| let mut add_md_cell = |source: String| { | ||
| cells.push(serde_json::json!({ | ||
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [source] | ||
| })); | ||
| }; |
There was a problem hiding this comment.
In the Jupyter Notebook (.ipynb) format specification (nbformat), the source field of a cell can be a single string or an array of strings. However, when it is represented as an array of strings, each element is expected to represent a single line of text (typically ending with a newline character \n). Passing a multiline string wrapped in a single-element array (e.g., ["line1\nline2\n"]) is non-standard and can cause parsing or validation failures in strict Jupyter Notebook validators, diff tools, or downstream analytical workflows.
Using split_inclusive('\n') to split the multiline string into an array of single-line strings ensures full compliance with the nbformat specification and maximum compatibility across all Jupyter Notebook readers and editors.
let mut add_md_cell = |source: String| {
let lines: Vec<String> = source
.split_inclusive('\n')
.map(|s| s.to_string())
.collect();
cells.push(serde_json::json!({
"cell_type": "markdown",
"metadata": {},
"source": lines
}));
};There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f0c1277bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cells.push(serde_json::json!({ | ||
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [source] | ||
| })); |
There was a problem hiding this comment.
Add required cell IDs to notebook cells
When jupyter-export is enabled, the exporter declares nbformat_minor: 5, but every cell constructed here omits the id field. The nbformat 4.5+ schema requires each cell to have a unique string id (see the official nbformat docs: https://nbformat.readthedocs.io/en/latest/format_description.html#cell-ids), so the exported .ipynb will fail validation in tools that enforce the schema; add valid unique ids for each cell or emit an older minor version that does not require them.
Useful? React with 👍 / 👎.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #1089 +/- ##
=======================================
Coverage 86.63% 86.63%
=======================================
Files 139 139
Lines 86826 86826
=======================================
+ Hits 75220 75222 +2
+ Misses 11606 11604 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
💡 The Spark: "Trajectory exports are great for standalone static reading (markdown/html), but they lack interactability for deeper analysis. What if we could load our trajectories directly into a Jupyter Notebook for interactive data science and custom analysis?"
🚀 The Feature: "Implemented
JupyterExporterunder thejupyter-exportfeature. It seamlessly translates trajectory task, outcome, and message interactions into markdown and code cells within a standard Jupyter.ipynbJSON structure, passing all required redaction rules."🔮 The Potential: "Operators can now run analytical workflows, parse outputs with pandas, or write custom Python code inside a live notebook to introspect agent trajectories, unlocking a powerful data science integration right from the CLI."
jupyter-exportfeature flag and fully integrated with existing trajectory exporter conformance tests."PR created automatically by Jules for task 6270734913212772258 started by @madmax983