Skip to content

feat: add size-based operational log rotation#555

Merged
rapids-bot[bot] merged 4 commits into
NVIDIA:mainfrom
ericevans-nv:feat/operational-log-rotation
Jul 25, 2026
Merged

feat: add size-based operational log rotation#555
rapids-bot[bot] merged 4 commits into
NVIDIA:mainfrom
ericevans-nv:feat/operational-log-rotation

Conversation

@ericevans-nv

@ericevans-nv ericevans-nv commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Overview

Add optional size-based rotation and retention to Relay operational file-log sinks. File sinks remain append-only unless rotation is explicitly configured.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Add validated max_file_size_bytes and retained_files settings for file sinks.
  • Require both rotation settings together and reject zero or unsafe retention values.
  • Rotate complete log records before the next write would exceed the configured size.
  • Retain the configured number of managed backups while preserving the active file.
  • Preserve historical backups outside the current retention window when the configured limit is reduced, avoiding automatic deletion of existing data.
  • Keep file writes behind the existing asynchronous sink and report rotation failures through its error path.
  • Detect conflicts between active sink paths and generated backup paths.
  • Preserve existing append-only behavior when rotation is omitted.
  • Document the configuration and add focused core and CLI coverage.

Where should the reviewer start?

Start with the rotating writer in crates/core/src/logging/rotation.rs and its integration with the asynchronous file sink in crates/core/src/logging/sink.rs. Focused behavior coverage is in crates/core/tests/coverage/logging_tests.rs.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

Summary by CodeRabbit

  • New Features
    • Added size-based rotation for operational file log sinks using max_file_size_bytes and retained_files (with a retained_files max of 9).
    • When enabled, log writing rotates by size while keeping records intact and appending to the active file.
  • Bug Fixes
    • Enforced that rotation settings must be configured together; invalid values now fail configuration.
    • Prevented collisions between active log paths and any potential rotated/retained file targets.
  • Documentation
    • Updated the operational logging TOML examples and guidance for rotation configuration and limits.
  • Tests
    • Expanded parsing and integration coverage for rotation, retention ordering, boundary rotation, large-record behavior, and collision scenarios.

Signed-off-by: Eric Evans <194135482+ericevans-nv@users.noreply.github.com>
@ericevans-nv
ericevans-nv requested review from a team as code owners July 24, 2026 20:00
@github-actions github-actions Bot added size:L PR is large Feature a new feature lang:rust PR changes/introduces Rust code labels Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

File sinks gain optional size-based rotation and retention. Configuration validation, rotating file writing, sink path collision checks, runtime wiring, tests, and operational logging documentation are updated.

Changes

Operational log rotation

