Repository navigation
fix: preserve tool-call correlation through trajectory redaction - #1569
Conversation
Signed-off-by: Bryan Bednarski <[email protected]>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Preserve correlation identifiers crates/pii-redaction/src/trajectory.rs, crates/pii-redaction/README.md |
Trajectory sanitization retains tool-call correlation IDs. The README distinguishes these IDs from response IDs and other application identifiers. |
Verify sanitized output and correlation crates/pii-redaction/tests/unit/component_tests.rs, crates/pii-redaction/tests/unit/trajectory_tool_correlation_tests.rs |
Tests check that correlation IDs remain unchanged, response-message IDs remain redacted, and repeated sanitization is idempotent. Exporter tests check call correlation across reverse-order completions and telemetry projections. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- NVIDIA/NeMo-Relay#1554: Documents trajectory PII redaction behavior and native-tool examples, which are also described in this PR.
Merge Risk: 
Minimal · up to cab75
-
Tool-call IDs remain available to correlate results as documented. No actionable merge-blocking issue remains.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title uses the allowed type "fix" with a colon and a concise imperative summary (64 characters, under 72, no trailing period). It clearly describes the main change: preserving tool-call correlation IDs during trajectory redaction, which matches the trajectory.rs changes, the tests, and the PR objectives. No breaking change is indicated, so no "!" suffix is needed.
Full details: Description check
-
Explanation
The description follows the repository template. It includes the Overview with both checklist items marked, a Details section listing the correlation-ID preservation changes, the regression test, the README update, and the validation results. It also has a Where should the reviewer start section naming the key test and source file, and a Related Issues section using the 'Relates to' keyword with RELAY-1154 and
#1554. The template's 'Closes' example is not used, but 'Relates to' is one of the allowed action keywords, so the section is complete.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 3 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
…1554) #### Overview The PII documentation mixes configuration lookup, detailed policy behavior, and worked examples. Organize it into three pages: About explains runtime placement and backend availability; Configuration provides settings and complete examples; Redaction Behavior explains selection, transformation, preservation, and match diagnostics. **Dependency satisfied:** #1569 is merged into `release/0.11` and included in this branch. The native-tool examples use its correlation-ID preservation. - [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license. - [x] I searched existing issues and open pull requests, and this does not duplicate existing work. #### Details - Organize About around runtime placement, scope and mark events, covered data, backend availability, an email example, policy selection, and the middleware comparison. Keep the block diagram compatible with Fern's renderer. - Keep Configuration focused on grouped reference tables, codec selection, configuration validation, profiles, surface flags, local-backend fields, the detector catalog, and CLI setup. - Add Redaction Behavior for payload boundaries and publication, actions, detector matching, exact pointers and globs, trajectory preservation, typed metrics, and selection accounting. Folder navigation discovers the new page using its frontmatter position. - Keep two tab groups with twelve complete worked examples on Configuration, including captured native function-calling requests/responses and separate tool events. Preserve the Worked Examples jump link immediately before surface-flag guidance. - Keep all content visible under normal headings. Preserve all 45 existing Configuration anchors beside links to moved material, and update the affected cross-page and migration-guide references. - Keep a short policy-verification section and diagnostic component-key reference on Configuration. - Qualify single-policy coverage of other scope events and typed metric-name preservation in the email example. Validation: - `just docs` passed, including navigation and internal link validation. All staged pre-commit hooks passed, including dependency audits and external link checking. - Verified that every worked-example TOML/JSON code block is unchanged by the page split. The six native-tool JSON blocks match the managed-call capture; application-facing requests and results remain unchanged. - Checked About, Configuration, and Redaction Behavior at desktop and 390-pixel widths: no page overflow or expandable content; both tab groups and all twelve example tabs work. - Verified the Worked Examples jump link, cross-page navigation into Path Semantics, all 45 legacy Configuration anchors, and the new cross-page fragment targets. - Runtime validation for the correlation fix is recorded in #1569. This PR changes documentation only. #### Where should the reviewer start? Read the three page introductions, then follow Configuration's Redaction Behavior links into `redaction-behavior.mdx`. Check that settings and examples remain easy to find and that the behavior guide contains the detailed selection/preservation rules. Review the native-tool trajectory example and the legacy Configuration anchor compatibility. #### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) - Relates to [RELAY-1154](https://linear.app/nvidia/issue/RELAY-1154). - Relates to #1549. - Depends on #1569 (merged). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Reorganized the PII redaction guides to describe which observability events are sanitized and how they differ from provider and tool requests and application results. * Expanded configuration guidance for profiles and single policies, including codec behavior, validation, surface settings, backends, actions, and policy ordering. * Added examples and guidance for email redaction, path selection, selector limitations, observability boundaries, and interpreting diagnostics. * Documented `local_model` as a runtime-provided extension point and explained the distinction between the configuration-driven plugin and raw sanitization middleware. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Bryan Bednarski <[email protected]>
Overview
With
trajectory_contextenabled, distinct model tool calls and tool execution events receive the same[REDACTED]correlation ID. ATIF consequently merges genuine tool results: two same-name calls produce one observation. Preserve the original tool-call correlation IDs while continuing to remove conversational content.Details
Validation:
release/0.11, including Clippy, build checks, dependency audits, and link checking.NEXTEST_TEST_THREADS=4 just test-rustpassed on this release-based branch: 6,602 tests passed, 4 skipped. Reduced concurrency avoided the networking timeouts observed in the earlier parallel run.Where should the reviewer start?
Start with
crates/pii-redaction/tests/unit/trajectory_tool_correlation_tests.rsfor the managed-call reproducer and exporter assertions. Then review the correlation-field preservation incrates/pii-redaction/src/trajectory.rs.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit