🌟 Nova: Yaml Exporter for Trajectories#612
Conversation
Implemented `YamlExporter` and the `yaml-export` feature for exporting trajectories to YAML format. Updated `bench inspect` to route `--format yaml` appropriately, and adjusted CLI help text and fallback paths. 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 yaml-export feature and adds support for exporting trajectories in YAML format via the inspect command. It updates the CLI arguments, implements the YamlExporter with content redaction, and adds corresponding unit tests. The review feedback points out a potential security risk where exporting the entire Trajectory struct directly to YAML could leak sensitive metadata (such as local_workdir or manifest), and suggests clearing these fields before serialization.
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.
| fn export(trajectory: &Trajectory) -> String { | ||
| let redactor = Redactor::default_enabled(); | ||
| let mut redacted_traj = trajectory.clone(); | ||
|
|
||
| if let Some(task) = &mut redacted_traj.info.task { | ||
| *task = redactor.redact_text(task, surface::EXPORT).text; | ||
| } | ||
|
|
||
| if let Some(outcome) = &mut redacted_traj.info.outcome { | ||
| *outcome = redactor.redact_text(outcome, surface::EXPORT).text; | ||
| } | ||
|
|
||
| for msg in &mut redacted_traj.messages { | ||
| msg.content = redactor.redact_text(&msg.content, surface::EXPORT).text; | ||
| } | ||
|
|
||
| serde_yml::to_string(&redacted_traj) | ||
| .unwrap_or_else(|_| "Failed to export as YAML".to_string()) | ||
| } |
There was a problem hiding this comment.
Exporting the entire Trajectory struct directly to YAML can accidentally expose sensitive metadata, such as local system paths in local_workdir or command-line history/git details in manifest. Other exporters (like Markdown or HTML) only export the conversation messages and basic info.
To prevent accidental data leaks when sharing exported YAML files, consider clearing these sensitive metadata fields before serialization.
fn export(trajectory: &Trajectory) -> String {
let redactor = Redactor::default_enabled();
let mut redacted_traj = trajectory.clone();
if let Some(task) = &mut redacted_traj.info.task {
*task = redactor.redact_text(task, surface::EXPORT).text;
}
if let Some(outcome) = &mut redacted_traj.info.outcome {
*outcome = redactor.redact_text(outcome, surface::EXPORT).text;
}
for msg in &mut redacted_traj.messages {
msg.content = redactor.redact_text(&msg.content, surface::EXPORT).text;
}
// Clear sensitive or verbose metadata before exporting to prevent accidental leaks
redacted_traj.info.manifest = None;
redacted_traj.info.local_workdir = None;
serde_yml::to_string(&redacted_traj)
.unwrap_or_else(|_| "Failed to export as YAML".to_string())
}
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (21.42%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## trunk #612 +/- ##
==========================================
- Coverage 85.26% 85.24% -0.02%
==========================================
Files 115 115
Lines 65856 65867 +11
==========================================
+ Hits 56150 56151 +1
- Misses 9706 9716 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a19b2b3737
ℹ️ 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".
| serde_yml::to_string(&redacted_traj) | ||
| .unwrap_or_else(|_| "Failed to export as YAML".to_string()) |
There was a problem hiding this comment.
Redact all serialized trajectory strings
When --format yaml is enabled, this serializes the entire trajectory after only redacting info.task, info.outcome, and messages[].content; fields that are now included only by the YAML exporter, such as info.other, verification_results, fork_lineage.tail_overrides, and message.extra.response/other, can still contain secret-looking strings in imported or legacy trajectories. Because the other exporters do not emit these nested fields, enabling YAML can expose unredacted API keys or tokens unless the exporter recursively redacts the whole structure before serde_yml::to_string.
Useful? React with 👍 / 👎.
💡 The Spark: "We have CSV, Markdown, HTML, and Mermaid exporters, but a structured human-readable data format like YAML is missing."
⚠️ Risk: "Low. Isolated in
🚀 The Feature: "Implemented
YamlExporterand theyaml-exportfeature for exporting trajectories."🔮 The Potential: "Could be used to quickly inspect trajectories in the terminal with syntax highlighting (e.g. using
bat) or to integrate with YAML-based tools."src/trajectory/export.rsand CLI routing behind a feature flag."PR created automatically by Jules for task 4815380765560303509 started by @madmax983