Layer / File(s) Summary
Rotation configuration contract
crates/core/src/logging/config.rs, crates/core/src/logging/mod.rs, crates/cli/src/configuration/logging.rs, crates/cli/tests/coverage/shared/config_tests.rs, crates/core/tests/coverage/logging_tests.rs, docs/reference/operational-logging.mdx
File sinks accept paired max_file_size_bytes and retained_files settings, validate non-zero and maximum values, resolve FileLogRotationConfig, and document the TOML behavior.
Rotating file writer
crates/core/src/logging/rotation.rs
SizeRotatingFileWriter tracks active file size, rotates retained files, preserves append behavior on initialization, and handles reopening after rotation errors.
Rotation-aware sink assembly
crates/core/src/logging/sink.rs, crates/core/tests/coverage/logging_tests.rs
build_logger selects rotating writers, reserves generated backup paths, rejects path collisions, and tests retention order, existing-file rotation, historical backups, and collision errors.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TOML
  participant build_logger
  participant SizeRotatingFileWriter
  participant FileSystem
  TOML->>build_logger: resolve file sink rotation settings
  build_logger->>SizeRotatingFileWriter: construct writer with size and retention
  SizeRotatingFileWriter->>FileSystem: append active log records
  SizeRotatingFileWriter->>FileSystem: rotate and rename retained files at size boundary
  FileSystem-->>SizeRotatingFileWriter: return file operation results
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 69.23% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is Conventional Commits compliant and accurately summarizes the PR's main change.
Description check ✅ Passed The description matches the template with overview, details, reviewer start, and linked issue reference filled in.
Linked Issues check ✅ Passed The PR implements optional size-based rotation, retention, validation, collision handling, and docs/tests aligned with #553.
Out of Scope Changes check ✅ Passed The changes appear scoped to operational logging rotation, related tests, and documentation, with no unrelated additions.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/core/src/logging/rotation.rs`:
- Around line 122-140: Remove the destination-existence check and
fs::remove_file call from rotate_files, leaving fs::rename to replace any
existing rotated log directly. Preserve the existing source selection,
missing-source skip, iteration order, and error propagation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 1569cb30-c611-4484-ae42-964d45b073a1

📥 Commits

Reviewing files that changed from the base of the PR and between 6e13cfd and 9ebd5ac.

📒 Files selected for processing (8)
  • crates/cli/src/configuration/logging.rs
  • crates/cli/tests/coverage/shared/config_tests.rs
  • crates/core/src/logging/config.rs
  • crates/core/src/logging/mod.rs
  • crates/core/src/logging/rotation.rs
  • crates/core/src/logging/sink.rs
  • crates/core/tests/coverage/logging_tests.rs
  • docs/reference/operational-logging.mdx
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (20)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

When changing the core Rust runtime or Rust-facing API surface, format Rust code with cargo fmt (rustfmt defaults), keep cargo clippy -- -D warnings clean, and satisfy cargo deny check per deny.toml.

**/*.rs: If any Rust code changed, always run just test-rust.
If any Rust code changed, also run cargo fmt --all.
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings even if relying on pre-commit.

Files:

  • crates/core/src/logging/sink.rs
  • crates/core/src/logging/mod.rs
  • crates/cli/tests/coverage/shared/config_tests.rs
  • crates/core/src/logging/rotation.rs
  • crates/cli/src/configuration/logging.rs
  • crates/core/src/logging/config.rs
  • crates/core/tests/coverage/logging_tests.rs
{crates/core,crates/adaptive}/**/*

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

Changes to crates/core or crates/adaptive must run the full language matrix

Files:

  • crates/core/src/logging/sink.rs
  • crates/core/src/logging/mod.rs
  • crates/core/src/logging/rotation.rs
  • crates/core/src/logging/config.rs
  • crates/core/tests/coverage/logging_tests.rs
crates/core/**/*.rs

📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)

If the change touched crates/core or shared runtime semantics, also use validate-change for broader validation

Files:

  • crates/core/src/logging/sink.rs
  • crates/core/src/logging/mod.rs
  • crates/core/src/logging/rotation.rs
  • crates/core/src/logging/config.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions in Rust and Python: use snake_case.

Files:

  • crates/core/src/logging/sink.rs
  • crates/core/src/logging/mod.rs
  • crates/cli/tests/coverage/shared/config_tests.rs
  • crates/core/src/logging/rotation.rs
  • crates/cli/src/configuration/logging.rs
  • crates/core/src/logging/config.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{rs,py,js,mjs,cjs,ts,tsx}: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.

Files:

  • crates/core/src/logging/sink.rs
  • crates/core/src/logging/mod.rs
  • crates/cli/tests/coverage/shared/config_tests.rs
  • crates/core/src/logging/rotation.rs
  • crates/cli/src/configuration/logging.rs
  • crates/core/src/logging/config.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.{rs,py,go,js,ts,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use language-appropriate naming conventions: Rust snake_case, C FFI exports prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • crates/core/src/logging/sink.rs
  • crates/core/src/logging/mod.rs
  • crates/cli/tests/coverage/shared/config_tests.rs
  • crates/core/src/logging/rotation.rs
  • crates/cli/src/configuration/logging.rs
  • crates/core/src/logging/config.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.{rs,go,js,ts}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding // comment form.

Files:

  • crates/core/src/logging/sink.rs
  • crates/core/src/logging/mod.rs
  • crates/cli/tests/coverage/shared/config_tests.rs
  • crates/core/src/logging/rotation.rs
  • crates/cli/src/configuration/logging.rs
  • crates/core/src/logging/config.rs
  • crates/core/tests/coverage/logging_tests.rs
{crates/**/src/**/*.rs,python/**/*.py}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Do not add tests under src; Rust tests belong in crate tests/ trees, and Python SDK tests belong under python/tests.

Files:

  • crates/core/src/logging/sink.rs
  • crates/core/src/logging/mod.rs
  • crates/core/src/logging/rotation.rs
  • crates/cli/src/configuration/logging.rs
  • crates/core/src/logging/config.rs
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • crates/core/src/logging/sink.rs
  • docs/reference/operational-logging.mdx
  • crates/core/src/logging/mod.rs
  • crates/cli/tests/coverage/shared/config_tests.rs
  • crates/core/src/logging/rotation.rs
  • crates/cli/src/configuration/logging.rs
  • crates/core/src/logging/config.rs
  • crates/core/tests/coverage/logging_tests.rs
crates/{core,adaptive}/**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If crates/core or crates/adaptive changed, run the full validation matrix across Rust, Python, Go, and Node.js.

Files:

  • crates/core/src/logging/sink.rs
  • crates/core/src/logging/mod.rs
  • crates/core/src/logging/rotation.rs
  • crates/core/src/logging/config.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.{rs,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If a language surface changed, always run that language's test target even when Rust core did not change.

Files:

  • crates/core/src/logging/sink.rs
  • crates/core/src/logging/mod.rs
  • crates/cli/tests/coverage/shared/config_tests.rs
  • crates/core/src/logging/rotation.rs
  • crates/cli/src/configuration/logging.rs
  • crates/core/src/logging/config.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.{rs,py,js,ts,tsx,go,java,kt,swift}

📄 CodeRabbit inference engine (.agents/skills/add-middleware/SKILL.md)

Add tests covering registration and duplicate names, deregistration and missing names, priority ordering, callback failure policy, scope-local inheritance and cleanup, event payload semantics, immutable mark and scope fields, and parity across affected bindings.

Files:

  • crates/core/src/logging/sink.rs
  • crates/core/src/logging/mod.rs
  • crates/cli/tests/coverage/shared/config_tests.rs
  • crates/core/src/logging/rotation.rs
  • crates/cli/src/configuration/logging.rs
  • crates/core/src/logging/config.rs
  • crates/core/tests/coverage/logging_tests.rs
crates/{core,adaptive}/**/*.rs

⚙️ CodeRabbit configuration file

crates/{core,adaptive}/**/*.rs: Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.
Pay close attention to task-local/thread-local scope propagation, callback lifetimes, stream finalization, and root_uuid isolation.
Public API changes should preserve existing behavior unless tests and docs show the intended migration path.

Files:

  • crates/core/src/logging/sink.rs
  • crates/core/src/logging/mod.rs
  • crates/core/src/logging/rotation.rs
  • crates/core/src/logging/config.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.mdx

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

MDX top-of-file SPDX comments must use {/* ... */} delimiters instead of HTML comment delimiters (Must-Fix)

In MDX files, top-of-file comments must use JSX comment delimiters ({/* to open and */} to close); do not use HTML comments for MDX SPDX headers

Files:

  • docs/reference/operational-logging.mdx
**/*.{md,mdx}

📄 CodeRabbit inference engine (AGENTS.md)

Update README.md, fern/, package READMEs, and binding-support notes when public behavior, package names, examples, or supported bindings change.

**/*.{md,mdx}: Prefer the documented public API, not internal shortcuts
Keep package names, repo references, and build commands current
Keep release-process and release-notes guidance in repo-maintainer docs such as RELEASING.md, not as user-facing docs pages or CHANGELOG.md
Keep stable user-facing wrappers at scripts/ root in docs and examples; only point at namespaced helper paths when documenting internal maintenance work
When detailed dynamic plugin guides exist, keep Rust native plugin examples, Python worker plugin examples, and grpc-v1 protocol details on separate pages

If links in documentation change, run just docs-linkcheck.

Files:

  • docs/reference/operational-logging.mdx
**/*.{md,markdown,mdx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add the SPDX license header to all Markdown/MDX documentation files using the HTML comment block form.

Files:

  • docs/reference/operational-logging.mdx
{docs,examples}/**/*

📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)

Update docs and examples.

Files:

  • docs/reference/operational-logging.mdx
docs/**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If documentation examples or commands under docs/ change, run the targeted docs checks appropriate to the change.

Files:

  • docs/reference/operational-logging.mdx
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}

⚙️ CodeRabbit configuration file

{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.
Flag stale examples, missing SPDX headers where required, and instructions that no longer match CI or pre-commit behavior.

Files:

  • docs/reference/operational-logging.mdx
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • crates/cli/tests/coverage/shared/config_tests.rs
  • crates/core/tests/coverage/logging_tests.rs
🔇 Additional comments (7)
crates/core/src/logging/config.rs (1)

31-37: LGTM!

Also applies to: 229-289, 335-397

crates/core/src/logging/mod.rs (1)

11-11: LGTM!

Also applies to: 25-27

crates/cli/src/configuration/logging.rs (1)

10-12: LGTM!

Also applies to: 40-41, 106-125

crates/cli/tests/coverage/shared/config_tests.rs (1)

3274-3323: LGTM!

crates/core/tests/coverage/logging_tests.rs (1)

5-12: LGTM!

Also applies to: 243-243, 300-390, 548-673

docs/reference/operational-logging.mdx (1)

103-114: LGTM!

crates/core/src/logging/sink.rs (1)

13-19: LGTM!

Also applies to: 28-29, 49-112, 171-187

Comment thread crates/core/src/logging/rotation.rs
Signed-off-by: Eric Evans <194135482+ericevans-nv@users.noreply.github.com>

@willkill07 willkill07 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just one question on maximum files. with rotation naming, .0 -> .9 makes sense (for up to 10) but anything beyond that isn't default sorted.

Comment thread crates/core/src/logging/config.rs Outdated
Signed-off-by: Eric Evans <194135482+ericevans-nv@users.noreply.github.com>
Comment thread crates/core/src/logging/rotation.rs Outdated

@mnajafian-nv mnajafian-nv 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.

LGTM, plus Will's nit

Signed-off-by: Eric Evans <194135482+ericevans-nv@users.noreply.github.com>

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
crates/core/src/logging/rotation.rs (1)

37-45: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not rotate an empty active file for an oversized first record.

When the active file is empty and one record is larger than max_file_size_bytes, the pre-write size check rotates the empty file into the first backup, then writes the oversized record to the new active file. This wastes a retained slot and can evict historical backups earlier than configured.

Only rotate when current_size > 0 (or explicitly reject oversized records), and add a regression test.

Proposed guard
-        if self.current_size.saturating_add(incoming_len) > self.max_file_size_bytes {
+        if self.current_size > 0
+            && self.current_size.saturating_add(incoming_len) > self.max_file_size_bytes
+        {
             self.rotate()?;
         }

Also applies to: 85-91

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/core/src/logging/rotation.rs` around lines 37 - 45, Update
rotate_if_needed so an empty active file is never rotated, including when
incoming_bytes exceeds max_file_size_bytes; only invoke rotate when current_size
is greater than zero and the combined size exceeds the limit. Add a regression
test covering an oversized first record and verify no empty backup is created
while the record is written successfully.
crates/core/tests/coverage/logging_tests.rs (1)

