Skip to content

🌟 Nova: Jupyter Notebook Exporter#1089

Open
madmax983 wants to merge 1 commit into
trunkfrom
nova-jupyter-exporter-6270734913212772258
Open

🌟 Nova: Jupyter Notebook Exporter#1089
madmax983 wants to merge 1 commit into
trunkfrom
nova-jupyter-exporter-6270734913212772258

Conversation

@madmax983

Copy link
Copy Markdown
Owner

💡 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 JupyterExporter under the jupyter-export feature. It seamlessly translates trajectory task, outcome, and message interactions into markdown and code cells within a standard Jupyter .ipynb JSON 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."

⚠️ Risk: "Low. Kept strictly isolated behind the jupyter-export feature flag and fully integrated with existing trajectory exporter conformance tests."


PR created automatically by Jules for task 6270734913212772258 started by @madmax983

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>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/trajectory/export.rs
Comment on lines +187 to +193
let mut add_md_cell = |source: String| {
cells.push(serde_json::json!({
"cell_type": "markdown",
"metadata": {},
"source": [source]
}));
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
            }));
        };

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/trajectory/export.rs
Comment on lines +188 to +192
cells.push(serde_json::json!({
"cell_type": "markdown",
"metadata": {},
"source": [source]
}));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.63%. Comparing base (33594d5) to head (4f0c127).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant