Repository navigation
fix: harden anonymization and release 1.0.93 - #5
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfe7578ae9
ℹ️ 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".
| temporary_output_file.sync_all()?; | ||
| ensure_temporary_path_matches_handle(&temporary_output_path, &temporary_output_file)?; |
There was a problem hiding this comment.
Clean up temporary output when durability checks fail
If sync_all() fails (for example because the device runs out of space) or the handle/path metadata check returns an error, these ? operators exit before the cleanup branches below run. The complete transformed dataset is then left behind in the destination directory as a hidden .tmp file; route these failures through the same removal path used for write and publication errors.
Useful? React with 👍 / 👎.
| // Text, CDATA, and general references are one logical scalar in XML. Buffer adjacent | ||
| // content so a value split as `Ada Lovelace` is transformed once, rather than | ||
| // leaving the reference untouched or assigning separate replacements to each piece. | ||
| Event::Text(event) => { | ||
| let raw = event | ||
| .xml_content(XmlVersion::Implicit1_0) | ||
| .map_err(xml_error)?; | ||
| let replacement = xml_text_replacement(&path, &raw, &mut transform_context); | ||
| let event = match replacement.as_deref() { | ||
| Some(anonymized) => Event::Text(BytesText::new(anonymized)), | ||
| None => Event::Text(event), | ||
| }; | ||
| writer.write_event(event).map_err(xml_error)?; | ||
| if selected_xml_text_path(&path, selected_by_path) { | ||
| append_pending_xml_scalar(&mut pending_scalar, &path, raw.into_owned(), false); |
There was a problem hiding this comment.
Prepare Smart replacements from the buffered XML scalar
When a selected XML value spans text, CDATA, or a character reference, this code now transforms the concatenated scalar (for example Ada Lovelace&), but collect_xml_fields() still supplies Ada and Lovelace as separate values and ignores the reference when preparing Smart replacements. Consequently the generated replacements cannot be found under the combined key, so every such Local AI field silently uses the rule-based fallback while its report still accounts for the unused Smart replacements; collection and transformation need to construct the same logical scalar.
Useful? React with 👍 / 👎.
| transform_json_value(&mut value, &mut Vec::new(), &mut context); | ||
|
|
||
| let row_count = infer_value_row_count(&value); | ||
| // The output is serialized by the caller, which knows whether this document is | ||
| // JSON or YAML; everything else about the run is settled here. | ||
| let start_time = Instant::now(); |
There was a problem hiding this comment.
Start the document timer before transforming
For JSON and YAML pasted documents, the timer is now created only after transform_json_value() has completed, so the user-facing durationMs excludes the entire transformation and will normally report 0ms regardless of document size. Initialize it before traversal, as the previous implementation did, so the displayed processing duration remains meaningful.
Useful? React with 👍 / 👎.
Summary
Verification
Native desktop interaction remains unavailable in this environment.