560-673: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Cover runtime rotation failures through the sink error path.

These tests cover successful rotation, boundary handling, retention, and preflight collisions, but not a rename/open failure after the asynchronous sink is running. Add deterministic coverage asserting that the existing sink-error handler reports the failure and Relay remains shutdown-safe.

As per path instructions, tests under crates/core/tests/** should cover promised behavior, including error paths and cross-request isolation where relevant.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/core/tests/coverage/logging_tests.rs` around lines 560 - 673, Add a
deterministic test near logging_rotation_* that starts the asynchronous file
sink, forces a runtime rotation rename or reopen failure after logging begins,
and asserts the existing sink-error handler reports the failure. Also verify the
resulting Relay/runtime shutdown completes safely, reusing the established test
helpers and error-observation mechanism rather than adding new production
behavior.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@crates/core/src/logging/rotation.rs`:
- Around line 37-45: Update rotate_if_needed so an empty active file is never
rotated, including when incoming_bytes exceeds max_file_size_bytes; only invoke
rotate when current_size is greater than zero and the combined size exceeds the
limit. Add a regression test covering an oversized first record and verify no
empty backup is created while the record is written successfully.

In `@crates/core/tests/coverage/logging_tests.rs`:
- Around line 560-673: Add a deterministic test near logging_rotation_* that
starts the asynchronous file sink, forces a runtime rotation rename or reopen
failure after logging begins, and asserts the existing sink-error handler
reports the failure. Also verify the resulting Relay/runtime shutdown completes
safely, reusing the established test helpers and error-observation mechanism
rather than adding new production behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 6b69dc11-d445-454f-be7f-d59dbf7c985b

📥 Commits

Reviewing files that changed from the base of the PR and between c5d19bb and ebcc9e2.

📒 Files selected for processing (2)
  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (14)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

When changing the core Rust runtime or Rust-facing API surface, format Rust code with cargo fmt (rustfmt defaults), keep cargo clippy -- -D warnings clean, and satisfy cargo deny check per deny.toml.

**/*.rs: If any Rust code changed, always run just test-rust.
If any Rust code changed, also run cargo fmt --all.
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings even if relying on pre-commit.

Files:

  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
{crates/core,crates/adaptive}/**/*

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

Changes to crates/core or crates/adaptive must run the full language matrix

Files:

  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
crates/core/**/*.rs

📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)

If the change touched crates/core or shared runtime semantics, also use validate-change for broader validation

Files:

  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions in Rust and Python: use snake_case.

Files:

  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{rs,py,js,mjs,cjs,ts,tsx}: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.

Files:

  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.{rs,py,go,js,ts,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use language-appropriate naming conventions: Rust snake_case, C FFI exports prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.{rs,go,js,ts}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding // comment form.

Files:

  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
{crates/**/src/**/*.rs,python/**/*.py}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Do not add tests under src; Rust tests belong in crate tests/ trees, and Python SDK tests belong under python/tests.

Files:

  • crates/core/src/logging/rotation.rs
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
crates/{core,adaptive}/**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If crates/core or crates/adaptive changed, run the full validation matrix across Rust, Python, Go, and Node.js.

Files:

  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.{rs,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If a language surface changed, always run that language's test target even when Rust core did not change.

Files:

  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
**/*.{rs,py,js,ts,tsx,go,java,kt,swift}

📄 CodeRabbit inference engine (.agents/skills/add-middleware/SKILL.md)

Add tests covering registration and duplicate names, deregistration and missing names, priority ordering, callback failure policy, scope-local inheritance and cleanup, event payload semantics, immutable mark and scope fields, and parity across affected bindings.

Files:

  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
crates/{core,adaptive}/**/*.rs

⚙️ CodeRabbit configuration file

crates/{core,adaptive}/**/*.rs: Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.
Pay close attention to task-local/thread-local scope propagation, callback lifetimes, stream finalization, and root_uuid isolation.
Public API changes should preserve existing behavior unless tests and docs show the intended migration path.

Files:

  • crates/core/src/logging/rotation.rs
  • crates/core/tests/coverage/logging_tests.rs
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • crates/core/tests/coverage/logging_tests.rs
🔇 Additional comments (3)
crates/core/tests/coverage/logging_tests.rs (1)

5-12: LGTM!

Also applies to: 243-243, 300-390, 548-558

crates/core/src/logging/rotation.rs (2)

1-16: 📐 Maintainability & Code Quality

Run the required Rust/core validation before handoff.

Because this change touches crates/core, run cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, just test-rust, validate-change, the full Rust/Python/Go/Node validation matrix, and uv run pre-commit run --all-files.

As per coding guidelines, Rust changes require formatting, strict clippy, and just test-rust; changes under crates/core also require broader validation.

Source: Coding guidelines


18-35: LGTM!

Also applies to: 47-80, 94-101, 103-148

@ericevans-nv

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 9d16c07 into NVIDIA:main Jul 25, 2026
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature a new feature lang:rust PR changes/introduces Rust code size:L PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Add size-based rotation and retention for operational log file sinks

3 participants